1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-18 04:22:10 +02:00

Updates to legacy code in ProcessTemplate, cleaning things up a bit

This commit is contained in:
Ryan Cramer
2016-11-02 12:27:01 -04:00
parent b2a6857561
commit 36984e4a05
8 changed files with 549 additions and 212 deletions

View File

@@ -30,6 +30,12 @@
* @property array|null $orderByCols Columns that WireArray values are sorted by (default=null), Example: "sort" or "-created". #pw-internal
* @property int|null $paginationLimit Used by paginated WireArray values to indicate limit to use during load. #pw-internal
*
* Common Inputfield properties that Field objects store:
* @property int|bool|null $required
* @property string|null $requiredIf
* @property string|null $showIf
* @property int|null $columnWidth
*
* @method bool viewable(Page $page = null, User $user = null) Is the field viewable on the given $page by the given $user? #pw-group-access
* @method bool editable(Page $page = null, User $user = null) Is the field editable on the given $page by the given $user? #pw-group-access
* @method Inputfield getInputfield(Page $page, $contextStr = '') Get instance of the Inputfield module that collects input for this field.

View File

@@ -20,6 +20,8 @@ class Fieldgroups extends WireSaveableItemsLookup {
/**
* Instances of FieldgroupsArray
*
* @var FieldgroupsArray
*
*/
protected $fieldgroupsArray;
@@ -61,6 +63,8 @@ class Fieldgroups extends WireSaveableItemsLookup {
/**
* Per WireSaveableItems interface, return all available Fieldgroup instances
*
* @return FieldgroupsArray
*
*/
public function getAll() {
return $this->fieldgroupsArray;
@@ -69,6 +73,8 @@ class Fieldgroups extends WireSaveableItemsLookup {
/**
* Per WireSaveableItems interface, create a blank instance of a Fieldgroup
*
* @return Fieldgroup
*
*/
public function makeBlankItem() {
return $this->wire(new Fieldgroup());
@@ -77,6 +83,8 @@ class Fieldgroups extends WireSaveableItemsLookup {
/**
* Per WireSaveableItems interface, return the name of the table that Fieldgroup instances are stored in
*
* @return string
*
*/
public function getTable() {
return 'fieldgroups';
@@ -85,6 +93,8 @@ class Fieldgroups extends WireSaveableItemsLookup {
/**
* Per WireSaveableItemsLookup interface, return the name of the table that Fields are linked to Fieldgroups
*
* @return string
*
*/
public function getLookupTable() {
return 'fieldgroups_fields';

View File

@@ -20,6 +20,7 @@
* @property int $flags Flags (bitmask) assigned to this template. See the flag constants. #pw-group-identification
* @property string $ns Namespace found in the template file, or blank if not determined. #pw-group-identification
* @property string $pageClass Class for instantiated page objects. Page assumed if blank, or specify class name. #pw-group-identification
* @property int $modified Last modified time for template or template file
*
* Fieldgroup/Fields
*

View File

@@ -13,6 +13,7 @@
* @method TemplatesArray find($selector) Return the templates matching the the given selector query. #pw-internal
* @method bool save(Template $template) Save the given Template.
* @method bool delete() delete(Template $template) Delete the given Template. Note that this will throw a fatal error if the template is in use by any pages.
* @method bool|Saveable|Template clone(Saveable $item, $name = '')
*
*/
class Templates extends WireSaveableItems {

View File

@@ -9,9 +9,18 @@
* ProcessWire 3.x, Copyright 2016 by Ryan Cramer
* https://processwire.com
*
* @method WireArray load(WireArray $items, $selectors = null);
* @method bool save(Saveable $item);
* @method bool delete(Saveable $item);
* @method WireArray load(WireArray $items, $selectors = null)
* @method bool save(Saveable $item)
* @method bool delete(Saveable $item)
* @method WireArray find($selectors)
* @method void saveReady(Saveable $item) #pw-hooker
* @method void deleteReady(Saveable $item) #pw-hooker
* @method void cloneReady(Saveable $item, Saveable $copy) #pw-hooker
* @method array saved(Saveable $item, array $changes = array()) #pw-hooker
* @method void added(Saveable $item) #pw-hooker
* @method void deleted(Saveable $item) #pw-hooker
* @method void cloned(Saveable $item, Saveable $copy) #pw-hooker
*
*
*/
@@ -20,6 +29,8 @@ abstract class WireSaveableItems extends Wire implements \IteratorAggregate {
/**
* Return the WireArray that this DAO stores it's items in
*
* @return WireArray
*
*/
abstract public function getAll();
@@ -32,6 +43,8 @@ abstract class WireSaveableItems extends Wire implements \IteratorAggregate {
/**
* Return the name of the table that this DAO stores item records in
*
* @return string
*
*/
abstract public function getTable();
@@ -41,6 +54,8 @@ abstract class WireSaveableItems extends Wire implements \IteratorAggregate {
*
* This is overridden by selectors if applied during the load method
*
* @return string
*
*/
public function getSort() { return ''; }

View File

@@ -10,6 +10,8 @@
* @property int $columnWidthSpacing Optionally set the column width spacing (pixels)
* @property string $description Optionally set a description headline for the form
* @property string $confirmText Confirmation text that precedes list of changes (when class InputfieldFormConfirm is active)
* @property string $method Form method attribute (default="post")
* @property string $action Form action attribute (default="./")
*
* Optional classes:
* =================

View File

@@ -3,6 +3,10 @@
/**
* Intended just for outputting markup as help or commentary among other Inputfields
*
* @property callable|string|null $markupFunction
* @property array $textformatters
* @property string $markupText
*
*/
class InputfieldMarkup extends InputfieldWrapper {

File diff suppressed because it is too large Load Diff