コード例 #1
0
ファイル: Package.php プロジェクト: beesheer/freehdfootage
 /**
  * Generate a package manifest.
  *
  * @param integer $packageId
  * @return array | false
  */
 protected function _generateManifest($packageId)
 {
     $package = new Object_Package($packageId);
     if (!$package->getId()) {
         return false;
     }
     // Get all the title manifests.
     $titles = Repo_PackageTitle::getInstance()->getPackageTitles($packageId);
     $titleManifests = array();
     if ($titles && $titles->count()) {
         foreach ($titles as $_t) {
             $titleManifests[] = Manager_Manifest_Title::getInstance()->getManifest($_t->id);
         }
     }
     // Get all the page manifests.
     $pages = Repo_PackageTitle::getInstance()->getPackagePages($packageId);
     $pageManifests = array();
     if (is_array($pages) && !empty($pages)) {
         foreach ($pages as $_p) {
             $pageManifests[] = Manager_Manifest_Page::getInstance()->getManifest($_p['page_id']);
         }
     }
     $manifest = array('version' => $package->version, 'id' => $package->id, 'title' => $package->name, 'manifestVersion' => $package->getManifestVersion(), 'remoteControlEnabled' => true, 'description' => $package->description, 'nav_type' => $package->nav_type, 'nav_data' => $package->nav_data, 'titles' => $titleManifests, 'pages' => $pageManifests);
     if ($package->media_asset_id) {
         $media = new Object_MediaAsset($package->media_asset_id);
         $manifest['thumbnail'] = $media->getExternalLink();
     }
     return $manifest;
 }
コード例 #2
0
ファイル: Page.php プロジェクト: beesheer/freehdfootage
 /**
  * Returns an instance.
  *
  * Singleton pattern implementation.
  *
  * @return Manager_Manifest_Page
  */
 public static function getInstance()
 {
     if (null === self::$_instance) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
コード例 #3
0
 /**
  * Get the manifest for a page. TESTING ONLY.
  *
  */
 public function pageManifestAction()
 {
     $id = $this->_request->getParam('id');
     $manifest = Manager_Manifest_Page::getInstance()->getManifest($id);
     echo Zend_Json::encode($manifest);
     die;
 }
コード例 #4
0
ファイル: Title.php プロジェクト: beesheer/freehdfootage
 /**
  * Generate a title manifest.
  *
  * @param integer $titleId
  * @return array | false
  */
 protected function _generateManifest($titleId, $includePages = false)
 {
     $title = new Object_Title($titleId);
     if (!$title->getId()) {
         return false;
     }
     // Get the page ids.
     $pages = Repo_TitlePage::getInstance()->getTitlePages($titleId);
     $pageIds = array();
     if ($pages && $pages->count()) {
         foreach ($pages as $_p) {
             $pageIds[] = $_p->page_id;
         }
     }
     $manifest = array('version' => $title->version, 'id' => $title->id, 'title' => $title->name, 'type' => $title->type, 'isLocked' => true, 'description' => $title->description, 'isEditable' => $title->is_editable, 'pageIds' => $pageIds);
     if ($title->nav_type == 'tree') {
         $manifest['menu'] = $title->getMenu();
     }
     if ($includePages) {
         $pageManifests = array();
         if (is_array($pageIds) && !empty($pageIds)) {
             foreach ($pages as $_p) {
                 $pageManifests[] = Manager_Manifest_Page::getInstance()->getManifest($_p->id);
             }
             $manifest['pages'] = $pageManifests;
         }
     }
     if ($title->media_asset_id) {
         $media = new Object_MediaAsset($title->media_asset_id);
         $manifest['thumbnail'] = $media->getExternalLink();
     }
     return $manifest;
 }