/** * Display the Javascript code to be included in <head> * * Snippet and files are included one after another in the order of call * of includeJavascriptFile & includeJavascriptSnippet methods. * * @see includeJavascriptFile * @see includeJavascriptSnippet */ public function displayJavascriptElements($params) { $c = new Combined($this->getCombinedDirectory()); if ($this->shouldIncludeFatCombined($params)) { echo $c->getScripts(array('/scripts/codendi/common.js')); } else { $this->includeSubsetOfCombined(); } $ckeditor_path = '/scripts/ckeditor-4.3.2/'; echo '<script type="text/javascript">window.CKEDITOR_BASEPATH = "' . $ckeditor_path . '";</script> <script type="text/javascript" src="' . $ckeditor_path . '/ckeditor.js"></script>'; //Javascript i18n echo '<script type="text/javascript">' . "\n"; include $GLOBALS['Language']->getContent('scripts/locale'); echo ' codendi.imgroot = \'' . $this->imgroot . '\'; ' . $this->changeColorpickerPalette() . ' </script>'; if (ForgeConfig::get('DEBUG_MODE') && (ForgeConfig::get('DEBUG_DISPLAY_FOR_ALL') || user_ismember(1, 'A'))) { echo '<script type="text/javascript" src="/scripts/codendi/debug_reserved_names.js"></script>'; } $em =& EventManager::instance(); $em->processEvent("javascript_file", null); foreach ($this->javascript as $js) { if (isset($js['file'])) { if (!$c->isCombined($js['file'])) { echo '<script type="text/javascript" src="' . $js['file'] . '"></script>' . "\n"; } } else { if (isset($js['snippet'])) { echo '<script type="text/javascript">' . "\n"; echo '//<!--' . "\n"; echo $js['snippet'] . "\n"; echo '//-->' . "\n"; echo '</script>' . "\n"; } } } echo '<script type="text/javascript">' . "\n"; $em->processEvent(Event::JAVASCRIPT, null); echo ' </script>'; }
/** * Display the Javascript code to be included in <head> * * Snippet and files are included one after another in the order of call * of includeJavascriptFile & includeJavascriptSnippet methods. * * @see includeJavascriptFile * @see includeJavascriptSnippet */ public function displayJavascriptElements() { $c = new Combined(); echo $c->getScripts(array('/scripts/codendi/common.js')); //Javascript i18n echo '<script type="text/javascript">' . "\n"; include $GLOBALS['Language']->getContent('scripts/locale'); echo ' codendi.imgroot = \'' . $this->imgroot . '\'; ' . $this->changeColorpickerPalette() . ' </script>'; if (Config::get('DEBUG_MODE') && (Config::get('DEBUG_DISPLAY_FOR_ALL') || user_ismember(1, 'A'))) { echo '<script type="text/javascript" src="/scripts/codendi/debug_reserved_names.js"></script>'; } if (Config::get('DEBUG_MODE')) { echo '<!--[if IE]><script type="text/javascript" src="http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js"></script><![endif]-->'; } $em =& EventManager::instance(); $em->processEvent("javascript_file", null); foreach ($this->javascript as $js) { if (isset($js['file'])) { if (!$c->isCombined($js['file'])) { echo '<script type="text/javascript" src="' . $js['file'] . '"></script>' . "\n"; } } else { if (isset($js['snippet'])) { echo '<script type="text/javascript">' . "\n"; echo '//<!--' . "\n"; echo $js['snippet'] . "\n"; echo '//-->' . "\n"; echo '</script>' . "\n"; } } } echo '<script type="text/javascript">' . "\n"; $em->processEvent(Event::JAVASCRIPT, null); echo ' </script>'; }
public function getSourceDir_exposed($params) { return parent::getSourceDir($params); }
private function invalidateJsCombined() { $this->logger->info('Invalidate JS combined cache'); $combined = new Combined($GLOBALS['HTML']->getCombinedDirectory()); $combined->invalidateCache(); }