Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Sedo_LoadCssVariable_Listener
- {
- public static $loaderOjb;
- public static function initDependencies(XenForo_Dependencies_Abstract $dependencies, array $data)
- {
- XenForo_Template_Helper_Core::$helperCallbacks['variable_css'] = array('Sedo_LoadCssVariable_Listener', 'getCssVariable');
- }
- public static function getCssVariable($methodName, array $options = array())
- {
- if(!self::$loaderOjb)
- {
- self::$loaderOjb = new Sedo_LoadCssVariable_Loader($methodName, $options);
- }
- else
- {
- self::$loaderOjb->loadNewOptions($methodName, $options);
- }
- return self::$loaderOjb->$methodName();
- }
- }
- class Sedo_LoadCssVariable_Loader
- {
- protected $_currentMethodCalled;
- protected $_options;
- public function __construct($methodName, array $options = array())
- {
- $this->_currentMethodCalled = $methodName;
- $this->_options[$methodName] = $options;
- }
- public function loadNewOptions($methodName, array $options = array())
- {
- $this->_currentMethodCalled = $methodName;
- $this->_options[$methodName] = $options;
- }
- public function getcurrentOptions()
- {
- if(isset($this->_options[$this->_currentMethodCalled]))
- {
- return $this->_options[$this->_currentMethodCalled];
- }
- return array();
- }
- public function __call($name, $arguments)
- {
- return 'Unknown method';
- }
- /**
- * Custom functions
- */
- public function getBlackColor()
- {
- return 'black';
- }
- public function getCustomProperties()
- {
- return array('color'=>'blue', 'background-color'=>'red', 'border-color' => 'yellow');
- }
- }
- //Zend_Debug::dump($abc);
Advertisement
Add Comment
Please, Sign In to add comment