/** * CSS/JS requirements */ public function requirements() { Requirements::customHeadTags(Kohana::config("globalcode.head"), 'globalcode-head'); Requirements::js("media/js/jquery.js"); Requirements::js("media/js/jquery.ui.min.js"); //Requirements::js(Kohana::config('core.site_protocol')."://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"); Requirements::js("media/js/jquery.pngFix.pack.js"); Requirements::js("media/js/jquery.timeago.js"); Requirements::css("media/css/jquery-ui-themeroller.css"); Requirements::js('media/js/global.js'); Requirements::css('media/css/global.css'); if ($this->map_enabled) { Requirements::js("media/js/OpenLayers.js"); Requirements::js("media/js/ushahidi.js"); if ($this->api_url) { Requirements::js($this->api_url); } Requirements::customJS("OpenLayers.ImgPath = '" . url::file_loc('js') . "media/img/openlayers/" . "';", 'openlayers-imgpath'); Requirements::css("media/css/openlayers.css"); } if ($this->hovertip_enabled) { Requirements::js('media/js/jquery.hovertip-1.0.js'); Requirements::css('media/css/jquery.hovertip-1.0.css', ''); Requirements::customJS("\$(function() {\n\t\t\t\t\t\tif(\$('.tooltip[title]') != null)\n\t\t\t\t\t\t\$('.tooltip[title]').hovertip();\n\t\t\t\t\t});", 'tooltip-js'); } if ($this->slider_enabled) { Requirements::js('media/js/selectToUISlider.jQuery.js'); } if ($this->timeline_enabled) { Requirements::js("media/js/jquery.jqplot.min.js"); Requirements::css("media/css/jquery.jqplot.min.css"); Requirements::js("media/js/jqplot.dateAxisRenderer.min.js"); Requirements::js("media/js/jqplot.barRenderer.min.js"); // HT: added for bar graph Requirements::js("media/js/jqplot.pointLabels.min.js"); // HT: added for showing point label } if ($this->treeview_enabled) { Requirements::css("media/css/jquery.treeview.css"); Requirements::js("media/js/jquery.treeview.js"); } // Load ProtoChart if ($this->protochart_enabled) { Requirements::customJS("jQuery.noConflict()", 'jquery-noconflict'); Requirements::js('media/js/protochart/prototype.js'); Requirements::customHeadTags('<!--[if IE]>' . html::script(url::file_loc('js') . 'media/js/protochart/excanvas-compressed', TRUE) . '<![endif]-->', 'ie-excanvas-compressed'); Requirements::js('media/js/protochart/ProtoChart.js'); } // Load Raphael if ($this->raphael_enabled) { // The only reason we include prototype is to keep the div element naming convention consistent //Requirements::js('media/js/protochart/prototype.js'); Requirements::js('media/js/raphael.js'); Requirements::customJS('var impact_json = ' . $this->impact_json . ';', 'impact_json'); Requirements::js('media/js/raphael-ushahidi-impact.js'); } if ($this->validator_enabled) { Requirements::js("media/js/jquery.validate.min.js"); } if ($this->photoslider_enabled) { Requirements::css("media/css/picbox/picbox.css"); Requirements::js("media/js/picbox.js"); } if ($this->colorpicker_enabled) { Requirements::css("media/css/colorpicker.css"); Requirements::js("media/js/colorpicker.js"); } // Load jwysiwyg if ($this->editor_enabled) { Requirements::css('media/js/jwysiwyg/jquery.wysiwyg.css'); Requirements::css('media/js/jwysiwyg/plugins/fileManager/wysiwyg.fileManager.css'); if (Kohana::config("cdn.cdn_ignore_jwysiwyg") == TRUE) { Requirements::js(url::file_loc('ignore') . 'media/js/jwysiwyg/jquery.wysiwyg.js'); // not sure what the hell to do about this Requirements::js(url::file_loc('ignore') . 'media/js/jwysiwyg/controls/wysiwyg.link.js'); Requirements::js(url::file_loc('ignore') . 'media/js/jwysiwyg/controls/wysiwyg.image.js'); Requirements::js(url::file_loc('ignore') . 'media/js/jwysiwyg/controls/wysiwyg.table.js'); Requirements::js(url::file_loc('ignore') . 'media/js/jwysiwyg/plugins/wysiwyg.fullscreen.js'); Requirements::js(url::file_loc('ignore') . 'media/js/jwysiwyg/plugins/wysiwyg.rmFormat.js'); Requirements::js(url::file_loc('ignore') . 'media/js/jwysiwyg/plugins/wysiwyg.fileManager.js'); } else { Requirements::js('media/js/jwysiwyg/jquery.wysiwyg.js'); Requirements::js('media/js/jwysiwyg/controls/wysiwyg.link.js'); Requirements::js('media/js/jwysiwyg/controls/wysiwyg.image.js'); Requirements::js('media/js/jwysiwyg/controls/wysiwyg.table.js'); Requirements::js('media/js/jwysiwyg/plugins/wysiwyg.fullscreen.js'); Requirements::js('media/js/jwysiwyg/plugins/wysiwyg.rmFormat.js'); Requirements::js('media/js/jwysiwyg/plugins/wysiwyg.fileManager.js'); } } // Table Row Sort if ($this->tablerowsort_enabled) { Requirements::js('media/js/jquery.tablednd_0_5.js'); } // JSON2 for IE+ if ($this->json2_enabled) { Requirements::js('media/js/json2.js'); } if ($this->datepicker_enabled) { Requirements::customJS("\n\t\t\t\tDate.dayNames = [\n\t\t\t\t '" . Kohana::lang('datetime.sunday.full') . "',\n\t\t\t\t '" . Kohana::lang('datetime.monday.full') . "',\n\t\t\t\t '" . Kohana::lang('datetime.tuesday.full') . "',\n\t\t\t\t '" . Kohana::lang('datetime.wednesday.full') . "',\n\t\t\t\t '" . Kohana::lang('datetime.thursday.full') . "',\n\t\t\t\t '" . Kohana::lang('datetime.friday.full') . "',\n\t\t\t\t '" . Kohana::lang('datetime.saturday.full') . "'\n\t\t\t\t];\n\t\t\t\tDate.abbrDayNames = [\n\t\t\t\t '" . Kohana::lang('datetime.sunday.abbv') . "',\n\t\t\t\t '" . Kohana::lang('datetime.monday.abbv') . "',\n\t\t\t\t '" . Kohana::lang('datetime.tuesday.abbv') . "',\n\t\t\t\t '" . Kohana::lang('datetime.wednesday.abbv') . "',\n\t\t\t\t '" . Kohana::lang('datetime.thursday.abbv') . "',\n\t\t\t\t '" . Kohana::lang('datetime.friday.abbv') . "',\n\t\t\t\t '" . Kohana::lang('datetime.saturday.abbv') . "'\n\t\t\t\t];\n\t\t\t\tDate.monthNames = [\n\t\t\t\t '" . Kohana::lang('datetime.january.full') . "',\n\t\t\t\t '" . Kohana::lang('datetime.february.full') . "',\n\t\t\t\t '" . Kohana::lang('datetime.march.full') . "',\n\t\t\t\t '" . Kohana::lang('datetime.april.full') . "',\n\t\t\t\t '" . Kohana::lang('datetime.may.full') . "',\n\t\t\t\t '" . Kohana::lang('datetime.june.full') . "',\n\t\t\t\t '" . Kohana::lang('datetime.july.full') . "',\n\t\t\t\t '" . Kohana::lang('datetime.august.full') . "',\n\t\t\t\t '" . Kohana::lang('datetime.september.full') . "',\n\t\t\t\t '" . Kohana::lang('datetime.october.full') . "',\n\t\t\t\t '" . Kohana::lang('datetime.november.full') . "',\n\t\t\t\t '" . Kohana::lang('datetime.december.full') . "'\n\t\t\t\t];\n\t\t\t\tDate.abbrMonthNames = [\n\t\t\t\t '" . Kohana::lang('datetime.january.abbv') . "',\n\t\t\t\t '" . Kohana::lang('datetime.february.abbv') . "',\n\t\t\t\t '" . Kohana::lang('datetime.march.abbv') . "',\n\t\t\t\t '" . Kohana::lang('datetime.april.abbv') . "',\n\t\t\t\t '" . Kohana::lang('datetime.may.abbv') . "',\n\t\t\t\t '" . Kohana::lang('datetime.june.abbv') . "',\n\t\t\t\t '" . Kohana::lang('datetime.july.abbv') . "',\n\t\t\t\t '" . Kohana::lang('datetime.august.abbv') . "',\n\t\t\t\t '" . Kohana::lang('datetime.september.abbv') . "',\n\t\t\t\t '" . Kohana::lang('datetime.october.abbv') . "',\n\t\t\t\t '" . Kohana::lang('datetime.november.abbv') . "',\n\t\t\t\t '" . Kohana::lang('datetime.december.abbv') . "'\n\t\t\t\t];\n\t\t\t\tDate.firstDayOfWeek = 1;\n\t\t\t\tDate.format = 'mm/dd/yyyy';\n\t\t\t", 'locale-dates'); Requirements::js('media/js/jquery.datePicker.js'); Requirements::customHeadTags('<!--[if IE]>' . html::script(url::file_loc('js') . 'media/js/jquery.bgiframe.min', TRUE) . '<![endif]-->', 'jquery.bgiframe.min'); } // JS base combines $base_js = array('media/js/jquery.js', 'media/js/jquery.ui.min.js', 'media/js/jquery.pngFix.pack.js', 'media/js/jquery.timeago.js', 'media/js/global.js', 'media/js/jquery.treeview.js', 'media/js/selectToUISlider.jQuery.js', 'media/js/jquery.validate.min.js', 'media/js/colorpicker.js'); if ($this->timeline_enabled) { $base_js[] = 'media/js/jquery.jqplot.min.js'; $base_js[] = 'media/js/jqplot.dateAxisRenderer.min.js'; $base_js[] = 'media/js/jqplot.barRenderer.min.js'; // HT: added for bar graph $base_js[] = 'media/js/jqplot.pointLabels.min.js'; // HT: added for showing point label } Requirements::combine_files('0_base.js', $base_js); // CSS base combines $base_css = array('media/css/jquery-ui-themeroller.css', 'media/css/global.css', 'media/css/openlayers.css', 'media/css/jquery.treeview.css', 'media/css/colorpicker.css'); if ($this->timeline_enabled) { $base_css[] = 'media/css/jquery.jqplot.min.css'; } Requirements::combine_files('0_base.css', $base_css); Event::run('ushahidi_action.themes_add_requirements_pre_theme', $this); if ($this->admin) { $this->admin_requirements(); // JP: Add _global.css file, if found. foreach (self::$theme_css as $css) { if (!strcmp(end(explode("/", $css)), "_global.css")) { Requirements::css($css); } } } if ($this->frontend) { $this->frontend_requirements(); } // Inline Javascript if (!empty($this->js)) { //@todo add deprecated warning Requirements::customJS($this->js, 'pagejs'); } Event::run('ushahidi_action.themes_add_requirements', $this); }