1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-12 01:34:31 +02:00

Add Field::getContexts() method. Update ProcessField and ProcessTemplate to improve their main listing screen, particularly the 'flags' column which now shows more details and also now uses contextual links to relevant flags.

This commit is contained in:
Ryan Cramer
2021-07-09 10:59:46 -04:00
parent 5f6adc9221
commit 405b80e54b
5 changed files with 159 additions and 67 deletions

View File

@@ -743,6 +743,24 @@ class Field extends WireData implements Saveable, Exportable {
return $this->getContext($for, $namespace, true); return $this->getContext($for, $namespace, true);
} }
/**
* Get all contexts this field is used in
*
* @return array Array of 'fieldgroup-name' => [ contexts ]
* @since 3.0.182
*
*/
public function getContexts() {
$contexts = array();
foreach($this->wire()->fieldgroups as $fieldgroup) {
/** @var Fieldgroup $fieldgroup */
$context = $fieldgroup->getFieldContextArray($this->id);
if(empty($context)) continue;
$contexts[$fieldgroup->name] = $context;
}
return $contexts;
}
/** /**
* Set the roles that are allowed to view or edit this field on pages. * Set the roles that are allowed to view or edit this field on pages.
* *
@@ -860,7 +878,7 @@ class Field extends WireData implements Saveable, Exportable {
* *
*/ */
public function numFieldgroups() { public function numFieldgroups() {
return count($this->getFieldgroups()); return $this->getFieldgroups(true);
} }
/** /**
@@ -868,20 +886,23 @@ class Field extends WireData implements Saveable, Exportable {
* *
* #pw-group-retrieval * #pw-group-retrieval
* *
* @return FieldgroupsArray WireArray of Fieldgroup objects. * @param bool $getCount Get count rather than FieldgroupsArray? (default=false) 3.0.182+
* @return FieldgroupsArray|int WireArray of Fieldgroup objects or count if requested
* *
*/ */
public function getFieldgroups() { public function getFieldgroups($getCount = false) {
$fieldgroups = $this->wire(new FieldgroupsArray()); $fieldgroups = $getCount ? null : $this->wire(new FieldgroupsArray());
foreach($this->wire('fieldgroups') as $fieldgroup) { $count = 0;
foreach($this->wire()->fieldgroups as $fieldgroup) {
foreach($fieldgroup as $field) { foreach($fieldgroup as $field) {
if($field->id == $this->id) { if($field->id == $this->id) {
$fieldgroups->add($fieldgroup); if($fieldgroups) $fieldgroups->add($fieldgroup);
$count++;
break; break;
} }
} }
} }
return $fieldgroups; return $getCount ? $count : $fieldgroups;
} }
/** /**
@@ -889,10 +910,18 @@ class Field extends WireData implements Saveable, Exportable {
* *
* #pw-group-retrieval * #pw-group-retrieval
* *
* @return TemplatesArray WireArray of Template objects. * @param bool $getCount Get count rather than FieldgroupsArray? (default=false) 3.0.182+
* @return TemplatesArray|int WireArray of Template objects or count when requested.
* *
*/ */
public function getTemplates() { public function getTemplates($getCount = false) {
if($getCount) {
$count = 0;
foreach($this->templates as $template) {
if($template->hasField($this)) $count++;
}
return $count;
}
$templates = $this->wire(new TemplatesArray()); $templates = $this->wire(new TemplatesArray());
$fieldgroups = $this->getFieldgroups(); $fieldgroups = $this->getFieldgroups();
foreach($this->templates as $template) { foreach($this->templates as $template) {

View File

@@ -85,7 +85,9 @@ $(document).ready(function() {
window.location = href; window.location = href;
}); });
$("a.fieldFlag").click(function() { return false; }); $("a.fieldFlag").click(function() {
if($(this).attr('href') === '#') return false;
});
$("#export_data").click(function() { $(this).select(); }); $("#export_data").click(function() { $(this).select(); });

View File

@@ -1 +1 @@
$(document).ready(function(){var fieldFilterFormChange=function(){$("#field_filter_form").submit()};$("#templates_id").change(fieldFilterFormChange);$("#fieldtype").change(fieldFilterFormChange);$("#wrap_show_system input").click(fieldFilterFormChange);var $asmListItemStatus=$("#asmListItemStatus");var $columnWidth=$("#columnWidth");function setAsmListItemStatus(){var tpl=$asmListItemStatus.attr("data-tpl");if(!tpl)return;var showIf=$("#Inputfield_showIf").val();var required=$("#Inputfield_required").is(":checked")?true:false;if(showIf&&showIf.length>0)tpl="<i class='fa fa-question-circle'></i>"+tpl;if(required)tpl="<i class='fa fa-asterisk'></i>"+tpl;var w=parseInt($columnWidth.val());if(w==100)w=0;if(w>0)w=w+"%";else w="";tpl=tpl.replace("%",w);$asmListItemStatus.val(tpl)}$("#Inputfield_showIf").change(setAsmListItemStatus);$("#Inputfield_required").change(setAsmListItemStatus);setAsmListItemStatus();$(".columnWidthInput").each(function(){var $columnWidth=$(this);var $slider=$("<div class='InputfieldColumnWidthSlider'></div>");var columnWidthVal=parseInt($columnWidth.val());$columnWidth.val(columnWidthVal+"%");$columnWidth.after($slider);$slider.slider({range:"min",min:10,max:100,value:parseInt($columnWidth.val()),slide:function(e,ui){var val=ui.value+"%";$columnWidth.val(val).trigger("change");if($columnWidth.prop("id")==="columnWidth")setAsmListItemStatus()}});$columnWidth.change(function(){var val=parseInt($(this).val());if(val>100)val=100;if(val<10)val=10;$(this).val(val+"%");$slider.slider("option","value",val)})});var $fieldEdit=$("#ProcessFieldEdit");if($fieldEdit.length>0&&$("li.WireTab").length>1){$fieldEdit.find("script").remove();$fieldEdit.WireTabs({items:$(".Inputfields li.WireTab"),id:"FieldEditTabs",skipRememberTabIDs:["delete"]})}$("#fieldgroupContextSelect").change(function(){var field_id=$("#Inputfield_id").val();var fieldgroup_id=$(this).val();var href="./edit?id="+field_id;if(fieldgroup_id>0)href+="&fieldgroup_id="+fieldgroup_id;window.location=href});$("a.fieldFlag").click(function(){return false});$("#export_data").click(function(){$(this).select()});$(".import_toggle input[type=radio]").change(function(){var $table=$(this).parents("p.import_toggle").next("table");var $fieldset=$(this).closest(".InputfieldFieldset");if($(this).is(":checked")&&$(this).val()==0){$table.hide();$fieldset.addClass("ui-priority-secondary")}else{$table.show();$fieldset.removeClass("ui-priority-secondary")}}).change();$("#wrap_Inputfield_send_templates").find(":input").change(function(){$("#_send_templates_changed").val("changed")});$("#viewRoles_37").click(function(){if($(this).is(":checked"))$("input.viewRoles").prop("checked",true)});$("input.viewRoles:not(#viewRoles_37)").click(function(){if($("#viewRoles_37").is(":checked"))return false;return true});$("input.editRoles:not(:disabled)").click(function(){if($(this).is(":checked")){$(this).closest("tr").find("input.viewRoles").prop("checked",true)}});$(".override-select-all").click(function(){var $checkboxes=$(this).closest("table").find("input[type=checkbox]");if($(this).hasClass("override-checked")){$checkboxes.prop("checked",false);$(this).removeClass("override-checked")}else{$checkboxes.prop("checked",true);$(this).addClass("override-checked")}return false});$(document).on("pw-modal-closed","a",function(e,ui){if(!$("#tab-overrides").is(":visible"))return;Inputfields.reload("#Inputfield_overrides_table")})}); $(document).ready(function(){var fieldFilterFormChange=function(){$("#field_filter_form").submit()};$("#templates_id").change(fieldFilterFormChange);$("#fieldtype").change(fieldFilterFormChange);$("#wrap_show_system input").click(fieldFilterFormChange);var $asmListItemStatus=$("#asmListItemStatus");var $columnWidth=$("#columnWidth");function setAsmListItemStatus(){var tpl=$asmListItemStatus.attr("data-tpl");if(!tpl)return;var showIf=$("#Inputfield_showIf").val();var required=$("#Inputfield_required").is(":checked")?true:false;if(showIf&&showIf.length>0)tpl="<i class='fa fa-question-circle'></i>"+tpl;if(required)tpl="<i class='fa fa-asterisk'></i>"+tpl;var w=parseInt($columnWidth.val());if(w==100)w=0;if(w>0)w=w+"%";else w="";tpl=tpl.replace("%",w);$asmListItemStatus.val(tpl)}$("#Inputfield_showIf").change(setAsmListItemStatus);$("#Inputfield_required").change(setAsmListItemStatus);setAsmListItemStatus();$(".columnWidthInput").each(function(){var $columnWidth=$(this);var $slider=$("<div class='InputfieldColumnWidthSlider'></div>");var columnWidthVal=parseInt($columnWidth.val());$columnWidth.val(columnWidthVal+"%");$columnWidth.after($slider);$slider.slider({range:"min",min:10,max:100,value:parseInt($columnWidth.val()),slide:function(e,ui){var val=ui.value+"%";$columnWidth.val(val).trigger("change");if($columnWidth.prop("id")==="columnWidth")setAsmListItemStatus()}});$columnWidth.change(function(){var val=parseInt($(this).val());if(val>100)val=100;if(val<10)val=10;$(this).val(val+"%");$slider.slider("option","value",val)})});var $fieldEdit=$("#ProcessFieldEdit");if($fieldEdit.length>0&&$("li.WireTab").length>1){$fieldEdit.find("script").remove();$fieldEdit.WireTabs({items:$(".Inputfields li.WireTab"),id:"FieldEditTabs",skipRememberTabIDs:["delete"]})}$("#fieldgroupContextSelect").change(function(){var field_id=$("#Inputfield_id").val();var fieldgroup_id=$(this).val();var href="./edit?id="+field_id;if(fieldgroup_id>0)href+="&fieldgroup_id="+fieldgroup_id;window.location=href});$("a.fieldFlag").click(function(){if($(this).attr("href")==="#")return false});$("#export_data").click(function(){$(this).select()});$(".import_toggle input[type=radio]").change(function(){var $table=$(this).parents("p.import_toggle").next("table");var $fieldset=$(this).closest(".InputfieldFieldset");if($(this).is(":checked")&&$(this).val()==0){$table.hide();$fieldset.addClass("ui-priority-secondary")}else{$table.show();$fieldset.removeClass("ui-priority-secondary")}}).change();$("#wrap_Inputfield_send_templates").find(":input").change(function(){$("#_send_templates_changed").val("changed")});$("#viewRoles_37").click(function(){if($(this).is(":checked"))$("input.viewRoles").prop("checked",true)});$("input.viewRoles:not(#viewRoles_37)").click(function(){if($("#viewRoles_37").is(":checked"))return false;return true});$("input.editRoles:not(:disabled)").click(function(){if($(this).is(":checked")){$(this).closest("tr").find("input.viewRoles").prop("checked",true)}});$(".override-select-all").click(function(){var $checkboxes=$(this).closest("table").find("input[type=checkbox]");if($(this).hasClass("override-checked")){$checkboxes.prop("checked",false);$(this).removeClass("override-checked")}else{$checkboxes.prop("checked",true);$(this).addClass("override-checked")}return false});$(document).on("pw-modal-closed","a",function(e,ui){if(!$("#tab-overrides").is(":visible"))return;Inputfields.reload("#Inputfield_overrides_table")})});

View File

@@ -607,7 +607,12 @@ class ProcessField extends Process implements ConfigurableModule {
$table = $this->modules->get("MarkupAdminDataTable"); $table = $this->modules->get("MarkupAdminDataTable");
$labels = $this->labels; $labels = $this->labels;
$headerRow = array($labels['name'], $labels['label'], $labels['type'], $labels['templates']); $headerRow = array(
$labels['name'],
$labels['label'],
$labels['type'],
$labels['templates']
);
$table->headerRow($headerRow); $table->headerRow($headerRow);
$table->setEncodeEntities(false); $table->setEncodeEntities(false);
@@ -634,53 +639,77 @@ class ProcessField extends Process implements ConfigurableModule {
* *
*/ */
protected function ___getListTableRow(Field $field) { protected function ___getListTableRow(Field $field) {
$sanitizer = $this->wire()->sanitizer;
$session = $this->wire()->session;
$editUrl = "edit?id=$field->id";
$flagDefs = array( $flagDefs = array(
'Autojoin' => array( 'Autojoin' => array(
'icon' => 'fa fa-sign-in', 'icon' => 'sign-in',
'label' => $this->_x('autojoin', 'list notes') 'label' => $this->_x('autojoin', 'list notes'),
), 'href' => "$editUrl#find-autojoin",
),
'Global' => array( 'Global' => array(
'icon' => 'fa fa-globe', 'icon' => 'globe',
'label' => $this->_x('global', 'list notes') 'label' => $this->_x('global', 'list notes'),
), 'href' => "$editUrl#find-global",
),
'System' => array( 'System' => array(
'icon' => 'fa fa-puzzle-piece', 'icon' => 'puzzle-piece',
'label' => $this->_x('system', 'list notes') 'label' => $this->_x('system', 'list notes'),
), 'href' => ($this->wire()->config->advanced ? "$editUrl#find-system" : ''),
),
'Permanent' => array( 'Permanent' => array(
'icon' => 'fa fa-building-o', 'icon' => 'building-o',
'label' => $this->_x('permanent', 'list notes') 'label' => $this->_x('permanent', 'list notes')
), ),
'Required' => array( 'Required' => array(
'icon' => 'fa fa-asterisk', 'icon' => 'asterisk',
'label' => $this->_x('required', 'list notes') 'label' => $this->_x('required', 'list notes'),
), 'href' => "$editUrl#find-required",
),
'Dependency' => array( 'Dependency' => array(
'icon' => 'fa fa-question-circle', 'icon' => 'question-circle',
'label' => $this->_x('show if...', 'list notes') 'label' => $this->_x('show if...', 'list notes'),
), 'href' => "$editUrl#find-showIf",
),
'Access' => array( 'Access' => array(
'icon' => 'fa fa-key', 'icon' => 'key',
'label' => $this->_x('access', 'list notes') 'label' => $this->_x('access', 'list notes'),
), 'href' => "$editUrl#find-useRoles",
); ),
'Unique' => array(
'icon' => 'snowflake-o',
'label' => $this->_x('unique', 'list notes'),
'href' => "$editUrl#find-flagUnique",
),
'Context' => array(
'icon' => 'shield',
'label' => $this->_x('overrides/contexts', 'list notes'),
'href' => "$editUrl#find-tab-overrides",
),
);
$numTemplates = 0; $numTemplates = $field->getTemplates(true);
$numTemplatesLink = "$editUrl#find-send_templates";
$numTemplatesLabel = sprintf($this->_n('%d template', '%d templates', $numTemplates), $numTemplates);
$flags = array(); $flags = array();
$fieldName = $field->name;
$builtIn = false; $builtIn = false;
$templatesID = (int) $this->session->getFor($this, 'filterTemplate'); $templatesID = (int) $session->getFor($this, 'filterTemplate');
if($templatesID && $template = $this->templates->get($templatesID)) { if($templatesID && $template = $this->templates->get($templatesID)) {
if(!$template->fieldgroup->has($field)) return array(); if(!$template->fieldgroup->has($field)) return array();
} }
if($fieldtype = $this->session->getFor($this, 'filterFieldtype')) { if($fieldtype = $session->getFor($this, 'filterFieldtype')) {
if($field->type != $fieldtype) return array(); if($field->type != $fieldtype) return array();
} }
if($field->flags & Field::flagAutojoin) $flags[] = 'Autojoin'; if($field->flags & Field::flagAutojoin) $flags[] = 'Autojoin';
if($field->flags & Field::flagGlobal) $flags[] = 'Global'; if($field->flags & Field::flagGlobal) $flags[] = 'Global';
if($field->flags & Field::flagAccess) $flags[] = 'Access'; if($field->flags & Field::flagAccess) $flags[] = 'Access';
if($field->flags & Field::flagUnique) $flags[] = 'Unique';
if($field->flags & Field::flagSystem) { if($field->flags & Field::flagSystem) {
$flags[] = 'System'; $flags[] = 'System';
@@ -694,31 +723,47 @@ class ProcessField extends Process implements ConfigurableModule {
if($field->showIf) $flags[] = 'Dependency'; if($field->showIf) $flags[] = 'Dependency';
if($field->required) $flags[] = 'Required'; if($field->required) $flags[] = 'Required';
if(count($field->getContexts())) $flags[] = 'Context';
if($builtIn && !$templatesID && $field->name != 'title' && $field->name != 'email') { if($builtIn && !$templatesID && $field->name != 'title' && $field->name != 'email') {
if(!$this->session->getFor($this, 'filterShowSystem')) return array(); if(!$session->getFor($this, 'filterShowSystem')) return array();
} }
foreach($field->getFieldgroups() as $fieldgroup) {
$numTemplates += $fieldgroup->numTemplates();
}
$numTemplatesLink = "../template/?filter_field={$field->name}&nosave=1";
$flagsOut = ''; $flagsOut = '';
foreach($flags as $flagName) { foreach($flags as $flagName) {
if(!isset($flagDefs[$flagName])) continue;
$flag = $flagDefs[$flagName]; $flag = $flagDefs[$flagName];
$icon = "<i class='$flag[icon]'></i>"; $icon = wireIconMarkup($flag['icon']);
$flagsOut .= "<a href='#' class='fieldFlag fieldFlag$flagName tooltip' title='$flag[label]'>$icon</span></a>"; $href = isset($flag['href']) ? $flag['href'] : '#';
$flagsOut .= "<a href='$href' class='fieldFlag fieldFlag$flagName tooltip' title='$flag[label]'>$icon</span></a>";
} }
$icon = $field->icon ? "<i class='fa fa-" . str_replace(array('icon-', 'fa-'), '', $this->wire('sanitizer')->name($field->icon)) . "'></i> " : ''; $icon = $field->getIcon();
$icon = $icon ? wireIconMarkup($icon) : '';
$label = $sanitizer->entities($field->getLabel());
$typeName = $sanitizer->entities($field->type->shortName);
$inputName = $typeName === 'Page' ? $field->get('inputfield') : $field->get('inputfieldClass|fieldtypeClass');
if($inputName) {
$inputName = $sanitizer->entities(str_replace(array('Inputfield', 'Fieldtype'), '', $inputName));
if(strpos($inputName, $typeName) === 0) list(,$inputName) = explode($typeName, $inputName, 2);
$inputName = $inputName === $typeName || !$inputName ? '' : "/$inputName";
} else {
$inputName = '';
}
if($numTemplates) {
} else {
$label .= " <span class='notes'>" . $this->_('(not used)') . "</span>";
}
return array( return array(
$field->name => "edit?id={$field->id}", "$fieldName" => $editUrl,
$icon . $this->sanitizer->entities($field->getLabel()), "$icon $label",
$this->sanitizer->entities($field->type->shortName), "$typeName$inputName",
"$flagsOut<a href='$numTemplatesLink'>$numTemplates</a>" "$flagsOut<a class='pw-tooltip' title='$numTemplatesLabel' href='$numTemplatesLink'>$numTemplates</a>"
); );
} }
/** /**
@@ -1181,7 +1226,7 @@ class ProcessField extends Process implements ConfigurableModule {
$f = $modules->get('InputfieldMarkup'); $f = $modules->get('InputfieldMarkup');
$f->attr('name', 'overrides_table'); $f->attr('name', 'overrides_table');
$f->description = $this->_('The following settings are overridden for this field by the indicated template(s). Check the box to the right of any row to remove the setting override (restoring the original value).'); $f->description = $this->_('The following settings are overridden for this field by the indicated template(s). Check the box to the right of any row to remove the setting override (restoring the original value).');
$f->icon = 'exchange'; $f->icon = 'shield';
if($this->fieldgroup) { if($this->fieldgroup) {
if($this->contextNamespace) { if($this->contextNamespace) {
$f->label = sprintf($this->_('Setting overrides for field namespace: %s'), $this->contextNamespace); $f->label = sprintf($this->_('Setting overrides for field namespace: %s'), $this->contextNamespace);
@@ -1407,6 +1452,7 @@ class ProcessField extends Process implements ConfigurableModule {
$fieldset = $this->wire('modules')->get('InputfieldFieldset'); $fieldset = $this->wire('modules')->get('InputfieldFieldset');
$fieldset->label = $this->_('Front-end editing'); $fieldset->label = $this->_('Front-end editing');
$fieldset->icon = 'edit'; $fieldset->icon = 'edit';
$fieldset->attr('id', 'front-end-editing');
$fieldset->collapsed = Inputfield::collapsedYes; $fieldset->collapsed = Inputfield::collapsedYes;
$tab->add($fieldset); $tab->add($fieldset);

View File

@@ -403,37 +403,45 @@ class ProcessTemplate extends Process implements ConfigurableModule {
*/ */
public function ___getListTableRow(Template $template, $useLabel = true) { public function ___getListTableRow(Template $template, $useLabel = true) {
$editUrl = "edit?id={$template->id}";
$flags = array(); $flags = array();
$flagDefs = array( $flagDefs = array(
'system' => array( 'system' => array(
'label' => $this->_x('system', 'list-note'), 'label' => $this->_x('system', 'list-note'),
'icon' => 'puzzle-piece' 'icon' => 'puzzle-piece',
), 'href' => ($this->wire()->config->advanced ? "$editUrl#find-flagSystem" : $editUrl),
),
'access' => array( 'access' => array(
'label' => $this->_x('access', 'list-note'), 'label' => $this->_x('access', 'list-note'),
'icon' => 'key' 'icon' => 'key',
), 'href' => "$editUrl#find-tab_access",
),
'no-file' => array( 'no-file' => array(
'label' => $this->_x('no-file', 'list-note'), 'label' => $this->_x('no-file', 'list-note'),
'icon' => 'ban' 'icon' => 'ban',
), 'href' => "$editUrl#find-tab_files",
),
'cache' => array( 'cache' => array(
'label' => $this->_x('cache', 'list-note'), 'label' => $this->_x('cache', 'list-note'),
'icon' => 'clock-o' 'icon' => 'clock-o',
), 'href' => "$editUrl#find-tab_cache",
),
'procache' => array( 'procache' => array(
'label' => $this->_x('ProCache', 'list-note'), 'label' => $this->_x('ProCache', 'list-note'),
'icon' => 'fighter-jet' 'icon' => 'fighter-jet',
'href' => "$editUrl#find-tab_cache",
), ),
'url-segments' => array( 'url-segments' => array(
'label' => $this->_x('URL segments', 'list-note'), 'label' => $this->_x('URL segments', 'list-note'),
'icon' => 'sitemap' 'icon' => 'sitemap',
), 'href' => "$editUrl#find-urlSegments",
),
'page-numbers' => array( 'page-numbers' => array(
'label' => $this->_x('Page numbers', 'list-note'), 'label' => $this->_x('Page numbers', 'list-note'),
'icon' => 'list-ol' 'icon' => 'list-ol',
) 'href' => "$editUrl#find-allowPageNum",
); )
);
$filterField = $this->session->getFor($this, 'filterField'); $filterField = $this->session->getFor($this, 'filterField');
$filterSystem = $this->session->getFor($this, 'filterSystem'); $filterSystem = $this->session->getFor($this, 'filterSystem');
@@ -455,7 +463,9 @@ class ProcessTemplate extends Process implements ConfigurableModule {
$class = 'templateFlag' . ucfirst($flag); $class = 'templateFlag' . ucfirst($flag);
$flag = $flagDefs[$flag]; $flag = $flagDefs[$flag];
$label = str_replace('-', ' ', ucfirst($flag['label'])); $label = str_replace('-', ' ', ucfirst($flag['label']));
$notes .= "<a class='tooltip templateFlag $class' title='$label'><i class='fa fa-$flag[icon]'></i>&nbsp;</a> "; $href = empty($flag['href']) ? '#' : $flag['href'];
$icon = wireIconMarkup($flag['icon'], 'fw');
$notes .= "<a href='$href' class='tooltip templateFlag $class' title='$label'>$icon</a> ";
} }
$numPages = $template->getNumPages(); $numPages = $template->getNumPages();
@@ -465,7 +475,7 @@ class ProcessTemplate extends Process implements ConfigurableModule {
if($template->fieldgroup && $template->fieldgroup->name != $template->name) $numFields .= " " . $template->fieldgroup->name; if($template->fieldgroup && $template->fieldgroup->name != $template->name) $numFields .= " " . $template->fieldgroup->name;
$row = array(); $row = array();
$row["{$template->name} "] = "edit?id={$template->id}"; $row["{$template->name} "] = $editUrl;
if($useLabel) { if($useLabel) {
$icon = $template->getIcon(); $icon = $template->getIcon();
$icon = $icon ? wireIconMarkup($icon, 'fw') : ''; $icon = $icon ? wireIconMarkup($icon, 'fw') : '';
@@ -717,12 +727,14 @@ class ProcessTemplate extends Process implements ConfigurableModule {
$t->attr('title', $this->_x('URLs', 'tab')); $t->attr('title', $this->_x('URLs', 'tab'));
// $t->head = $this->_('Optional settings for URLs of pages using this template'); // $t->head = $this->_('Optional settings for URLs of pages using this template');
$t->attr('class', 'WireTab'); $t->attr('class', 'WireTab');
$t->attr('id', 'tab_urls');
$t->add($this->buildEditFormURLs($template)); $t->add($this->buildEditFormURLs($template));
$form->add($t); $form->add($t);
$t = $this->wire(new InputfieldWrapper()); $t = $this->wire(new InputfieldWrapper());
$t->attr('title', $this->_x('Files', 'tab')); $t->attr('title', $this->_x('Files', 'tab'));
$t->attr('class', 'WireTab'); $t->attr('class', 'WireTab');
$t->attr('id', 'tab_files');
$t->add($this->buildEditFormFile($template)); $t->add($this->buildEditFormFile($template));
$form->add($t); $form->add($t);
@@ -738,6 +750,7 @@ class ProcessTemplate extends Process implements ConfigurableModule {
$t->attr('title', $this->_x('Advanced', 'tab')); $t->attr('title', $this->_x('Advanced', 'tab'));
// $t->head = $this->_('Optional advanced template settings'); // $t->head = $this->_('Optional advanced template settings');
$t->attr('class', 'WireTab'); $t->attr('class', 'WireTab');
$t->attr('id', 'tab_advanced');
$t->add($this->buildEditFormAdvanced($template)); $t->add($this->buildEditFormAdvanced($template));
$form->add($t); $form->add($t);
@@ -746,6 +759,7 @@ class ProcessTemplate extends Process implements ConfigurableModule {
$t->attr('title', $this->_x('System', 'tab')); $t->attr('title', $this->_x('System', 'tab'));
// $t->head = $this->_('System-specific template settings'); // $t->head = $this->_('System-specific template settings');
$t->attr('class', 'WireTab'); $t->attr('class', 'WireTab');
$t->attr('id', 'tab_system');
$t->add($this->buildEditFormSystem($template)); $t->add($this->buildEditFormSystem($template));
$form->add($t); $form->add($t);
} }
@@ -753,6 +767,7 @@ class ProcessTemplate extends Process implements ConfigurableModule {
$t = $this->wire(new InputfieldWrapper()); $t = $this->wire(new InputfieldWrapper());
$t->attr('class', 'WireTab'); $t->attr('class', 'WireTab');
$t->attr('title', $this->_x('Actions', 'tab')); $t->attr('title', $this->_x('Actions', 'tab'));
$t->attr('id', 'tab_actions');
$t->add($this->buildEditFormActions($template)); $t->add($this->buildEditFormActions($template));
$form->add($t); $form->add($t);