示例#1
0
 protected function copyCustomPlugins()
 {
     if ($plugins = $this->getCustomPluginPath()) {
         $basepath = $this->getPage()->getClientScript()->getPradoScriptAssetPath('tinymce');
         $assets = $this->getApplication()->getAssetManager();
         $path = is_dir($plugins) ? $plugins : Prado::getPathOfNameSpace($plugins);
         $name = basename($path);
         $dest = $basepath . '/plugins/' . $name;
         if (!is_dir($dest) || $this->getApplication()->getMode() !== TApplicationMode::Performance) {
             $assets->copyDirectory($path, $dest);
         }
     }
 }
示例#2
0
 /**
  * @param string javascript or css package path.
  * @return array tuple($path,$url).
  */
 protected function getPackagePathUrl($base)
 {
     $assets = Prado::getApplication()->getAssetManager();
     if (strpos($base, $assets->getBaseUrl()) === false) {
         if (($dir = Prado::getPathOfNameSpace($base)) !== null) {
             $base = $dir;
         }
         return array($assets->getPublishedPath($base), $assets->publishFilePath($base));
     } else {
         return array($assets->getBasePath() . str_replace($assets->getBaseUrl(), '', $base), $base);
     }
 }
示例#3
0
 protected function copyCustomPlugins($url)
 {
     if ($plugins = $this->getCustomPluginPath()) {
         $assets = $this->getApplication()->getAssetManager();
         $path = is_dir($plugins) ? $plugins : Prado::getPathOfNameSpace($plugins);
         $dest = $assets->getBasePath() . '/' . basename($url) . '/tiny_mce/plugins/' . basename($path);
         if (!is_dir($dest) || $this->getApplication()->getMode() !== TApplicationMode::Performance) {
             $assets->copyDirectory($path, $dest);
         }
     }
 }