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


PHP elgg_define_js函数代码示例

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


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

示例1: 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');
}
开发者ID:juho-jaakkola,项目名称:elgg-tour,代码行数:35,代码来源:start.php

示例2: hydra_theme_init

function hydra_theme_init()
{
    elgg_unextend_view('page/elements/header', 'search/header');
    elgg_extend_view('page/elements/sidebar', 'search/header', 0);
    if (elgg_get_context() != "admin") {
        elgg_require_js("lorea_hydra/js");
    }
    $bower = elgg_get_site_url() . "mod/lorea_hydra/vendors/bower_components/";
    elgg_register_css("bootstrap", "{$bower}bootstrap/dist/css/bootstrap.css", 0);
    elgg_register_css("bootstrap-select", "{$bower}bootstrap-select/dist/css/bootstrap-select.min.css");
    elgg_register_css("jasny", "{$bower}jasny-bootstrap/dist/css/jasny-bootstrap.min.css");
    elgg_register_css("lorea_hydra", elgg_get_site_url() . "mod/hydra_theme/css/lorea_hydra.css", 10000);
    elgg_define_js("bootstrap", array("src" => "{$bower}bootstrap/dist/js/bootstrap.min.js"));
    //elgg_register_js("bootstrap", "{$bower}bootstrap/dist/js/bootstrap.min.js");
    elgg_register_js("bootstrap-select", "{$bower}bootstrap-select/dist/js/bootstrap-select.min.js");
    elgg_register_js("jasny", "{$bower}jasny-bootstrap/dist/js/jasny-bootstrap.min.js");
    elgg_register_js("lorea_hydra", elgg_get_site_url() . "mod/hydra_theme/css/lorea_hydra.css", 10000);
    if (elgg_get_context() != "admin") {
        elgg_load_css("bootstrap");
        elgg_load_css("bootstrap-select");
        elgg_load_css("lorea_hydra");
        elgg_load_css("jasny");
        elgg_load_js("bootstrap");
        elgg_load_js("jasny");
        elgg_load_js("bootstrap-select");
        elgg_load_js("lorea_hydra");
    }
}
开发者ID:epsylon,项目名称:Hydra-dev,代码行数:28,代码来源:start.php

示例3: 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()));
}
开发者ID:mrclay,项目名称:elgg_recaptcha,代码行数:7,代码来源:start.php

示例4: 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');
}
开发者ID:hypejunction,项目名称:hypeprototypervalidators,代码行数:31,代码来源:start.php

示例5: stripe_init

function stripe_init()
{
    // Register Stripe js
    //elgg_register_js('stripe.js', 'https://js.stripe.com/v2/', 'head', 50);
    //elgg_load_js('stripe.js');
    elgg_define_js('stripe', ['src' => 'https://js.stripe.com/v2/stripe.js']);
    elgg_require_js('stripe');
    elgg_extend_view('js/initialize_elgg', 'js/stripe/config');
    elgg_extend_view('js/elgg', 'js/stripe/cards');
    elgg_extend_view('css/elgg', 'css/stripe/css');
    elgg_extend_view('css/admin', 'css/stripe/css');
    // Registering actions
    elgg_register_action('stripe/customers/sync', __DIR__ . '/actions/stripe/customers/sync.php', 'admin');
    elgg_register_action('stripe/cards/add', __DIR__ . '/actions/stripe/cards/add.php', 'public');
    elgg_register_action('stripe/cards/remove', __DIR__ . '/actions/stripe/cards/remove.php');
    elgg_register_action('stripe/cards/set_default', __DIR__ . '/actions/stripe/cards/make_default.php');
    elgg_register_action('stripe/subscriptions/cancel', __DIR__ . '/actions/stripe/subscriptions/cancel.php');
    // Page handler
    elgg_register_page_handler('billing', 'stripe_page_handler');
    elgg_register_plugin_hook_handler('register', 'menu:stripe-actions', 'stripe_actions_menu');
    elgg_register_plugin_hook_handler('ping', 'stripe.events', 'stripe_ping_event');
    elgg_register_plugin_hook_handler('customer.created', 'stripe.events', 'stripe_customer_created_event');
    elgg_register_plugin_hook_handler('customer.deleted', 'stripe.events', 'stripe_customer_deleted_event');
    elgg_register_plugin_hook_handler('charge.succeeded', 'stripe.events', 'stripe_charge_succeeded_event');
    elgg_register_plugin_hook_handler('charge.failed', 'stripe.events', 'stripe_charge_failed_event');
    elgg_register_plugin_hook_handler('charge.refunded', 'stripe.events', 'stripe_charge_refunded_event');
    // Stripe Webhooks
    elgg_ws_expose_function('stripe.webhooks', 'stripe_webhook_handler', array('environment' => array('type' => 'string', 'required' => true)), 'Handles webhooks received from Stripe', 'POST', false, false);
    // Map newly registered users to their Stripe profiles if any
    elgg_register_event_handler('create', 'user', 'stripe_register_user');
}
开发者ID:Daltonmedia,项目名称:stripe,代码行数:31,代码来源:start.php

示例6: 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');
}
开发者ID:nooshin-mirzadeh,项目名称:web_2.0_benchmark,代码行数:34,代码来源:start.php

示例7: staticsites_init

function staticsites_init()
{
    // Register backbone
    elgg_register_library('elgg:backbone', elgg_get_plugins_path() . 'staticsites/lib/backbone/backbone.php');
    elgg_load_library('elgg:backbone');
    elgg_register_library('elgg:staticsites', elgg_get_plugins_path() . 'staticsites/lib/staticsites.php');
    elgg_load_library('elgg:staticsites');
    // Include plugin vendors
    require elgg_get_plugins_path() . 'staticsites/vendor/autoload.php';
    // Static sites CSS
    elgg_extend_view('css/elgg', 'css/staticsites/css');
    // Register underscore with requirejs (and elgg)
    elgg_define_js('underscore', array('src' => 'mod/staticsites/vendors/underscore-min.js', 'location' => 'footer', 'exports' => '_'));
    // Register backbone with requirejs (and elgg)
    elgg_define_js('backbone', array('src' => 'mod/staticsites/vendors/backbone-min.js', 'location' => 'footer', 'deps' => array('jquery'), 'exports' => 'Backbone'));
    // Alloy Editor
    elgg_define_js('alloyEditor', array('src' => 'mod/staticsites/vendors/alloy-editor/alloy-editor-all-min.js', 'location' => 'footer', 'exports' => 'AlloyEditor'));
    // Alloy Editor CSS
    elgg_register_css('alloyeditor', 'mod/staticsites/vendors/alloy-editor/assets/alloy-editor-ocean-min.css');
    elgg_load_css('alloyeditor');
    // Set up group admin tools menu
    elgg_register_plugin_hook_handler('register', 'menu:groups:admin', 'staticsites_groups_admin_menu_setup');
    // Register main page handler
    elgg_register_page_handler('staticsites', 'staticsites_page_handler');
    // Actions
    $action_base = elgg_get_plugins_path() . "staticsites/actions/staticsites";
    elgg_register_action('staticsites/save_page', "{$action_base}/save_page.php");
    elgg_register_action('staticsites/delete_page', "{$action_base}/delete_page.php");
    // Whitelist template dir for ajax loads
    backbone_whitelist_templates(elgg_get_plugins_path() . 'staticsites/views/default/staticsites/templates/');
}
开发者ID:THINKGlobalSchool,项目名称:staticsites,代码行数:31,代码来源:start.php

示例8: 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'));
}
开发者ID:elgg,项目名称:zaudio,代码行数:7,代码来源:start.php

示例9: elgg_clean_init

function elgg_clean_init()
{
    elgg_unextend_view('page/elements/header', 'search/header');
    elgg_extend_view('page/elements/sidebar', 'search/header', 0);
    if (elgg_get_context() != "admin") {
        elgg_require_js("elgg_clean/js");
    }
    elgg_register_event_handler('pagesetup', 'system', 'elgg_clean_pagesetup', 1000);
    elgg_register_plugin_hook_handler('head', 'page', 'elgg_clean_setup_head');
    $bower = elgg_get_site_url() . "mod/elgg_clean/vendors/bower_components/";
    elgg_register_css("bootstrap", "{$bower}bootstrap/dist/css/bootstrap.css", 0);
    elgg_register_css("open", "http://fonts.googleapis.com/css?family=Open+Sans:400,700,700italic,400italic");
    elgg_register_css("passion", "http://fonts.googleapis.com/css?family=Passion+One");
    elgg_register_css("elgg_clean", elgg_get_site_url() . "mod/elgg_clean/css/elgg_clean.css", 10000);
    elgg_register_css("font-awesome", "{$bower}fontawesome/css/font-awesome.min.css");
    elgg_register_css("bootstrap-select", "{$bower}bootstrap-select/dist/css/bootstrap-select.min.css");
    elgg_register_css("jasny", "{$bower}jasny-bootstrap/dist/css/jasny-bootstrap.min.css");
    elgg_register_css("fuelux", "{$bower}fuelux/dist/css/fuelux.min.css");
    elgg_register_css("agency", elgg_get_site_url() . "mod/elgg_clean/css/agency.css", 20000);
    elgg_register_css("home", elgg_get_site_url() . "mod/elgg_clean/css/home.css", 30000);
    elgg_register_js('respond', '{$bower}respond/src/respond.js');
    elgg_define_js("bootstrap", array("src" => "{$bower}bootstrap/dist/js/bootstrap.min.js"));
    elgg_register_js("bootstrap-select", "{$bower}bootstrap-select/dist/js/bootstrap-select.min.js");
    elgg_register_js("jasny", "{$bower}jasny-bootstrap/dist/js/jasny-bootstrap.min.js");
    elgg_register_js("agency", elgg_get_site_url() . "mod/elgg_clean/js/agency.js");
    elgg_register_js("cbpAnimatedHeader", elgg_get_site_url() . "mod/elgg_clean/js/cbpAnimatedHeader.js");
    elgg_register_js("classie", elgg_get_site_url() . "mod/elgg_clean/js/classie.js");
    elgg_register_js("contact_me", elgg_get_site_url() . "mod/elgg_clean/js/contact_me.js");
    elgg_register_js("scrollspy", "{$bower}scrollspy/jquery.scrollspy.js");
    elgg_register_js("parallax", "{$boder}jquery-parallax/scripts/jquery.parallax-1.13.js");
    elgg_register_js("scrollto", "{$bower}jquery-parallax/scripts/jquery.scrollTo-1.4.2-min.js");
    elgg_define_js('fuelux', array('src' => "{$bower}fuelux/dist/js/fuelux.min.js"));
    if (elgg_get_context() != "admin") {
        elgg_load_js('respond');
        elgg_load_js("bootstrap");
        elgg_load_js("jscolor");
        elgg_load_js("elgg_clean");
        elgg_load_js("bootstrap-select");
        elgg_load_js("jasny");
        elgg_load_js("agency");
        elgg_load_js("parallax");
        elgg_load_js("scrollto");
        elgg_require_js("fuelux");
        elgg_load_css("bootstrap");
        elgg_load_css("open");
        elgg_load_css("passion");
        elgg_load_css("font-awesome");
        elgg_load_css("bootstrap-select");
        elgg_load_css("elgg_clean");
        elgg_load_css("jasny");
        elgg_load_css("fuelux");
        elgg_load_css("agency");
    }
    // non-members do not get visible links to RSS feeds
    if (!elgg_is_logged_in()) {
        elgg_unregister_plugin_hook_handler('output:before', 'layout', 'elgg_views_add_rss_link');
    }
    elgg_register_action("elgg_clean/contact", elgg_get_plugins_path() . "elgg_clean/actions/contact.php", "public");
}
开发者ID:n8b,项目名称:VMN,代码行数:59,代码来源:start.php

示例10: arck_avatar_init

/**
 * Initialize the plugin
 * @return void
 */
function arck_avatar_init()
{
    elgg_register_action('avatar/upload', __DIR__ . '/actions/avatar/upload.php');
    elgg_register_plugin_hook_handler('route', 'avatar', 'arck_avatar_router');
    elgg_define_js('cropper', array('src' => '/mod/arck_avatar/vendors/jquery.cropper/cropper.min.js', 'deps' => array('jquery')));
    elgg_register_css('jquery.cropper', '/mod/arck_avatar/vendors/jquery.cropper/cropper.min.css');
    elgg_register_css('arck.avatar', elgg_get_simplecache_url('css', 'arck/avatar.css'));
}
开发者ID:arckinteractive,项目名称:arck_avatar,代码行数:12,代码来源:start.php

示例11: extended_tinymce_init

function extended_tinymce_init()
{
    elgg_extend_view('css/elgg', 'extended_tinymce/css');
    elgg_extend_view('css/admin', 'extended_tinymce/css');
    elgg_define_js('extended_tinymce', array('src' => 'mod/extended_tinymce/vendor/tinymce/js/tinymce/jquery.tinymce.min.js', 'deps' => array('jquery', 'elgg')));
    elgg_extend_view('input/longtext', 'extended_tinymce/init');
    elgg_extend_view('js/embed/embed', 'js/elgg/extended_tinymce/insert.js');
    // extend allowed styles for tinymce editor as filtered by htmlawed
    elgg_register_plugin_hook_handler('allowed_styles', 'htmlawed', 'extended_tinymce_allowed_styles');
}
开发者ID:epsylon,项目名称:Hydra-dev,代码行数:10,代码来源:start.php

示例12: xoxco_tags_init

function xoxco_tags_init()
{
    elgg_extend_view('css/elgg', 'xoxco_tags/css/elgg_after', 501);
    elgg_extend_view('css/admin', 'xoxco_tags/css/elgg_after', 501);
    elgg_define_js('jquery.tagsinput', array('src' => '/mod/xoxco_tags/js/lib/jquery.tagsinput.min.js'));
    // Include the feature only if Elgg is displaying the tags input
    elgg_register_plugin_hook_handler('view', 'input/tags', function () {
        elgg_require_js('xoxco_tags');
    });
}
开发者ID:mrclay,项目名称:xoxco_tags,代码行数:10,代码来源:start.php

示例13: pages_init

/**
 * Initialize the pages plugin.
 *
 */
function pages_init()
{
    // register a library of helper functions
    elgg_register_library('elgg:pages', __DIR__ . '/lib/pages.php');
    $item = new ElggMenuItem('pages', elgg_echo('pages'), 'pages/all');
    elgg_register_menu_item('site', $item);
    // Register a page handler, so we can have nice URLs
    elgg_register_page_handler('pages', 'pages_page_handler');
    // Register a url handler
    elgg_register_plugin_hook_handler('entity:url', 'object', 'pages_set_url');
    elgg_register_plugin_hook_handler('entity:url', 'object', 'pages_set_url');
    elgg_register_plugin_hook_handler('extender:url', 'annotation', 'pages_set_revision_url');
    // Register some actions
    $action_base = __DIR__ . '/actions';
    elgg_register_action("pages/edit", "{$action_base}/pages/edit.php");
    elgg_register_action("pages/delete", "{$action_base}/pages/delete.php");
    elgg_register_action("annotations/page/delete", "{$action_base}/annotations/page/delete.php");
    // Extend the main css view
    elgg_extend_view('elgg.css', 'pages/css');
    elgg_define_js('jquery.treeview', array('src' => '/mod/pages/vendors/jquery-treeview/jquery.treeview.min.js', 'exports' => 'jQuery.fn.treeview', 'deps' => array('jquery')));
    $css_url = 'mod/pages/vendors/jquery-treeview/jquery.treeview.css';
    elgg_register_css('jquery.treeview', $css_url);
    // Register entity type for search
    elgg_register_entity_type('object', 'page');
    elgg_register_entity_type('object', 'page_top');
    // Register for notifications
    elgg_register_notification_event('object', 'page');
    elgg_register_notification_event('object', 'page_top');
    elgg_register_plugin_hook_handler('prepare', 'notification:create:object:page', 'pages_prepare_notification');
    elgg_register_plugin_hook_handler('prepare', 'notification:create:object:page_top', 'pages_prepare_notification');
    // add to groups
    add_group_tool_option('pages', elgg_echo('groups:enablepages'), true);
    elgg_extend_view('groups/tool_latest', 'pages/group_module');
    //add a widget
    elgg_register_widget_type('pages', elgg_echo('pages'), elgg_echo('pages:widget:description'));
    // Language short codes must be of the form "pages:key"
    // where key is the array key below
    elgg_set_config('pages', array('title' => 'text', 'description' => 'longtext', 'tags' => 'tags', 'parent_guid' => 'parent', 'access_id' => 'access', 'write_access_id' => 'write_access'));
    elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'pages_owner_block_menu');
    // write permission plugin hooks
    elgg_register_plugin_hook_handler('permissions_check', 'object', 'pages_write_permission_check');
    elgg_register_plugin_hook_handler('container_permissions_check', 'object', 'pages_container_permission_check');
    elgg_register_plugin_hook_handler('access:collections:write', 'user', 'pages_write_access_options_hook');
    // icon url override
    elgg_register_plugin_hook_handler('entity:icon:url', 'object', 'pages_icon_url_override');
    // entity menu
    elgg_register_plugin_hook_handler('register', 'menu:entity', 'pages_entity_menu_setup');
    // register ecml views to parse
    elgg_register_plugin_hook_handler('get_views', 'ecml', 'pages_ecml_views_hook');
    // allow to be liked
    elgg_register_plugin_hook_handler('likes:is_likable', 'object:page', 'Elgg\\Values::getTrue');
    elgg_register_plugin_hook_handler('likes:is_likable', 'object:page_top', 'Elgg\\Values::getTrue');
    // prevent public write access
    elgg_register_plugin_hook_handler('view_vars', 'input/access', 'pages_write_access_vars');
}
开发者ID:thehereward,项目名称:Elgg,代码行数:59,代码来源:start.php

示例14: file_tools_init

/**
 * Called during system initialization
 *
 * @return void
 */
function file_tools_init()
{
    // extend CSS
    elgg_extend_view("css/elgg", "css/file_tools/site");
    $vendors = elgg_get_site_url() . "mod/file_tools/vendors/";
    // register JS libraries
    elgg_define_js('jquery.uploadify', array('src' => '/mod/file_tools/vendors/uploadify/jquery.uploadify-3.1.min.js', 'deps' => array('jquery')));
    elgg_register_simplecache_view("css/uploadify/uploadify");
    elgg_register_css("jquery.uploadify", elgg_get_simplecache_url("css", "uploadify/uploadify"));
    elgg_register_css("jquery.tree", $vendors . "jstree/dist/themes/default/style.css");
    elgg_define_js('jquery.tree', array('src' => $vendors . 'jstree/dist/jstree.min.js', 'deps' => array('jquery')));
    elgg_define_js('jquery.hashchange', array('src' => '/mod/file_tools/vendors/hashchange/jquery.hashchange.js', 'exports' => 'jQuery.fn.hashchange', 'deps' => array('jquery')));
    // Make settings file loadable through AMD
    elgg_register_simplecache_view('js/file_tools/settings.js');
    // extend views
    elgg_extend_view("groups/edit", "file_tools/group_settings");
    // register page handler for nice URL's
    elgg_register_page_handler("file_tools", "file_tools_page_handler");
    // make our own URLs for folder icons
    elgg_register_plugin_hook_handler("entity:icon:url", "object", "file_tools_folder_icon_hook");
    // register group option to allow management of file tree structure
    add_group_tool_option("file_tools_structure_management", elgg_echo("file_tools:group_tool_option:structure_management"));
    // register widgets
    // add folder widget
    // need to keep file_tree for the widget name to be compatible with previous filetree plugin users
    elgg_register_widget_type("file_tree", elgg_echo("widgets:file_tree:title"), elgg_echo("widgets:file_tree:description"), array("dashboard", "profile", "groups"), true);
    // group files
    elgg_register_widget_type("group_files", elgg_echo("file:group"), elgg_echo("widgets:group_files:description"), array("groups"));
    // index files
    elgg_register_widget_type("index_file", elgg_echo("file"), elgg_echo("widgets:index_file:description"), array("index"), true);
    // register events
    elgg_register_event_handler("create", "object", "file_tools_object_handler");
    elgg_register_event_handler("update", "object", "file_tools_object_handler");
    elgg_register_event_handler("delete", "object", "file_tools_object_handler_delete");
    // register hooks
    elgg_register_plugin_hook_handler("register", "menu:entity", "file_tools_entity_menu_hook");
    elgg_register_plugin_hook_handler("permissions_check:metadata", "object", "file_tools_can_edit_metadata_hook");
    // 	elgg_register_plugin_hook_handler("access:collections:write", "all", "file_tools_write_acl_plugin_hook", 550);
    elgg_register_plugin_hook_handler("route", "file", "file_tools_file_route_hook");
    elgg_register_plugin_hook_handler("widget_url", "widget_manager", "file_tools_widget_url_hook");
    elgg_register_plugin_hook_handler("entity:url", "object", "file_tools_folder_url_handler");
    elgg_register_plugin_hook_handler("register", "menu:file_tools_folder_breadcrumb", "file_tools_folder_breadcrumb_hook");
    elgg_register_plugin_hook_handler("register", "menu:file_tools_folder_sidebar_tree", "file_tools_folder_sidebar_tree_hook");
    // register actions
    elgg_register_action("file_tools/groups/save_sort", dirname(__FILE__) . "/actions/groups/save_sort.php");
    elgg_register_action("file_tools/folder/edit", dirname(__FILE__) . "/actions/folder/edit.php");
    elgg_register_action("file_tools/folder/delete", dirname(__FILE__) . "/actions/folder/delete.php");
    elgg_register_action("file_tools/folder/reorder", dirname(__FILE__) . "/actions/folder/reorder.php");
    elgg_register_action("file_tools/upload/zip", dirname(__FILE__) . "/actions/upload/zip.php");
    elgg_register_action("file_tools/folder/delete", dirname(__FILE__) . "/actions/folder/delete.php");
    elgg_register_action("file_tools/file/hide", dirname(__FILE__) . "/actions/file/hide.php");
    elgg_register_action("file/move", dirname(__FILE__) . "/actions/file/move.php");
    elgg_register_action("file/bulk_delete", dirname(__FILE__) . "/actions/file/bulk_delete.php");
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:59,代码来源:start.php

示例15: elgg_tokeninput_init

/**
 * Initialize the plugin
 */
function elgg_tokeninput_init()
{
    elgg_register_library('elgg.tokeninput', elgg_get_plugins_path() . 'elgg_tokeninput/lib/tokeninput.php');
    elgg_define_js('jquery.tokeninput', array('src' => 'mod/elgg_tokeninput/vendors/jquery-tokeninput/build/jquery.tokeninput.min.js', 'deps' => array('jquery')));
    elgg_require_js('tokeninput/init');
    elgg_extend_view('css/elgg', 'css/tokeninput/stylesheet.css');
    elgg_extend_view('css/admin', 'css/tokeninput/stylesheet.css');
    elgg_register_plugin_hook_handler('action', 'all', 'elgg_tokeninput_explode_field_values', 1);
    elgg_register_page_handler(ELGG_TOKENINPUT_PAGEHANDLER, 'elgg_tokeninput_page_handler');
    elgg_extend_view('theme_sandbox/forms', 'theme_sandbox/forms/elgg_tokeninput');
}
开发者ID:n8b,项目名称:VMN,代码行数:14,代码来源:start.php


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