本文整理汇总了PHP中elgg_extend_view函数的典型用法代码示例。如果您正苦于以下问题:PHP elgg_extend_view函数的具体用法?PHP elgg_extend_view怎么用?PHP elgg_extend_view使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了elgg_extend_view函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
}
示例2: lazy_hover_init
function lazy_hover_init()
{
elgg_extend_view("js/elgg", "js/lazy_hover/site");
elgg_register_page_handler("lazy_hover", "lazy_hover_page_handler");
// extend public pages
elgg_register_plugin_hook_handler('public_pages', 'walled_garden', 'lazy_hover_public_pages');
}
示例3: 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();
}
示例4: roles_register_views
/**
*
* Processes view permissions from the role configuration array. This is called after the 'ready', 'system' event.
*
* For view extension and replacements the function simply calls the corresponding {@link elgg_extend_view()} and
* {@link elgg_set_view_location()} functions, to post-register views after all plugins have been initalized.
*
* For suppressing views (by using the "deny" rule), it registers a specific handler for the given view,
* to return an empty string instead of the view's original output. This is to conserve resources -
* there are hundreds of views contributing to any elgg page. Listening for all "views", "all" hooks would
* be quite a waste.
*
* @param string $event Equals 'ready'
* @param string $event_type Equals 'system'
* @param mixed $object Not in use for this specific listener
*/
function roles_register_views($event, $type, $object)
{
$role = roles_get_role();
if (elgg_instanceof($role, 'object', 'role')) {
$role_perms = roles_get_role_permissions($role, 'views');
if (is_array($role_perms) && !empty($role_perms)) {
foreach ($role_perms as $view => $perm_details) {
switch ($perm_details['rule']) {
case 'deny':
elgg_register_plugin_hook_handler('view', $view, 'roles_views_permissions');
break;
case 'extend':
$params = $perm_details['view_extension'];
$view_extension = roles_replace_dynamic_paths($params['view']);
$priority = isset($params['priority']) ? $params['priority'] : 501;
$viewtype = isset($params['viewtype']) ? $params['viewtype'] : '';
elgg_extend_view($view, $view_extension, $priority, $viewtype);
break;
case 'replace':
$params = $perm_details['view_replacement'];
$location = elgg_get_root_path() . roles_replace_dynamic_paths($params['location']);
$viewtype = isset($params['viewtype']) ? $params['viewtype'] : '';
elgg_set_view_location($view, $location, $viewtype);
break;
case 'allow':
default:
break;
}
}
}
}
}
示例5: developers_process_settings
function developers_process_settings()
{
if (elgg_get_plugin_setting('display_errors', 'developers') == 1) {
ini_set('display_errors', 1);
} else {
ini_set('display_errors', 0);
}
if (elgg_get_plugin_setting('screen_log', 'developers') == 1) {
$cache = new ElggLogCache();
elgg_set_config('log_cache', $cache);
elgg_register_plugin_hook_handler('debug', 'log', array($cache, 'insertDump'));
elgg_extend_view('page/elements/foot', 'developers/log');
}
if (elgg_get_plugin_setting('show_strings', 'developers') == 1) {
// first and last in case a plugin registers a translation in an init method
elgg_register_event_handler('init', 'system', 'developers_clear_strings', 1000);
elgg_register_event_handler('init', 'system', 'developers_clear_strings', 1);
}
if (elgg_get_plugin_setting('wrap_views', 'developers') == 1) {
elgg_register_plugin_hook_handler('view', 'all', 'developers_wrap_views');
}
if (elgg_get_plugin_setting('log_events', 'developers') == 1) {
elgg_register_event_handler('all', 'all', 'developers_log_events', 1);
elgg_register_plugin_hook_handler('all', 'all', 'developers_log_events', 1);
}
}
示例6: init
function init()
{
elgg_extend_view('css/elgg', 'css/elgg_recaptcha');
elgg_register_plugin_hook_handler('view', 'all', __NAMESPACE__ . '\\view_hook');
elgg_register_plugin_hook_handler('action', 'all', __NAMESPACE__ . '\\action_hook');
elgg_define_js('google_recaptcha', array('src' => 'https://www.google.com/recaptcha/api.js?render=explicit&onload=elgg_recaptcha_render&hl=' . get_language()));
}
示例7: tidypicsExt_init
function tidypicsExt_init()
{
// Load system configuration
global $CONFIG;
// Extend View
elgg_extend_view('tidypics/forms/upload', 'tidypicsExt/forms/upload');
}
示例8: 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');
}
示例9: pages_tools_init
/**
* Called during system init
*
* @return void
*/
function pages_tools_init()
{
// register DOM PDF as a library
elgg_register_library("dompdf", dirname(__FILE__) . "/vendor/dompdf/dompdf/dompdf_config.inc.php");
// extend site css
elgg_extend_view("css/elgg", "css/pages_tools/site");
// extend site js
elgg_extend_view("js/elgg", "js/pages_tools/site");
// register JS library
elgg_register_js("jquery.tree", elgg_get_site_url() . "mod/pages_tools/vendors/jstree/jquery.tree.min.js");
elgg_register_css("jquery.tree", elgg_get_site_url() . "mod/pages_tools/vendors/jstree/themes/classic/style.css");
// add widgets (overrule default pages widget, to add group support)
elgg_register_widget_type("pages", elgg_echo("pages"), elgg_echo("pages:widget:description"), array("profile", "dashboard", "groups"));
elgg_register_widget_type("index_pages", elgg_echo("pages"), elgg_echo("pages_tools:widgets:index_pages:description"), array("index"), true);
// register plugin hooks
elgg_register_plugin_hook_handler("route", "pages", "pages_tools_route_pages_hook");
elgg_register_plugin_hook_handler("register", "menu:entity", "pages_tools_entity_menu_hook");
elgg_register_plugin_hook_handler("permissions_check:comment", "object", "pages_tools_permissions_comment_hook");
elgg_register_plugin_hook_handler("widget_url", "widget_manager", "pages_tools_widget_url_hook");
elgg_register_plugin_hook_handler("cron", "daily", "pages_tools_daily_cron_hook");
// events
elgg_register_event_handler('create', 'object', 'pages_tools_cache_handler');
elgg_register_event_handler('update', 'object', 'pages_tools_cache_handler');
elgg_register_event_handler('delete', 'object', 'pages_tools_cache_handler');
// register actions
elgg_register_action("pages/export", dirname(__FILE__) . "/actions/export.php", "public");
elgg_register_action("pages/reorder", dirname(__FILE__) . "/actions/reorder.php");
elgg_register_action("pages_tools/update_edit_notice", dirname(__FILE__) . "/actions/update_edit_notice.php");
// overrule action
elgg_register_action("pages/edit", dirname(__FILE__) . "/actions/pages/edit.php");
elgg_register_action("pages/delete", dirname(__FILE__) . "/actions/pages/delete.php");
}
示例10: agerestriction_init
function agerestriction_init()
{
//put the check at the very end
elgg_extend_view('register/extend', 'agerestriction/register', 1000);
//block user registration if they don't check the box
elgg_register_plugin_hook_handler('action', 'register', 'agerestriction_register_hook');
}
示例11: 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');
}
示例12: theme_eersel_init
/**
* Initialize the theme
*
* @return void
*/
function theme_eersel_init()
{
elgg_register_css('font-awesome', 'mod/theme_eersel/vendors/font-awesome-4.3.0/css/font-awesome.min.css');
elgg_load_css('font-awesome');
// extend views
elgg_extend_view("js/elgg", "js/theme_eersel");
elgg_extend_view("css/elgg", "css/theme_eersel");
elgg_extend_view("css/elgg", "css/theme_eersel_images");
elgg_extend_view("page/layouts/widgets", "theme_eersel/widgets_fix");
elgg_extend_view('icon/default', 'theme_eersel/group/icon', 400);
elgg_unextend_view("page/elements/header", "search/header");
elgg_unextend_view("page/elements/owner_block/extend", "group_tools/owner_block");
// page handlers
elgg_register_page_handler("theme_eersel", "theme_eersel_page_handler");
elgg_register_page_handler("profile", "theme_eersel_profile_page_handler");
elgg_register_js('jquery.flexslider', 'mod/theme_eersel/vendors/jquery.flexslider/jquery.flexslider-min.js');
elgg_load_js('jquery.flexslider');
// register widgets
elgg_register_widget_type("profile_owner_block", elgg_echo("theme_eersel:widgets:profile_owner_block:title"), elgg_echo("theme_eersel:widgets:profile_owner_block:description"), "profile");
elgg_register_widget_type("index_photos", elgg_echo("theme_eersel:widgets:index_photos:title"), elgg_echo("theme_eersel:widgets:index_photos:description"), "index");
elgg_register_widget_type("index_sidebar", elgg_echo("theme_eersel:widgets:index_sidebar:title"), elgg_echo("theme_eersel:widgets:index_sidebar:description"), "index");
// register plugin hooks
elgg_register_plugin_hook_handler("register", "menu:topbar", "theme_eersel_register_topbar_menu_handler");
elgg_register_plugin_hook_handler("prepare", "menu:owner_block", "theme_eersel_prepare_owner_block_menu_handler");
elgg_register_plugin_hook_handler('route', 'groups', 'theme_eersel_route_groups_handler');
// register events
elgg_register_event_handler('pagesetup', 'system', 'theme_eersel_pagesetup');
// register admin menu item
elgg_register_admin_menu_item("configure", "theme_eersel", "appearance");
// register actions
elgg_register_action("theme_eersel/slider_upload", dirname(__FILE__) . "/actions/slider_upload.php", "admin");
elgg_register_action("theme_eersel/links", dirname(__FILE__) . "/actions/links.php", "admin");
}
示例13: 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');
}
示例14: 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');
}
示例15: tour_init
/**
* Initialize the plugin.
*/
function tour_init()
{
$js_lib = elgg_get_plugin_setting('js_library', 'tour');
if ($js_lib == 'joyride') {
elgg_register_css('joyride', '/mod/tour/vendors/joyride/joyride-2.1.css');
elgg_load_css('joyride');
elgg_define_js('joyride', array('src' => '/mod/tour/vendors/joyride/jquery.joyride-2.1.js', 'exports' => 'joyride'));
} else {
elgg_register_css('hopscotch', '/mod/tour/vendors/hopscotch/css/hopscotch.min.css');
elgg_load_css('hopscotch');
elgg_define_js('hopscotch', array('src' => '/mod/tour/vendors/hopscotch/hopscotch.min.js', 'exports' => 'hopscotch'));
}
elgg_require_js('elgg/tour/display');
//elgg_require_js('elgg/tour/edit');
elgg_register_ajax_view('ajax/tour_stop/save');
elgg_extend_view('page/elements/footer', 'tour/outline');
elgg_extend_view('css/elgg', 'css/tour');
elgg_extend_view('css/admin', 'css/tour_admin');
elgg_register_action('tour_page/save', __DIR__ . '/actions/tour_page/save.php', 'admin');
elgg_register_action('tour_page/reorder', __DIR__ . '/actions/tour_page/reorder.php', 'admin');
elgg_register_action('tour_page/delete', __DIR__ . '/actions/tour_page/delete.php', 'admin');
elgg_register_action('tour_stop/save', __DIR__ . '/actions/tour_stop/save.php', 'admin');
elgg_register_action('tour_stop/delete', __DIR__ . '/actions/tour_stop/delete.php', 'admin');
elgg_register_page_handler('tour', 'tour_page_handler');
elgg_register_page_handler('tour_stop', 'tour_page_handler');
// For convenience
elgg_register_admin_menu_item('administer', 'tour', 'administer_utilities');
elgg_register_menu_item('topbar', array('name' => 'tour', 'href' => '', 'text' => elgg_echo('tour:start'), 'id' => 'tour-start', 'section' => 'alt', 'data-library' => $js_lib));
elgg_register_plugin_hook_handler('register', 'menu:entity', array('Tour\\Page\\EntityMenu', 'setUp'));
elgg_register_plugin_hook_handler('register', 'menu:entity', array('Tour\\Stop\\EntityMenu', 'setUp'));
elgg_register_viewtype('json');
}