Пример #1
0
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $groupId = $this->vars["groupId"];
     $cmp = new GHEADER_CMP_CoverItem($groupId);
     $this->addComponent("cover", $cmp);
 }
Пример #2
0
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $defaults = array("iconClass" => null, "title" => '', "description" => '', "status" => null, "list" => null, "info" => null, "more" => null);
     $this->vars = array_merge($defaults, $this->vars);
     if (empty($this->vars['list'])) {
         $this->setVisible(false);
         return;
     }
     // prepare image list
     foreach ($this->vars['list'] as $id => $image) {
         $image['url'] = $this->getUrl($image['url']);
         $this->list[$id] = $image;
     }
     $limit = self::LIST_LIMIT;
     // prepare view more url
     if (!empty($this->vars['more'])) {
         $this->vars['more']['url'] = $this->getUrl($this->vars['more']);
         if (!empty($this->vars['more']['limit'])) {
             $limit = $this->vars['more']['limit'];
         }
     }
     $this->assign('list', array_slice($this->list, 0, $limit));
     $this->assign('vars', $this->vars);
     $totalCount = count($this->list);
     $moreCount = $totalCount <= $limit ? 0 : $totalCount - $limit;
     $this->assign('moreCount', $moreCount);
 }
Пример #3
0
 public function __construct($vars, $formatName = null)
 {
     parent::__construct($vars, $formatName);
     $defaults = array("text" => null, "status" => null);
     $this->vars = array_merge($defaults, $this->vars);
     $this->assign("text", $this->vars["text"] ? $this->vars["text"] : $this->vars["status"]);
 }
Пример #4
0
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $defaults = array("image" => null, "status" => null, "url" => null, "info" => null);
     $this->vars = array_merge($defaults, $this->vars);
     $this->vars['url'] = $this->getUrl($this->vars['url']);
     $this->assign('vars', $this->vars);
 }
Пример #5
0
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     //$coverId = $this->vars["coverId"];
     $userId = $this->vars["userId"];
     $cmp = new UHEADER_CMP_CoverItem($userId);
     $this->addComponent("cover", $cmp);
 }
Пример #6
0
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $defaults = array("image" => null, "thumbnail" => null, "iconClass" => null, "title" => '', "description" => '', "status" => null, "url" => null, "userList" => null);
     $tplVars = array_merge($defaults, $this->vars);
     $tplVars["url"] = $this->getUrl($tplVars["url"]);
     if (!empty($tplVars["userList"])) {
         $tplVars["userList"] = $this->getUserList($tplVars["userList"]);
     }
     $this->assign('vars', $tplVars);
 }
Пример #7
0
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $defaults = array("iconClass" => null, "title" => '', "description" => '', "status" => null, "url" => null, 'activity' => null);
     $tplVars = array_merge($defaults, $this->vars);
     if (!empty($tplVars['activity']['title'])) {
         $tplVars['activity']["title"] = $this->getLocalizedText($tplVars['activity']["title"]);
     }
     $tplVars["url"] = $this->getUrl($tplVars["url"]);
     $tplVars["title"] = $this->getLocalizedText($tplVars["title"]);
     $this->assign('vars', $tplVars);
 }
Пример #8
0
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $defaults = array("image" => null, "iconClass" => null, "title" => '', "description" => '', "status" => null, "url" => null, "embed" => '');
     $tplVars = array_merge($defaults, $this->vars);
     $tplVars["url"] = $this->getUrl($tplVars["url"]);
     $tplVars['blankImg'] = OW::getThemeManager()->getCurrentTheme()->getStaticUrl() . 'mobile/images/1px.png';
     $this->assign('vars', $tplVars);
     if ($tplVars['embed']) {
         $script = '$("a.ow_format_video_play").click(function(){
             var $embed = $($(this).parent().find(".ow_format_video_embed").val());
             $(this).replaceWith($embed);
         });';
         OW::getDocument()->addOnloadScript($script);
     }
 }
Пример #9
0
 public function onBeforeRender()
 {
     parent::onBeforeRender();
     $uniqId = uniqid("vf-");
     $this->assign("uniqId", $uniqId);
     $defaults = array("image" => null, "iconClass" => null, "title" => '', "description" => '', "status" => null, "url" => null, "embed" => '');
     $tplVars = array_merge($defaults, $this->vars);
     $tplVars["url"] = $this->getUrl($tplVars["url"]);
     $tplVars['blankImg'] = OW::getThemeManager()->getCurrentTheme()->getStaticUrl() . 'mobile/images/1px.png';
     $this->assign('vars', $tplVars);
     if ($tplVars['embed']) {
         $js = UTIL_JsGenerator::newInstance();
         $code = BOL_TextFormatService::getInstance()->addVideoCodeParam($tplVars['embed'], "autoplay", 1);
         $code = BOL_TextFormatService::getInstance()->addVideoCodeParam($code, "play", 1);
         $js->addScript('$(".ow_oembed_video_cover", "#" + {$uniqId}).click(function() { ' . '$("#" + {$uniqId}).addClass("ow_video_playing"); ' . '$(".ow_newsfeed_item_picture", "#" + {$uniqId}).html({$embed});' . 'return false; });', array("uniqId" => $uniqId, "embed" => $code));
         OW::getDocument()->addOnloadScript($js);
     }
 }