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


PHP add_group_tool_option函数代码示例

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


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

示例1: bookmarks_init

function bookmarks_init()
{
    // Grab the config global
    global $CONFIG;
    //add a tools menu option
    if (isloggedin()) {
        add_menu(elgg_echo('bookmarks'), $CONFIG->wwwroot . "pg/bookmarks/" . $_SESSION['user']->username . '/items');
        // add "bookmark this" to owner block
        elgg_extend_view('owner_block/extend', 'bookmarks/owner_block');
    }
    // Register a page handler, so we can have nice URLs
    register_page_handler('bookmarks', 'bookmarks_page_handler');
    // Add our CSS
    elgg_extend_view('css', 'bookmarks/css');
    // Register granular notification for this type
    if (is_callable('register_notification_object')) {
        register_notification_object('object', 'bookmarks', elgg_echo('bookmarks:new'));
    }
    // Listen to notification events and supply a more useful message
    register_plugin_hook('notify:entity:message', 'object', 'bookmarks_notify_message');
    // Register a URL handler for shared items
    register_entity_url_handler('bookmark_url', 'object', 'bookmarks');
    // Shares widget
    add_widget_type('bookmarks', elgg_echo("bookmarks:recent"), elgg_echo("bookmarks:widget:description"));
    // Register entity type
    register_entity_type('object', 'bookmarks');
    // Add group menu option
    add_group_tool_option('bookmarks', elgg_echo('bookmarks:enablebookmarks'), true);
}
开发者ID:ashwiniravi,项目名称:Elgg-Social-Network-Single-Sign-on-and-Web-Statistics,代码行数:29,代码来源:start.php

示例2: videos_init

/**
 * video init
 */
function videos_init()
{
    $root = dirname(__FILE__);
    elgg_register_library('elgg:videos', elgg_get_plugins_path() . 'videos/lib/videos.php');
    // For now we can use the embed video library of Cash. Once that plugin is updated to 1.8
    // we can use the elgg's manifest file to make the users use that library along with this
    // and remove the library from this plugin
    // V1.4 Added support for https in Cash's library
    elgg_register_library('elgg:videos:embed', elgg_get_plugins_path() . 'videos/lib/embed_video.php');
    elgg_register_library('elgg:youtube_api', elgg_get_plugins_path() . 'videos/lib/youtube_functions.php');
    $action_path = "{$root}/actions/videos";
    elgg_register_action('videos/save', "{$action_path}/save.php");
    elgg_register_action('videos/delete', "{$action_path}/delete.php");
    elgg_register_menu_item('site', array('name' => 'videos', 'text' => elgg_echo('videos'), 'href' => 'videos/all'));
    elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'videos_owner_block_menu');
    elgg_register_page_handler('videos', 'videos_page_handler');
    elgg_extend_view('css/elgg', 'videos/css');
    elgg_register_widget_type('videos', elgg_echo('videos'), elgg_echo('videos:widget:description'));
    register_notification_object('object', 'videos', elgg_echo('videos:new'));
    elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'videos_notify_message');
    elgg_register_entity_url_handler('object', 'videos', 'video_url');
    elgg_register_entity_type('object', 'videos');
    add_group_tool_option('videos', elgg_echo('videos:enablevideos'), true);
    elgg_extend_view('groups/tool_latest', 'videos/group_module');
    $views = array('output/longtext', 'output/plaintext');
    foreach ($views as $view) {
        elgg_register_plugin_hook_handler("view", $view, "videos_view_filter", 500);
    }
}
开发者ID:amcfarlane1251,项目名称:ongarde,代码行数:32,代码来源:start.php

示例3: subgroups_init

/**
 * Subgroups plugin initialization functions.
 */
function subgroups_init()
{
    // register a library of helper functions
    elgg_register_library('elgg:subgroups', elgg_get_plugins_path() . 'subgroups/lib/subgroups.php');
    // override groups library
    elgg_register_library('elgg:groups', elgg_get_plugins_path() . 'subgroups/lib/groups.php');
    // Register actions
    $actions_path = elgg_get_plugins_path() . 'subgroups/actions/subgroups';
    elgg_register_action("subgroups/add", $actions_path . "/add.php");
    elgg_register_action("subgroups/remove", $actions_path . "/remove.php");
    // Register page handler
    elgg_register_page_handler('subgroups', 'subgroups_page_handler');
    // Register pagesetup event handler
    elgg_register_event_handler('pagesetup', 'system', 'subgroups_setup_sidebar_menus');
    // Register unsetter container_guid handler
    elgg_register_event_handler('update', 'group', 'subgroups_unset_group_container');
    // Register an unrelate link to entity menu (max priority to run the last)
    elgg_register_plugin_hook_handler('register', 'menu:entity', 'subgroups_menu_setup', 9999);
    // Extend group fields
    elgg_register_plugin_hook_handler('profile:fields', 'group', 'subgroups_add_container_field');
    // Access permissions
    elgg_register_plugin_hook_handler('access:collections:write', 'all', 'subgroups_read_acl_plugin_hook');
    // Extending views
    elgg_extend_view('groups/sidebar/members', 'groups/sidebar/subgroups', 300);
    //TODO elgg_extend_view('groups/forum_latest', 'subgroups/frontpage');
    // Extending CSS
    elgg_extend_view('css/elements/components', 'groups/css/elements/components');
    elgg_register_ajax_view('subgroups/groups_i_can_edit');
    // Add group tool
    add_group_tool_option('subgroups', elgg_echo('subgroups:in_frontpage'), false);
    elgg_extend_view('groups/tool_latest', 'subgroups/group_module');
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:35,代码来源:start.php

示例4: bookmarks_init

/**
 * Bookmark init
 */
function bookmarks_init()
{
    $root = dirname(__FILE__);
    elgg_register_library('elgg:bookmarks', "{$root}/lib/bookmarks.php");
    // actions
    $action_path = "{$root}/actions/bookmarks";
    elgg_register_action('bookmarks/save', "{$action_path}/save.php");
    elgg_register_action('bookmarks/delete', "{$action_path}/delete.php");
    elgg_register_action('bookmarks/share', "{$action_path}/share.php");
    // menus
    elgg_register_menu_item('site', array('name' => 'bookmarks', 'text' => elgg_echo('bookmarks'), 'href' => 'bookmarks/all'));
    elgg_register_plugin_hook_handler('register', 'menu:page', 'bookmarks_page_menu');
    elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'bookmarks_owner_block_menu');
    elgg_register_page_handler('bookmarks', 'bookmarks_page_handler');
    elgg_extend_view('css/elgg', 'bookmarks/css');
    elgg_extend_view('js/elgg', 'bookmarks/js');
    elgg_register_widget_type('bookmarks', elgg_echo('bookmarks'), elgg_echo('bookmarks:widget:description'));
    if (elgg_is_logged_in()) {
        $user_guid = elgg_get_logged_in_user_guid();
        $address = urlencode(current_page_url());
        elgg_register_menu_item('extras', array('name' => 'bookmark', 'text' => elgg_view_icon('push-pin-alt'), 'href' => "bookmarks/add/{$user_guid}?address={$address}", 'title' => elgg_echo('bookmarks:this'), 'rel' => 'nofollow'));
    }
    // Register granular notification for this type
    register_notification_object('object', 'bookmarks', elgg_echo('bookmarks:new'));
    // Listen to notification events and supply a more useful message
    elgg_register_plugin_hook_handler('notify:entity:message', 'object', 'bookmarks_notify_message');
    // Register a URL handler for bookmarks
    elgg_register_entity_url_handler('object', 'bookmarks', 'bookmark_url');
    // Register entity type for search
    elgg_register_entity_type('object', 'bookmarks');
    // Groups
    add_group_tool_option('bookmarks', elgg_echo('bookmarks:enablebookmarks'), true);
    elgg_extend_view('groups/tool_latest', 'bookmarks/group_module');
}
开发者ID:redvabel,项目名称:Vabelgg,代码行数:37,代码来源:start.php

示例5: proposals_init

/**
 * Init proposals plugin.
 */
function proposals_init()
{
    if (!elgg_is_active_plugin('crud')) {
        return;
    }
    // register proposals library
    elgg_register_library('elgg:proposals', elgg_get_plugins_path() . 'proposals/lib/proposals.php');
    // add to the main css
    elgg_extend_view('css/elgg', 'proposals/css');
    // Add group option
    add_group_tool_option('proposals', elgg_echo('proposals:enableproposals'), false);
    elgg_extend_view('groups/tool_latest', 'proposals/group_module');
    //
    $action_path = elgg_get_plugins_path() . 'proposals/actions/proposals';
    elgg_register_action("proposals/vote", "{$action_path}/vote.php");
    elgg_register_plugin_hook_handler('permissions_check:annotate', 'object', 'proposals_user_can_vote');
    // data types
    $variables = array('title' => 'text', 'description' => 'longtext', 'access_id' => 'access');
    $crud = crud_register_type('decision', $variables);
    $crud->children_type = 'proposal';
    // the following is to not overwrite module if assemblies set it
    // before, since we don't need explicit module.
    if ($crud->module == 'decision') {
        $crud->module = 'proposals';
    }
    //$crud->module = 'proposals';
    $crud->owner_menu = 'group';
    $variables = array('title' => 'text', 'description' => 'longtext', 'tags' => 'tags', 'access_id' => 'access', 'improves_guid' => array('type' => 'url', 'input_view' => 'hidden', 'output_view' => 'proposal', 'default_value' => get_input('improves')));
    $crud = crud_register_type('proposal', $variables);
    #$crud->children_type = 'agenda_point';
    $crud->module = 'proposals';
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:35,代码来源:start.php

示例6: bookmarks_init

/**
 * Bookmark init
 */
function bookmarks_init()
{
    $root = dirname(__FILE__);
    elgg_register_library('elgg:bookmarks', "{$root}/lib/bookmarks.php");
    // actions
    $action_path = "{$root}/actions/bookmarks";
    elgg_register_action('bookmarks/save', "{$action_path}/save.php");
    elgg_register_action('bookmarks/delete', "{$action_path}/delete.php");
    elgg_register_action('bookmarks/share', "{$action_path}/share.php");
    // menus
    elgg_register_menu_item('site', array('name' => 'bookmarks', 'text' => elgg_echo('bookmarks'), 'href' => 'bookmarks/all'));
    elgg_register_plugin_hook_handler('register', 'menu:page', 'bookmarks_page_menu');
    elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'bookmarks_owner_block_menu');
    elgg_register_page_handler('bookmarks', 'bookmarks_page_handler');
    elgg_extend_view('elgg.css', 'bookmarks/css');
    elgg_extend_view('elgg.js', 'bookmarks/js');
    elgg_register_widget_type('bookmarks', elgg_echo('bookmarks'), elgg_echo('bookmarks:widget:description'));
    if (elgg_is_logged_in()) {
        $user_guid = elgg_get_logged_in_user_guid();
        $address = urlencode(current_page_url());
        elgg_register_menu_item('extras', array('name' => 'bookmark', 'text' => elgg_view_icon('push-pin-alt'), 'href' => "bookmarks/add/{$user_guid}?address={$address}", 'title' => elgg_echo('bookmarks:this'), 'rel' => 'nofollow'));
    }
    // Register for notifications
    elgg_register_notification_event('object', 'bookmarks', array('create'));
    elgg_register_plugin_hook_handler('prepare', 'notification:create:object:bookmarks', 'bookmarks_prepare_notification');
    // Register bookmarks view for ecml parsing
    elgg_register_plugin_hook_handler('get_views', 'ecml', 'bookmarks_ecml_views_hook');
    // Register a URL handler for bookmarks
    elgg_register_plugin_hook_handler('entity:url', 'object', 'bookmark_set_url');
    // Register entity type for search
    elgg_register_entity_type('object', 'bookmarks');
    // Groups
    add_group_tool_option('bookmarks', elgg_echo('bookmarks:enablebookmarks'), true);
    elgg_extend_view('groups/tool_latest', 'bookmarks/group_module');
}
开发者ID:bhargavgarlapati,项目名称:Elgg,代码行数:38,代码来源:start.php

示例7: event_manager_init

function event_manager_init()
{
    // Register subtype
    run_function_once("event_manager_run_once_subtypes");
    // Register entity_type for search
    elgg_register_entity_type("object", Event::SUBTYPE);
    elgg_extend_view("css/elgg", "event_manager/css/site");
    elgg_extend_view("js/elgg", "js/event_manager/site");
    elgg_extend_view("page/elements/head", "event_manager/metatags");
    elgg_register_page_handler("events", "event_manager_page_handler");
    // Register granular notification for this type
    register_notification_object("object", Event::SUBTYPE, elgg_echo("event_manager:notification:subject"));
    // Listen to notification events and supply a more useful message
    elgg_register_plugin_hook_handler("notify:entity:message", "object", "event_manager_notify_message");
    // add site menu item
    elgg_register_menu_item("site", array("name" => "event_manager", "text" => elgg_echo("event_manager:menu:title"), "href" => "/events"));
    // add group tool option
    add_group_tool_option("event_manager", elgg_echo("groups:enableevents"), true);
    // add to group profile
    elgg_extend_view("groups/tool_latest", "event_manager/group_module");
    // add widgets
    elgg_register_widget_type("events", elgg_echo("event_manager:widgets:events:title"), elgg_echo("event_manager:widgets:events:description"), "index,dashboard,profile,groups");
    elgg_register_plugin_hook_handler("widget_url", "widget_manager", "event_manager_widget_events_url");
    // register js libraries
    $maps_key = elgg_get_plugin_setting("google_api_key", "event_manager");
    elgg_register_simplecache_view("js/event_manager/googlemaps");
    $em_maps_js = elgg_get_simplecache_url("js", "event_manager/googlemaps");
    elgg_register_js("event_manager.maps.helper", $em_maps_js);
    elgg_register_js("event_manager.maps.base", "//maps.googleapis.com/maps/api/js?key=" . $maps_key . "&sensor=true");
    elgg_register_js("addthisevent", elgg_get_site_url() . "mod/event_manager/vendors/addthisevent/atemay.js");
}
开发者ID:amcfarlane1251,项目名称:ongarde,代码行数:31,代码来源:start.php

示例8: tasks_init

function tasks_init()
{
    // Grab the config file
    global $CONFIG;
    extend_view('metatags', 'tasks/js');
    //add a tools menu option
    if (isloggedin()) {
        add_menu(elgg_echo('tasks'), $CONFIG->wwwroot . "pg/tasks/" . $_SESSION['user']->username . '/items');
    }
    // Register a page handler, so we can have nice URLs
    register_page_handler('tasks', 'tasks_page_handler');
    // Add our CSS
    extend_view('css', 'tasks/css');
    // Add to groups context
    extend_view('groups/left_column', 'tasks/groupprofile_tasks');
    // Register granular notification for this type
    if (is_callable('register_notification_object')) {
        register_notification_object('object', 'tasks', elgg_echo('tasks:new'));
    }
    // Listen to notification events and supply a more useful message
    register_plugin_hook('notify:entity:message', 'object', 'tasks_notify_message');
    // Register a URL handler for shared items
    register_entity_url_handler('task_url', 'object', 'tasks');
    // Shares widget
    add_widget_type('tasks', elgg_echo("tasks:recent"), elgg_echo("tasks:widget:description"));
    // Register entity type
    register_entity_type('object', 'tasks');
    // Add group menu option
    add_group_tool_option('tasks', elgg_echo('tasks:enabletasks'), true);
}
开发者ID:eokyere,项目名称:elgg,代码行数:30,代码来源:start.php

示例9: vouchers_init

/**
 * Vouchers plugin initialization functions.
 */
function vouchers_init()
{
    // register a library of helper functions
    elgg_register_library('elgg:vouchers', elgg_get_plugins_path() . 'vouchers/lib/vouchers.php');
    // Register subtype
    run_function_once('vouchers_manager_run_once_subtypes');
    // Register entity_type for search
    elgg_register_entity_type('object', Voucher::SUBTYPE);
    // Site navigation
    $item = new ElggMenuItem('vouchers', elgg_echo('vouchers:menu'), 'vouchers/all');
    elgg_register_menu_item('site', $item);
    // Extend CSS
    elgg_extend_view('css/elgg', 'vouchers/css');
    elgg_register_css('vouchers_tooltip_css', '//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css');
    // Extend js
    elgg_register_js('vouchersjs', elgg_get_site_url() . 'mod/vouchers/assets/vouchers.js');
    elgg_register_js('vouchers_tooltip_js', '//code.jquery.com/ui/1.11.1/jquery-ui.js');
    // Register a page handler, so we can have nice URLs
    elgg_register_page_handler('vouchers', 'vouchers_page_handler');
    // Register a URL handler for voucher
    $release = get_version(true);
    // Register a URL handler for agora
    if ($release < 1.9) {
        // version 1.8
        elgg_register_entity_url_handler('object', 'vouchers', 'voucher_url');
    } else {
        // use this since Elgg 1.9
        elgg_register_plugin_hook_handler('entity:url', 'object', 'vouchers_set_url');
    }
    // Register menu item to an ownerblock
    elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'vouchers_owner_block_menu');
    // Register admin transaction log menu under "Utilities"
    elgg_register_admin_menu_item('administer', 'vouchers_transactions_log', 'administer_utilities');
    // register plugin hooks
    elgg_register_plugin_hook_handler("public_pages", "walled_garden", "vouchers_walled_garden_hook");
    // Register actions
    $action_path = elgg_get_plugins_path() . 'vouchers/actions';
    elgg_register_action("vouchers/addvoucher", "{$action_path}/addvoucher.php");
    elgg_register_action("vouchers/delete", "{$action_path}/delvoucher.php");
    elgg_register_action("vouchers/set_featured", "{$action_path}/vouchers/set_featured.php");
    // set a voucher post as featured
    elgg_register_action("vouchers/unset_featured", "{$action_path}/vouchers/unset_featured.php");
    // unset a voucher post from featured
    elgg_register_action("vouchers/get_with_points", "{$action_path}/vouchers/get_with_points.php");
    // voucher purchase with points only
    elgg_register_action('vouchers/be_interested', "{$action_path}/be_interested.php");
    // send interest
    elgg_register_action("vouchers/usersettings", "{$action_path}/usersettings.php");
    // save user settings
    // extend group main page
    elgg_extend_view('groups/tool_latest', 'vouchers/group_module');
    //elgg_extend_view("print", "printpreview/pageshell/pageshell");
    // add the group vouchers tool option
    add_group_tool_option('vouchers', elgg_echo('vouchers:group:enablevouchers'), true);
    // Add vouchers widgets
    elgg_register_widget_type('vouchers', elgg_echo('vouchers:widget'), elgg_echo('vouchers:widget:description'), 'profile,groups,dashboard');
    // member's voucher posts
    elgg_register_widget_type('vouchers_featured', elgg_echo('vouchers:widget:featured'), elgg_echo('vouchers:widget:featured:description'), 'dashboard');
    // featured vouchers for dashboard
}
开发者ID:nlybe,项目名称:Elgg-Vouchers,代码行数:63,代码来源:start.php

示例10: questions_init

function questions_init()
{
    elgg_register_library("elgg:questions", dirname(__FILE__) . "/lib/questions.php");
    add_subtype("object", 'question', 'ElggQuestion');
    update_subtype("object", 'question', 'ElggQuestion');
    add_subtype("object", 'answer', 'ElggAnswer');
    update_subtype("object", 'answer', 'ElggAnswer');
    elgg_extend_view("css/elgg", "questions/css");
    elgg_extend_view("js/elgg", "questions/js");
    elgg_register_menu_item("site", array("name" => 'questions', "text" => elgg_echo('questions'), "href" => "/questions/all"));
    elgg_register_entity_type("object", 'questions');
    elgg_register_widget_type('questions', elgg_echo("widget:questions:title"), elgg_echo("widget:questions:description"));
    $actions_base = dirname(__FILE__) . '/actions/object/question';
    elgg_register_action("object/question/save", "{$actions_base}/save.php");
    elgg_register_action("questions/delete", "{$actions_base}/delete.php");
    $actions_base = dirname(__FILE__) . '/actions/object/answer';
    elgg_register_action("object/answer/save", "{$actions_base}/save.php");
    elgg_register_entity_url_handler('object', 'question', 'questions_url_handler');
    $plugin_dir = dirname(__FILE__);
    elgg_register_entity_url_handler('object', 'answer', 'answers_url');
    elgg_register_page_handler('questions', 'questions_page_handler');
    elgg_register_page_handler('answers', 'answers_page_handler');
    $actions_base = "{$plugin_dir}/actions/object/answer";
    elgg_register_action('object/answer/add', "{$actions_base}/save.php");
    elgg_register_action('object/answer/edit', "{$actions_base}/save.php");
    elgg_register_action('answers/delete', "{$actions_base}/delete.php");
    elgg_register_plugin_hook_handler("register", "menu:owner_block", 'questions_owner_block_menu_handler');
    elgg_register_plugin_hook_handler("register", "menu:user_hover", 'questions_user_hover_menu_handler');
    elgg_register_plugin_hook_handler("register", 'menu:entity', 'questions_entity_menu_handler');
    elgg_register_plugin_hook_handler("notify:entity:message", "object", 'questions_notify_message_handler');
    add_group_tool_option('questions', elgg_echo("questions:enable"), true);
    elgg_extend_view("groups/tool_latest", "questions/group_module");
    elgg_register_plugin_hook_handler('container_permissions_check', 'object', 'questions_container_permissions_check');
}
开发者ID:remy40,项目名称:gvrs,代码行数:34,代码来源:start.php

示例11: blog_init

/**
 * Init blog plugin.
 */
function blog_init()
{
    elgg_register_library('elgg:blog', __DIR__ . '/lib/blog.php');
    // add a site navigation item
    elgg_register_menu_item('site', ['name' => 'blog', 'text' => elgg_echo('blog:blogs'), 'href' => 'blog/all']);
    // add to the main css
    elgg_extend_view('elgg.css', 'blog/css');
    // routing of urls
    elgg_register_page_handler('blog', 'blog_page_handler');
    // override the default url to view a blog object
    elgg_register_plugin_hook_handler('entity:url', 'object', 'blog_set_url');
    // notifications
    elgg_register_notification_event('object', 'blog', array('publish'));
    elgg_register_plugin_hook_handler('prepare', 'notification:publish:object:blog', 'blog_prepare_notification');
    // add blog link to owner block
    elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'blog_owner_block_menu');
    // Register for search.
    elgg_register_entity_type('object', 'blog');
    // Add group option
    add_group_tool_option('blog', elgg_echo('blog:enableblog'), true);
    elgg_extend_view('groups/tool_latest', 'blog/group_module');
    // entity menu
    elgg_register_plugin_hook_handler('register', 'menu:entity', 'blog_entity_menu_setup');
    // archive menu
    elgg_register_plugin_hook_handler('register', 'menu:blog_archive', 'blog_archive_menu_setup');
    // ecml
    elgg_register_plugin_hook_handler('get_views', 'ecml', 'blog_ecml_views_hook');
    // allow to be liked
    elgg_register_plugin_hook_handler('likes:is_likable', 'object:blog', 'Elgg\\Values::getTrue');
}
开发者ID:elgg,项目名称:elgg,代码行数:33,代码来源:start.php

示例12: izap_zcontest_init

function izap_zcontest_init()
{
    global $CONFIG;
    izap_plugin_init(GLOBAL_IZAP_CONTEST_PLUGIN);
    // asking group to include the izap_files
    if (is_callable('add_group_tool_option')) {
        add_group_tool_option(GLOBAL_IZAP_CONTEST_CHALLENGE_SUBTYPE, elgg_echo('izap-contest:challenge:group:enable'), true);
        elgg_extend_view('groups/tool_latest', GLOBAL_IZAP_CONTEST_PLUGIN . '/group_module');
    }
    elgg_register_page_handler(GLOBAL_IZAP_CONTEST_CHALLENGE_PAGEHANDLER, GLOBAL_IZAP_PAGEHANDLER);
    elgg_register_page_handler(GLOBAL_IZAP_CONTEST_QUIZ_PAGEHANDLER, GLOBAL_IZAP_PAGEHANDLER);
    elgg_register_action(GLOBAL_IZAP_CONTEST_QUIZ_PAGEHANDLER, GLOBAL_IZAP_PAGEHANDLER);
    elgg_register_page_handler(GLOBAL_IZAP_CONTEST_PAGEHANDLER, GLOBAL_IZAP_PAGEHANDLER);
    elgg_register_event_handler('izap', 'link', 'izap_contest_link_hook');
    elgg_register_menu_item('site', new ElggMenuItem('izap-contest', elgg_echo('izap-contest:contests'), IzapBase::setHref(array('context' => GLOBAL_IZAP_CONTEST_CHALLENGE_PAGEHANDLER, 'action' => 'list', 'vars' => array('all'), 'page_owner' => false))));
    if (elgg_get_context() == GLOBAL_IZAP_CONTEST_CHALLENGE_PAGEHANDLER) {
        $menu_item_add = new ElggMenuItem('izap-contest:challenge_add', elgg_echo('izap-contest:challenge:add'), IzapBase::setHref(array('context' => GLOBAL_IZAP_CONTEST_CHALLENGE_PAGEHANDLER, 'action' => 'add')));
        //elgg_register_menu_item('page', $menu_item_add);
        $menu_item_list = new ElggMenuItem('izap-contest:challenge_list', elgg_echo('izap-contest:challenge:all'), IzapBase::setHref(array('context' => GLOBAL_IZAP_CONTEST_CHALLENGE_PAGEHANDLER, 'action' => 'list', 'page_owner' => false, 'vars' => array('all'))));
        //elgg_register_menu_item('page', $menu_item_list);
        $menu_item_my_list = new ElggMenuItem('izap-contest:challenge_my_list', elgg_echo("izap-contest:chellenge:list", array("My")), IzapBase::setHref(array('context' => GLOBAL_IZAP_CONTEST_CHALLENGE_PAGEHANDLER, 'action' => 'list', 'page_owner' => false, 'vars' => array($_SESSION['user']->username))));
        //elgg_register_menu_item('page', $menu_item_my_list);
        $menu_item_my_accepted = new ElggMenuItem('izap-contest:challenge_my_myaccepted', elgg_echo('izap-contest:challenge:accepted'), IzapBase::setHref(array('context' => GLOBAL_IZAP_CONTEST_CHALLENGE_PAGEHANDLER, 'action' => 'accepted')));
        elgg_register_menu_item('page', $menu_item_my_accepted);
    }
}
开发者ID:socialweb,项目名称:PiGo,代码行数:26,代码来源:start.php

示例13: file_init

/**
 * File plugin initialisation functions.
 */
function file_init()
{
    // Get config
    global $CONFIG;
    // Set up menu for logged in users
    if (isloggedin()) {
        add_menu(elgg_echo('file'), $CONFIG->wwwroot . "pg/file/" . $_SESSION['user']->username);
    }
    // Extend CSS
    extend_view('css', 'file/css');
    // Extend hover-over and profile menu
    extend_view('profile/menu/links', 'file/menu');
    extend_view('groups/left_column', 'file/groupprofile_files');
    extend_view('dgroups/left_column', 'file/groupprofile_files');
    // Register a page handler, so we can have nice URLs
    register_page_handler('file', 'file_page_handler');
    // Add a new file widget
    add_widget_type('filerepo', elgg_echo("file:widget"), elgg_echo("file:widget:description"));
    // Register a URL handler for files
    register_entity_url_handler('file_url', 'object', 'file');
    // Register granular notification for this type
    if (is_callable('register_notification_object')) {
        register_notification_object('object', 'file', elgg_echo('file:newupload'));
    }
    // Listen to notification events and supply a more useful message
    register_plugin_hook('notify:entity:message', 'object', 'file_notify_message');
    // add the group files tool option
    add_group_tool_option('files', elgg_echo('groups:enablefiles'), true);
    // Register entity type
    register_entity_type('object', 'file');
}
开发者ID:eokyere,项目名称:elgg,代码行数:34,代码来源:start.php

示例14: simplekaltura_init

function simplekaltura_init()
{
    $plugin_root = dirname(__FILE__);
    elgg_register_library('simplekaltura', "{$plugin_root}/lib/simplekaltura_lib.php");
    elgg_register_library('KalturaClient', "{$plugin_root}/vendors/kaltura_client/KalturaClient.php");
    elgg_load_library('simplekaltura');
    // helper libs
    $libs = array('swfobject', 'html5', 'utility', 'thumbs');
    foreach ($libs as $lib) {
        $url = elgg_get_simplecache_url('js', "simplekaltura/{$lib}");
        elgg_register_js("simplekaltura:{$lib}", $url);
    }
    // Register SKUploader
    elgg_register_external_view('js/simplekaltura/SKUploader.js', TRUE);
    // Include html5 js library
    elgg_load_js('simplekaltura:html5');
    elgg_load_js('simplekaltura:utility');
    elgg_extend_view('css/elgg', 'simplekaltura/css');
    // If plugin is properly configured
    if (simplekaltura_is_configured()) {
        // Add to main menu
        $item = new ElggMenuItem('simplekaltura', elgg_get_plugin_setting('kaltura_entity_title', 'simplekaltura'), 'videos');
        elgg_register_menu_item('site', $item);
        // Register page handler
        elgg_register_page_handler('videos', 'simplekaltura_page_handler');
    } else {
        elgg_add_admin_notice('simpkaltura_not_configured', elgg_echo('simplekaltura:error:pluginnotconfigured'));
    }
    // add the group pages tool option
    add_group_tool_option('simplekaltura', elgg_echo('groups:enablesimplekaltura'), TRUE);
    // Profile block hook
    elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'simplekaltura_owner_block_menu');
    // Modify entity menu for addional video items
    elgg_register_plugin_hook_handler('register', 'menu:entity', 'simplekaltura_setup_entity_menu');
    // notifications
    elgg_register_notification_event('object', 'simplekaltura_video', array('create'));
    elgg_register_plugin_hook_handler('prepare', 'notification:publish:object:simplekaltura_video', 'simplekaltura_prepare_notification');
    // actions
    $actions_root = "{$plugin_root}/actions/simplekaltura";
    elgg_register_action('simplekaltura/save', "{$actions_root}/save.php");
    elgg_register_action('simplekaltura/update', "{$actions_root}/update.php");
    elgg_register_action('simplekaltura/get_embed', "{$actions_root}/get_embed.php");
    elgg_register_action('simplekaltura/featured', "{$actions_root}/featured.php", 'admin');
    elgg_register_action('videos/delete', "{$actions_root}/delete.php");
    elgg_register_action('simplekaltura/migrate', "{$actions_root}/migrate.php", 'admin');
    // entity url and icon handlers
    elgg_register_plugin_hook_handler('entity:url', 'object', 'simplekaltura_url_handler');
    elgg_register_plugin_hook_handler('entity:icon:url', 'object', 'simplekaltura_icon_url_override');
    // Register type
    elgg_register_entity_type('object', 'simplekaltura_video');
    // register CRON hook to poll video plays/duration/etc..
    elgg_register_plugin_hook_handler('cron', 'fifteenmin', 'simplekaltura_bulk_update');
    // Most Played Sidebar
    elgg_extend_view('simplekaltura/sidebar', 'simplekaltura/featured');
    elgg_extend_view('simplekaltura/sidebar', 'simplekaltura/most_played');
    // Whitelist ajax views
    elgg_register_ajax_view('simplekaltura/popup');
    return TRUE;
}
开发者ID:beck24,项目名称:Simplekaltura,代码行数:59,代码来源:start.php

示例15: polls_init

function polls_init()
{
    elgg_register_library('elgg:polls', elgg_get_plugins_path() . 'polls/models/model.php');
    // Set up menu for logged in users
    if (elgg_is_logged_in()) {
        $item = new ElggMenuItem('polls', elgg_echo('polls'), 'polls/owner/' . elgg_get_logged_in_user_entity()->username);
    } else {
        $item = new ElggMenuItem('polls', elgg_echo('poll'), 'polls/all');
    }
    elgg_register_menu_item('site', $item);
    // Extend system CSS with our own styles, which are defined in the polls/css view
    elgg_extend_view('css/elgg', 'polls/css');
    // Extend hover-over menu
    elgg_extend_view('profile/menu/links', 'polls/menu');
    // Register a page handler, so we can have nice URLs
    elgg_register_page_handler('polls', 'polls_page_handler');
    // Register a URL handler for poll posts
    elgg_register_entity_url_handler('object', 'poll', 'polls_url');
    // notifications
    $elgg_version = explode('.', get_version(true));
    if ($elgg_version[1] > 8) {
        $send_notification = elgg_get_plugin_setting('send_notification', 'polls');
        if (!$send_notification || $send_notification != 'no') {
            elgg_register_notification_event('object', 'poll');
            elgg_register_plugin_hook_handler('prepare', 'notification:create:object:poll', 'polls_prepare_notification');
        }
    }
    // add link to owner block
    elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'polls_owner_block_menu');
    elgg_register_plugin_hook_handler('widget_url', 'widget_manager', 'polls_widget_url_handler');
    // Register entity type
    elgg_register_entity_type('object', 'poll');
    // register the JavaScript
    $js = elgg_get_simplecache_url('js', 'polls/js');
    elgg_register_simplecache_view('js/polls/js');
    elgg_register_js('elgg.polls', $js);
    // add group widget
    $group_polls = elgg_get_plugin_setting('group_polls', 'polls');
    if (!$group_polls || $group_polls != 'no') {
        elgg_extend_view('groups/tool_latest', 'polls/group_module');
    }
    if (!$group_polls || $group_polls == 'yes_default') {
        add_group_tool_option('polls', elgg_echo('polls:enable_polls'), TRUE);
    } else {
        if ($group_polls == 'yes_not_default') {
            add_group_tool_option('polls', elgg_echo('polls:enable_polls'), FALSE);
        }
    }
    //add widgets
    elgg_register_widget_type('poll', elgg_echo('polls:my_widget_title'), elgg_echo('polls:my_widget_description'), "profile,groups");
    elgg_register_widget_type('latestPolls', elgg_echo('polls:latest_widget_title'), elgg_echo('polls:latest_widget_description'), "index,profile,dashboard,groups");
    elgg_register_widget_type('poll_individual', elgg_echo('polls:individual'), elgg_echo('poll_individual_group:widget:description'), "index,profile,dashboard,groups");
    // Register actions
    $action_path = elgg_get_plugins_path() . 'polls/actions/polls';
    elgg_register_action("polls/add", "{$action_path}/add.php");
    elgg_register_action("polls/edit", "{$action_path}/edit.php");
    elgg_register_action("polls/delete", "{$action_path}/delete.php");
    elgg_register_action("polls/vote", "{$action_path}/vote.php");
}
开发者ID:socialweb,项目名称:PiGo,代码行数:59,代码来源:start.php


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