Пример #1
0
 public function __construct($oembed)
 {
     parent::__construct();
     $oembed["html"] = EQUESTIONS_CLASS_VideoTools::addCodeParam($oembed["html"]);
     if (!empty($oembed["thumbnail_url"])) {
         $oembed["html"] = EQUESTIONS_CLASS_VideoTools::addAutoPlay($oembed["html"]);
     }
     $this->assign('oembed', $oembed);
 }
Пример #2
0
 public function __construct($oembed, $expandedView = false)
 {
     parent::__construct();
     $this->uniqId = uniqid('eqattachment');
     $this->assign('uniqId', $this->uniqId);
     $types = array('video', 'photo', 'link');
     $type = in_array($oembed['type'], $types) ? $oembed['type'] : 'link';
     if ($type == "video") {
         $oembed["html"] = EQUESTIONS_CLASS_VideoTools::addCodeParam($oembed["html"]);
         if (!empty($oembed["thumbnail_url"])) {
             $oembed["html"] = EQUESTIONS_CLASS_VideoTools::addAutoPlay($oembed["html"]);
         }
     }
     $this->oembed = $oembed;
     $plugin = OW::getPluginManager()->getPlugin('equestions');
     $this->setTemplate($plugin->getCmpViewDir() . 'att_' . $type . '.html');
     $this->assign('expandedView', $expandedView);
 }