contributions/javascript.jquery/behaviour/base/javscript.jquery.eventsink.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * EventSink to deal with JCSSManager events 00004 * 00005 * @author Gerd Riesselmann 00006 * @ingroup JQuery 00007 */ 00008 class JavascriptJQueryEventSink 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 switch ($event_name) { 00020 case 'jcssmanager_compress': 00021 if ($event_params == JCSSManager::TYPE_JS && Config::get_value(ConfigJQuery::CDN) == '') { 00022 array_unshift($result, 'js/jquery.js'); 00023 } 00024 break; 00025 case 'jcssmanager_collect': 00026 if ($event_params == JCSSManager::TYPE_JS && Config::has_feature(ConfigJQuery::ON_EVERY_PAGE)) { 00027 array_unshift($result, JQuery::get_path()); 00028 } 00029 break; 00030 } 00031 } 00032 }