示例#1
0
 /**
  * Fetch system scripts
  *
  * @param bool $render If true, a string will be returned of rendered script for header
  * @param bool $includeEditor
  *
  * @return array|string
  */
 public function getSystemScripts($render = false, $includeEditor = false)
 {
     $assets = $this->assetHelper->getAssets();
     if ($includeEditor) {
         $assets['js'] = array_merge($assets['js'], $this->getFroalaScripts());
     }
     if ($render) {
         $js = '';
         if (isset($assets['js'])) {
             foreach ($assets['js'] as $url) {
                 $js .= '<script src="' . $this->getUrl($url) . '" data-source="mautic"></script>' . "\n";
             }
         }
         return $js;
     }
     return $assets['js'];
 }
示例#2
0
 /**
  * Fetch system scripts
  *
  * @param bool $render If true, a string will be returned of rendered script for header
  * @param bool $includeEditor
  *
  * @return array|string
  */
 public function getSystemScripts($render = false, $includeEditor = false)
 {
     $assets = $this->assetHelper->getAssets();
     if ($includeEditor) {
         $assets['js'][] = 'app/bundles/CoreBundle/Assets/js/libraries/ckeditor/ckeditor.js?v' . $this->version;
         $assets['js'][] = 'app/bundles/CoreBundle/Assets/js/libraries/ckeditor/adapters/jquery.js?v' . $this->version;
     }
     if ($render) {
         $js = '';
         if (isset($assets['js'])) {
             foreach ($assets['js'] as $url) {
                 $js .= '<script src="' . $this->getUrl($url) . '"></script>' . "\n";
             }
         }
         return $js;
     }
     return $assets['js'];
 }