_container = $registry[__CLASS__]; } /** * Return jQuery View Helper class, to execute jQuery library related functions. * * @return ZendX_JQuery_View_Helper_JQuery_Container */ public function jQuery() { return $this->_container; } /** * Set view object * * @param Zend_View_Interface $view * @return void */ public function setView(Zend_View_Interface $view) { $this->view = $view; $this->_container->setView($view); } /** * Proxy to container methods * * @param string $method * @param array $args * @return mixed * @throws Zend_View_Exception For invalid method calls */ public function __call($method, $args) { if (!method_exists($this->_container, $method)) { require_once 'Zend/View/Exception.php'; throw new Zend_View_Exception(sprintf('Invalid method "%s" called on jQuery view helper', $method)); } return call_user_func_array(array($this->_container, $method), $args); } /** * Enable the jQuery internal noConflict Mode to work with * other Javascript libraries. Will setup jQuery in the variable * $j instead of $ to overcome conflicts. * * @link http://docs.jquery.com/Using_jQuery_with_Other_Libraries */ public static function enableNoConflictMode() { self::$noConflictMode = true; } /** * Disable noConflict Mode of jQuery if this was previously enabled. * * @return void */ public static function disableNoConflictMode() { self::$noConflictMode = false; } /** * Return current status of the jQuery no Conflict Mode * * @return Boolean */ public static function getNoConflictMode() { return self::$noConflictMode; } /** * Return current jQuery handler based on noConflict mode settings. * * @return String */ public static function getJQueryHandler() { return ((self::getNoConflictMode()==true)?'$j':'$'); } }