diff --git a/wire/modules/Process/ProcessPageList/ProcessPageList.module b/wire/modules/Process/ProcessPageList/ProcessPageList.module index a4b26479..d73370ab 100644 --- a/wire/modules/Process/ProcessPageList/ProcessPageList.module +++ b/wire/modules/Process/ProcessPageList/ProcessPageList.module @@ -546,7 +546,7 @@ class ProcessPageList extends Process implements ConfigurableModule { } $numChildren = $id > 1 ? $page->numChildren : 0; - $label = $renderer->getPageLabel($page, array('noTags' => true)); + $label = $renderer->getPageLabel($page, array('noTags' => true, 'noIcon' => true)); if(strlen($label) > $maxLabelLength) { $label = substr($label, 0, $maxLabelLength); $pos = strrpos($label, ' '); diff --git a/wire/modules/Process/ProcessPageList/ProcessPageListRender.php b/wire/modules/Process/ProcessPageList/ProcessPageListRender.php index 7fedb96f..4506e58c 100644 --- a/wire/modules/Process/ProcessPageList/ProcessPageListRender.php +++ b/wire/modules/Process/ProcessPageList/ProcessPageListRender.php @@ -44,7 +44,7 @@ abstract class ProcessPageListRender extends Wire { 'restore' => $this->_('Restore'), // Restore from trash action ); require_once(dirname(__FILE__) . '/ProcessPageListActions.php'); - $this->actions = $this->wire(new ProcessPageListActions($this)); + $this->actions = $this->wire(new ProcessPageListActions()); $this->actions->setActionLabels($this->actionLabels); } @@ -102,13 +102,14 @@ abstract class ProcessPageListRender extends Wire { * * @param Page $page * @param array $options + * - `noTags` (bool): If true, HTML will be excluded [other than for icon] in returned text value (default=false) + * - `noIcon` (bool): If true, icon markup will be excluded from returned value (default=false) * @return string * */ public function ___getPageLabel(Page $page, array $options = array()) { $value = ''; - $icon = empty($options['noTags']) ? $page->getIcon() : ''; if(strpos($this->pageLabelField, '!') === 0) { // exclamation forces this one to be used, rather than template-specific one @@ -124,9 +125,10 @@ abstract class ProcessPageListRender extends Wire { $bracket1 = strpos($pageLabelField, '{'); if($bracket1 !== false && $bracket1 < strpos($pageLabelField, '}')) { - // predefined format string + $icon = $page->getIcon(); if($icon) $pageLabelField = str_replace(array("fa-$icon", "icon-$icon", " "), array('', '', ' '), $pageLabelField); + if(!empty($options['noIcon'])) $icon = ''; // adjust string so that it'll work on a single line, without the markup in it $value = $page->getText($pageLabelField, true, true); // if(strpos($value, '')) $value = preg_replace('!\s*