當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。