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


PHP require_js函数代码示例

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


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

示例1: display_init

 /**
  * Get ready for displaying the skin.
  *
  * This may register some CSS or JS...
  */
 function display_init()
 {
     // call parent:
     parent::display_init();
     // Add CSS:
     require_css('basic_styles.css', 'blog');
     // the REAL basic styles
     require_css('basic.css', 'blog');
     // Basic styles
     require_css('blog_base.css', 'blog');
     // Default styles for the blog navigation
     require_css('item_base.css', 'blog');
     // Default styles for the post CONTENT
     // Make sure standard CSS is called ahead of custom CSS generated below:
     require_css('style.css', 'relative');
     require_js('ajax.js', 'blog');
     require_js('functions.js');
     require_js('rollovers.js');
     skin_content_header();
     // Sets charset!
     require_js('jquery-1.2.3.min.js');
     require_js('jquery.easing.min.js');
     require_js('jquery.lavalamp.min.js');
     // Colorbox (a lightweight Lightbox alternative) allows to zoom on images and do slideshows with groups of images:
     if ($this->get_setting("colorbox")) {
         require_js_helper('colorbox', 'blog');
     }
 }
开发者ID:b2evolution,项目名称:berona_skin,代码行数:33,代码来源:_skin.class.php

示例2: print_header

 function print_header()
 {
     global $CFG;
     popup_form('admin.php?type=' . $this->type . '&path=', $this->current_assignments, 'path_selector', $this->path, 'Year/College/Major', '', '', false, 'self', get_string('academic_current', 'block_student_gradeviewer'));
     // Once we have everything we need, then we can load the javascript
     // for the auto complete
     echo '<script type="text/javascript">';
     foreach ($this->fields as $field => $values) {
         echo data_reduce($field, $values);
     }
     echo '</script>';
     // Get all the libraries required for the yui stuff
     require_js(array($CFG->wwwroot . '/lib/yui/yahoo/yahoo-min.js', $CFG->wwwroot . '/lib/yui/event/event-min.js', $CFG->wwwroot . '/lib/yui/animation/animation-min.js', $CFG->wwwroot . '/lib/yui/yahoo-dom-event/yahoo-dom-event.js', $CFG->wwwroot . '/lib/yui/autocomplete/autocomplete-min.js', $CFG->wwwroot . '/blocks/student_gradeviewer/admin/functions.js'));
     // The yui autocomplete has to have the most complicated html setup
     echo '<div class="admin_header">
             <div class="yui-skin-sam">
               <form method="post">
                 <div class="admin_inputs">
               ' . array_reduce($this->input_fields, array($this, 'input_reduce'), ' ') . '
                 </div>
                 <div class="submit_button">
                 <input type="submit" value="' . get_string('submit') . '">
                 </div>
               </form>
             </div>
           </div>';
     $this->print_errors();
     $header_strings = array_reduce($this->input_fields, array($this, 'header_strings'), '');
     $assigning = get_string('admin_assigning', 'block_student_gradeviewer');
     $this->header_string($assigning . $header_strings);
 }
开发者ID:rrusso,项目名称:EARS,代码行数:31,代码来源:admin_academics.php

示例3: display_init

 /**
  * Get ready for displaying the skin.
  *
  * This may register some CSS or JS...
  */
 function display_init()
 {
     // call parent:
     parent::display_init();
     // Add CSS:
     require_css('basic_styles.css', 'blog');
     // the REAL basic styles
     require_css('basic.css', 'blog');
     // Basic styles
     require_css('blog_base.css', 'blog');
     // Default styles for the blog navigation
     require_css('item_base.css', 'blog');
     // Default styles for the post CONTENT
     require_js('ajax.js', 'blog');
     require_js('functions.js');
     require_js('rollovers.js');
     // Make sure standard CSS is called ahead of custom CSS generated below:
     require_css('style.css', 'relative');
     // Width switch styles
     add_headline('<link rel="stylesheet" href="style.css" type="text/css" title="fixed"/>');
     add_headline('<link rel="alternate stylesheet" href="fluid.css" type="text/css" title="fluid"/>');
     add_headline('<script type="text/javascript" src="rsc/js/styleswitcher.js"></script>');
     // Colorbox (a lightweight Lightbox alternative) allows to zoom on images and do slideshows with groups of images:
     if ($this->get_setting("colorbox")) {
         require_js_helper('colorbox', 'blog');
     }
 }
开发者ID:b2evolution,项目名称:grey_skale_skin,代码行数:32,代码来源:_skin.class.php

示例4: display_init

 /**
  * Get ready for displaying the skin.
  *
  * This may register some CSS or JS...
  */
 function display_init()
 {
     // call parent:
     parent::display_init();
     // Add CSS:
     // fp> Note: having those here should allow
     // 1) Requesting them earlier as if they are @import'ed
     // 2) Allow bundling
     // fp> I am not 100% sure though. Comments welcome :)
     /*require_css( 'basic_styles.css', 'blog' ); // the REAL basic styles
     		require_css( 'basic.css', 'blog' ); // Basic styles
     		require_css( 'blog_base.css', 'blog' ); // Default styles for the blog navigation
     		require_css( 'item_base.css', 'blog' ); // Default styles for the post CONTENT
     		require_css( 'item.css', 'relative' );
     		require_css( 'style.css', 'relative' );*/
     // Colorbox (a lightweight Lightbox alternative) allows to zoom on images and do slideshows with groups of images:
     if ($this->get_setting('colorbox')) {
         require_js_helper('colorbox', 'blog');
     }
     require_css('basic_styles.css', 'blog');
     // the REAL basic styles
     require_css('basic.css', 'blog');
     // Basic styles
     require_css('style.css', 'relative');
     require_js('js/core.js', 'relative');
     require_js('navigation.js', 'blog');
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:32,代码来源:_skin.class.php

示例5: show_header

 function show_header()
 {
     global $CFG, $USER;
     $swwwroot = htmlspecialchars($CFG->wwwroot);
     $navtail = get_string('summary_title', ANNOTATION_STRINGS);
     $navmiddle = "";
     require_js(ANNOTATION_PATH . '/marginalia/3rd-party.js');
     require_js(ANNOTATION_PATH . '/marginalia/log.js');
     require_js(ANNOTATION_PATH . '/marginalia-config.js');
     require_js(ANNOTATION_PATH . '/marginalia/domutil.js');
     require_js(ANNOTATION_PATH . '/marginalia/prefs.js');
     require_js(ANNOTATION_PATH . '/marginalia/rest-prefs.js');
     require_js(ANNOTATION_PATH . '/marginalia/annotation.js');
     require_js(ANNOTATION_PATH . '/marginalia/rest-annotate.js');
     require_js(ANNOTATION_PATH . '/smartquote.js');
     require_js(ANNOTATION_PATH . '/summary.js');
     $meta = "<link rel='stylesheet' type='text/css' href='" . s(ANNOTATION_PATH) . "/summary-styles.php'/>\n";
     if (null != $this->course && $this->course->category) {
         print_header($this->course->shortname . ': ' . get_string('summary_title', ANNOTATION_STRINGS), $this->course->fullname, '<a href=' . $CFG->wwwroot . '/course/view.php?id=' . $this->course->id . '>' . $this->course->shortname . '</a> -> ' . $navtail, "", $meta, true, "", navmenu($this->course));
     } elseif (null != $this->course) {
         print_header($this->course->shortname . ': ' . get_string('summary_title', ANNOTATION_STRINGS), $this->course->fullname, $navtail, "", $meta, true, "", navmenu($this->course));
     } else {
         print_header(get_string('summary_title', ANNOTATION_STRINGS), null, "{$navtail}", "", $meta, true, "", null);
     }
     //		echo $tagsHtml;
     if (isloggedin()) {
         $sannotationpath = s(ANNOTATION_PATH);
         echo "<script language='JavaScript' type='text/javascript'>\n" . "var annotationService = new RestAnnotationService('{$sannotationpath}/annotate.php', { csrfCookie: 'MoodleSessionTest' } );\n" . "window.annotationSummary = new AnnotationSummary(annotationService" . ", '{$swwwroot}'" . ", '" . s($USER->username) . "');\n" . "window.preferences = new Preferences( new RestPreferenceService('{$sannotationpath}/user-preference.php' ) );\n" . "</script>\n";
     }
 }
开发者ID:njorth,项目名称:marginalia,代码行数:30,代码来源:summary.php

示例6: output

 function output()
 {
     require_js(array('js/jquery.Jcrop.min.js'));
     $result = '<script type="text/javascript" charset="utf-8">
                     function saveCoords( coords ) {
                         $("#x1").attr("value", coords.x);
                         $("#y1").attr("value", coords.y);
                         $("#x2").attr("value", coords.x2);
                         $("#y2").attr("value", coords.y2);
                         $("#cropInfo").html("' . get_string('from') . ':" + coords.x + "x" + coords.y + ", ' . get_string('size') . ': " + coords.w + "x" + coords.h);;
                     }
                     
                 $(document).ready(function(){
                     $("#cropImage").Jcrop({
                             onSelect: saveCoords
                     });
                 });
                 </script>';
     $result .= '<input type="hidden" name="x1" id="x1" value="0" />
                 <input type="hidden" name="y1" id="y1" value="0" />
                 <input type="hidden" name="x2" id="x2" value="0" />
                 <input type="hidden" name="y2" id="y2" value="0" />
                 <table>
                   <tr>
                     <td>' . lightboxgallery_make_img_tag(lightboxgallery_get_image_url($this->gallery->id, $this->image), 'cropImage') . '</td>
                   </tr>
                   <tr>
                     <td><span id="cropInfo">&nbsp;</span></td>
                   </tr>
                   <tr>
                     <td><input type="submit" value="' . get_string('savechanges') . '" /></td>
                   </tr>
                 </table>';
     return $this->enclose_in_form($result);
 }
开发者ID:itziko,项目名称:Moodle-jQuery-Lightbox-Gallery,代码行数:35,代码来源:crop.class.php

示例7: SkinBeginHtmlHead

 function SkinBeginHtmlHead(&$params)
 {
     global $Blog;
     if ($this->get_coll_setting('addthis_enabled', $Blog)) {
         require_js('//s7.addthis.com/js/300/addthis_widget.js#pubid=' . $this->get_coll_setting('addthis_publisher_id', $Blog), 'rsc_url', true);
     }
 }
开发者ID:b2evolution,项目名称:addthis_plugin,代码行数:7,代码来源:_addthis.plugin.php

示例8: output_html

 function output_html($data, $query = '')
 {
     global $CFG;
     require_js($CFG->wwwroot . '/file/repository/alfresco/rootfolder.js');
     $default = $this->get_defaultsetting();
     $repoisup = false;
     /// Validate the path, if we can.
     if ($repo = repository_factory::factory('alfresco')) {
         $repoisup = $repo->is_configured() && $repo->verify_setup();
         if ($repoisup) {
             if (empty($CFG->repository_alfresco_root_folder)) {
                 // if alfresco root folder is currently empty, set it to moodle (the default)
                 $root_folder = '/moodle';
             } else {
                 $root_folder = $CFG->repository_alfresco_root_folder;
             }
             if ($root_folder == s($data) && !empty($repo->muuid)) {
                 $valid = '<span class="pathok">&#x2714;</span>';
             } else {
                 $valid = '<span class="patherror">&#x2718;</span>';
             }
         }
     }
     if (!isset($valid)) {
         $valid = '';
     }
     $inputs = '<div class="form-file defaultsnext"><input type="text" size="48" id="' . $this->get_id() . '" name="' . $this->get_full_name() . '" value="' . s($data) . '" /> <input type="button" ' . 'onclick="return chooseRootFolder(document.getElementById(\'adminsettings\'));" value="' . get_string('chooserootfolder', 'repository_alfresco') . '" name="' . $this->get_full_name() . '"' . (!$repoisup ? ' disabled="disabled"' : '') . ' />' . $valid . '</div>';
     return format_admin_setting($this, $this->visiblename, $inputs, $this->description, true, '', $default, $query);
 }
开发者ID:remotelearner,项目名称:elis.alfresco,代码行数:29,代码来源:admin_settings_alfresco.php

示例9: init_templates

 /**
  * This function should init the templates - like adding Javascript through the {@link add_headline()} method.
  */
 function init_templates()
 {
     global $Hit;
     // This is included before controller specifc require_css() calls:
     require_css('basic_styles.css', 'rsc_url');
     // the REAL basic styles
     require_css('basic.css', 'rsc_url');
     // Basic styles
     require_css('results.css', 'rsc_url');
     // Results/tables styles
     require_css('item_base.css', 'rsc_url');
     // Default styles for the post CONTENT
     require_css('fileman.css', 'rsc_url');
     // Filemanager styles
     require_css('admin.global.css', 'rsc_url');
     // Basic admin styles
     require_css('skins_adm/chicago/rsc/css/chicago.css', true);
     if ($Hit->is_IE()) {
         require_css('admin_global_ie.css', 'rsc_url');
     }
     // CSS for IE9
     add_headline('<!--[if IE 9 ]>');
     require_css('ie9.css', 'rsc_url');
     add_headline('<![endif]-->');
     require_js('#jquery#', 'rsc_url');
     require_js('jquery/jquery.raty.min.js', 'rsc_url');
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:30,代码来源:_adminUI.class.php

示例10: display_init

    /**
     * Get ready for displaying the skin.
     */
    function display_init()
    {
        require_js('#jquery#');
        add_headline('<!--[if lte IE 6]> <script type="text/javascript"> isIE6 = true; isIE = true; </script> <![endif]-->
					  <!--[if gte IE 7]> <script type="text/javascript"> isIE = true; </script> <![endif]-->');
        require_js('resources/jquery.mystique.js', true);
        if ($this->get_setting('fancy_helper')) {
            require_js('resources/jquery.custom.fancy.js', true);
            add_headline('<!-- Add Thumbnail helper (this is optional) -->');
            require_css('resources/helpers/jquery.fancybox-thumbs.css', true);
            require_js('resources/helpers/jquery.fancybox-thumbs.js', true);
            require_css('resources/helpers/jquery.fancybox-buttons.css', true);
            require_js('resources/helpers/jquery.fancybox-buttons.js', true);
        }
        /*
        <script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
        <script language="javascript" src="/tweet/jquery.tweet.js" type="text/javascript"></script> 
        */
        if ($this->get_setting('enable_thumbshots')) {
            // Display thumbshots
            add_js_headline('jQuery(document).ready(function() {
			if( ThumbsLinks = jQuery(".bText a[href^=\'http:\']").not("[href*=\'" + window.location.host + "\']") )
			{
				ThumbshotPopups("thumbshot", ThumbsLinks);
			}
			})');
        }
        add_css_headline(' #page {font-family: ' . $this->get_setting('skin_font') . '}');
        require_css('resources/color-' . $this->get_setting('skin_color') . '.css', true);
        // call parent:
        parent::display_init();
    }
开发者ID:b2evolution,项目名称:mystique_skin,代码行数:35,代码来源:_skin.class.php

示例11: SkinBeginHtmlHead

 /** Plugin Hooks **/
 function SkinBeginHtmlHead(&$params)
 {
     global $Blog;
     if ($this->get_coll_setting('sharethis_enabled', $Blog)) {
         $url = 'http://w.sharethis.com/button/buttons.js';
         require_js($url);
         add_headline('<script type="text/javascript">stLight.options({publisher:"' . $this->get_coll_setting('sharethis_publisher_id', $Blog) . '",onhover: false});</script>');
     }
 }
开发者ID:b2evolution,项目名称:sharethis_plugin,代码行数:10,代码来源:_sharethis.plugin.php

示例12: display_init

 /**
  * Get ready for displaying the skin.
  *
  * This may register some CSS or JS...
  */
 function display_init()
 {
     // call parent:
     parent::display_init();
     // We pass NO params. This gives up the default Skins API v5 behavior.
     add_js_headline('var touch_skin_switch_confirm_text = "' . TS_('Switch to regular view? \\n \\n You can switch back again in the footer.') . '";');
     $this->require_js('js/core.js');
     require_js('navigation.js', 'blog');
 }
开发者ID:b2evolution,项目名称:touch_skin,代码行数:14,代码来源:_skin.class.php

示例13: SkinBeginHtmlHead

 function SkinBeginHtmlHead()
 {
     global $plugins_url;
     require_css($plugins_url . 'blog_selector_plugin/rsc/chosen.min.css', true);
     require_css($plugins_url . 'blog_selector_plugin/rsc/blogselector.css', true);
     require_js($plugins_url . 'blog_selector_plugin/rsc/chosen.jquery.min.js', true);
     add_js_headline("\n\t\t\t\$.noConflict();\n\t\t\tjQuery(document).ready(function(\$){\n\t\t\t  \$('select.blog_sel_w').chosen({disable_search_threshold: 6});\n\t\t\t  \$('select.blog_sel_w').bind('change', function () {\n\t\t\t\t  var url = \$(this).find(':selected').data('url')\n\t\t\t\t  if (url) { // require a URL\n\t\t\t\t\t  window.location = url; // redirect\n\t\t\t\t  }\n\t\t\t\t  return false;\n\t\t\t  });\n\t\t\t});\n\t\t");
     //require_js( $plugins_url.'blog_selector_plugin/rsc/blog.select.init.js', true );
 }
开发者ID:eminozlem,项目名称:b2-blog-selector-plugin,代码行数:9,代码来源:_blog_selector.plugin.php

示例14: moodle_optimization_register_scripts

function moodle_optimization_register_scripts($eventdata)
{
    global $CFG;
    // javascript-mod is a special case since we are caching that special in the cron
    $javascriptversion = get_field('mo_cache_versions', 'version', 'source', 'javascript-mod');
    require_js($CFG->wwwroot . '/mod/moodle_optimization/javascript-mod.js?version=' . $javascriptversion);
    // because we have included these files into javascript-mod this will stop the header from printing them
    $CFG->excludeoldflashclients = false;
    return true;
}
开发者ID:NextEinstein,项目名称:riverhills,代码行数:10,代码来源:eventslib.php

示例15: SkinBeginHtmlHead

 /** Plugin HOOKS **/
 function SkinBeginHtmlHead(&$params)
 {
     if ($this->plugin->get_coll_enabled_addon()) {
         require_js('//s7.addthis.com/js/300/addthis_widget.js#pubid=' . $this->coll_settings['addthis_publisher_id'], 'rsc_url', true);
         return true;
     } else {
         // Unknown call, Don't render this case
         return;
     }
 }
开发者ID:b2evolution,项目名称:socialshare_plugin,代码行数:11,代码来源:addthis.class.php


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