Exemplo n.º 1
0
 /**
  * Renders all javascript file related stuff of the MooTools enviroment.
  *
  * @return string
  */
 protected function _renderScriptTags()
 {
     $scriptTags = '';
     if (($this->getRenderMode() & ZendX_MooTools::RENDER_LIBRARY) > 0) {
         $source = $this->_getMooToolsLibraryPath();
         $scriptTags .= '<script type="text/javascript" src="' . $source . '"></script>' . PHP_EOL;
         if ($this->mooreIsEnabled()) {
             $moorePath = $this->_getMooToolsMooreLibraryPath();
             $scriptTags .= '<script type="text/javascript" src="' . $moorePath . '"></script>' . PHP_EOL;
         }
         if (ZendX_MooTools_View_Helper_MooTools::getNoSafeMode() == true) {
             $scriptTags .= '<script type="text/javascript">var $ = document.id;</script>' . PHP_EOL;
         }
     }
     if (($this->getRenderMode() & ZendX_MooTools::RENDER_SOURCES) > 0) {
         foreach ($this->getJavascriptFiles() as $javascriptFile) {
             $scriptTags .= '<script type="text/javascript" src="' . $javascriptFile . '"></script>' . PHP_EOL;
         }
     }
     return $scriptTags;
 }
Exemplo n.º 2
0
 public function testUsingNoConflictMode()
 {
     ZendX_MooTools_View_Helper_MooTools::enableNoSafeMode();
     $this->helper->setVersion("1.2.4");
     $this->helper->enable();
     $render = $this->helper->__toString();
     $this->assertContains('var $ = document.id;', $render);
 }
Exemplo n.º 3
0
 /**
  * Disable safe Mode of MooTools if this was previously enabled.
  *
  * @return void
  */
 public static function disableNoSafeMode()
 {
     self::$noSafeMode = false;
 }