Exemple #1
0
            if (!empty($menu['handler'])) {
                $attributes .= ' onclick="' . str_replace('"', '\'', $menu['handler']) . '"';
            }
            $smTpl .= '<a' . $attributes . '>' . $menu['text'] . $description . '</a>' . "\n";
            if (!empty($menu['children'])) {
                $smTpl .= '<ul class="modx-subsubnav">' . "\n";
                $this->processSubMenus($smTpl, $menu['children']);
                $smTpl .= '</ul>' . "\n";
            }
            $smTpl .= '</li>';
            $output .= $smTpl;
            $this->childrenCt++;
        }
        //$output .= '</ul>'."\n";
    }
    /**
     * Clean "orphan" sub menus
     *
     * @return void
     */
    public function cleanEmptySubMenus()
    {
        $emptySub = '<ul class="modx-subsubnav">' . "\n" . '</ul>' . "\n";
        $this->output = str_replace($emptySub, '', $this->output);
    }
}
// Set Smarty placeholder to display search bar, if appropriate
$this->setPlaceholder('_search', $modx->hasPermission('search'));
$menu = new TopMenu($this);
$menu->render();
Exemple #2
0
 public function render()
 {
     return "  [decorated_top_menu]\n  " . parent::render() . "\n  [/decorated_top_menu]";
 }