/**
  * Get category/video list
  * @param unknown_type $provider
  * @param unknown_type $location
  * @param Zend_Controller_Action $controller
  */
 public function getShareItems($provider, $location, Zend_Controller_Action $controller)
 {
     // this plugin add items only if it is the provider
     if ($provider != $this->getId()) {
         return;
     }
     X_Debug::i("Plugin triggered");
     $urlHelper = $controller->getHelper('url');
     $items = new X_Page_ItemList_PItem();
     if ($location != '' && ($location == self::INDEX_NARUTO || $location == self::INDEX_ONEPIECE || $location == self::INDEX_BLEACH)) {
         $pageIndex = $this->config('index.url', 'http://www.dbforever.net/home.php') . "?page={$location}";
         $htmlString = $this->_loadPage($pageIndex);
         $dom = new Zend_Dom_Query($htmlString);
         $results = $dom->queryXpath('//div[@align="left"]/a');
         for ($i = 0; $i < $results->count(); $i++, $results->next()) {
             $node = $results->current();
             $href = $node->getAttribute('href');
             $label = $node->nodeValue;
             $item = new X_Page_Item_PItem($this->getId() . '-' . $label, $label);
             $item->setIcon('/images/icons/file_32.png')->setType(X_Page_Item_PItem::TYPE_ELEMENT)->setCustom(__CLASS__ . ':location', $href)->setLink(array('action' => 'mode', 'l' => X_Env::encode($href)), 'default', false);
             $items->append($item);
         }
     } else {
         $item = new X_Page_Item_PItem($this->getId() . '-' . self::INDEX_NARUTO, X_Env::_('p_dbforever_naruto_ep'));
         $item->setIcon('/images/icons/folder_32.png')->setType(X_Page_Item_PItem::TYPE_CONTAINER)->setCustom(__CLASS__ . ':location', self::INDEX_NARUTO)->setThumbnail('http://www.dbforever.net/img/banner/naruto_banner_grande.jpg')->setLink(array('l' => X_Env::encode(self::INDEX_NARUTO)), 'default', false);
         $items->append($item);
         $item = new X_Page_Item_PItem($this->getId() . '-' . self::INDEX_ONEPIECE, X_Env::_('p_dbforever_onepiece_ep'));
         $item->setIcon('/images/icons/folder_32.png')->setType(X_Page_Item_PItem::TYPE_CONTAINER)->setCustom(__CLASS__ . ':location', self::INDEX_ONEPIECE)->setThumbnail('http://www.dbforever.net/img/banner/onepiece_banner_grande.jpg')->setLink(array('l' => X_Env::encode(self::INDEX_ONEPIECE)), 'default', false);
         $items->append($item);
         $item = new X_Page_Item_PItem($this->getId() . '-' . self::INDEX_BLEACH, X_Env::_('p_dbforever_bleach_ep'));
         $item->setIcon('/images/icons/folder_32.png')->setType(X_Page_Item_PItem::TYPE_CONTAINER)->setCustom(__CLASS__ . ':location', self::INDEX_BLEACH)->setThumbnail('http://www.dbforever.net/img/banner/bleach_banner_grande.jpg')->setLink(array('l' => X_Env::encode(self::INDEX_BLEACH)), 'default', false);
         $items->append($item);
     }
     return $items;
 }
Example #2
0
 public function doAction(Zend_Controller_Action $action)
 {
     $client = Infra_ClientHelper::getClient();
     $virusScanPlugin = Kaltura_Client_VirusScan_Plugin::get($client);
     //create new form
     $newForm = new Form_NewVirusScanProfile();
     $page = $this->_getParam('page', 1);
     $pageSize = $this->_getParam('pageSize', 10);
     //get PartnerId
     $partnerId = $this->_getParam('partnerId');
     //filter form
     $request = $action->getRequest();
     $virusScanFilterForm = new Form_VirusScanFilter();
     $virusScanFilterFormAction = $action->view->url(array('controller' => $request->getParam('controller'), 'action' => $request->getParam('action')), null, true);
     $virusScanFilterForm->setAction($virusScanFilterFormAction);
     $virusScanFilterForm->populate($request->getParams());
     $virusScanFilter = $this->getVirusScanFilterFromRequest($request);
     $newForm->getElement("newPartnerId")->setValue($virusScanFilter->partnerIdEqual);
     //filter also by partnerId
     if (!is_null($partnerId)) {
         $virusScanFilter->partnerIdEqual = $partnerId;
     }
     $paginatorAdapter = new Infra_FilterPaginator($virusScanPlugin->virusScanProfile, "listAction", null, $virusScanFilter);
     $paginator = new Infra_Paginator($paginatorAdapter);
     $paginator->setCurrentPageNumber($page);
     $paginator->setItemCountPerPage($pageSize);
     $action->view->virusScanFilterForm = $virusScanFilterForm;
     $action->view->newForm = $newForm;
     $action->view->paginator = $paginator;
 }
Example #3
0
 public function doAction(Zend_Controller_Action $action)
 {
     $request = $action->getRequest();
     $page = $this->_getParam('page', 1);
     $pageSize = $this->_getParam('pageSize', 10);
     $partnerId = $this->_getParam('partnerId');
     // init filter
     $drmProfileFilter = $this->getDrmProfileFilterFromRequest($request);
     $drmProfileFilter->orderBy = "-createdAt";
     $client = Infra_ClientHelper::getClient();
     $drmPluginClient = Kaltura_Client_Drm_Plugin::get($client);
     // get results and paginate
     $paginatorAdapter = new Infra_FilterPaginator($drmPluginClient->drmProfile, "listAction", null, $drmProfileFilter);
     $paginator = new Infra_Paginator($paginatorAdapter, $request);
     $paginator->setCurrentPageNumber($page);
     $paginator->setItemCountPerPage($pageSize);
     // set view
     $drmProfileFilterForm = new Form_DrmProfileFilter();
     $drmProfileFilterForm->populate($request->getParams());
     $drmProfileFilterFormAction = $action->view->url(array('controller' => $request->getParam('controller'), 'action' => $request->getParam('action')), null, true);
     $drmProfileFilterForm->setAction($drmProfileFilterFormAction);
     $action->view->filterForm = $drmProfileFilterForm;
     $action->view->paginator = $paginator;
     $createProfileForm = new Form_CreateDrmProfile();
     $actionUrl = $action->view->url(array('controller' => 'plugin', 'action' => 'DrmProfileConfigure'), null, true);
     $createProfileForm->setAction($actionUrl);
     if ($drmProfileFilter && isset($drmProfileFilter->partnerIdEqual)) {
         $createProfileForm->getElement("newPartnerId")->setValue($drmProfileFilter->partnerIdEqual);
     }
     $action->view->newProfileForm = $createProfileForm;
 }
 /**
  * Redirect to controls if vlc is running
  * @param Zend_Controller_Action $controller
  */
 public function gen_beforePageBuild(Zend_Controller_Action $controller)
 {
     /*
     $vlc = X_Vlc::getLastInstance();
     
     if ( $vlc === null ) {
     	X_Debug::i("No vlc instance");
     	return;
     }
     */
     $controllerName = $controller->getRequest()->getControllerName();
     $actionName = $controller->getRequest()->getActionName();
     $query = "{$controllerName}/{$actionName}";
     X_Debug::i("Plugin triggered for: {$query}");
     //$isRunning = $vlc->isRunning();
     $isRunning = X_Streamer::i()->isStreaming();
     if (array_search($query, $this->redirectCond_To) !== false && $isRunning) {
         $controller->getRequest()->setControllerName('controls')->setActionName('control')->setDispatched(false);
         X_Debug::i("Redirect to controls/control");
     } elseif (array_search($query, $this->redirectCond_Away) !== false && !$isRunning) {
         X_Debug::i("Redirect to index/collections");
         $controller->getRequest()->setControllerName('index')->setActionName('collections')->setDispatched(false);
     } else {
         X_Debug::i("No redirection: vlc is running? " . ($isRunning ? 'Yes' : 'No'));
     }
 }
Example #5
0
 public function doAction(Zend_Controller_Action $action)
 {
     $entryId = $action->getRequest()->getParam('entry-id');
     $xslt = $action->getRequest()->getParam('xslt');
     $this->client = Infra_ClientHelper::getClient();
     $xml = $this->client->media->getMrss($entryId);
     $xslParams = array();
     $xslParams['entryDistributionId'] = '';
     $xslParams['distributionProfileId'] = '';
     ob_start();
     $xmlDoc = new DOMDocument();
     $xmlDoc->loadXML($xml);
     $xsltDoc = new DOMDocument();
     $xsltDoc->loadXML($xslt);
     $xslt = new XSLTProcessor();
     $xslt->registerPHPFunctions();
     // it is safe to register all php fuctions here
     $xslt->setParameter('', $xslParams);
     $xslt->importStyleSheet($xsltDoc);
     $ob = ob_get_clean();
     ob_end_clean();
     if ($ob) {
         $action->getHelper('json')->direct(array('error' => $ob));
     }
     $obj = array('result' => $xslt->transformToXml($xmlDoc));
     $action->getHelper('json')->direct($obj);
 }
 public function doAction(Zend_Controller_Action $action)
 {
     $request = $action->getRequest();
     $page = $this->_getParam('page', 1);
     $pageSize = $this->_getParam('pageSize', 10);
     $form = new Form_PartnerIdFilter();
     $form->populate($request->getParams());
     $newForm = new Form_NewEventNotificationTemplate();
     $actionUrl = $action->view->url(array('controller' => 'plugin', 'action' => 'EventNotificationTemplatesListAction'), null, true);
     $form->setAction($actionUrl);
     // init filter
     $partnerFilter = $this->getPartnerFilterFromRequest($request);
     $client = Infra_ClientHelper::getClient();
     $eventNotificationPlugin = Kaltura_Client_EventNotification_Plugin::get($client);
     // get results and paginate
     $paginatorAdapter = new Infra_FilterPaginator($eventNotificationPlugin->eventNotificationTemplate, "listByPartner", null, $partnerFilter);
     $paginator = new Infra_Paginator($paginatorAdapter, $request);
     $paginator->setCurrentPageNumber($page);
     $paginator->setItemCountPerPage($pageSize);
     if ($partnerFilter) {
         $newForm->getElement('newPartnerId')->setValue($partnerFilter->idIn);
     }
     // set view
     $action->view->form = $form;
     $action->view->newForm = $newForm;
     $action->view->paginator = $paginator;
 }
 public function doAction(Zend_Controller_Action $action)
 {
     $request = $action->getRequest();
     $field = $request->getParam('field', null);
     $id = $request->getParam('id', null);
     $type = $request->getParam('type', null);
     $reqponse = $this->query($type, array("{$field}Id" => array($id)), array("@timestamp" => "desc"), 100, array("sessionId"));
     $json = array();
     if (isset($reqponse->hits) && isset($reqponse->hits->hits)) {
         $sessions = array();
         foreach ($reqponse->hits->hits as $hit) {
             if (isset($hit->fields) && isset($hit->fields->sessionId)) {
                 foreach ($hit->fields->sessionId as $sessionId) {
                     if (!in_array("{$sessionId}", $sessions)) {
                         $sessions[] = "{$sessionId}";
                     }
                 }
             }
         }
         $reqponse = $this->query($type, array("sessionId" => $sessions), array("@timestamp" => "asc", "sessionIndex" => "asc"), 100000);
         if (isset($reqponse->hits) && isset($reqponse->hits->hits)) {
             $json = $reqponse->hits->hits;
         }
     }
     echo $action->getHelper('json')->sendJson($json, false);
 }
Example #8
0
 public function doAction(Zend_Controller_Action $action)
 {
     $entryId = $action->getRequest()->getParam('entry-id');
     $this->client = Infra_ClientHelper::getClient();
     $action->getHelper('layout')->setLayout('layout_empty');
     $action->view->entryId = $entryId;
     $action->view->xml = $this->client->media->getMrss($entryId);
 }
 public function gen_afterPageBuild(X_Page_ItemList_PItem $items, Zend_Controller_Action $controller)
 {
     if (count($items->getItems()) == 0) {
         X_Debug::i("Plugin triggered");
         $item = new X_Page_Item_PItem('emptylists', X_Env::_('p_emptylists_moveaway'));
         $item->setType(X_Page_Item_PItem::TYPE_ELEMENT)->setLink(X_Env::completeUrl($controller->getHelper('url')->url()));
         $items->append($item);
     }
 }
 /**
  * Redirect to controls if vlc is running
  * @param Zend_Controller_Action $controller
  */
 public function gen_beforePageBuild(Zend_Controller_Action $controller)
 {
     X_Debug::i("Plugin triggered: redirect to installer");
     $controllerName = $controller->getRequest()->getControllerName();
     if ($controllerName != 'installer' && $controllerName != 'error') {
         //die($controllerName);
         $controller->getRequest()->setControllerName('installer')->setActionName('index')->setDispatched(false);
     }
 }
 public function gen_afterPageBuild(X_Page_ItemList_PItem $items, Zend_Controller_Action $controller)
 {
     if ($this->helpers()->devices()->isWiimc() && $this->helpers()->devices()->isWiimcBeforeVersion('1.0.9')) {
         if (count($items->getItems()) === 1) {
             X_Debug::i("Plugin triggered");
             $item = new X_Page_Item_PItem('workaroundwiimcplaylistitemsbug', '-- Workaround for bug in Wiimc <= 1.0.9 --');
             $item->setType(X_Page_Item_PItem::TYPE_ELEMENT)->setLink(X_Env::completeUrl($controller->getHelper('url')->url()));
             $items->append($item);
         }
     }
 }
Example #12
0
 /**
  * Get configured view
  * @param Zend_Controller_Action $action
  * @return System_View_Xslt
  */
 public static function getViewFromAction(Zend_Controller_Action $action)
 {
     $bootstrap = $action->getInvokeArg('bootstrap');
     if ($bootstrap instanceof Zend_Application_Bootstrap_Bootstrap && $bootstrap->getResource('View') instanceof Zend_View_Abstract) {
         $view = clone $bootstrap->getResource('View');
     } else {
         $view = new System_View_Xslt();
     }
     $view->setScriptPath($action->view->getScriptPaths());
     return $view;
 }
Example #13
0
 /**
  * @description render view
  * @param Zend_Controller_Action $controller
  * @param string $personal
  * @return void
  */
 public function render(Zend_Controller_Action $controller, $personal = 'payment/alfa.phtml')
 {
     if (!is_file(APPLICATION_PATH . '/views/scripts/' . $personal)) {
         $default = isset($this->_config['defaultViewName']) ? $this->_config['defaultViewName'] : 'index.phtml';
         $controller->getHelper('viewRenderer')->setNoRender();
         // turn off native (personal) view
         $controller->view->addScriptPath(__DIR__ . '/alfa/application/views/scripts/');
         // add current folder to the view path
         $controller->view->form = $this->getForm();
         $controller->getHelper('viewRenderer')->renderScript($default);
         // render
     }
 }
 public function doAction(Zend_Controller_Action $action)
 {
     $action->getHelper('viewRenderer')->setNoRender();
     $providerId = $this->_getParam('provider_id');
     $client = Kaltura_ClientHelper::getClient();
     try {
         $client->genericDistributionProvider->delete($providerId);
         echo $action->getHelper('json')->sendJson('ok', false);
     } catch (Exception $e) {
         KalturaLog::err($e->getMessage() . "\n" . $e->getTraceAsString());
         echo $action->getHelper('json')->sendJson($e->getMessage(), false);
     }
 }
 /**
  * Get category/video list
  * @param unknown_type $provider
  * @param unknown_type $location
  * @param Zend_Controller_Action $controller
  */
 public function getShareItems($provider, $location, Zend_Controller_Action $controller)
 {
     if ($provider != $this->getId()) {
         return;
     }
     X_Debug::i('Plugin triggered');
     X_VlcShares_Plugins::broker()->unregisterPluginClass('X_VlcShares_Plugins_SortItems');
     //$baseUrl = $this->config('base.url', 'http://www.gogocinema.net/mediacenter/index.php?page=ajax_show_folder&id=');
     $items = new X_Page_ItemList_PItem();
     X_Debug::i("Requested location: {$location}");
     // location format:
     // sortType/subType/page/thread/linkType:linkId
     $split = $location != '' ? @explode('/', $location, 5) : array();
     @(list($sortType, $subType, $page, $thread, $linkTypeId) = $split);
     X_Debug::i("Exploded location: " . var_export($split, true));
     // special case: if sortType = search the subType param can be in
     // gogocinema:search
     if ($sortType == self::SORT_SEARCH && is_null($subType)) {
         $this->disableCache();
         $searchValue = $controller->getRequest()->getParam("{$this->getId()}:search", null);
         if ($searchValue == null) {
             // go back in index
             $split = array();
         } else {
             $subType = $searchValue;
             $split[1] = $searchValue;
             // in this way sort search doesn't go in classification
         }
     }
     switch (count($split)) {
         case 5:
             // we shouldn't be here!
         // we shouldn't be here!
         case 4:
             $this->_fetchVideos($items, $sortType, $subType, $page, $thread);
             break;
         case 2:
             $page = 1;
         case 3:
             $this->_fetchThreads($items, $sortType, $subType, $page);
             break;
         case 1:
             $this->_fetchClassification($items, $sortType);
             break;
         case 0:
         default:
             $this->disableCache();
             $this->_fetchSortType($items);
     }
     return $items;
 }
 public function doAction(Zend_Controller_Action $action)
 {
     $action->getHelper('layout')->disableLayout();
     $request = $action->getRequest();
     $drmProfileId = $this->_getParam('drm_profile_id');
     $partnerId = $this->_getParam('new_partner_id');
     $drmProfileProvider = $this->_getParam('new_drm_profile_provider');
     $drmProfileForm = null;
     $action->view->formValid = false;
     try {
         if ($request->isPost()) {
             $partnerId = $this->_getParam('partnerId');
             $drmProfileProvider = $this->_getParam('provider');
             $drmProfileForm = new Form_DrmProfileConfigure($partnerId, $drmProfileProvider);
             $action->view->formValid = $this->processForm($drmProfileForm, $request->getPost(), $partnerId, $drmProfileId);
             if (!is_null($drmProfileId)) {
                 $drmProfile = $drmProfileForm->getObject("Kaltura_Client_Drm_Type_DrmProfile", $request->getPost(), false, true);
             }
         } else {
             if (!is_null($drmProfileId)) {
                 $client = Infra_ClientHelper::getClient();
                 $drmPluginClient = Kaltura_Client_Drm_Plugin::get($client);
                 $drmProfile = $drmPluginClient->drmProfile->get($drmProfileId);
                 $partnerId = $drmProfile->partnerId;
                 $drmProfileProvider = $drmProfile->provider;
                 $drmProfileForm = new Form_DrmProfileConfigure($partnerId, $drmProfileProvider);
                 $drmProfileForm->populateFromObject($drmProfile, false);
             } else {
                 $drmProfileForm = new Form_DrmProfileConfigure($partnerId, $drmProfileProvider);
                 $drmProfileForm->getElement('partnerId')->setValue($partnerId);
             }
         }
     } catch (Exception $e) {
         $action->view->formValid = false;
         KalturaLog::err($e->getMessage() . "\n" . $e->getTraceAsString());
         $action->view->errMessage = $e->getMessage();
     }
     $action->view->form = $drmProfileForm;
     $pluginInstances = KalturaPluginManager::getPluginInstances('IKalturaApplicationPartialView');
     KalturaLog::debug("plugin instances [" . count($pluginInstances) . "]");
     foreach ($pluginInstances as $pluginInstance) {
         $drmProfilePlugins = $pluginInstance->getApplicationPartialViews('plugin', get_class($this));
         if (!$drmProfilePlugins) {
             continue;
         }
         foreach ($drmProfilePlugins as $plugin) {
             /* @var $plugin Kaltura_View_Helper_PartialViewPlugin */
             $plugin->plug($action->view);
         }
     }
 }
 public function doAction(Zend_Controller_Action $action)
 {
     $action->getHelper('layout')->disableLayout();
     $drmProfileId = $this->_getParam('drmProfileId');
     $client = Infra_ClientHelper::getClient();
     $drmPluginClient = Kaltura_Client_Drm_Plugin::get($client);
     try {
         $updatedDrmProfile = $drmPluginClient->drmProfile->delete($drmProfileId);
         echo $action->getHelper('json')->sendJson('ok', false);
     } catch (Exception $e) {
         KalturaLog::err($e->getMessage() . "\n" . $e->getTraceAsString());
         echo $action->getHelper('json')->sendJson($e->getMessage(), false);
     }
 }
 public function doAction(Zend_Controller_Action $action)
 {
     $action->getHelper('viewRenderer')->setNoRender();
     $profileId = $this->_getParam('profile_id');
     $status = $this->_getParam('status');
     $client = Kaltura_ClientHelper::getClient();
     try {
         $client->distributionProfile->updateStatus($profileId, $status);
         echo $action->getHelper('json')->sendJson('ok', false);
     } catch (Exception $e) {
         KalturaLog::err($e->getMessage() . "\n" . $e->getTraceAsString());
         echo $action->getHelper('json')->sendJson($e->getMessage(), false);
     }
 }
Example #19
0
 /**
  * Get category/video list
  * @param unknown_type $provider
  * @param unknown_type $location
  * @param Zend_Controller_Action $controller
  */
 public function getShareItems($provider, $location, Zend_Controller_Action $controller)
 {
     // this plugin add items only if it is the provider
     if ($provider != $this->getId()) {
         return;
     }
     X_Debug::i("Plugin triggered");
     // try to disable SortItems plugin, so link are listed as in html page
     X_VlcShares_Plugins::broker()->unregisterPluginClass('X_VlcShares_Plugins_SortItems');
     $urlHelper = $controller->getHelper('url');
     $items = new X_Page_ItemList_PItem();
     if ($location != '' && array_key_exists((int) $location, $this->seasons)) {
         // episodes list
         $url = $this->seasons[(int) $location];
         $html = $this->_loadPage($url);
         $dom = new Zend_Dom_Query($html);
         $results = $dom->queryXpath('//div[@id="randomVideos"]//div[@class="randomTab"]//a[@class="previewDescriptionTitle"]');
         $resultsImages = $dom->queryXpath('//div[@id="randomVideos"]//div[@class="randomTab"]//img[1]/attribute::src');
         for ($i = 0; $i < $results->count(); $i++, $results->next()) {
             $node = $results->current();
             $href = $node->getAttribute('href');
             $label = $node->nodeValue;
             $id = explode('id=', $href, 2);
             $id = @$id[1];
             $thumb = null;
             try {
                 if ($resultsImages->valid()) {
                     $thumb = $resultsImages->current()->nodeValue;
                     $resultsImages->next();
                 }
             } catch (Exception $e) {
                 $thumb = null;
             }
             $item = new X_Page_Item_PItem($this->getId() . '-' . $label, $label);
             $item->setIcon('/images/icons/file_32.png')->setType(X_Page_Item_PItem::TYPE_ELEMENT)->setCustom(__CLASS__ . ':location', $id)->setLink(array('action' => 'mode', 'l' => X_Env::encode($id)), 'default', false);
             if ($thumb !== null) {
                 $item->setThumbnail($thumb);
             }
             $items->append($item);
         }
     } else {
         foreach ($this->seasons as $key => $seasons) {
             $item = new X_Page_Item_PItem($this->getId() . '-' . $key, X_Env::_('p_allsp_season_n') . ": {$key}");
             $item->setIcon('/images/icons/folder_32.png')->setType(X_Page_Item_PItem::TYPE_CONTAINER)->setCustom(__CLASS__ . ':location', $key)->setLink(array('action' => 'share', 'l' => X_Env::encode($key)), 'default', false);
             $items->append($item);
         }
     }
     return $items;
 }
 /**
  * Retrieve news from plugins
  * @param Zend_Controller_Action $this
  * @return X_Page_ItemList_News
  */
 public function getIndexNews(Zend_Controller_Action $controller)
 {
     try {
         $view = $controller->getHelper('viewRenderer');
         $view->view->headScript()->appendFile('http://www.google.com/jsapi');
         $view->view->headScript()->appendFile($view->view->baseUrl("/js/widgetdevnews/script.js"));
         $view->view->headLink()->appendStylesheet($view->view->baseUrl('/css/widgetdevnews/style.css'));
         $text = (include dirname(__FILE__) . '/WidgetDevNews.commits.phtml');
         $item = new X_Page_Item_News($this->getId(), '');
         $item->setTab(X_Env::_('p_widgetdevnews_commits_tab'))->setContent($text);
         return new X_Page_ItemList_News(array($item));
     } catch (Exception $e) {
         X_Debug::e('No view O_o');
     }
 }
 public function doAction(Zend_Controller_Action $action)
 {
     $action->getHelper('viewRenderer')->setNoRender();
     $templateId = $this->_getParam('template_id');
     $status = $this->_getParam('status');
     $client = Infra_ClientHelper::getClient();
     $eventNotificationPlugin = Kaltura_Client_EventNotification_Plugin::get($client);
     try {
         $eventNotificationPlugin->eventNotificationTemplate->updateStatus($templateId, $status);
         echo $action->getHelper('json')->sendJson('ok', false);
     } catch (Exception $e) {
         KalturaLog::err($e->getMessage() . "\n" . $e->getTraceAsString());
         echo $action->getHelper('json')->sendJson($e->getMessage(), false);
     }
 }
 public function gen_afterPageBuild(X_Page_ItemList_PItem $items, Zend_Controller_Action $controller)
 {
     /*
     if ( !$this->_forceRendering ) { 
     	// even if forced.enabled, don't build the page if the device is wiimc
     	if ( $this->helpers()->devices()->isWiimc() || ( !((bool) $this->config('forced.enabled', false)) && !$this->helpers()->devices()->isAndroid() )) return;
     }
     */
     if (!$this->isDefaultRenderer()) {
         return;
     }
     X_Debug::i("Plugin triggered");
     $request = $controller->getRequest();
     $urlHelper = $controller->getHelper('url');
     /* @var $view Zend_Controller_Action_Helper_ViewRenderer */
     $view = $controller->getHelper('viewRenderer');
     /* @var $layout Zend_Layout_Controller_Action_Helper_Layout */
     $layout = $controller->getHelper('layout');
     $view->setViewSuffix('mobile.phtml');
     $layout->getLayoutInstance()->setLayout('mobile', true);
     if ($request instanceof Zend_Controller_Request_Http) {
         if ($request->isXmlHttpRequest()) {
             $layout->getLayoutInstance()->disableLayout();
         }
     }
     try {
         $providerObj = X_VlcShares_Plugins::broker()->getPlugins($request->getParam('p', ''));
         $view->view->providerName = strtolower($providerObj->getId());
         if ($providerObj instanceof X_VlcShares_Plugins_ResolverDisplayableInterface) {
             // location in request obj are X_Env::encoded
             $view->view->location = $providerObj->resolveLocation(X_Env::decode($request->getParam('l', '')));
         }
         if ($providerObj instanceof X_VlcShares_Plugins_ResolverInterface) {
             // location in request obj are X_Env::encoded
             $view->view->locationRaw = $providerObj->resolveLocation(X_Env::decode($request->getParam('l', '')));
             $view->view->parentLocation = $providerObj->getParentLocation(X_Env::decode($request->getParam('l', '')));
         }
     } catch (Exception $e) {
         //die('No provider');
         X_Debug::i('No provider O_o');
     }
     // set some vars for view
     $view->view->provider = $request->getParam('p', '');
     $view->view->items = $items;
     $view->view->actionName = $request->getActionName();
     $view->view->controllerName = $request->getControllerName();
     $view->view->coverflowEnabled = $this->config('coverflow.enabled', true);
 }
Example #23
0
 public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array(), $params = null)
 {
     if (!is_null($params)) {
         $this->params = $params;
     }
     parent::__construct($request, $response, $invokeArgs);
 }
Example #24
0
 public function init()
 {
     parent::init();
     // Wählt Hauptmenueeintrag nach Modul aus
     // Fuer einige Module muss das ueberschrieben werden (Review, Search).
     $this->getHelper('MainMenu')->setActive($this->_request->getModuleName());
 }
Example #25
0
 /**
  * Disables the view for the Zend Framework environment.
  *
  * @param Zend_Controller_Request_Abstract $request
  * @param Zend_Controller_Response_Abstract $response
  * @param array $invokeArgs
  */
 public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
 {
     parent::__construct($request, $response, $invokeArgs);
     $this->_helper->layout()->disableLayout();
     $this->getHelper('viewRenderer')->setNoRender();
     header("Connection: close");
 }
Example #26
0
 public function init()
 {
     parent::init();
     $this->getResponse()->setHeader('Content-Type', 'application/xml; charset="UTF-8"');
     if (preg_match('/(uploadimage)/', $this->getRequest()->getActionName())) {
         return $this;
     }
     $this->_current_device_id = $this->getRequest()->getParam('device_id');
     $this->_current_app = Application_Model_Application::getInstance();
     if ($customer_id = $this->getRequest()->getParam('customer_id')) {
         $customer->find($customer_id);
         if (!$customer->getId()) {
             $error = true;
         } else {
             $this->_current_customer = $customer;
         }
     } else {
         $this->_current_customer = $customer;
     }
     if (!$customer->getId()) {
         $error = true;
     }
     if ($error) {
         $this->_sendError();
     }
 }
Example #27
0
 /**
  * getResponse() -
  * 
  * @return Zend_Controller_Response_Abstract $response 
  */
 public function getResponse()
 {
     if (null === $this->_response) {
         $this->_response = $this->_actionController->getResponse();
     }
     return $this->_response;
 }
 public function init()
 {
     parent::init();
     /*
      * Initial instance of social plugin
      */
     $this->_social = HTS_Api::getInstance()->getSocialPlugin();
     $this->view->social = $this->_social;
     /*
      * Initial layout
      */
     $this->_helper->layout->setLayout('hts_canvas');
     /*
      * Check user authorize apps 
      */
     $this->_authenticate();
     $this->_authorize();
     /*
      * Get user infomation
      */
     $this->_id_user = $this->_social->getIdUser();
     $this->_id_social = $this->_social->getIdSocial();
     $this->_user = $this->_social->getUser();
     /*
      * Get all params
      */
     $this->_params = $this->_getAllParams();
     $this->_params['id_user'] = $this->_id_user;
     $this->_params['id_social'] = $this->_id_social;
     Zend_Registry::set('params', $this->_params);
     /*
      * Initial translate language
      */
     $this->_initTranslator();
 }
 public function init()
 {
     parent::init();
     $helper = new vkNgine_View_Helper_PublicUrl();
     $this->view->registerHelper($helper, 'publicUrl');
     $helper = new vkNgine_View_Helper_Seo();
     $this->view->registerHelper($helper, 'seo');
     $helper = new vkNgine_View_Helper_AssetUrl();
     $this->view->registerHelper($helper, 'assetUrl');
     $helper = new vkNgine_View_Helper_Dateformat();
     $this->view->registerHelper($helper, 'dateFormat');
     $searchForm = new Public_Model_Form_Search();
     $this->view->searchForm = $searchForm;
     $view = Zend_Registry::get('view');
     $appTitle = Zend_Registry::get('t')->_('GYM Tracker');
     $view->headTitle($appTitle, Zend_View_Helper_Placeholder_Container_Abstract::SET);
     if (!vkNgine_Auth::isAuthenticated()) {
         header("location:/auth/login");
         exit;
     }
     $modelExercises = new Model_Exercises();
     $this->view->exercises = $modelExercises;
     $user = vkNgine_Public_Auth::revalidate();
     $this->view->params = $this->getAllParams();
     Zend_Registry::set('user', $user);
     $this->view->assign('user', $user);
     $this->user = Zend_Registry::get('user');
     $this->view->t = Zend_Registry::get('t');
     $this->t = Zend_Registry::get('t');
 }
Example #30
0
 /**
  * Hook into action controller preDispatch() workflow
  *
  * @return void
  */
 public function preDispatch()
 {
     $role = 'guest';
     //        die($role);
     if ($this->_auth->hasIdentity()) {
         $user = $this->_auth->getIdentity();
         if (is_object($user)) {
             $role = $this->_auth->getIdentity()->role;
         }
     }
     $request = $this->_action->getRequest();
     $controller = $request->getControllerName();
     $action = $request->getActionName();
     $module = $request->getModuleName();
     //        $this->view->getLayout()->setLayout($module);
     $this->_controllerName = $controller;
     $resource = $controller;
     $privilege = $action;
     if (!$this->_acl->has($resource)) {
         $resource = null;
     }
     if (!$this->_acl->isAllowed($role, $resource, $privilege)) {
         if (!$this->_auth->hasIdentity()) {
             $noPermsAction = $this->_acl->getNoAuthAction();
         } else {
             $noPermsAction = $this->_acl->getNoAclAction();
         }
         $request->setModuleName($noPermsAction['module']);
         $request->setControllerName($noPermsAction['controller']);
         $request->setActionName($noPermsAction['action']);
         $request->setDispatched(false);
     }
 }