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


PHP ElggMenuItem::setSection方法代码示例

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


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

示例1: logbrowser_user_hover_menu

/**
 * Add to the user hover menu
 */
function logbrowser_user_hover_menu($hook, $type, $return, $params)
{
    $user = $params['entity'];
    $url = "admin/overview/logbrowser?user_guid={$user->guid}";
    $item = new ElggMenuItem('logbrowser', elgg_echo('logbrowser:explore'), $url);
    $item->setSection('admin');
    $return[] = $item;
    return $return;
}
开发者ID:redvabel,项目名称:Vabelgg,代码行数:12,代码来源:start.php

示例2: album_link_hover_menu

function album_link_hover_menu($hook, $type, $return, $params)
{
    $user = $params['entity'];
    $url = elgg_get_site_url() . "photos/owner/" . $user->username;
    $item = new ElggMenuItem('album_link_hover', elgg_echo("album_link:album_link", array($user->name)), $url);
    $item->setSection('action');
    $return[] = $item;
    return $return;
}
开发者ID:iionly,项目名称:album_link,代码行数:9,代码来源:start.php

示例3: donation_user_hover_menu

function donation_user_hover_menu($hook, $type, $return, $params)
{
    $user = $params['entity'];
    $url = "action/donation/add?guid={$user->guid}";
    $url = elgg_add_action_tokens_to_url($url);
    $item = new ElggMenuItem('donation', elgg_echo('donation:add'), $url);
    $item->setSection('admin');
    $return[] = $item;
    return $return;
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:10,代码来源:start.php

示例4: hover_menu

function hover_menu($hook, $type, $return, $params)
{
    $user = $params['entity'];
    if ($user->spam_throttle_suspension > time() && elgg_is_admin_logged_in()) {
        $url = "action/spam_throttle/unsuspend?guid={$user->guid}";
        $item = new \ElggMenuItem("spam_throttle_unsuspend", elgg_echo("spam_throttle:unsuspend"), $url);
        $item->setConfirmText(elgg_echo('spam_throttle:unsuspend:confirm'));
        $item->setSection('admin');
        $return[] = $item;
    }
    return $return;
}
开发者ID:n8b,项目名称:VMN,代码行数:12,代码来源:hooks.php

示例5: reportedcontent_user_hover_menu

/**
 * Add report user link to hover menu
 */
function reportedcontent_user_hover_menu($hook, $type, $return, $params)
{
    $user = $params['entity'];
    $profile_url = urlencode($user->getURL());
    $name = urlencode($user->name);
    $url = "reportedcontent/add?address={$profile_url}&title={$name}";
    if (elgg_is_logged_in() && elgg_get_logged_in_user_guid() != $user->guid) {
        $item = new ElggMenuItem('reportuser', elgg_echo('reportedcontent:user'), $url);
        $item->setSection('action');
        $return[] = $item;
    }
    return $return;
}
开发者ID:nooshin-mirzadeh,项目名称:web_2.0_benchmark,代码行数:16,代码来源:start.php

示例6: badges_user_hover_menu

/**
 * Add to the user hover menu
 */
function badges_user_hover_menu($hook, $type, $return, $params)
{
    $user = $params['entity'];
    $url = "admin/administer_utilities/elggx_badges?tab=assign&user_guid={$user->guid}";
    $item = new ElggMenuItem('badges', elgg_echo('badges:assign_badge'), $url);
    $item->setSection('admin');
    $return[] = $item;
    $url = "admin/administer_utilities/elggx_badges?tab=unassign&user_guid={$user->guid}";
    $item = new ElggMenuItem('badges', elgg_echo('badges:unassign_badge'), $url);
    $item->setSection('admin');
    $return[] = $item;
    return $return;
}
开发者ID:iionly,项目名称:elggx_badges,代码行数:16,代码来源:start.php

示例7: user_hover_hook

/**
 * 
 * @param type $hook
 * @param type $type
 * @param type $returnvalue
 * @param type $params
 * @return ElggMenuItem
 */
function user_hover_hook($hook, $type, $returnvalue, $params)
{
    $user = $params['entity'];
    $url = elgg_get_site_url() . "activity_tabs/user/{$user->username}";
    $item = new \ElggMenuItem('activity_tabs_user_activity', elgg_echo('activity_tabs'), $url);
    if ($type == 'menu:user_hover') {
        $item->setSection('action');
        $item->setLinkClass('activity-tabs-user-hover');
        $item->setPriority(200);
    }
    $returnvalue[] = $item;
    return $returnvalue;
}
开发者ID:smellems,项目名称:mt_activity_tabs,代码行数:21,代码来源:hooks.php

示例8: hflts_user_hover_menu

function hflts_user_hover_menu($hook, $type, $return, $params)
{
    $user = $params['entity'];
    //if (elgg_is_admin_logged_in() != $user->guid) supuestamente esto es para que no vea mi propia valoracion
    if (elgg_is_admin_logged_in()) {
        $url = "hflts/{$user->username}";
        $item = new \ElggMenuItem('hflts:user', elgg_echo('hflts:menuhover'), $url);
        $item->setSection('admin');
        //default + elgg_get_logged_in_user_guid() | admin + elgg_is_admin_logged_in
        //$item->setConfirmText(elgg_echo('confirm'));//saca un are you sure
        $return[] = $item;
    }
    return $return;
}
开发者ID:rosanamontes,项目名称:teranga.go,代码行数:14,代码来源:start.php

示例9: translation_editor_user_hover_menu

function translation_editor_user_hover_menu($hook, $type, $return, $params)
{
    $user = $params['entity'];
    if (elgg_is_admin_logged_in() && !$user->isAdmin()) {
        // TODO: replace with a single toggle editor action?
        if (translation_editor_is_translation_editor($user->getGUID())) {
            $url = "action/translation_editor/unmake_translation_editor?user=" . $user->getGUID();
            $title = elgg_echo("translation_editor:action:unmake_translation_editor");
        } else {
            $url = "action/translation_editor/make_translation_editor?user=" . $user->getGUID();
            $title = elgg_echo("translation_editor:action:make_translation_editor");
        }
        $item = new ElggMenuItem('translation_editor', $title, $url);
        $item->setSection('admin');
        $item->setConfirmText(elgg_echo("question:areyousure"));
        $return[] = $item;
        return $return;
    }
}
开发者ID:amcfarlane1251,项目名称:ongarde,代码行数:19,代码来源:hooks.php

示例10: event_manager_user_hover_menu

function event_manager_user_hover_menu($hook, $entity_type, $returnvalue, $params)
{
    $result = $returnvalue;
    $event = false;
    $guid = get_input("guid");
    if (!empty($guid) && ($entity = get_entity($guid))) {
        if ($entity->getSubtype() == Event::SUBTYPE) {
            $event = $entity;
        }
    }
    if ($event) {
        $user = elgg_extract("entity", $params);
        if ($user) {
            // kick from event
            $href = elgg_get_site_url() . 'action/event_manager/event/rsvp?guid=' . $event->getGUID() . '&user=' . $user->getGUID() . '&type=' . EVENT_MANAGER_RELATION_UNDO;
            $href = elgg_add_action_tokens_to_url($href);
            $item = new ElggMenuItem("event_manager_kick", elgg_echo("event_manager:event:relationship:kick"), $href);
            $item->setSection("action");
            $result[] = $item;
            $user_relationship = $event->getRelationshipByUser($user->getGUID());
            if ($user_relationship == EVENT_MANAGER_RELATION_ATTENDING_PENDING) {
                // resend confirmation
                $href = elgg_get_site_url() . 'action/event_manager/event/resend_confirmation?guid=' . $event->getGUID() . '&user=' . $user->getGUID();
                $href = elgg_add_action_tokens_to_url($href);
                $item = new ElggMenuItem("event_manager_resend_confirmation", elgg_echo("event_manager:event:menu:user_hover:resend_confirmation"), $href);
                $item->setSection("action");
                $result[] = $item;
            }
            if (in_array($user_relationship, array(EVENT_MANAGER_RELATION_ATTENDING_PENDING, EVENT_MANAGER_RELATION_ATTENDING_WAITINGLIST))) {
                // move to attendees
                $href = elgg_get_site_url() . 'action/event_manager/attendees/move_to_attendees?guid=' . $event->getGUID() . '&user=' . $user->getGUID();
                $href = elgg_add_action_tokens_to_url($href);
                $item = new ElggMenuItem("event_manager_move_to_attendees", elgg_echo("event_manager:event:menu:user_hover:move_to_attendees"), $href);
                $item->setSection("action");
                $result[] = $item;
            }
        }
    }
    return $result;
}
开发者ID:amcfarlane1251,项目名称:ongarde,代码行数:40,代码来源:hooks.php

示例11: messages_user_hover_menu

/**
 * Add to the user hover menu
 */
function messages_user_hover_menu($hook, $type, $return, $params)
{
    $user = $params['entity'];
    if (elgg_is_logged_in() && elgg_get_logged_in_user_guid() != $user->guid) {
        $url = "messages/compose?send_to={$user->guid}";
        $item = new ElggMenuItem('send', elgg_echo('messages:sendmessage'), $url);
        $item->setSection('action');
        $return[] = $item;
    }
    return $return;
}
开发者ID:nirajkaushal,项目名称:Elgg,代码行数:14,代码来源:start.php

示例12: zhaohu_user_hover_menu

function zhaohu_user_hover_menu($hook, $type, $return, $params)
{
    $entity = $params['entity'];
    if (elgg_instanceof($entity, 'user') && elgg_get_logged_in_user_guid() == $entity->guid) {
        $item = new ElggMenuItem('usersettings', elgg_echo('settings'), "settings/user/{$entity->username}");
        $item->setSection('action');
        $return[] = $item;
    }
    return $return;
}
开发者ID:pingwangcs,项目名称:51zhaohu,代码行数:10,代码来源:start.php

示例13: event_calendar_handle_menu

function event_calendar_handle_menu($event_guid)
{
    $event = get_entity($event_guid);
    $event_calendar_personal_manage = elgg_get_plugin_setting('personal_manage', 'event_calendar');
    if ($event_calendar_personal_manage == 'by_event' && $event->personal_manage == 'closed' || ($event_calendar_personal_manage == 'closed' || $event_calendar_personal_manage == 'no')) {
        $url = "event_calendar/review_requests/{$event_guid}";
        $item = new ElggMenuItem('event-calendar-0review_requests', elgg_echo('event_calendar:review_requests_menu_title'), $url);
        $item->setSection('event_calendar');
        elgg_register_menu_item('page', $item);
        //add_submenu_item(elgg_echo('event_calendar:review_requests_title'), $CONFIG->wwwroot . "pg/event_calendar/review_requests/".$event_id, '0eventcalendaradmin');
    }
    $event_calendar_add_users = elgg_get_plugin_setting('add_users', 'event_calendar');
    if ($event_calendar_add_users == 'yes') {
        $url = "event_calendar/manage_users/{$event_guid}";
        $item = new ElggMenuItem('event-calendar-1manage_users', elgg_echo('event_calendar:manage_users:breadcrumb'), $url);
        $item->setSection('event_calendar');
        elgg_register_menu_item('page', $item);
    }
}
开发者ID:lionding2009,项目名称:Elgg-Event-Calendar,代码行数:19,代码来源:model.php

示例14: elggchat_user_hover_menu

function elggchat_user_hover_menu($hook, $type, $return, $params)
{
    $user = $params['entity'];
    if (elgg_is_logged_in() && elgg_get_logged_in_user_guid() != $user->guid) {
        $allowed = false;
        $allow_contact_from = elgg_get_plugin_user_setting("allow_contact_from", $user->guid, "elggchat");
        if (!empty($allow_contact_from)) {
            if ($allow_contact_from == "all") {
                $allowed = true;
            } elseif ($allow_contact_from == "friends") {
                if ($user->isFriendsWith(elgg_get_logged_in_user_guid())) {
                    $allowed = true;
                }
            }
        } else {
            if ($user->isFriendsWith(elgg_get_logged_in_user_guid())) {
                // default: only friends allowed to invite to chat
                $allowed = true;
            } else {
                if (elgg_is_admin_logged_in()) {
                    // admins can always invite everyone for chatting
                    $allowed = true;
                }
            }
        }
        if ($allowed) {
            $url = "javascript:startSession(" . $user->guid . ");";
            $item = new ElggMenuItem('elggchat_hover', elgg_echo("elggchat:chat:profile:invite"), $url);
            $item->setSection('action');
            $return[] = $item;
        }
    }
    return $return;
}
开发者ID:nooshin-mirzadeh,项目名称:web_2.0_benchmark,代码行数:34,代码来源:start.php

示例15: foreach

    // @todo when using index table, can include result counts on each of these.
    if (is_array($subtypes) && count($subtypes)) {
        foreach ($subtypes as $subtype) {
            if ($subtype === "page_top") {
                // skip this one as it is merged with page objects
                continue;
            }
            $label = "item:{$type}:{$subtype}";
            $count = "";
            if (array_key_exists($label, $search_result_counters)) {
                $count = " <span class='elgg-quiet'>[" . $search_result_counters[$label] . "]</span>";
            }
            $data = htmlspecialchars(http_build_query(array('q' => $query, 'entity_subtype' => $subtype, 'entity_type' => $type, 'owner_guid' => $owner_guid, 'container_guid' => $container_guid, 'search_type' => 'entities', 'friends' => $friends)));
            $url = elgg_get_site_url() . "search?{$data}";
            $menu_item = new ElggMenuItem($label, elgg_echo($label) . $count, $url);
            $menu_item->setSection($type);
            elgg_register_menu_item('page', $menu_item);
        }
    } else {
        $label = "item:{$type}";
        $count = "";
        if (array_key_exists($label, $search_result_counters)) {
            $count = " <span class='elgg-quiet'>[" . $search_result_counters[$label] . "]</span>";
        }
        $data = htmlspecialchars(http_build_query(array('q' => $query, 'entity_type' => $type, 'owner_guid' => $owner_guid, 'container_guid' => $container_guid, 'search_type' => 'entities', 'friends' => $friends)));
        $url = elgg_get_site_url() . "search?{$data}";
        $menu_item = new ElggMenuItem($label, elgg_echo($label) . $count, $url);
        elgg_register_menu_item('page', $menu_item);
    }
}
// add sidebar for custom searches
开发者ID:coldtrick,项目名称:theme_haarlem_intranet,代码行数:31,代码来源:index.php


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