示例#1
0
 public function openSlide($slideId)
 {
     $slide = $this->find($slideId)->current();
     if ($slide) {
         $mdlContentNode = new Model_PageNode();
         $content = $mdlContentNode->fetchContentArray($slide->id, null, null, $this->getDefaultLanguage());
         $objSlide = new stdClass();
         $objSlide->id = $slide->id;
         $objSlide->title = $slide->name;
         $objSlide->dateCreated = $slide->create_date;
         $objSlide->showId = $slide->parent_id;
         if (isset($content['preview_path'])) {
             $objSlide->previewPath = $content['preview_path'];
         } else {
             $objSlide->previewPath = null;
         }
         if (isset($content['image_path'])) {
             $objSlide->imagePath = $content['image_path'];
         } else {
             $objSlide->imagePath = null;
         }
         if (isset($content['caption'])) {
             $objSlide->caption = $content['caption'];
         } else {
             $objSlide->caption = null;
         }
         return $objSlide;
     } else {
         return null;
     }
 }
示例#2
0
 public function openPost($postId)
 {
     $post = $this->find($postId)->current();
     if ($post) {
         $mdlContentNode = new Model_PageNode();
         $content = $mdlContentNode->fetchContentArray($post->id, null, null, $this->getDefaultLanguage());
         $objPost = new stdClass();
         $objPost->id = $post->id;
         $objPost->title = $post->name;
         $objPost->dateCreated = $post->create_date;
         $objPost->blogId = $post->parent_id;
         if (isset($content['teaser'])) {
             $objPost->teaser = $content['teaser'];
         } else {
             $objPost->teaser = null;
         }
         if (isset($content['content'])) {
             $objPost->content = $content['content'];
         } else {
             $objPost->content = null;
         }
         $mdlUser = new Model_User();
         $author = $mdlUser->find($post->name)->current();
         if ($author) {
             $objPost->author = $author->first_name . ' ' . $author->last_name;
         } else {
             $objPost->author = null;
         }
         $objPost->name = $post->name;
         return $objPost;
     } else {
         return null;
     }
 }
示例#3
0
 public function getLabelById($pageId, $language = null)
 {
     if ($language == null) {
         $language = Digitalus_Language::getLanguage();
     }
     $pageNode = new Model_PageNode();
     //fetch the content nodes
     $info = $pageNode->fetchContentArray($pageId, 'label', $language);
     if (isset($info['label']) && '' != $info['label']) {
         return $info['label'];
     } else {
         $where[] = $this->_db->quoteInto('id = ?', $pageId);
         $row = $this->fetchRow($where);
         return $row->name;
     }
 }