コード例 #1
0
ファイル: video_bridge.php プロジェクト: vazahat/dudex
 /**
  * Returns an instance of class (singleton pattern implementation).
  *
  * @return EQUESTIONS_CLASS_VideoBridge
  */
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
コード例 #2
0
ファイル: attachment_video.php プロジェクト: vazahat/dudex
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $bridge = EQUESTIONS_CLASS_VideoBridge::getInstance();
     $this->assign('videoActive', $bridge->isActive());
     $this->assign('uniqId', $this->uniqId);
     $language = OW::getLanguage();
     $this->assign('langs', array('cancel' => $language->text('equestions', 'attachments_cancel_label'), 'close' => $language->text('equestions', 'attachments_close_label'), 'addEmbed' => $language->text('equestions', 'attachments_add_embed_label'), 'search' => $language->text('equestions', 'attachments_add_search_label'), 'addVideo' => $language->text('equestions', 'attachments_add_video_label'), 'chooseMy' => $language->text('equestions', 'attachments_choose_my_video_label')));
 }
コード例 #3
0
ファイル: attachments.php プロジェクト: vazahat/dudex
 private function getMyVideos($query)
 {
     $userId = OW::getUser()->getId();
     $bridge = EQUESTIONS_CLASS_VideoBridge::getInstance();
     if (!$bridge->isActive()) {
         return false;
     }
     $count = $query['offset'] == 0 ? 15 : 10;
     $videos = $bridge->findUserVideos($userId, $query['offset'], $count + 6);
     $viewMore = count($videos) - $count > 5;
     if ($viewMore) {
         $videos = array_slice($videos, 0, $count);
     }
     $cmp = new EQUESTIONS_CMP_MyVideos($videos);
     return array('myPanel' => array('html' => $cmp->render(), 'viewMore' => $viewMore, 'offset' => $query['offset'] + count($videos), 'itemsCount' => count($videos)));
 }