当前位置: 首页>>代码示例>>PHP>>正文


PHP ElggMenuItem::addChild方法代码示例

本文整理汇总了PHP中ElggMenuItem::addChild方法的典型用法代码示例。如果您正苦于以下问题:PHP ElggMenuItem::addChild方法的具体用法?PHP ElggMenuItem::addChild怎么用?PHP ElggMenuItem::addChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ElggMenuItem的用法示例。


在下文中一共展示了ElggMenuItem::addChild方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: gvtheme_init

function gvtheme_init()
{
    // custom topbar
    elgg_unregister_menu_item('topbar', 'elgg_logo');
    elgg_register_plugin_hook_handler('register', 'menu:topbar', 'gvtheme_custom_topbarmenu_setup');
    elgg_register_plugin_hook_handler('register', 'menu:entity', 'gvtheme_custom_entitymenu_setup');
    elgg_register_plugin_hook_handler('register', 'menu:river', 'gvtheme_custom_rivermenu_setup');
    elgg_register_event_handler('pagesetup', 'system', 'gvtheme_custom_usersettings_pagesetup');
    elgg_extend_view('css/elgg', 'gvtheme/css');
    elgg_extend_view('page/elements/head', 'gvtheme/head');
    // remove entities statistics views from user account
    elgg_unextend_view('core/settings/statistics', 'core/settings/statistics/numentities');
    // override some actions
    $action_base = elgg_get_plugins_path() . 'gvtheme/actions';
    elgg_register_action("avatar/upload", "{$action_base}/avatar/upload.php");
    elgg_register_action("avatar/crop", "{$action_base}/avatar/crop.php");
    elgg_register_action("friends/add", "{$action_base}/friends/add.php");
    // get number of users
    $num_members = get_number_users();
    elgg_register_menu_item('topbar', array('name' => 'member_number', 'href' => "members/newest", 'text' => elgg_echo("gvtheme:num_members", array($num_members)), 'priority' => 1000, 'section' => 'alt'));
    $initiatives_item = new ElggMenuItem('initiatives', elgg_echo('gvtheme:initiatives'));
    $cnc_item = new ElggMenuItem('cnc', elgg_echo('gvtheme:cnc'), 'file/group/9545/all');
    $cnc_item->setItemClass('gvgroup-child-menu');
    $initiatives_item->addChild($cnc_item);
    elgg_register_menu_item('site', $initiatives_item);
}
开发者ID:remy40,项目名称:gvrs,代码行数:26,代码来源:start.php

示例2: au_theme_titlemenu

function au_theme_titlemenu($h, $t, $r, $p)
{
    $threshold = elgg_get_plugin_setting('compact_title_button_threshold', 'au_theme');
    if (!$threshold) {
        $threshold = 1;
    }
    if ($t == 'menu:title' && count($r) > $threshold) {
        $count = 0;
        foreach ($r as $key => $button) {
            if ($button->inContext()) {
                $count++;
            }
        }
        if ($count <= $threshold) {
            return $r;
        }
        // add in our top level element 'Actions'
        // everything else gets added as a child of that
        $text = elgg_echo('au_theme:titledropdown') . '<span class="elgg-icon elgg-icon-round-plus"></span>';
        $item = new ElggMenuItem('action-dropdown', $text, '#');
        $item->setLinkClass('action-dropdown');
        foreach ($r as $key => $button) {
            if ($button->inContext()) {
                $item->addChild($button);
            }
        }
        return array($item);
    }
}
开发者ID:AU-Landing-Project,项目名称:au_theme,代码行数:29,代码来源:start.php


注:本文中的ElggMenuItem::addChild方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。