Example #1
0
 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')));
 }
Example #2
0
 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)));
 }