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


PHP require_javascript函数代码示例

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


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

示例1: splurgh_master_build

/**
 * Get a splurghified version of the specified item.
 *
 * @param  string			The name of what the key we want to reference is in our array of maps (e.g. 'id')
 * @param  array			A row of maps for data we are splurghing; this is probably just the result of $GLOBALS['SITE_DB']->query_select
 * @param  URLPATH		The stub that links will be passed through
 * @param  ID_TEXT		The page name we will be saving customised HTML under
 * @param  TIME			The time we did our last change to the data being splurghed (so it can see if we can simply decache instead of deriving)
 * @param  ?AUTO_LINK	The ID that is at the root of our tree (NULL: db_get_first_id)
 * @return string			A string of HTML that represents our splurghing (will desplurgh in the users browser)
 */
function splurgh_master_build($key_name, $map, $url_stub, $_cache_file, $last_change_time, $first_id = NULL)
{
    if (is_null($first_id)) {
        $first_id = db_get_first_id();
    }
    if (!array_key_exists($first_id, $map)) {
        return '';
    }
    if (!has_js()) {
        warn_exit(do_lang_tempcode('MSG_JS_NEEDED'));
    }
    require_javascript('javascript_splurgh');
    if (is_browser_decacheing()) {
        $last_change_time = time();
    }
    $cache_file = zone_black_magic_filterer(get_custom_file_base() . '/' . get_zone_name() . '/pages/html_custom/' . filter_naughty(user_lang()) . '/' . filter_naughty($_cache_file) . '.htm');
    if (!file_exists($cache_file) || is_browser_decacheing() || filesize($cache_file) == 0 || $last_change_time > filemtime($cache_file)) {
        $myfile = @fopen($cache_file, 'wt');
        if ($myfile === false) {
            intelligent_write_error($cache_file);
        }
        $fulltable = array();
        $splurgh = _splurgh_do_node($map, $first_id, '', $fulltable, 0);
        $page = do_template('SPLURGH', array('_GUID' => '8775edfc5a386fdf2cec69b0fc889952', 'KEY_NAME' => $key_name, 'URL_STUB' => $url_stub, 'SPLURGH' => str_replace('"', '\'', $splurgh)));
        $ev = $page->evaluate();
        if (fwrite($myfile, $ev) < strlen($ev)) {
            warn_exit(do_lang_tempcode('COULD_NOT_SAVE_FILE'));
        }
        fclose($myfile);
        fix_permissions($cache_file);
        sync_file($cache_file);
        return $ev;
    }
    return file_get_contents($cache_file, FILE_TEXT);
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:46,代码来源:splurgh.php

示例2: run

 /**
  * Standard modular run function.
  *
  * @return tempcode	The result of execution.
  */
 function run()
 {
     require_javascript('javascript_translate');
     require_code('lang2');
     require_code('lang_compile');
     require_lang('lang');
     $type = get_param('type', 'misc');
     if ($type == 'content') {
         return $this->interface_content();
     }
     if ($type == '_content') {
         return $this->set_lang_content();
     }
     if ($type == 'criticise') {
         return $this->criticise();
     }
     if ($type == 'misc') {
         return $this->interface_code();
     }
     if ($type == '_code') {
         return $this->set_lang_code();
     }
     if ($type == '_code2') {
         return $this->set_lang_code_2();
     }
     // This is a lang string setter called from an external source. Strings may be from many different files
     if ($type == 'export_po') {
         return $this->export_po();
     }
     return new ocp_tempcode();
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:36,代码来源:admin_lang.php

示例3: init

 function init()
 {
     //		require_javascript("og/HtmlPanel.js");
     require_javascript("og/MessageManager.js");
     ajx_current("panel", "messages", null, null, true);
     ajx_replace(true);
 }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:7,代码来源:MessageController.class.php

示例4: init

 function init()
 {
     require_javascript('og/EmailAccountMenu.js');
     require_javascript("og/MailManager.js");
     ajx_current("panel", "mails-containerpanel", null, null, true);
     ajx_replace(true);
 }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:7,代码来源:MailController.class.php

示例5: init

 function init()
 {
     require_javascript('MailAccountMenu.js', $this->plugin_name);
     require_javascript("MailManager.js", $this->plugin_name);
     ajx_current("panel", "mails-containerpanel", null, null, true);
     ajx_replace(true);
 }
开发者ID:abhinay100,项目名称:fengoffice_app,代码行数:7,代码来源:MailController.class.php

示例6: run

 /**
  * Standard modular run function.
  *
  * @return tempcode	The result of execution.
  */
 function run()
 {
     require_javascript('javascript_realtime_rain');
     require_javascript('javascript_ajax');
     require_javascript('javascript_more');
     require_lang('realtime_rain');
     require_css('realtime_rain');
     $title = get_page_title('REALTIME_RAIN');
     if (!has_js()) {
         // Send them to the page permissions screen
         $url = build_url(array('page' => 'admin_stats', 'type' => 'misc'), '_SELF');
         require_code('site2');
         assign_refresh($url, 5.0);
         return do_template('REDIRECT_SCREEN', array('URL' => $url, 'TITLE' => $title, 'TEXT' => do_lang_tempcode('NO_JS_REALTIME')));
     }
     $GLOBALS['TEMPCODE_SETGET']['chrome_frame'] = make_string_tempcode('1');
     if (browser_matches('ie6')) {
         attach_message(do_lang_tempcode('IE_OLD_PLEASE_UPGRADE'), 'warn');
     }
     if (!has_js()) {
         // Send them to the stats screen
         $url = build_url(array('page' => 'admin_stats', 'type' => 'misc'), '_SELF');
         require_code('site2');
         assign_refresh($url, 5.0);
         return do_template('REDIRECT_SCREEN', array('URL' => $url, 'TITLE' => $title, 'TEXT' => do_lang_tempcode('NO_JS_ADVANCED_SCREEN_REALTIME_RAIN')));
     }
     $min_time = $GLOBALS['SITE_DB']->query_value('stats', 'MIN(date_and_time)');
     if (is_null($min_time)) {
         $min_time = time();
     }
     return do_template('REALTIME_RAIN_OVERLAY', array('MIN_TIME' => strval($min_time)));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:37,代码来源:admin_realtime_rain.php

示例7: run_start

 /**
  * Standard aed_module run_start.
  *
  * @param  ID_TEXT		The type of module execution
  * @return tempcode		The output of the run
  */
 function run_start($type)
 {
     $GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/emoticons';
     $GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_emoticons';
     $this->add_one_label = do_lang_tempcode('ADD_EMOTICON');
     $this->edit_this_label = do_lang_tempcode('EDIT_THIS_EMOTICON');
     $this->edit_one_label = do_lang_tempcode('EDIT_EMOTICON');
     require_lang('dearchive');
     require_code('images');
     if (get_forum_type() != 'ocf') {
         warn_exit(do_lang_tempcode('NO_OCF'));
     } else {
         ocf_require_all_forum_stuff();
     }
     require_code('ocf_general_action');
     require_code('ocf_general_action2');
     if ($type == 'ad') {
         require_javascript('javascript_ajax');
         $script = find_script('snippet');
         $this->javascript = "\n\t\t\t\tvar form=document.getElementById('main_form');\n\t\t\t\tform.old_submit=form.onsubmit;\n\t\t\t\tform.onsubmit=function()\n\t\t\t\t\t{\n\t\t\t\t\t\tdocument.getElementById('submit_button').disabled=true;\n\t\t\t\t\t\tvar url='" . addslashes($script) . "?snippet=exists_emoticon&name='+window.encodeURIComponent(form.elements['code'].value);\n\t\t\t\t\t\tif (!do_ajax_field_test(url))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdocument.getElementById('submit_button').disabled=false;\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdocument.getElementById('submit_button').disabled=false;\n\t\t\t\t\t\tif (typeof form.old_submit!='undefined' && form.old_submit) return form.old_submit();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t};\n\t\t\t";
     }
     if ($type == 'misc') {
         return $this->misc();
     }
     if ($type == 'import') {
         return $this->import();
     }
     if ($type == '_import') {
         return $this->_import();
     }
     return new ocp_tempcode();
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:38,代码来源:admin_ocf_emoticons.php

示例8: init

	function init() {
		$js_manager_info = array('js_file' => "og/FileManager.js");
		Hook::fire('change_js_manager', $this, $js_manager_info);
		require_javascript(array_var($js_manager_info, 'js_file'), array_var($js_manager_info, 'plugin'));
		
		ajx_current("panel", "files", null, null, true);
		ajx_replace(true);
	}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:8,代码来源:FilesController.class.php

示例9: run

 /**
  * Standard modular run function.
  *
  * @param  array		A map of parameters.
  * @return tempcode	The result of execution.
  */
 function run($map)
 {
     require_lang('activities');
     require_css('activities');
     require_javascript('javascript_activities_state');
     require_javascript('javascript_jquery');
     $title = array_key_exists('param', $map) ? $map['param'] : do_lang('STATUS_UPDATE');
     return do_template('BLOCK_MAIN_ACTIVITIES_STATE', array('TITLE' => $title));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:15,代码来源:main_activities_state.php

示例10: init

 function init()
 {
     $ot = ObjectTypes::findById(array_var($_REQUEST, 'type_id'));
     $dim = Dimensions::findById(array_var($_REQUEST, 'dim_id'));
     evt_add("refresh member list parameters", array('object_type_id' => array_var($_REQUEST, 'type_id'), 'dimension_id' => array_var($_REQUEST, 'dim_id'), 'dimension_code' => $dim instanceof Dimension ? $dim->getCode() : '', 'object_type_name' => $ot instanceof ObjectType ? $ot->getName() : ''));
     require_javascript("og/MemberManager.js");
     ajx_current("panel", "members", null, null, true);
     ajx_replace(true);
 }
开发者ID:abhinay100,项目名称:feng_app,代码行数:9,代码来源:MemberController.class.php

示例11: tpl_preview__administrative__site_tree_editor_screen

 /**
  * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
  * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
  * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
  *
  * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
  */
 function tpl_preview__administrative__site_tree_editor_screen()
 {
     require_javascript('javascript_ajax');
     require_javascript('javascript_more');
     require_javascript('javascript_tree_list');
     require_javascript('javascript_dragdrop');
     require_javascript('javascript_site_tree_editor');
     require_lang('zones');
     return array(lorem_globalise(do_lorem_template('SITE_TREE_EDITOR_SCREEN', array('TITLE' => lorem_title())), NULL, '', true));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:17,代码来源:page_management.php

示例12: run

 /**
  * Standard modular run function.
  *
  * @param  array		A map of parameters.
  * @return tempcode	The result of execution.
  */
 function run($map)
 {
     require_lang('activities');
     require_css('activities');
     require_javascript('javascript_activities');
     require_javascript('javascript_jquery');
     require_javascript('javascript_base64');
     if (!array_key_exists('max', $map)) {
         $map['max'] = '10';
     }
     if (array_key_exists('param', $map)) {
         $title = $map['param'];
     } else {
         $title = do_lang_tempcode('ACTIVITIES_TITLE');
     }
     // See if we're displaying for a specific member
     if (array_key_exists('member', $map)) {
         $member_ids = array_map('intval', explode(',', $map['member']));
     } else {
         // No specific user. Use ourselves.
         $member_ids = array(get_member());
     }
     require_css('side_blocks');
     require_lang('activities');
     require_code('activities');
     require_code('addons_overview');
     $mode = array_key_exists('mode', $map) ? $map['mode'] : 'all';
     $viewer_id = get_member();
     //We'll need this later anyway.
     $guest_id = $GLOBALS['FORUM_DRIVER']->get_guest_id();
     list($proceed_selection, $whereville) = find_activities($viewer_id, $mode, $member_ids);
     $can_remove_others = has_zone_access($viewer_id, 'adminzone') ? true : false;
     $content = array();
     global $NON_CANONICAL_PARAMS;
     $NON_CANONICAL_PARAMS[] = 'act_start';
     $start = get_param_integer('act_start', 0);
     $max = get_param_integer('act_max', intval($map['max']));
     if ($proceed_selection === true) {
         $max_rows = $GLOBALS['SITE_DB']->query_value_null_ok_full('SELECT COUNT(*) FROM ' . get_table_prefix() . 'activities WHERE ' . $whereville);
         require_code('templates_results_browser');
         $results_browser = results_browser(do_lang('ACTIVITIES_TITLE'), NULL, $start, 'act_start', $max, 'act_max', $max_rows, NULL, NULL, true, false, 7, NULL, 'tab__activities');
         $activities = $GLOBALS['SITE_DB']->query('SELECT * FROM ' . get_table_prefix() . 'activities WHERE ' . $whereville . ' ORDER BY a_time DESC', $max, $start);
         if (!is_null($activities) && count($activities) > 0) {
             foreach ($activities as $row) {
                 list($message, $memberpic, $datetime, $member_url, $lang_string) = render_activity($row);
                 $content[] = array('LANG_STRING' => $lang_string, 'ADDON_ICON' => find_addon_icon($row['a_addon']), 'BITS' => $message, 'MEMPIC' => $memberpic, 'USERNAME' => $GLOBALS['FORUM_DRIVER']->get_username($row['a_member_id']), 'DATETIME' => strval($datetime), 'MEMBER_URL' => $member_url, 'LIID' => strval($row['id']), 'ALLOW_REMOVE' => $row['a_member_id'] == $viewer_id || $can_remove_others ? '1' : '0');
             }
         }
     } else {
         $results_browser = new ocp_tempcode();
     }
     // No entries
     return do_template('BLOCK_MAIN_ACTIVITIES', array('TITLE' => $title, 'MODE' => $mode, 'MEMBER_IDS' => implode(',', $member_ids), 'CONTENT' => $content, 'GROW' => array_key_exists('grow', $map) ? $map['grow'] == '1' : true, 'RESULTS_BROWSER' => $results_browser, 'MAX' => $start == 0 ? strval($max) : NULL));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:60,代码来源:main_activities.php

示例13: tpl_preview__administrative__redirecte_table_screen

 /**
  * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
  * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
  * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
  *
  * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
  */
 function tpl_preview__administrative__redirecte_table_screen()
 {
     require_javascript('javascript_ajax');
     $fields = new ocp_tempcode();
     foreach (placeholder_array() as $i => $row) {
         $fields->attach(do_lorem_template('REDIRECTE_TABLE_REDIRECT', array('I' => strval($i), 'TO_ZONES' => placeholder_options(), 'FROM_ZONES' => placeholder_options(), 'FROM_PAGE' => lorem_word(), 'TO_PAGE' => lorem_word_2(), 'TICKED' => true, 'NAME' => "is_transparent_{$i}")));
     }
     $new = do_lorem_template('REDIRECTE_TABLE_REDIRECT', array('I' => 'new', 'TO_ZONES' => placeholder_options(), 'FROM_ZONES' => placeholder_options(), 'FROM_PAGE' => '', 'TO_PAGE' => '', 'TICKED' => false, 'NAME' => 'is_transparent_new'));
     $out = do_lorem_template('REDIRECTE_TABLE_SCREEN', array('NOTES' => '', 'PING_URL' => placeholder_url(), 'WARNING_DETAILS' => '', 'TITLE' => lorem_title(), 'FIELDS' => $fields, 'NEW' => $new, 'URL' => placeholder_url()));
     return array(lorem_globalise($out, NULL, '', true));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:18,代码来源:redirects_editor.php

示例14: tpl_preview__administrative__permissions_tree_editor_screen

 /**
  * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
  * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
  * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
  *
  * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
  */
 function tpl_preview__administrative__permissions_tree_editor_screen()
 {
     require_javascript('javascript_ajax');
     require_javascript('javascript_tree_list');
     require_javascript('javascript_more');
     require_lang('permissions');
     $groups = new ocp_tempcode();
     foreach (placeholder_array() as $id => $group_name) {
         $groups->attach(form_input_list_entry("{$id}", false, $group_name));
     }
     return array(lorem_globalise(do_lorem_template('PERMISSIONS_TREE_EDITOR_SCREEN', array('USERGROUPS' => placeholder_array(), 'TITLE' => lorem_title(), 'INITIAL_GROUP' => lorem_phrase(), 'COLOR' => lorem_phrase(), 'GROUPS' => $groups, 'EDITOR' => lorem_phrase())), NULL, '', true));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:19,代码来源:core_permission_management.php

示例15: internalise_own_screen

/**
 * Put the contents of a page inside an iframe. This is typically used when a page is being used to traverse a result-set that spans multiple screens.
 *
 * @param  tempcode		The title
 * @param  ?integer		The time between refreshes (NULL: do not refresh)
 * @param  ?mixed			Data. A refresh will only happen if an AJAX-check indicates this data has changed (NULL: no check)
 * @return ?tempcode		The page output to finish off our current page stream such that it will spawn the iframe (NULL: not internalised)
 */
function internalise_own_screen($title, $refresh_time = NULL, $refresh_if_changed = NULL)
{
    if (get_value('no_frames') === '1' || get_param_integer('no_frames', 0) == 1 || get_param_integer('keep_no_frames', 0) == 1) {
        return NULL;
    }
    if (!has_js()) {
        return NULL;
    }
    // We need JS to make this a seamless process
    if (strpos(ocp_srv('REQUEST_URI'), '/iframe.php') !== false) {
        return NULL;
    }
    // This is already in the iframe
    require_javascript('javascript_ajax');
    require_javascript('javascript_iframe_screen');
    $url = find_script('iframe') . '?zone=' . rawurlencode(get_zone_name()) . '&wide_high=1&utheme=' . rawurlencode($GLOBALS['FORUM_DRIVER']->get_theme());
    foreach (array_merge($_GET, $_POST) as $key => $param) {
        if (!is_string($param)) {
            continue;
        }
        if (substr($key, 0, 5) == 'keep_' && skippable_keep($key, $param)) {
            continue;
        }
        if (get_magic_quotes_gpc()) {
            $param = stripslashes($param);
        }
        $url .= '&' . $key . '=' . urlencode($param);
    }
    if (!is_null($refresh_if_changed)) {
        require_javascript('javascript_sound');
        $change_detection_url = find_script('change_detection') . '?whatever=1';
        foreach ($_GET as $key => $param) {
            if (!is_string($param)) {
                continue;
            }
            if (substr($key, 0, 5) == 'keep_' && skippable_keep($key, $param)) {
                continue;
            }
            if (get_magic_quotes_gpc()) {
                $param = stripslashes($param);
            }
            $change_detection_url .= '&' . $key . '=' . urlencode($param);
        }
    } else {
        $refresh_if_changed = '';
        $change_detection_url = '';
    }
    return do_template('IFRAME_SCREEN', array('_GUID' => '06554eb227428fd5c648dee3c5b38185', 'TITLE' => $title, 'REFRESH_IF_CHANGED' => md5(serialize($refresh_if_changed)), 'CHANGE_DETECTION_URL' => $change_detection_url, 'REFRESH_TIME' => is_null($refresh_time) ? '' : strval($refresh_time), 'IFRAME_URL' => $url));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:57,代码来源:templates_internalise_screen.php


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