• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_context函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_context函数的典型用法代码示例。如果您正苦于以下问题:PHP get_context函数的具体用法?PHP get_context怎么用?PHP get_context使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: vazco_avatar_init

function vazco_avatar_init()
{
    global $CONFIG;
    define('VAZCO_AVATAR_PATH', 'vazco_avatars');
    //set admin user ID to 2 - the default admin. TODO: do it cleaner.
    // Since we use ElggFile here, the ID has to belong to the user that is in the system all the time.
    define('VAZCO_AVATAR_ADMIN', 2);
    extend_view('profile/editicon', 'vazco_avatar/select', 601);
    extend_view('css', 'vazco_avatar/css', 601);
    register_action("vazco_avatar/upload", false, $CONFIG->pluginspath . "vazco_avatar/actions/upload.php");
    register_action("vazco_avatar/select", false, $CONFIG->pluginspath . "vazco_avatar/actions/select.php");
    register_action("vazco_avatar/delete", false, $CONFIG->pluginspath . "vazco_avatar/actions/delete.php");
    register_plugin_hook('action', 'profile/cropicon', 'vazco_avatar_cropicon', 600);
    if (isadminloggedin() && get_context() == 'admin' || get_context() == 'vazco_avatar') {
        add_submenu_item(elgg_echo('vazco_avatar:menu'), $CONFIG->wwwroot . 'pg/vazco_avatar/edit');
    }
    if (isadminloggedin() && get_context() == 'vazco_avatar') {
        add_submenu_item(elgg_echo('avatars:upload'), $CONFIG->wwwroot . 'pg/vazco_avatar/upload');
    }
    if (isloggedin()) {
        //update current user's avatar for topbar and edit icon page
        setUserIcon($_SESSION['user'], 'topbar');
        setUserIcon($_SESSION['user'], 'medium');
    }
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:25,代码来源:start.php


示例2: dreamfish_admin_pagesetup

function dreamfish_admin_pagesetup()
{
    if (get_context() == 'admin' && isadminloggedin()) {
        global $CONFIG;
        add_submenu_item(elgg_echo('dreamfish_admin:admin_title'), $CONFIG->wwwroot . 'mod/dreamfish_admin/admintasks.php');
    }
}
开发者ID:eokyere,项目名称:elgg,代码行数:7,代码来源:start.php


示例3: reportedcontent_pagesetup

/**
 * Adding the reported content to the admin menu
 *
 */
function reportedcontent_pagesetup()
{
    if (get_context() == 'admin' && isadminloggedin()) {
        global $CONFIG;
        add_submenu_item(elgg_echo('reportedcontent'), $CONFIG->wwwroot . 'pg/reportedcontent/');
    }
}
开发者ID:eokyere,项目名称:elgg,代码行数:11,代码来源:start.php


示例4: messages_init

/**
 * Messages initialisation
 *
 * These parameters are required for the event API, but we won't use them:
 * 
 * @param unknown_type $event
 * @param unknown_type $object_type
 * @param unknown_type $object
 */
function messages_init()
{
    // Load system configuration
    global $CONFIG;
    //add submenu options
    if (get_context() == "messages") {
        add_submenu_item(elgg_echo('messages:compose'), $CONFIG->wwwroot . "mod/messages/send.php");
        add_submenu_item(elgg_echo('messages:inbox'), $CONFIG->wwwroot . "pg/messages/" . $_SESSION['user']->username);
        add_submenu_item(elgg_echo('messages:sentmessages'), $CONFIG->wwwroot . "mod/messages/sent.php");
    }
    // Extend system CSS with our own styles, which are defined in the shouts/css view
    extend_view('css', 'messages/css');
    // Extend the elgg topbar
    extend_view('elgg_topbar/extend', 'messages/topbar');
    // Register a page handler, so we can have nice URLs
    register_page_handler('messages', 'messages_page_handler');
    // Register a URL handler for shouts posts
    register_entity_url_handler('messages_url', 'object', 'messages');
    // Extend hover-over and profile menu
    extend_view('profile/menu/links', 'messages/menu');
    // Register a notification handler for site messages
    register_notification_handler("site", "messages_site_notify_handler");
    register_plugin_hook('notify:entity:message', 'object', 'messages_notification_msg');
    if (is_callable('register_notification_object')) {
        register_notification_object('object', 'messages', elgg_echo('messages:new'));
    }
    // Shares widget
    //  add_widget_type('messages',elgg_echo("messages:recent"),elgg_echo("messages:widget:description"));
    // Override metadata permissions
    register_plugin_hook('permissions_check:metadata', 'object', 'messages_can_edit_metadata');
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:40,代码来源:start.php


示例5: ckeditor_pagesetup

function ckeditor_pagesetup()
{
    if (get_context() == 'admin' && isadminloggedin()) {
        global $CONFIG;
        add_submenu_item(elgg_echo('ckeditor:admin_title'), $CONFIG->wwwroot . 'mod/CKEditor/admin.php');
    }
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:7,代码来源:start.php


示例6: file_submenus

/**
 * Sets up submenus for the file system.  Triggered on pagesetup.
 *
 */
function file_submenus()
{
    global $CONFIG;
    $page_owner = page_owner_entity();
    // Group submenu option
    if ($page_owner instanceof ElggGroup && get_context() == "groups") {
        if ($page_owner->files_enable != "no") {
            add_submenu_item(sprintf(elgg_echo("file:group"), $page_owner->name), $CONFIG->wwwroot . "pg/file/" . $page_owner->username);
        }
    }
    // General submenu options
    if (get_context() == "file") {
        if ((page_owner() == $_SESSION['guid'] || !page_owner()) && isloggedin()) {
            add_submenu_item(sprintf(elgg_echo("file:yours"), $page_owner->name), $CONFIG->wwwroot . "pg/file/" . $page_owner->username);
            add_submenu_item(sprintf(elgg_echo('file:yours:friends'), $page_owner->name), $CONFIG->wwwroot . "pg/file/" . $page_owner->username . "/friends/");
        } else {
            if (page_owner()) {
                add_submenu_item(sprintf(elgg_echo("file:user"), $page_owner->name), $CONFIG->wwwroot . "pg/file/" . $page_owner->username);
                if ($page_owner instanceof ElggUser) {
                    // This one's for users, not groups
                    add_submenu_item(sprintf(elgg_echo('file:friends'), $page_owner->name), $CONFIG->wwwroot . "pg/file/" . $page_owner->username . "/friends/");
                }
            }
        }
        add_submenu_item(elgg_echo('file:all'), $CONFIG->wwwroot . "mod/file/world.php");
        if (can_write_to_container($_SESSION['guid'], page_owner())) {
            add_submenu_item(elgg_echo('file:upload'), $CONFIG->wwwroot . "pg/file/" . $page_owner->username . "/new/");
        }
    }
}
开发者ID:eokyere,项目名称:elgg,代码行数:34,代码来源:start.php


示例7: collaboration_pagesetup

function collaboration_pagesetup()
{
    global $CONFIG;
    if (get_context() == 'admin' && isadminloggedin()) {
        add_submenu_item('Manage external sites', $CONFIG->wwwroot . 'pg/collaboration/admin');
    }
}
开发者ID:rkvsraman,项目名称:elgg_external_sites,代码行数:7,代码来源:start.php


示例8: removewidget_pagesetup

function removewidget_pagesetup()
{
    global $CONFIG;
    if (get_context() == 'admin' && isadminloggedin()) {
        add_submenu_item(elgg_echo('remove_widgets'), $CONFIG->wwwroot . 'pg/removewidget/');
    }
}
开发者ID:CashElgg,项目名称:remove_widget,代码行数:7,代码来源:start.php


示例9: logbrowser_pagesetup

/**
 * Adding the log browser to the admin menu
 *
 */
function logbrowser_pagesetup()
{
    if (get_context() == 'admin' && isadminloggedin()) {
        global $CONFIG;
        add_submenu_item(elgg_echo('logbrowser'), $CONFIG->wwwroot . 'pg/logbrowser/');
    }
}
开发者ID:ashwiniravi,项目名称:Elgg-Social-Network-Single-Sign-on-and-Web-Statistics,代码行数:11,代码来源:start.php


示例10: plugins_add_submenus

/**
 * Sets up submenus. Triggered on pagesetup.
 *
 */
function plugins_add_submenus()
{
    global $CONFIG;
    $plugins_base = "{$CONFIG->wwwroot}pg/plugins";
    if (get_context() == 'admin') {
        $title = elgg_echo("plugins:admin:menu");
        add_submenu_item($title, "{$plugins_base}/admin/");
        return;
    }
    if (get_context() != "plugins") {
        return;
    }
    $page_owner = page_owner_entity();
    if (isloggedin() && page_owner() == get_loggedin_userid()) {
        $title = sprintf(elgg_echo("plugins:yours"), elgg_echo('plugins:types:'));
        add_submenu_item($title, "{$plugins_base}/developer/{$page_owner->username}");
        //add_submenu_item(sprintf(elgg_echo('plugins:yours:friends'),page_owner_entity()->name), $CONFIG->wwwroot . "pg/plugins/". $page_owner->username . "/friends/");
    } else {
        if (page_owner()) {
            $title = sprintf(elgg_echo("plugins:user"), $page_owner->name, elgg_echo('plugins:types:'));
            add_submenu_item($title, "{$plugins_base}/developer/{$page_owner->username}");
            //if ($page_owner instanceof ElggUser) // This one's for users, not groups
            //add_submenu_item(sprintf(elgg_echo('plugins:friends'),$page_owner->name), $CONFIG->wwwroot . "pg/plugins/". $page_owner->username . "/friends/");
        }
    }
    add_submenu_item(elgg_echo('plugins:all'), "{$plugins_base}/all/");
    // add upload link when viewing own plugin page
    if (get_loggedin_userid() == page_owner()) {
        add_submenu_item(elgg_echo('plugins:upload'), "{$plugins_base}/new/project/{$page_owner->username}");
    }
}
开发者ID:nohup,项目名称:community_plugins,代码行数:35,代码来源:start.php


示例11: cclite_pagesetup

function cclite_pagesetup()
{
    global $CONFIG;
    //add submenu options
    if (get_context() == "cclite") {
    }
}
开发者ID:hbarnard,项目名称:cclite,代码行数:7,代码来源:start.php


示例12: categories_pagesetup

/**
 * Set up menu items
 *
 */
function categories_pagesetup()
{
    if (get_context() == 'admin' && isadminloggedin()) {
        global $CONFIG;
        add_submenu_item(elgg_echo('categories:settings'), $CONFIG->wwwroot . 'mod/categories/settings.php');
    }
}
开发者ID:eokyere,项目名称:elgg,代码行数:11,代码来源:start.php


示例13: elgg_dev_tools_pagesetup

/**
 * Add admin menu item
 */
function elgg_dev_tools_pagesetup()
{
    if (get_context() == 'admin') {
        global $CONFIG;
        add_submenu_item(elgg_echo('elgg_dev_tools:adminlink'), $CONFIG->wwwroot . 'pg/elgg_dev_tools/');
    }
}
开发者ID:CashElgg,项目名称:elgg-developer-tools,代码行数:10,代码来源:start.php


示例14: theme_editable_pagesetup

/**
 * Set up menu items
 */
function theme_editable_pagesetup()
{
    if (get_context() == 'admin' && isadminloggedin()) {
        global $CONFIG;
        add_submenu_item(elgg_echo('theme_editable:settings'), $CONFIG->wwwroot . 'mod/theme_editable/settings.php');
    }
}
开发者ID:psndcsrv,项目名称:theme_editable,代码行数:10,代码来源:start.php


示例15: vazco_topbar_submenus

function vazco_topbar_submenus()
{
    global $CONFIG;
    if (isadminloggedin() && get_context() == 'admin' || get_context() == 'vazco_topbar') {
        add_submenu_item(elgg_echo('vazco_topbar:menu:short'), $CONFIG->wwwroot . 'mod/vazco_topbar/edit.php');
    }
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:7,代码来源:start.php


示例16: twitter_bootswatch_init

function twitter_bootswatch_init()
{
    $bootswatch_style = elgg_get_plugin_setting('bootswatch_style', 'twitter_bootswatch');
    switch ($bootswatch_style) {
        case 'amelia':
        case 'cerulean':
        case 'cosmo':
        case 'cyborg':
        case 'flatty':
        case 'journal':
        case 'readable':
        case 'simplex':
        case 'slate':
        case 'spacelab':
        case 'spruce':
        case 'superhero':
        case 'united':
            break;
        default:
            $bootswatch_style = 'cyborg';
    }
    // Unextend the default bootstrap override css
    elgg_unextend_view('css/elgg', 'twitter_bootstrap/css');
    // Extend system CSS with our own styles
    elgg_extend_view('css/elgg', 'twitter_bootswatch/css');
    // united bootstrap
    $bootstrap_css = 'mod/twitter_bootswatch/vendors/bootstrap-' . $bootswatch_style . '.min.css';
    elgg_register_css('twitter_bootswatch_css', $bootstrap_css, 5);
    //unload default bootstrap css and load new one
    elgg_unregister_css('bootstrap_css');
    if (get_context() != 'admin') {
        elgg_load_css('twitter_bootswatch_css');
    }
}
开发者ID:socialweb,项目名称:PiGo,代码行数:34,代码来源:start.php


示例17: diagnostics_pagesetup

/**
 * Adding the diagnostics to the admin menu
 *
 */
function diagnostics_pagesetup()
{
    if (get_context() == 'admin' && isadminloggedin()) {
        global $CONFIG;
        add_submenu_item(elgg_echo('diagnostics'), $CONFIG->wwwroot . 'pg/diagnostics/');
    }
}
开发者ID:ashwiniravi,项目名称:Elgg-Social-Network-Single-Sign-on-and-Web-Statistics,代码行数:11,代码来源:start.php


示例18: bookmarks_pagesetup

function bookmarks_pagesetup()
{
    global $CONFIG;
    // Set up menu for logged in users
    //add submenu options
    if (get_context() == "bookmarks") {
        if (isloggedin()) {
            add_submenu_item(elgg_echo('bookmarks:inbox'), $CONFIG->wwwroot . "pg/bookmarks/" . $_SESSION['user']->username . "/inbox");
            if (page_owner()) {
                $page_owner = page_owner_entity();
                add_submenu_item(sprintf(elgg_echo('bookmarks:read'), $page_owner->name), $CONFIG->wwwroot . "pg/bookmarks/" . $page_owner->username . "/items");
            }
            if (!$page_owner instanceof ElggGroup) {
                add_submenu_item(elgg_echo('bookmarks:friends'), $CONFIG->wwwroot . "pg/bookmarks/" . $_SESSION['user']->username . "/friends");
            }
        }
        //if(!$page_owner instanceof ElggGroup)
        //	add_submenu_item(elgg_echo('bookmarks:everyone'),$CONFIG->wwwroot."mod/bookmarks/everyone.php");
        // Bookmarklet
        if (isloggedin() && page_owner() && can_write_to_container(0, page_owner())) {
            $page_owner = page_owner_entity();
            $bmtext = elgg_echo('bookmarks:bookmarklet');
            if ($page_owner instanceof ElggGroup) {
                $bmtext = elgg_echo('bookmarks:bookmarklet:group');
            }
            add_submenu_item($bmtext, $CONFIG->wwwroot . "pg/bookmarks/{$page_owner->username}/bookmarklet");
        }
    }
    $page_owner = page_owner_entity();
    if ($page_owner instanceof ElggGroup && get_context() == 'groups') {
        if ($page_owner->bookmarks_enable != "no") {
            add_submenu_item(sprintf(elgg_echo("bookmarks:group"), $page_owner->name), $CONFIG->wwwroot . "pg/bookmarks/" . $page_owner->username . '/items');
        }
    }
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:35,代码来源:start.php


示例19: activityAndPerformanceDashboard_pagesetup

function activityAndPerformanceDashboard_pagesetup()
{
    global $CONFIG;
    //NOTE Must add submenu item to be able to call getData.php!
    if (get_context() == 'dashboard') {
        add_submenu_item('ActivityAndPerformanceDashboard', $CONFIG->url . 'pg/activityAndPerformanceDashboard');
    }
}
开发者ID:WELTEN,项目名称:PerformanceDashboard,代码行数:8,代码来源:start.php


示例20: invitefriends_pagesetup

/**
 * Elgg invite page
 * 
 * @package ElggFile
 * @author Curverider Ltd
 * @copyright Curverider Ltd 2008-2009
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @link http://elgg.org/
 */
function invitefriends_pagesetup()
{
    // Menu options
    global $CONFIG;
    if (get_context() == "friends" || get_context() == "friendsof" || get_context() == "collections") {
        add_submenu_item(elgg_echo('friends:invite'), $CONFIG->wwwroot . "mod/invitefriends/", 'invite');
    }
}
开发者ID:eokyere,项目名称:elgg,代码行数:17,代码来源:start.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_context_info_array函数代码示例发布时间:2022-05-15
下一篇:
PHP get_content_by_id函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap