Permalink
Browse files

Enable the findPagesCode option in Inputfieldpage for non-Fieldtype c…

…ontext use of Inputfield forms (like FormBuilder)
  • Loading branch information...
1 parent 9b3039d commit d453a76b1f1721ab43e1c81553e212d95699a942 @ryancramerdesign committed Nov 17, 2012
Showing with 14 additions and 15 deletions.
  1. +14 −15 wire/modules/Inputfield/InputfieldPage/InputfieldPage.module
@@ -440,21 +440,20 @@ class InputfieldPage extends Inputfield implements ConfigurableModule {
$field->collapsed = Inputfield::collapsedBlank;
$fieldset->append($field);
- if($this->hasFieldtype !== false) {
- $field = $this->modules->get('InputfieldTextarea');
- $field->attr('name', 'findPagesCode');
- $field->label = "Custom PHP code to find selectable pages";
- $field->attr('value', $this->findPagesCode);
- $field->attr('rows', 4);
- $field->description =
- "If you want to find selectable pages using a PHP code snippet rather than selecting a parent page or template (above) then enter the code to find the selectable pages. " .
- "This statement has access to the \$page and \$pages API variables, where \$page refers to the page being edited. The snippet should return either a PageArray or NULL. " .
- "Using this is optional, and if used, it overrides the parent/template/selector fields above. NOTE: Not compatible with PageListSelect or Autocomplete input field types.";
-
- $field->notes = 'Example: return $page->parent->parent->children("name=locations")->first()->children();';
- $field->collapsed = Inputfield::collapsedBlank;
- $fieldset->append($field);
- }
+ $field = $this->modules->get('InputfieldTextarea');
+ $field->attr('name', 'findPagesCode');
+ $field->label = "Custom PHP code to find selectable pages";
+ $field->attr('value', $this->findPagesCode);
+ $field->attr('rows', 4);
+ $field->description =
+ "If you want to find selectable pages using a PHP code snippet rather than selecting a parent page or template (above) then enter the code to find the selectable pages. " .
+ "This statement has access to the \$page and \$pages API variables, where \$page refers to the page being edited. The snippet should return either a PageArray or NULL. " .
+ "Using this is optional, and if used, it overrides the parent/template/selector fields above. NOTE: Not compatible with PageListSelect or Autocomplete input field types.";
+
+ $field->notes = 'Example: return $page->parent->parent->children("name=locations")->first()->children();';
+ $field->collapsed = Inputfield::collapsedBlank;
+ $fieldset->append($field);
+
$inputfields->append($fieldset);
$field = $this->modules->get('InputfieldSelect');

0 comments on commit d453a76

Please sign in to comment.