Exemplo n.º 1
1
 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";
     }
 }
Exemplo n.º 2
0
 /**
  * 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');
     }
 }
Exemplo n.º 3
0
 function print_header()
 {
     global $CFG;
     popup_form('admin.php?type=' . $this->type . '&amp;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);
 }
Exemplo n.º 4
0
 /**
  * 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');
     }
 }
Exemplo n.º 5
0
 /**
  * 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');
 }
 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);
 }
 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);
     }
 }
 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);
 }
Exemplo n.º 9
0
 /**
  * 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');
 }
Exemplo n.º 10
0
    /**
     * 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();
    }
 /** 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>');
     }
 }
Exemplo n.º 12
0
 /**
  * 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');
 }
 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 );
 }
Exemplo n.º 14
0
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;
}
 /** 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;
     }
 }
Exemplo n.º 16
0
 /**
  * @see Plugin::SkinBeginHtmlHead()
  */
 function SkinBeginHtmlHead(&$params)
 {
     require_css('http://vjs.zencdn.net/c/video-js.css', 'relative');
     require_js('http://vjs.zencdn.net/c/video.js', 'relative');
     $this->require_skin();
     // Set a video size in css style, because option setting is ignored by some reason
     $width = (int) $this->Settings->get('width');
     $width = empty($width) ? '100%' : $width . 'px';
     $height = (int) $this->Settings->get('height');
     add_css_headline('.video-js{ width: ' . $width . ' !important; height: ' . $height . 'px !important; }');
 }
Exemplo n.º 17
0
    /**
     * Include JS/CSS files in HTML head
     *
     * @param boolean|string Is the file's path relative to the base path/url?
     */
    function init_html_head($relative_to)
    {
        global $Blog;
        if (!isset($Blog) || $this->get_coll_setting('coll_apply_rendering', $Blog) == 'never' && $this->get_coll_setting('coll_apply_comment_rendering', $Blog) == 'never') {
            // Don't load css/js files when plugin is not enabled
            return;
        }
        require_css($this->get_plugin_url(true) . 'infodots.css', $relative_to);
        // Bubbletip
        require_js('#jquery#', $relative_to);
        require_js('jquery/jquery.bubbletip.min.js', $relative_to);
        require_css('jquery/jquery.bubbletip.css', $relative_to);
        add_js_headline('jQuery( document ).ready( function()
{
	jQuery( ".infodots_dot" ).each( function()
	{ // Check what dot we can show on the page
		if( jQuery( "#" + jQuery( this ).attr( "rel" ) ).length )
		{ // Display dot if a content exists
			jQuery( this ).show();
		}
		else
		{ // Remove dot from the page, probably this dot appears after <more> separator
			jQuery( this ).remove();
		}
	} );

	jQuery( ".infodots_dot" ).mouseover( function()
	{
		var tooltip_obj = jQuery( "#" + jQuery( this ).attr( "rel" ) );
		if( tooltip_obj.length )
		{ // Init bubbletip for point once
			if( typeof( infodots_bubbletip_wrapperContainer ) == "undefined" ||
			    jQuery( infodots_bubbletip_wrapperContainer ).length == 0 )
			{ // Check for correct container
				infodots_bubbletip_wrapperContainer = "body";
			}

			jQuery( this ).bubbletip( tooltip_obj,
			{
				showOnInit: true,
				deltaShift: -5,
				wrapperContainer: infodots_bubbletip_wrapperContainer,
			} );
		}
		jQuery( this ).addClass( "hovered" );
	} )
	.bind( "click", function()
	{ // Duplicate this event for "touch" devices
		jQuery( this ).mouseover();
	} );
} );');
    }
Exemplo n.º 18
0
 /**
  * Display doctype + <head>...</head> section
  */
 function disp_html_head()
 {
     global $mode, $rsc_url, $adminskins_path;
     require_css('skins_adm/legacy/rsc/css/variation.css', TRUE, 'Variation');
     require_css('skins_adm/legacy/rsc/css/desert.css', TRUE, 'Desert');
     require_css('skins_adm/legacy/rsc/css/legacy.css', TRUE, 'Legacy');
     if (is_file($adminskins_path . '/legacy/rsc/css/custom.css')) {
         require_css('skins_adm/legacy/rsc/css/custom.css', TRUE, 'Custom');
     }
     // Style switcher:
     require_js('styleswitcher.js');
     parent::disp_html_head();
 }
 /** Plugin HOOKS **/
 function SkinBeginHtmlHead(&$params)
 {
     if ($this->plugin->get_coll_enabled_addon()) {
         global $Blog;
         $url = "http://w.sharethis.com/widget/?tabs=web%2Cpost%2Cemail&amp;charset=utf-8&amp;services=";
         $url .= urlencode($this->coll_settings['sharethis_services']);
         $url .= '&amp;style=default&amp;publisher=' . $this->coll_settings['sharethis_publisher_id'];
         require_js($url);
         return true;
     } else {
         // Unknown call, Don't render this case
         return;
     }
 }
Exemplo n.º 20
0
/**
 *
 * @staticvar bool $done
 */
function form_init_date_js()
{
    global $PAGE, $CFG;
    static $done = false;
    if (!$done) {
        echo '<style type="text/css">';
        echo '@import "' . $CFG->httpswwwroot . '/lib/yui/assets/skins/sam/calendar.css";';
        echo '</style>';
        require_js(array('yui_dom-event', 'yui_yahoo', 'yui_event', ajax_get_lib('yui_calendar'), ajax_get_lib('yui_container')));
        require_js($CFG->wwwroot . '/curriculum/form/javascript-static.js');
        echo '<script type="text/javascript">init_date_selectors("' . get_string('firstdayofweek') . '");</script>';
        $done = true;
    }
}
 /**
  * Performs the default action (display the report specified by URL)
  */
 function action_default()
 {
     global $CFG;
     //import necessary CSS
     $stylesheet_web_path = $CFG->wwwroot . '/blocks/php_report/styles.php';
     echo '<style>@import url("' . $stylesheet_web_path . '");</style>';
     //needed for AJAX calls
     require_js(array('yui_yahoo', 'yui_dom', 'yui_event', 'yui_connection', "{$CFG->wwwroot}/curriculum/js/associate.class.js", "{$CFG->wwwroot}/blocks/php_report/throbber.php"));
     //set up JS work to contain dynamic output in the report div
     //(make sure to do this before rendering the report because report rendering
     //may "die" after showing parameters
     echo "\n        <script>\n          my_handler = new associate_link_handler('{$CFG->wwwroot}/blocks/php_report/dynamicreport.php',\n                                                  'php_report_body_{$this->report_shortname}');\n        </script>";
     //output the report contents
     $this->report_instance->main('', '', 0, 20, '', $this->report_shortname);
 }
Exemplo n.º 22
0
 /**
  * This function should init the templates - like adding Javascript through the {@link add_headline()} method.
  */
 function init_templates()
 {
     global $Messages, $debug, $Hit, $check_browser_version;
     // This is included before controller specifc require_css() calls:
     require_css('results.css', 'rsc_url');
     // Results/tables styles
     require_js('#jquery#', 'rsc_url');
     require_js('jquery/jquery.raty.min.js', 'rsc_url');
     require_js('#bootstrap#', 'rsc_url');
     require_css('#bootstrap_css#', 'rsc_url');
     // require_css( '#bootstrap_theme_css#', 'rsc_url' );
     require_js('#bootstrap_typeahead#', 'rsc_url');
     // JS to init Bootstrap tooltips (E.g. on badges with title "Admin"):
     add_js_headline('jQuery( function () { jQuery( \'[data-toggle="tooltip"]\' ).tooltip() } )');
     if ($debug) {
         // Use readable CSS:
         // rsc/less/bootstrap-basic_styles.less
         // rsc/less/bootstrap-basic.less
         // rsc/less/bootstrap-evoskins.less
         require_css('bootstrap-backoffice-b2evo_base.bundle.css', 'rsc_url');
         // Concatenation of the above
     } else {
         // Use minified CSS:
         require_css('bootstrap-backoffice-b2evo_base.bmin.css', 'rsc_url');
         // Concatenation + Minifaction of the above
     }
     // Make sure standard CSS is called ahead of custom CSS generated below:
     if ($debug) {
         // Use readable CSS:
         require_css('skins_adm/bootstrap/rsc/css/style.css', 'relative');
         // Relative to <base> tag (current skin folder)
     } else {
         // Use minified CSS:
         require_css('skins_adm/bootstrap/rsc/css/style.min.css', 'relative');
         // Relative to <base> tag (current skin folder)
     }
     // Set bootstrap css classes for messages
     $Messages->set_params(array('class_outerdiv' => 'action_messages container-fluid', 'class_success' => 'alert alert-dismissible alert-success fade in', 'class_warning' => 'alert alert-dismissible alert-warning fade in', 'class_error' => 'alert alert-dismissible alert-danger fade in', 'class_note' => 'alert alert-dismissible alert-info fade in', 'before_message' => '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span></button>'));
     // Initialize font-awesome icons and use them as a priority over the glyphicons, @see get_icon()
     init_fontawesome_icons('fontawesome-glyphicons');
     if ($check_browser_version && $Hit->get_browser_version() > 0 && $Hit->is_IE(9, '<')) {
         // Display info message if browser IE < 9 version and it is allowed by config var:
         $Messages->add(T_('Your web browser is too old. For this site to work correctly, we recommend you use a more recent browser.'), 'note');
         if ($debug) {
             $Messages->add('User Agent: ' . $Hit->get_user_agent(), 'note');
         }
     }
 }
Exemplo n.º 23
0
 function get_content()
 {
     global $CFG;
     require_js('http://maps.google.com/maps/api/js?sensor=true');
     static $content = false;
     if ($content !== false) {
         return $content;
         // blocks get generated multiple times per page
     }
     $this->content = new stdClass();
     $uniqueid = 'google-map-' . $this->instance->id;
     $settings = new stdClass();
     $settings->mapcenter = !empty($this->config->center) ? $this->config->center : 0;
     $settings->zoom = !empty($this->config->zoom) ? $this->config->zoom : 9;
     $settings->mapCanvasId = $uniqueid;
     $markersarray = array();
     if (!empty($this->config->markers)) {
         foreach ($this->config->markers as $key => $marker) {
             $markersarray[$marker] = '';
             if (!empty($this->config->markerbubbles[$key])) {
                 $markersarray[$marker] = $this->config->markerbubbles[$key];
             }
         }
     }
     $settings->markers = $markersarray;
     if (!empty($this->config->polypoints)) {
         $settings->polygons = array();
         foreach ($this->config->polypoints as $key => $latlng) {
             $polygon = new stdClass();
             $polygon->latlng = !empty($this->config->polypoints[$key]) ? $this->config->polypoints[$key] : '';
             $polygon->hex = !empty($this->config->polyhex[$key]) ? $this->config->polyhex[$key] : '';
             $polygon->fillopacity = !empty($this->config->polyfillopacity[$key]) ? $this->config->polyfillopacity[$key] : 0;
             $polygon->strokeopacity = !empty($this->config->polylineopacity[$key]) ? $this->config->polylineopacity[$key] : 0;
             $settings->polygons[] = (array) $polygon;
         }
     }
     $settings = json_encode($settings);
     $width = !empty($this->config->width) ? $this->config->width : 200;
     $height = !empty($this->config->height) ? $this->config->height : 200;
     $content = "<div class=\"google-map\" id=\"{$uniqueid}\" style=\"width: {$width}px; height: {$height}px;\"></div>";
     $content .= "<script type=\"text/javascript\">\n                        jQuery(document).ready(function () {\n                            googlemap.initialize({$settings});\n                        });\n                     </script>";
     $this->content->text = $content;
     $this->content->footer = '';
     return $this->content;
 }
Exemplo n.º 24
0
 function SkinBeginHtmlHead(&$params)
 {
     global $plugins_url;
     $plug_url = $this->get_plugin_url();
     require_js($plug_url . 'res/jquery.nivo.slider.pack.js', TRUE);
     require_js('#jquery#');
     // Load themes
     $themes = array('bar', 'dark', 'default', 'light');
     $use_themes = $this->Settings->get('use_themes');
     if ($use_themes) {
         foreach ($themes as $theme) {
             require_css($plugins_url . 'b2nivo_plugin/themes/' . $theme . '/' . $theme . '.css');
         }
     } else {
         require_css($plugins_url . 'b2nivo_plugin/themes/default/default.css');
     }
     require_css($plugins_url . 'b2nivo_plugin/res/nivo-slider.css');
 }
Exemplo n.º 25
0
/**
 * Used to include JavaScript libraries.
 *
 * When the $lib parameter is given, the function will add $lib to an
 * internal list of libraries. When called without any parameters, it will
 * return the html that is needed to load the JavaScript libraries in that
 * list. Libraries that are included more than once will still only get loaded
 * once, so this works like require_once() in PHP.
 *
 * @param $lib - string or array of strings
 *               string(s) should be the shortname for the library or the
 *               full path to the library file.
 * @return string or false or nothing.
 */
function require_js($lib = '')
{
    global $CFG;
    static $loadlibs = array();
    if (!ajaxenabled()) {
        //return false;
    }
    if (!empty($lib)) {
        // Add the lib to the list of libs to be loaded, if it isn't already
        // in the list.
        if (is_array($lib)) {
            array_map('require_js', $lib);
        } else {
            $libpath = ajax_get_lib($lib);
            if (array_search($libpath, $loadlibs) === false) {
                $loadlibs[] = $libpath;
                // If this is called after header, then we print it right away
                // as otherwise nothing will ever happen!
                if (defined('HEADER_PRINTED')) {
                    $realloadlibs = $loadlibs;
                    $loadlibs = array($libpath);
                    print require_js();
                    $loadlibs = $realloadlibs;
                }
            }
        }
    } else {
        // Return the html needed to load the JavaScript files defined in
        // our list of libs to be loaded.
        $output = '';
        foreach ($loadlibs as $loadlib) {
            $output .= '<script type="text/javascript" ';
            $output .= " src=\"{$loadlib}\"></script>\n";
            if ($loadlib == $CFG->wwwroot . '/lib/yui/logger/logger-min.js') {
                // Special case, we need the CSS too.
                $output .= '<link type="text/css" rel="stylesheet" ';
                $output .= " href=\"{$CFG->wwwroot}/lib/yui/logger/assets/logger.css\" />\n";
            }
        }
        return $output;
    }
}
Exemplo n.º 26
0
 /**
  * Return HTML for insertion in the head of a document to include Marginalia Javascript
  * and initialize Marginalia.  If necessary, also creates relevant user preferences 
  * (necessary for Marginalia to function correctly).
  */
 public static function header_html()
 {
     global $CFG, $USER;
     $anscripts = listMarginaliaJavascript();
     for ($i = 0; $i < count($anscripts); ++$i) {
         require_js(ANNOTATION_PATH . '/marginalia/' . $anscripts[$i]);
     }
     require_js(array(ANNOTATION_PATH . '/marginalia-config.js', ANNOTATION_PATH . '/marginalia-strings.js', ANNOTATION_PATH . '/smartquote.js', ANNOTATION_PATH . '/MoodleMarginalia.js'));
     // Bits of YUI
     require_js(array($CFG->wwwroot . '/lib/yui/yahoo-dom-event/yahoo-dom-event.js', $CFG->wwwroot . '/lib/yui/autocomplete/autocomplete-min.js'));
     $meta = "<link rel='stylesheet' type='text/css' href='" . s($CFG->wwwroot) . "/lib/yui/autocomplete/assets/skins/sam/autocomplete.css'/>\n" . "<link rel='stylesheet' type='text/css' href='" . s(ANNOTATION_PATH) . "/marginalia/marginalia.css'/>\n" . "<link rel='stylesheet' type='text/css' href='" . s(ANNOTATION_PATH) . "/annotation-styles.php'/>\n";
     /*		Hack for attempt to get this working with the block:
     		$meta = "<script type='text/javascript'>\n"
     			."  domutil.loadStylesheet( '".s($CFG->wwwroot)."/lib/yui/autocomplete/assets/skins/sam/autocomplete.css');\n"
     			."  domutil.loadStylesheet( '".ANNOTATION_PATH.'/marginalia/marginalia.css'."');\n"
     			."  domutil.loadStylesheet( '".ANNOTATION_PATH.'/annotation-styles.php'."');\n"
     			."</script>\n";
     */
     return $meta;
 }
Exemplo n.º 27
0
    /**
     * @see Plugin::SkinBeginHtmlHead()
     */
    function SkinBeginHtmlHead(&$params)
    {
        $relative_to = is_admin_page() ? 'rsc_url' : 'blog';
        require_js('#flowplayer#', $relative_to);
        add_js_headline('flowplayer.conf = { flashfit: true, embed: false }');
        $this->require_skin();
        add_css_headline('.flowplayer_block {
	margin: 1em auto 0;
	background: #000;
}
.flowplayer_block .flowplayer {
	display: block;
	margin: auto;
}
.flowplayer_text {
	font-size: 84%;
	text-align: center;
	margin: 4px 0;
}');
    }
Exemplo n.º 28
0
 function output()
 {
     require_js(array('scripts/prototype.js', 'scripts/scriptaculous.js', 'scripts/effects.js', 'scripts/builder.js', 'scripts/dragdrop.js', 'scripts/cropper.js'));
     $result = '<script type="text/javascript" charset="utf-8">
                     function onEndCrop( coords, dimensions ) {
                         $( \'x1\' ).value = coords.x1;
                         $( \'y1\' ).value = coords.y1;
                         $( \'x2\' ).value = coords.x2;
                         $( \'y2\' ).value = coords.y2;
                         $( \'cropInfo\' ).innerHTML = \'' . get_string('from') . ': \' + coords.x1 + \'x\' + coords.y1 + \', ' . get_string('size') . ': \' + dimensions.width + \'x\' + dimensions.height;
                     }
                     Event.observe( 
                         window, 
                         \'load\', 
                         function() { 
                             new Cropper.Img( 
                                 \'cropImage\',
                                 {
                                     onEndCrop: onEndCrop 
                                 }
                             ) 
                         }
                     );
                 </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);
 }
Exemplo n.º 29
0
 /**
  * Get ready for displaying the skin.
  *
  * This may register some CSS or JS...
  */
 function display_init()
 {
     global $disp;
     // Request some common features that the parent function (Skin::display_init()) knows how to provide:
     parent::display_init(array('font_awesome', 'b2evo_base_css', 'colorbox', 'disp_auto'));
     // require_css( 'pureforums_header.css', 'relative' );
     // require_css( 'pureforums_main.css', 'relative' );
     // require_css( 'pureforums_footer.css', 'relative' );
     // require_css( 'pureforums.bundle.css', 'relative' ); // Concatenation of the above
     require_css('pureforums.bmin.css', 'relative');
     // Concatenation + Minifaction of the above
     if ($this->get_setting('width_switcher')) {
         // Functions to switch between the width sizes
         require_js('#jquery#', 'blog');
         require_js('widthswitcher.js', 'blog');
     }
     if (in_array($disp, array('single', 'page', 'comments'))) {
         // Load jquery UI to animate background color on change comment status or on vote
         require_js('#jqueryUI#', 'blog');
     }
 }
Exemplo n.º 30
0
    /**
     * @see Plugin::SkinBeginHtmlHead()
     */
    function SkinBeginHtmlHead(&$params)
    {
        global $Blog;
        $relative_to = is_admin_page() ? 'rsc_url' : 'blog';
        require_css('#videojs_css#', $relative_to);
        require_js('#videojs#', $relative_to);
        $this->require_skin();
        // Set a video size in css style, because option setting is ignored by some reason
        $width = intval($this->get_coll_setting('width', $Blog));
        $width = empty($width) ? '100%' : $width . 'px';
        $height = intval($this->get_coll_setting('height', $Blog));
        add_css_headline('.video-js{ width: ' . $width . ' !important; max-width: 100% !important; height: ' . $height . 'px !important; margin: auto; }
.videojs_block {
	margin: 0 auto 1em;
}
.videojs_block .videojs_text {
	font-size: 84%;
	text-align: center;
	margin: 4px 0;
}');
    }