本文整理汇总了PHP中Zend_Controller_Action::getHelper方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Action::getHelper方法的具体用法?PHP Zend_Controller_Action::getHelper怎么用?PHP Zend_Controller_Action::getHelper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Controller_Action
的用法示例。
在下文中一共展示了Zend_Controller_Action::getHelper方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: 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);
}
}
示例3: 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
}
}
示例4: 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);
}
}
示例5: 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);
}
}
示例6: doAction
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);
}
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:15,代码来源:EventNotificationTemplateUpdateStatusAction.php
示例7: gen_afterPageBuild
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);
}
示例8: 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;
}
示例9: 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);
}
示例10: 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);
}
示例11: doAction
public function doAction(Zend_Controller_Action $action)
{
$action->getHelper('layout')->disableLayout();
$dropFolderId = $this->_getParam('dropFolderId');
$newStatus = $this->_getParam('dropFolderStatus');
$client = Infra_ClientHelper::getClient();
$dropFolderPluginClient = Kaltura_Client_DropFolder_Plugin::get($client);
$updatedDropFolder = new Kaltura_Client_DropFolder_Type_DropFolder();
$updatedDropFolder->status = $newStatus;
try {
$updatedDropFolder = $dropFolderPluginClient->dropFolder->update($dropFolderId, $updatedDropFolder);
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:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:17,代码来源:DropFolderSetStatusAction.php
示例12: getSelectionItems
public function getSelectionItems($provider, $location, $pid, Zend_Controller_Action $controller)
{
// we want to expose items only if pid is this plugin
if ($this->getId() != $pid) {
return;
}
// check for resolvable $location
// this plugin is useless if i haven't an access
// to the real location (url for stream or path for file)
$provider = X_VlcShares_Plugins::broker()->getPlugins($provider);
if (!$provider instanceof X_VlcShares_Plugins_ResolverInterface) {
return;
}
$providerClass = get_class($provider);
X_Debug::i('Plugin triggered');
$urlHelper = $controller->getHelper('url');
// i try to mark current selected sub based on $this->getId() param
// in $currentSub i get the name of the current profile
$currentSub = $controller->getRequest()->getParam($this->getId(), false);
if ($currentSub !== false) {
$currentSub = X_Env::decode($currentSub);
}
$return = new X_Page_ItemList_PItem();
$item = new X_Page_Item_PItem($this->getId() . '-none', X_Env::_('p_audioswitcher_selection_none'));
$item->setType(X_Page_Item_PItem::TYPE_ELEMENT)->setLink(array('action' => 'mode', $this->getId() => null, 'pid' => null), 'default', false)->setHighlight($currentSub === false);
$return->append($item);
// i do the check for this on top
// location param come in a plugin encoded way
$location = $provider->resolveLocation($location);
// check if infile support is enabled
// by default infile.enabled is true
if ($this->config('infile.enabled', true)) {
// check for infile tracks
$infileTracks = $this->helpers()->stream()->setLocation($location)->getAudiosInfo();
//X_Debug::i(var_export($infileSubs, true));
foreach ($infileTracks as $streamId => $track) {
X_Debug::i("Valid infile-sub: [{$streamId}] {$track['language']} ({$track['format']})");
$item = new X_Page_Item_PItem($this->getId() . '-stream-' . $streamId, X_Env::_("p_audioswitcher_subtype_" . self::STREAM) . " {$streamId} {$track['language']} {$track['format']}");
$item->setType(X_Page_Item_PItem::TYPE_ELEMENT)->setCustom(__CLASS__ . ':sub', self::STREAM . ":{$streamId}")->setLink(array('action' => 'mode', 'pid' => null, $this->getId() => X_Env::encode(self::STREAM . ":{$streamId}")), 'default', false)->setHighlight($currentSub == self::STREAM . ":{$streamId}");
$return->append($item);
}
}
// for file system source i will search for subs in filename notation
// by default file.enabled is true
if ($this->config('file.enabled', true) && is_a($provider, 'X_VlcShares_Plugins_FileSystem')) {
$dirname = pathinfo($location, PATHINFO_DIRNAME);
$filename = pathinfo($location, PATHINFO_FILENAME);
$extTracks = $this->getFSTracks($dirname, $filename);
foreach ($extTracks as $streamId => $track) {
X_Debug::i("Valid extfile-sub: {$track['language']} ({$track['format']})");
$item = new X_Page_Item_PItem($this->getId() . '-file-' . $streamId, X_Env::_("p_audioswitcher_subtype_" . self::FILE) . " {$track['language']} ({$track['format']})");
$item->setType(X_Page_Item_PItem::TYPE_ELEMENT)->setCustom(__CLASS__ . ':sub', self::FILE . ":{$streamId}")->setLink(array('action' => 'mode', 'pid' => null, $this->getId() => X_Env::encode(self::FILE . ":{$streamId}")), 'default', false)->setHighlight($currentSub == self::FILE . ":{$streamId}");
$return->append($item);
}
}
// general profiles are in the bottom of array
return $return;
}
示例13: 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);
}
}
示例14: dispatchRequest
protected function dispatchRequest(Zend_Controller_Request_Http $request, X_Page_ItemList_PItem $items, Zend_Controller_Action $controller)
{
/* @var $view Zend_Controller_Action_Helper_ViewRenderer */
$view = $controller->getHelper('viewRenderer');
/* @var $layout Zend_Layout_Controller_Action_Helper_Layout */
$layout = $controller->getHelper('layout');
try {
$view->setNoRender(true);
$layout->disableLayout();
} catch (Exception $e) {
X_Debug::e("Layout or View not enabled: " . $e->getMessage());
}
$result = array();
$actionName = $request->getActionName();
$controllerName = $request->getControllerName();
$result['controller'] = $controllerName;
$result['action'] = $actionName;
$result['success'] = true;
$result['items'] = array();
/* @var $urlHelper Zend_Controller_Action_Helper_Url */
$urlHelper = $controller->getHelper('url');
$skipMethod = array('getCustom', 'getLinkParam', 'getLinkAction', 'getLinkController');
foreach ($items->getItems() as $itemId => $item) {
/* @var $item X_Page_Item_PItem */
$aItem = array();
$methods = get_class_methods(get_class($item));
foreach ($methods as $method) {
if (array_search($method, $skipMethod) !== false) {
continue;
}
if ($method == "getIcon") {
$aItem['icon'] = $request->getBaseUrl() . $item->getIcon();
} elseif (X_Env::startWith($method, 'get')) {
$aItem[lcfirst(substr($method, 3))] = $item->{$method}();
} elseif (X_Env::startWith($method, 'is')) {
$aItem[lcfirst(substr($method, 2))] = $item->{$method}();
}
}
$result['items'][] = $aItem;
}
/* @var $jsonHelper Zend_Controller_Action_Helper_Json */
$jsonHelper = $controller->getHelper('Json');
$jsonHelper->direct($result, true, false);
}
示例15: 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);
}
}
}