Ejemplo n.º 1
0
/**
 * Adds togglelinks on menu items
 *
 * @param string         $hook         the name of the hook
 * @param string         $type         the type of the hook
 * @param ElggMenuItem[] $return_value current return value
 * @param array          $params       supplied params
 *
 * @return ElggMenuItem[]
 */
function theme_haarlem_intranet_responsive_toggle_links($hook, $type, $return_value, $params)
{
    if (!is_array($return_value) || empty($return_value)) {
        return;
    }
    foreach ($return_value as $section_items) {
        foreach ($section_items as $item) {
            theme_haarlem_add_toggle_link($item);
        }
    }
}
Ejemplo n.º 2
0
/**
 * Adds a toggle link for use in responsive
 *
 * @param \ElggMenuItem $item
 */
function theme_haarlem_add_toggle_link(\ElggMenuItem &$item)
{
    $children = $item->getChildren();
    if (empty($children)) {
        return;
    }
    $item->setText($item->getText() . elgg_view_icon('angle-right', 'elgg-menu-site-toggle'));
    foreach ($children as $child) {
        theme_haarlem_add_toggle_link($child);
    }
}