*/ /* Temporary fix for sprint 2 */ if ($this->act instanceof CTableActivity) { /* If this's CTableActivity then we use getProperties() */ $activity = new CActivity($this->act->getProperties()); } else { /* If it's standard object than we just passing it */ $activity = new CActivity($this->act); } $mainframe = JFactory::getApplication(); $jinput = $mainframe->input; $isSingleAct = $jinput->get->get('actid', 0) > 0 ? true : false; $address = $activity->getLocation(); $user = $activity->getActor(); $target = $activity->getTarget(); $headMetas = $activity->getParams('headMetas'); /* We do convert into JRegistry to make it easier to use */ if ($headMetas) { $headMetaParams = new JRegistry($headMetas); } if ($act->app == 'profile.avatar.upload') { if ($my->id > 0) { $this->load('activities.stream.options'); } $this->load('activities.profile.avatar.upload'); return; } if (!empty($act->params)) { if (!is_object($act->params)) { $act->params = new JRegistry($act->params); }
public function ajaxShowStreamVideoWindow($activity_id) { $objResponse = new JAXResponse(); $my = CFactory::getUser(); $allowToView = true; if ($activity_id == '') { $allowToView = false; } $activityTable = JTable::getInstance('Activity', 'CTable'); if (!$activityTable->load($activity_id)) { $allowToView = false; } /* === Start Premission Checking === */ $user = CFactory::getUser($activityTable->actor); $blocked = $user->isBlocked(); if ($blocked && !COwnerHelper::isCommunityAdmin()) { $allowToView = false; } $activity = new CActivity($activityTable); $headMetas = $activity->getParams('headMetas'); $headMetaParams = ''; /* We do convert into JRegistry to make it easier to use */ if ($headMetas) { $headMetaParams = new JRegistry($headMetas); } $providerName = JString::strtolower($headMetaParams->get('video_provider')); if ($headMetaParams->get('type') == 'video' && $providerName != '') { $libraryPath = COMMUNITY_COM_PATH . '/libraries/videos' . '/' . $providerName . '.php'; require_once $libraryPath; $className = 'CTableVideo' . JString::ucfirst($providerName); $provider = new $className(); } if (!CPrivacy::isAccessAllowed($my->id, $activityTable->actor, 'custom', $activityTable->access)) { switch ($activityTable->access) { case '40': $allowToView = false; break; case '30': $allowToView = false; break; default: $allowToView = false; break; } } $objResponse->addScriptCall('cWindowShow', '', '', 640, 360); if ($allowToView) { $objResponse->addScriptCall('cWindowAddContent', $provider->getViewHTML($headMetaParams->get('video_id'), 640, 360)); } else { $objResponse->addScriptCall('cWindowAddContent', JText::_('COM_COMMUNITY_VIDEO_UNABLE_VIEW')); } $objResponse->sendResponse(); }