contributions/javascript.jqueryui/behaviour/base/javascript.jqueryui.eventsink.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * EventSink to catch JCSSManager events 00004 * 00005 * @author Gerd Riesselmann 00006 * @ingroup JQueryUI 00007 */ 00008 class JavascriptJQueryUIEventSink implements IEventSink { 00009 /** 00010 * Invoked to handle events 00011 * 00012 * Events can be anything, and they are invoked through the router 00013 * One event is "cron", it has no parameters 00014 * 00015 * @param string Event name 00016 * @param mixed Event parameter(s) 00017 */ 00018 public function on_event($event_name, $event_params, &$result) { 00019 if ($event_name == 'jcssmanager_compress' || $event_name == 'jcssmanager_collect') { 00020 switch($event_params) { 00021 case JCSSManager::TYPE_JS: 00022 if ($event_name == 'jcssmanager_collect' && JQueryUI::uses_cdn()) { 00023 $result[] = JQueryUI::get_cdn_url(); 00024 } 00025 foreach(JQueryUI::get_js_paths(JQueryUI::get_enabled_components()) as $js) { 00026 $result[] = $js; 00027 } 00028 break; 00029 case JCSSManager::TYPE_CSS: 00030 foreach(JQueryUI::get_css_paths(JQueryUI::get_enabled_components()) as $css) { 00031 $result[] = $css; 00032 } 00033 break; 00034 } 00035 } 00036 } 00037 }