コード例 #1
0
ファイル: Template.php プロジェクト: laiello/digitalus-cms
 public function load($template)
 {
     if (is_object($template)) {
         return $template;
     } else {
         if (file_exists($template)) {
             $form = new Digitalus_Content_Form();
             $view = $form->getView();
             $templateName = basename($template);
             $layoutPath = Digitalus_Toolbox_String::getParentFromPath($template);
             $view->addScriptPath($layoutPath);
             $fileContents = $view->render($templateName);
             $cleanFile = preg_replace('/(<\\?{1}[pP\\s]{1}.+\\?>)/', '', $fileContents);
             return simplexml_load_string($cleanFile);
         } else {
             return simplexml_load_string($template);
         }
     }
 }
コード例 #2
0
ファイル: Media.php プロジェクト: laiello/digitalus-cms
 /**
  * this function renames a folder
  *
  * @param string $path - the full path
  * @param string $newName - the new name
  */
 public static function renameFolder($path, $newName)
 {
     $path = self::getMediaPath($path);
     //get the new name
     $parent = Digitalus_Toolbox_String::getParentFromPath($path);
     $newpath = $parent . '/' . $newName;
     if (Digitalus_Filesystem_Dir::rename($path, $newpath)) {
         return $newpath;
     }
     return false;
 }
コード例 #3
0
ファイル: MediaController.php プロジェクト: ngukho/ducbui-cms
 /**
  * Rename Folder Action
  *
  * @return void
  */
 public function renameFolderAction()
 {
     $filepath = Digitalus_Filter_Post::get('filepath');
     $folderName = Digitalus_Filter_Post::get('folder_name');
     Digitalus_Media::renameFolder($filepath, $folderName);
     $folder = Digitalus_Toolbox_String::addUnderscores(Digitalus_Toolbox_String::getParentFromPath($filepath) . '/' . $folderName);
     $this->_request->setParam('folder', $folder);
     $this->_forward('open-folder');
 }