本文整理汇总了PHP中Zend_Controller_Action类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Action类的具体用法?PHP Zend_Controller_Action怎么用?PHP Zend_Controller_Action使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Controller_Action类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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'));
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
示例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;
}
示例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
}
}
示例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);
}
}
示例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;
}