本文整理汇总了PHP中elgg_get_simplecache_url函数的典型用法代码示例。如果您正苦于以下问题:PHP elgg_get_simplecache_url函数的具体用法?PHP elgg_get_simplecache_url怎么用?PHP elgg_get_simplecache_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了elgg_get_simplecache_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: modules_init
function modules_init()
{
// Register and load library
elgg_register_library('ajaxmodule', elgg_get_plugins_path() . 'modules/lib/ajaxmodule.php');
elgg_load_library('ajaxmodule');
// Ajax module page handler
elgg_register_page_handler('ajaxmodule', 'ajaxmodule_page_handler');
// Register view hook handler
elgg_register_plugin_hook_handler('view', 'all', 'ajaxmodule_view_hook_handler');
// Register icon handlers
elgg_register_plugin_hook_handler('entity:icon:url', 'object', 'simpleicon_hook_handler', 600);
// Register JS
$ajaxmodule_js = elgg_get_simplecache_url('js', 'modules/ajaxmodule');
elgg_register_simplecache_view('js/modules/ajaxmodule');
elgg_register_js('elgg.modules.ajaxmodule', $ajaxmodule_js);
// Register JS
$genericmodule_js = elgg_get_simplecache_url('js', 'modules/genericmodule');
elgg_register_simplecache_view('js/modules/genericmodule');
elgg_register_js('elgg.modules.genericmodule', $genericmodule_js);
// Register CSS
$m_css = elgg_get_simplecache_url('css', 'modules/css');
elgg_register_simplecache_view('css/modules/css');
elgg_register_css('elgg.modules', $m_css);
// Load JS/CSS
elgg_load_js('elgg.modules.ajaxmodule');
elgg_load_js('elgg.modules.genericmodule');
elgg_load_css('lightbox');
elgg_load_js('lightbox');
elgg_load_css('elgg.modules');
}
示例2: zaudio_init
function zaudio_init()
{
elgg_extend_view('elgg.css', 'zaudio/css');
elgg_define_js('AudioPlayer', ['exports' => 'AudioPlayer']);
// leave library registered for BC
elgg_register_js('elgg.zaudio', elgg_get_simplecache_url('AudioPlayer.js'));
}
示例3: elgg_file_viewer_init
function elgg_file_viewer_init()
{
// Registering a new viewtype for output buffer
elgg_register_viewtype('ob');
elgg_register_viewtype_fallback('ob');
// Exposing a function for remote access to non-public files
expose_function('efv.download', 'elgg_file_viewer_download', array('guid' => array('type' => 'int', 'required' => true)), 'Access a non-public file from a remote location', 'GET', false, true);
// Projekktor for Video/Audio support
elgg_register_js('projekktor', '/mod/elgg_file_viewer/vendors/projekktor-1.2.38r332/projekktor-1.2.38r332.min.js');
elgg_register_simplecache_view('js/elgg_file_viewer/projekktor');
elgg_register_js('elgg.projekktor', elgg_get_simplecache_url('js', 'elgg_file_viewer/projekktor'), 'footer');
elgg_register_css('projekktor', '/mod/elgg_file_viewer/vendors/projekktor-1.2.38r332/theme/maccaco/projekktor.style.css');
// Syntax highlighter / text support
elgg_register_js('syntaxhighlighter', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/scripts/shCore.js', 'footer');
elgg_register_js('syntaxhighlighter.css', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/scripts/shBrushCss.js', 'footer');
elgg_register_js('syntaxhighlighter.xml', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/scripts/shBrushXml.js', 'footer');
elgg_register_js('syntaxhighlighter.plain', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/scripts/shBrushPlain.js', 'footer');
elgg_register_js('syntaxhighlighter.js', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/scripts/shBrushJScript.js', 'footer');
elgg_register_js('syntaxhighlighter.php', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/scripts/shBrushPhp.js', 'footer');
elgg_register_simplecache_view('js/elgg_file_viewer/syntaxhighlighter');
elgg_register_js('elgg.syntaxhighlighter', elgg_get_simplecache_url('js', 'elgg_file_viewer/syntaxhighlighter'), 'footer');
elgg_register_css('syntaxhighlighter.core', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/styles/shCore.css');
elgg_register_css('syntaxhighlighter.theme', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/styles/shThemeDefault.css');
// FFmpeg class
elgg_register_class('FFmpeg', elgg_get_plugins_path() . 'elgg_file_viewer/vendors/ffmpeg/src/ffmpeg.class.php');
elgg_register_page_handler('projekktor', 'elgg_file_viewer_projekktor_video');
}
示例4: OhYesChat
/**
* Init the OhYesChat
*
* @access system
* @return null;
*/
function OhYesChat()
{
$plugin = elgg_get_plugins_path() . 'OhYesChat/';
elgg_register_simplecache_view('css/ohyes/ohyeschat');
$ohyescss = elgg_get_simplecache_url('css', 'ohyes/ohyeschat');
elgg_register_css('ohyeschat.css', $ohyescss);
elgg_register_simplecache_view('css/ohyes/ohyeschat.admin');
$ohyescssadmin = elgg_get_simplecache_url('css', 'ohyes/ohyeschat.admin');
elgg_register_css('ohyeschat.admin.css', $ohyescssadmin);
elgg_register_simplecache_view('js/ohyes/ohyescha');
$ohyesjs = elgg_get_simplecache_url('js', 'ohyes/ohyeschat');
elgg_register_js('ohyeschat.js', $ohyesjs);
if (elgg_is_logged_in()) {
elgg_register_page_handler('ohyeschat', 'ohyeschat_page_handler');
elgg_register_page_handler('chat', 'ohyeschat_page_handler');
}
elgg_register_action('ohyes/chat/deletemssages', "{$plugin}actions/admin/deletemssages.php", 'admin');
elgg_extend_view('page/elements/foot', 'ohyes/chat/bar');
elgg_extend_view('page/elements/body', 'ohyes/header/chat', 1);
elgg_extend_view('page/elements/body', 'ohyes/chat/sound');
OhYesChat::loadCss();
OhYesChat::loadJs();
run_function_once('ohyeschat_setup');
//register menu items
OhYesChat::RegisterMenus();
}
示例5: uservalidationbyadmin_init
function uservalidationbyadmin_init()
{
require_once dirname(__FILE__) . '/lib/functions.php';
// Register page handler to validate users
// This doesn't need to be an action because security is handled by the validation codes.
elgg_register_page_handler('uservalidationbyadmin', 'uservalidationbyadmin_page_handler');
// mark users as unvalidated and disable when they register
elgg_register_plugin_hook_handler('register', 'user', 'uservalidationbyadmin_disable_new_user');
// canEdit override to allow not logged in code to disable a user
elgg_register_plugin_hook_handler('permissions_check', 'user', 'uservalidationbyadmin_allow_new_user_can_edit');
// prevent users from logging in if they aren't validated
register_pam_handler('uservalidationbyadmin_check_auth_attempt', "required");
// when requesting a new password
elgg_register_plugin_hook_handler('action', 'user/requestnewpassword', 'uservalidationbyadmin_check_request_password');
// prevent the engine from logging in users via login()
elgg_register_event_handler('login', 'user', 'uservalidationbyadmin_check_manual_login');
// make admin users always validated
elgg_register_event_handler('make_admin', 'user', 'uservalidationbyadmin_validate_new_admin_user');
// register Walled Garden public pages
elgg_register_plugin_hook_handler('public_pages', 'walled_garden', 'uservalidationbyadmin_public_pages');
// admin interface to manually validate users
elgg_register_admin_menu_item('administer', 'unvalidated', 'users');
elgg_extend_view('css/admin', 'uservalidationbyadmin/css');
elgg_register_simplecache_view('js/elgg/uservalidationbyadmin');
elgg_register_js('elgg.uservalidationbyadmin', elgg_get_simplecache_url('js', 'elgg/uservalidationbyadmin'), 'footer');
$action_path = dirname(__FILE__) . '/actions/uservalidationbyadmin';
elgg_register_action('uservalidationbyadmin/spam', "{$action_path}/spam.php", 'admin');
elgg_register_action('uservalidationbyadmin/validate', "{$action_path}/validate.php", 'admin');
elgg_register_action('uservalidationbyadmin/delete', "{$action_path}/delete.php", 'admin');
elgg_register_action('uservalidationbyadmin/bulk_action', "{$action_path}/bulk_action.php", 'admin');
}
示例6: thewire_init
/**
* The Wire initialization
*/
function thewire_init()
{
// register the wire's JavaScript
$thewire_js = elgg_get_simplecache_url('thewire.js');
elgg_register_js('elgg.thewire', $thewire_js, 'footer');
elgg_register_ajax_view('thewire/previous');
// add a site navigation item
$item = new ElggMenuItem('thewire', elgg_echo('thewire'), 'thewire/all');
elgg_register_menu_item('site', $item);
// owner block menu
elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'thewire_owner_block_menu');
// remove edit and access and add thread, reply, view previous
elgg_register_plugin_hook_handler('register', 'menu:entity', 'thewire_setup_entity_menu_items');
// Extend system CSS with our own styles, which are defined in the thewire/css view
elgg_extend_view('elgg.css', 'thewire/css');
// Add a user's latest wire post to profile
elgg_extend_view('profile/status', 'thewire/profile_status');
// Register a page handler, so we can have nice URLs
elgg_register_page_handler('thewire', 'thewire_page_handler');
// Register a URL handler for thewire posts
elgg_register_plugin_hook_handler('entity:url', 'object', 'thewire_set_url');
// Register for search
elgg_register_entity_type('object', 'thewire');
// Register for notifications
elgg_register_notification_event('object', 'thewire');
elgg_register_plugin_hook_handler('prepare', 'notification:create:object:thewire', 'thewire_prepare_notification');
elgg_register_plugin_hook_handler('get', 'subscriptions', 'thewire_add_original_poster');
// allow to be liked
elgg_register_plugin_hook_handler('likes:is_likable', 'object:thewire', 'Elgg\\Values::getTrue');
elgg_register_plugin_hook_handler('unit_test', 'system', 'thewire_test');
}
示例7: thewire_init
/**
* The Wire initialization
*/
function thewire_init()
{
// register the wire's JavaScript
$thewire_js = elgg_get_simplecache_url('js', 'thewire');
elgg_register_js('elgg.thewire', $thewire_js, 'footer');
elgg_register_ajax_view('thewire/previous');
// add a site navigation item
$item = new ElggMenuItem('thewire', elgg_echo('thewire'), 'thewire/all');
elgg_register_menu_item('site', $item);
// owner block menu
elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'thewire_owner_block_menu');
// remove edit and access and add thread, reply, view previous
elgg_register_plugin_hook_handler('register', 'menu:entity', 'thewire_setup_entity_menu_items');
// Extend system CSS with our own styles, which are defined in the thewire/css view
elgg_extend_view('css/elgg', 'thewire/css');
// Add a user's latest wire post to profile
elgg_extend_view('profile/status', 'thewire/profile_status');
// Register a page handler, so we can have nice URLs
elgg_register_page_handler('thewire', 'thewire_page_handler');
// Register a URL handler for thewire posts
elgg_register_plugin_hook_handler('entity:url', 'object', 'thewire_set_url');
elgg_register_widget_type('thewire', elgg_echo('thewire'), elgg_echo("thewire:widget:desc"));
// Register for search
elgg_register_entity_type('object', 'thewire');
// Register for notifications
elgg_register_notification_event('object', 'thewire');
elgg_register_plugin_hook_handler('prepare', 'notification:create:object:thewire', 'thewire_prepare_notification');
elgg_register_plugin_hook_handler('get', 'subscriptions', 'thewire_add_original_poster');
// Register actions
$action_base = elgg_get_plugins_path() . 'thewire/actions';
elgg_register_action("thewire/add", "{$action_base}/add.php");
elgg_register_action("thewire/delete", "{$action_base}/delete.php");
elgg_register_plugin_hook_handler('unit_test', 'system', 'thewire_test');
elgg_register_event_handler('upgrade', 'system', 'thewire_run_upgrades');
}
示例8: advanced_statistics_init
/**
* initialization of plugin
*
* @return void
*/
function advanced_statistics_init()
{
// register page handler for nice URLs
elgg_register_page_handler("advanced_statistics", "advanced_statistics_page_handler");
if (elgg_is_admin_logged_in()) {
elgg_register_admin_menu_item('administer', 'users', 'advanced_statistics');
elgg_register_admin_menu_item('administer', 'groups', 'advanced_statistics');
elgg_register_admin_menu_item('administer', 'content', 'advanced_statistics');
elgg_register_admin_menu_item('administer', 'activity', 'advanced_statistics');
elgg_register_admin_menu_item('administer', 'widgets', 'advanced_statistics');
elgg_register_admin_menu_item('administer', 'system', 'advanced_statistics');
elgg_extend_view("js/admin", "js/advanced_statistics/admin");
$vendors = elgg_get_site_url() . "mod/advanced_statistics/vendors/";
elgg_register_js("excanvas", $vendors . "jqplot/excanvas.min.js");
// only for IE < 9
// jqplot base library
elgg_register_js("jquery.jqplot", $vendors . "jqplot/jquery.jqplot.js");
// jqplot plugins
elgg_register_js("jquery.jqplot.barRenderer", $vendors . "jqplot/plugins/jqplot.barRenderer.js");
elgg_register_js("jquery.jqplot.pieRenderer", $vendors . "jqplot/plugins/jqplot.pieRenderer.js");
elgg_register_js("jquery.jqplot.canvasAxisTickRenderer", $vendors . "jqplot/plugins/jqplot.canvasAxisTickRenderer.js");
elgg_register_js("jquery.jqplot.canvasTextRenderer", $vendors . "jqplot/plugins/jqplot.canvasTextRenderer.js");
elgg_register_js("jquery.jqplot.categoryAxisRenderer", $vendors . "jqplot/plugins/jqplot.categoryAxisRenderer.js");
elgg_register_js("jquery.jqplot.dateAxisRenderer", $vendors . "jqplot/plugins/jqplot.dateAxisRenderer.js");
elgg_register_js("jquery.jqplot.pointLabels", $vendors . "jqplot/plugins/jqplot.pointLabels.js");
elgg_register_js("jquery.jqplot.highlighter", $vendors . "jqplot/plugins/jqplot.highlighter.js");
elgg_register_simplecache_view("css/advanced_statistics/jqplot");
elgg_register_css("jquery.jqplot", elgg_get_simplecache_url("css", "advanced_statistics/jqplot"));
// register admin widgets
elgg_register_widget_type("advanced_statistics", elgg_echo("advanced_statistics:widgets:advanced_statistics:title"), elgg_echo("advanced_statistics:widgets:advanced_statistics:description"), array("admin"), true);
elgg_register_widget_type("online_user_count", elgg_echo("advanced_statistics:widgets:online_user_count:title"), elgg_echo("advanced_statistics:widgets:online_user_count:description"), array("admin"));
elgg_register_ajax_view("widgets/online_user_count/content");
}
}
示例9: elggchat_init
function elggchat_init()
{
elgg_extend_view('css/admin', 'elggchat/admin_css');
elgg_extend_view('css/elgg', 'elggchat/css');
$js_elggchat_sound = elgg_get_simplecache_url('js', 'elggchat/buzz.js');
elgg_register_simplecache_view('js/elggchat/buzz.js');
elgg_register_js('elggchat_sound', $js_elggchat_sound, 'head', 400);
elgg_define_js('elggchat_scroll', array('src' => elgg_get_site_url() . 'mod/elggchat/views/default/js/elggchat/jquery.scrollTo.js'));
if (elgg_is_logged_in()) {
if (elgg_get_plugin_user_setting("enableChat", 0, "elggchat") != "no") {
elgg_extend_view('page/elements/footer', 'elggchat/session_monitor');
}
}
elgg_register_admin_menu_item('administer', 'elggchat', 'administer_utilities');
// Extend avatar hover menu
elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'elggchat_user_hover_menu');
// Register cron job
$keepsessions = elgg_get_plugin_setting("keepsessions", "elggchat");
if (elgg_get_plugin_setting("keepsessions", "elggchat") != "yes") {
elgg_register_plugin_hook_handler('cron', 'hourly', 'elggchat_session_cleanup');
}
// Actions
$action_path = elgg_get_plugins_path() . 'elggchat/actions';
elgg_register_action("elggchat/create", "{$action_path}/create.php", "logged_in");
elgg_register_action("elggchat/post_message", "{$action_path}/post_message.php", "logged_in");
elgg_register_action("elggchat/poll", "{$action_path}/poll.php", "logged_in");
elgg_register_action("elggchat/invite", "{$action_path}/invite.php", "logged_in");
elgg_register_action("elggchat/leave", "{$action_path}/leave.php", "logged_in");
elgg_register_action("elggchat/get_smiley", "{$action_path}/get_smiley.php", "logged_in");
elgg_register_action("elggchat/admin_message", "{$action_path}/admin_message.php", "admin");
elgg_register_action("elggchat/delete_session", "{$action_path}/delete_session.php", "admin");
// Logout event handler
elgg_register_event_handler('logout:before', 'user', 'elggchat_logout_handler');
}
示例10: __construct
public function __construct($page)
{
admin_gatekeeper();
global $CONFIG;
$cshop = new stdClass();
$this->controller = GLOBAL_IZAP_CURRENT_CONTROLLER;
$this->action = 'action' . ucfirst($page[0]);
$this->_page = $page;
$this->url_vars = $this->_page;
$this->page_layout = $this->page_shell = 'admin';
$cshop->view = $this->_view = 'admin/' . implode('/', $page);
$this->page_elements['title'] = elgg_echo("admin:{$page[0]}");
if (count($page) > 1) {
$this->page_elements['title'] .= ' : ' . elgg_echo('admin:' . implode(':', $page));
}
if (method_exists($this, $this->action)) {
elgg_admin_add_plugin_settings_menu();
elgg_set_context('admin');
elgg_unregister_css('elgg');
$url = elgg_get_simplecache_url('js', 'admin');
elgg_register_js('elgg.admin', $url);
elgg_load_js('elgg.admin');
elgg_register_js('jquery.jeditable', 'vendors/jquery/jquery.jeditable.mini.js');
elgg_load_js('jquery.jeditable');
}
$CONFIG->cshop = $cshop;
}
示例11: prototyper_validators_init
/**
* Init
* @return void
*/
function prototyper_validators_init()
{
elgg_extend_view('prototyper/elements/help', 'prototyper/elements/validation');
elgg_extend_view('prototyper/input/before', 'prototyper/elements/js_validation');
elgg_register_plugin_hook_handler('validate:type', 'prototyper', 'prototyper_validate_type');
hypePrototyper()->config->registerValidationRule('type', array('string', 'alnum', 'alpha', 'int', 'numeric', 'date', 'url', 'email', 'guid', 'image'));
elgg_register_plugin_hook_handler('validate:min', 'prototyper', 'prototyper_validate_min');
hypePrototyper()->config->registerValidationRule('min');
elgg_register_plugin_hook_handler('validate:max', 'prototyper', 'prototyper_validate_max');
hypePrototyper()->config->registerValidationRule('max');
elgg_register_plugin_hook_handler('validate:minlength', 'prototyper', 'prototyper_validate_minlength');
hypePrototyper()->config->registerValidationRule('minlength');
elgg_register_plugin_hook_handler('validate:maxlength', 'prototyper', 'prototyper_validate_maxlength');
hypePrototyper()->config->registerValidationRule('maxlength');
elgg_register_plugin_hook_handler('validate:contains', 'prototyper', 'prototyper_validate_contains');
hypePrototyper()->config->registerValidationRule('contains');
elgg_register_plugin_hook_handler('validate:regex', 'prototyper', 'prototyper_validate_regex');
hypePrototyper()->config->registerValidationRule('regex');
if (\hypeJunction\Integration::isElggVersionBelow('1.9.0')) {
elgg_register_js('parsley', '/mod/hypePrototyperValidators/vendors/parsley/parsley.min.js', 'footer');
elgg_register_simplecache_view('js/framework/legacy/prototyper_validation');
elgg_register_js('prototyper_validation', elgg_get_simplecache_url('js', 'framework/legacy/prototyper_validation'), 'footer');
} else {
elgg_define_js('parsley', array('src' => '/mod/hypePrototyperValidators/vendors/parsley/parsley.min.js', 'deps' => array('jquery')));
}
elgg_register_plugin_hook_handler('input_vars', 'prototyper', 'prototyper_filter_input_view_vars');
}
示例12: init
/**
* System init callback
* @return void
*/
public function init()
{
hypeInbox()->config->registerLabels();
elgg_register_menu_item('page', array('name' => 'message_types', 'text' => elgg_echo('admin:inbox:message_types'), 'href' => 'admin/inbox/message_types', 'priority' => 500, 'contexts' => array('admin'), 'section' => 'configure'));
elgg_register_css('inbox.base.css', elgg_get_simplecache_url('css', 'framework/inbox/stylesheet.css'));
elgg_unregister_page_handler('messages', 'messages_page_handler');
elgg_register_page_handler($this->config->pagehandler_id, array($this->router, 'handlePages'));
$action_path = $this->plugin->getPath() . '/actions/';
elgg_register_action("hypeInbox/settings/save", $action_path . 'settings/save.php', 'admin');
elgg_register_action('inbox/admin/import', $action_path . 'admin/import.php', 'admin');
elgg_register_action('messages/send', $action_path . 'messages/send.php');
elgg_register_action('messages/delete', $action_path . 'messages/delete.php');
elgg_register_action('messages/markread', $action_path . 'messages/markread.php');
elgg_register_action('messages/markunread', $action_path . 'messages/markunread.php');
// Third party integrations
elgg_register_plugin_hook_handler('config:user_types', 'framework:inbox', array($this->hooks, 'filterUserTypes'));
// Menu
elgg_register_plugin_hook_handler('register', 'menu:page', array($this->hooks, 'setupPageMenu'));
elgg_register_plugin_hook_handler('register', 'menu:inbox', array($this->hooks, 'setupInboxMenu'));
elgg_register_plugin_hook_handler('register', 'menu:inbox:thread', array($this->hooks, 'setupInboxThreadMenu'));
elgg_register_plugin_hook_handler('register', 'menu:entity', array($this->hooks, 'setupMessageMenu'));
// Replace user hover menu items
elgg_unregister_plugin_hook_handler('register', 'menu:user_hover', 'messages_user_hover_menu');
elgg_register_plugin_hook_handler('register', 'menu:user_hover', array($this->hooks, 'setupUserHoverMenu'));
// URLs
elgg_register_plugin_hook_handler('entity:url', 'object', array($this->hooks, 'handleMessageURL'));
elgg_register_plugin_hook_handler('entity:icon:url', 'object', array($this->hooks, 'handleMessageIconURL'));
}
示例13: zhsocial_init
function zhsocial_init()
{
elgg_register_simplecache_view("js/zhsocial/login");
$login_js = elgg_get_simplecache_url("js", "zhsocial/login");
elgg_register_js("zhsocial.login", $login_js);
elgg_extend_view('forms/login', 'zhsocial/login', 501);
}
示例14: 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");
}
示例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");
}