• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Zend_Controller_Action类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Zend_Controller_Action的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Action类的具体用法?PHP Zend_Controller_Action怎么用?PHP Zend_Controller_Action使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Zend_Controller_Action类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getShareItems

 /**
  * 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;
 }
开发者ID:google-code-backups,项目名称:vlc-shares,代码行数:41,代码来源:DBForever.php


示例2: doAction

 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;
 }
开发者ID:DBezemer,项目名称:server,代码行数:30,代码来源:VirusScanListAction.php


示例3: doAction

 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;
 }
开发者ID:DBezemer,项目名称:server,代码行数:31,代码来源:DrmProfileListAction.php


示例4: gen_beforePageBuild

 /**
  * 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'));
     }
 }
开发者ID:google-code-backups,项目名称:vlc-shares,代码行数:30,代码来源:RedirectControls.php


示例5: doAction

 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);
 }
开发者ID:DBezemer,项目名称:server,代码行数:27,代码来源:XsltTesterApiAction.php


示例6: doAction

 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;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:27,代码来源:EventNotificationTemplatesListAction.php


示例7: doAction

 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);
 }
开发者ID:DBezemer,项目名称:server,代码行数:26,代码来源:KalturaEntryInvestigateLogAction.php


示例8: doAction

 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);
 }
开发者ID:DBezemer,项目名称:server,代码行数:8,代码来源:XsltTesterAction.php


示例9: gen_afterPageBuild

 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);
     }
 }
开发者ID:google-code-backups,项目名称:vlc-shares,代码行数:9,代码来源:EmptyLists.php


示例10: gen_beforePageBuild

 /**
  * 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);
     }
 }
开发者ID:google-code-backups,项目名称:vlc-shares,代码行数:13,代码来源:FirstRunSetup.php


示例11: gen_afterPageBuild

 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);
         }
     }
 }
开发者ID:google-code-backups,项目名称:vlc-shares,代码行数:11,代码来源:WorkaroundWiimcPlaylistItemsBug.php


示例12: getViewFromAction

 /**
  * 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;
 }
开发者ID:kandy,项目名称:HamsterCMF,代码行数:16,代码来源:XsltMessage.php


示例13: render

 /**
  * @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
     }
 }
开发者ID:nurikk,项目名称:EvilRocketFramework,代码行数:19,代码来源:Alfa.php


示例14: doAction

 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);
     }
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:13,代码来源:GenericDistributionProviderDeleteAction.php


示例15: getShareItems

 /**
  * 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;
 }
开发者ID:google-code-backups,项目名称:vlc-shares,代码行数:57,代码来源:GoGoCinema.php


示例16: doAction

 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);
         }
     }
 }
开发者ID:kubrickfr,项目名称:server,代码行数:51,代码来源:DrmProfileConfigureAction.php


示例17: doAction

 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);
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:14,代码来源:DrmProfileDeleteAction.php


示例18: doAction

 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);
     }
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:14,代码来源:DistributionProfileUpdateStatusAction.php


示例19: getShareItems

 /**
  * 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;
 }
开发者ID:google-code-backups,项目名称:vlc-shares,代码行数:55,代码来源:AllSp.php


示例20: getIndexNews

 /**
  * 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');
     }
 }
开发者ID:google-code-backups,项目名称:vlc-shares,代码行数:20,代码来源:WidgetDevNews.php



注:本文中的Zend_Controller_Action类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Zend_Controller_Action_HelperBroker类代码示例发布时间:2022-05-23
下一篇:
PHP Zend_Console_Getopt类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap