本文整理汇总了PHP中X_Env::_方法的典型用法代码示例。如果您正苦于以下问题:PHP X_Env::_方法的具体用法?PHP X_Env::_怎么用?PHP X_Env::_使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类X_Env
的用法示例。
在下文中一共展示了X_Env::_方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addAction
public function addAction()
{
$request = $this->getRequest();
$form = new Application_Form_Bookmark();
$form->setAction($this->_helper->url('add'));
if ($this->getRequest()->isPost()) {
if ($form->isValid($request->getPost())) {
$bookmark = new Application_Model_Bookmark();
$id = $request->getParam('id', false);
if ($id !== false && !is_null($id)) {
Application_Model_BookmarksMapper::i()->find($id, $bookmark);
if ($bookmark->isNew() || $bookmark->getId() != $id) {
throw new Exception(X_Env::_('p_bookmarks_err_invalidid'));
}
}
$url = $form->getValue('url');
$title = $form->getValue('title');
$description = $form->getValue('description');
$thumbnail = $form->getValue('thumbnail');
$bookmark->setUrl($url);
$bookmark->setTitle($title);
$bookmark->setThumbnail($thumbnail);
$bookmark->setDescription($description);
Application_Model_BookmarksMapper::i()->save($bookmark);
//return $this->_helper->redirector('index');
$this->_helper->redirector('index', 'bookmarks');
}
}
$this->view->form = $form;
}
示例2: proxyAction
function proxyAction()
{
// time to get params from get
/* @var $request Zend_Controller_Request_Http */
$request = $this->getRequest();
if (!$this->plugin->config('proxy.enabled', true) && !X_VlcShares_Plugins::helpers()->devices()->isWiimc()) {
throw new Exception(X_Env::_('p_animeftw_err_proxydisabled'));
}
// this action is so special.... no layout or viewRenderer
$this->_helper->viewRenderer->setNoRender();
$this->_helper->layout->disableLayout();
$videoUrl = $request->getParam('v', false);
// video file url
$refererUrl = $request->getParam('r', false);
// referer page needed
if ($videoUrl === false || $refererUrl === false) {
// invalid request
throw new Exception(X_Env::_('p_animeftw_err_invalidrequest'));
return;
}
$videoUrl = X_Env::decode($videoUrl);
$refererUrl = X_Env::decode($refererUrl);
// if user abort request (vlc/wii stop playing, this process ends
ignore_user_abort(false);
// close and clean the output buffer, everything will be read and send to device
ob_end_clean();
//$userAgent = $this->plugin->config('hide.useragent', true) ? 'User-Agent: vlc-shares/'.X_VlcShares::VERSION : 'User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20101019 Firefox/4.0.1';
$userAgent = 'User-Agent: vlc-shares/' . X_VlcShares::VERSION . ' animeftw/' . X_VlcShares_Plugins_AnimeFTW::VERSION;
$opts = array('http' => array('header' => array("Referer: {$refererUrl}", "User-Agent: {$userAgent}")));
$context = stream_context_create($opts);
// readfile open a file and send it directly to output buffer
readfile($videoUrl, false, $context);
}
示例3: init
public function init()
{
parent::init();
if (!X_VlcShares_Plugins::broker()->isRegistered('bookmarklets')) {
throw new Exception(X_Env::_('err_pluginnotregistered') . ": bookmarklets");
}
}
示例4: init
public function init()
{
// Set the method for the display form to POST
$this->setMethod('post');
$this->addElement('select', 'hoster', array('label' => X_Env::_('p_onlinelibrary_form_hoster_name'), 'description' => X_Env::_('p_onlinelibrary_form_hoster_description'), 'required' => true, 'filters' => array('StringTrim')));
$this->addElement('text', 'idVideo', array('label' => X_Env::_('p_onlinelibrary_form_idvideo_name'), 'description' => X_Env::_('p_onlinelibrary_form_idvideo_description'), 'required' => true, 'filters' => array('StringTrim')));
$this->addElement('text', 'category', array('label' => X_Env::_('p_onlinelibrary_form_category_name'), 'description' => X_Env::_('p_onlinelibrary_form_category_description'), 'required' => true, 'validators' => array(array('validator' => 'StringLength', 'options' => array(0, 50)))));
$this->addElement('checkbox', 'check', array('label' => X_Env::_('p_onlinelibrary_form_check_name'), 'description' => X_Env::_('p_onlinelibrary_form_check_description'), 'required' => false));
// Add the comment element
$this->addElement('text', 'title', array('label' => X_Env::_('p_onlinelibrary_form_title_name'), 'description' => X_Env::_('p_onlinelibrary_form_title_description'), 'required' => false, 'validators' => array(array('validator' => 'StringLength', 'options' => array(0, 50)))));
$this->addElement('textarea', 'description', array('label' => X_Env::_('p_onlinelibrary_form_description_name'), 'description' => X_Env::_('p_onlinelibrary_form_description_description'), 'rows' => '5', 'filters' => array('StripTags'), 'required' => false));
// Add the comment element
$this->addElement('text', 'thumbnail', array('label' => X_Env::_('p_onlinelibrary_form_thumbnail_name'), 'description' => X_Env::_('p_onlinelibrary_form_thumbnail_description'), 'required' => false));
// Add the submit button
$this->addElement('submit', 'submit', array('ignore' => true, 'label' => X_Env::_('p_onlinelibrary_form_submit')));
// Add the submit button
$this->addElement('button', 'abort', array('onClick' => 'javascript:history.back();', 'ignore' => true, 'label' => X_Env::_('p_onlinelibrary_form_abort')));
$this->addDisplayGroup(array('submit', 'abort'), 'buttons', array('decorators' => $this->getDefaultButtonsDisplayGroupDecorators()));
/*
// And finally add some CSRF protection
$this->addElement('hash', 'csrf', array(
'ignore' => true,
));
*/
}
示例5: init
public function init()
{
parent::init();
if (!X_VlcShares_Plugins::broker()->isRegistered('upnprenderer')) {
throw new Exception(X_Env::_('err_pluginnotregistered') . ": upnprenderer");
} else {
$this->plugin = X_VlcShares_Plugins::broker()->getPlugins('upnprenderer');
}
}
示例6: 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);
}
}
示例7: init
public function init()
{
// Set the method for the display form to POST
$this->setMethod('post')->setAttrib('enctype', 'multipart/form-data');
$this->addElement('file', 'file', array('label' => X_Env::_('plugin_install_label'), 'description' => X_Env::_('plugin_install_desc'), 'required' => true, 'filters' => array('StringTrim'), 'destination' => APPLICATION_PATH . '/../data/plugin/', 'validators' => array(array('validator' => 'Count', 'options' => array(false, 1)), array('validator' => 'Size', 'options' => array(false, ini_get('upload_max_filesize'))), array('validator' => 'Extension', 'options' => array(false, 'zip,xegg'))), 'decorators' => array('CompositeFile')));
// Add the submit button
$this->addElement('submit', 'submit', array('ignore' => true, 'label' => X_Env::_('plugin_installsubmit')));
// And finally add some CSRF protection
$this->addElement('hash', 'csrf', array('ignore' => true, 'salt' => 'plugin_install_salt'));
$this->addDisplayGroup(array('submit', 'csrf'), 'buttons', array('decorators' => $this->getDefaultButtonsDisplayGroupDecorators()));
}
示例8: init
public function init()
{
// Set the method for the display form to POST
$this->setMethod('post')->setAttrib('enctype', 'multipart/form-data');
$this->addElement('hidden', 'key', array('ignore' => false, 'decorators' => array('ViewHelper'), 'required' => true));
// Add the submit button
$this->addElement('submit', 'submit', array('ignore' => true, 'label' => X_Env::_('plugin_action_uninstall'), 'decorators' => array('ViewHelper')));
// And finally add some CSRF protection
$this->addElement('hash', 'csrf', array('ignore' => true, 'salt' => 'plugin_uconfirm_salt', 'decorators' => array('ViewHelper')));
$this->addDisplayGroup(array('submit', 'csrf', 'key'), 'buttons', array('decorators' => $this->getDefaultButtonsDisplayGroupDecorators()));
}
示例9: preGetControlItems
/**
* Add the button BackToStream in controls page
*
* @param X_Streamer_Engine $engine
* @param Zend_Controller_Action $controller the controller who handle the request
* @return array
*/
public function preGetControlItems(X_Streamer_Engine $engine, Zend_Controller_Action $controller)
{
// ignore if the streamer is not vlc
if (!$engine instanceof X_Streamer_Engine_RtmpDump) {
return;
}
$outputLink = "http://{%SERVER_NAME%}:{$this->helpers()->rtmpdump()->getStreamPort()}/";
$outputLink = str_replace(array('{%SERVER_IP%}', '{%SERVER_NAME%}'), array($_SERVER['SERVER_ADDR'], strstr($_SERVER['HTTP_HOST'], ':') ? strstr($_SERVER['HTTP_HOST'], ':') : $_SERVER['HTTP_HOST']), $outputLink);
$item = new X_Page_Item_PItem($this->getId(), X_Env::_('p_profiles_backstream'));
$item->setType(X_Page_Item_PItem::TYPE_PLAYABLE)->setIcon('/images/icons/play.png')->setLink($outputLink);
return new X_Page_ItemList_PItem(array($item));
}
示例10: init
public function init()
{
$this->setName('aclclass');
// Set the method for the display form to POST
$this->setMethod('post');
$this->addElement('text', 'name', array('label' => X_Env::_('p_auth_form_acl_class_name_label'), 'required' => true, 'filters' => array('StringTrim')));
$this->addElement('text', 'description', array('label' => X_Env::_('p_auth_form_acl_class_description_label'), 'required' => false, 'filters' => array('StringTrim'), 'validators' => array(array('validator' => 'StringLength', 'options' => array(0, 255)))));
// Add the submit button
$this->addElement('submit', 'submit', array('ignore' => true, 'label' => X_Env::_('submit'), 'decorators' => array('ViewHelper')));
// And finally add some CSRF protection
$this->addElement('hash', 'csrf', array('ignore' => true, 'salt' => __CLASS__));
$this->addDisplayGroup(array('submit', 'csrf'), 'buttons', array('decorators' => $this->getDefaultButtonsDisplayGroupDecorators()));
}
示例11: indexAction
/**
* Show the dashboard
*/
public function indexAction()
{
/* @var $messages X_Page_ItemList_Message */
$messages = new X_Page_ItemList_Message();
$messages->merge(X_VlcShares_Plugins::broker()->getIndexMessages($this));
$fm = $this->_helper->flashMessenger->getMessages();
foreach ($fm as $i => $m) {
$_m = new X_Page_Item_Message("fm-{$i}", '');
if (is_array($m)) {
if (array_key_exists('type', $m)) {
$_m->setType($m['type']);
}
if (array_key_exists('text', $m)) {
$_m->setLabel($m['text']);
}
} else {
$_m->setType(X_Page_Item_Message::TYPE_WARNING)->setLabel((string) $m);
}
$messages->append($_m);
}
$news = X_VlcShares_Plugins::broker()->getIndexNews($this);
$manageLinks = new X_Page_ItemList_ManageLink();
$item = new X_Page_Item_ManageLink('core-manage-browse', X_Env::_('manage_goto_browsetitle'));
$item->setTitle(X_Env::_('manage_goto_browse'))->setIcon('/images/manage/browse.png')->setLink(array('controller' => 'index', 'action' => 'collections'), 'default', true);
$manageLinks->append($item);
$item = new X_Page_Item_ManageLink('core-manage-test', X_Env::_('manage_goto_testtitle'));
$item->setTitle(X_Env::_('manage_goto_test'))->setIcon('/images/manage/test.png')->setLink(array('controller' => 'test', 'action' => 'index'), 'default', true);
$manageLinks->append($item);
$item = new X_Page_Item_ManageLink('core-manage-configs', X_Env::_('manage_goto_configstitle'));
$item->setTitle(X_Env::_('manage_goto_configs'))->setIcon('/images/manage/configs.png')->setLink(array('controller' => 'gconfigs', 'action' => 'index'), 'default', true);
$manageLinks->append($item);
$item = new X_Page_Item_ManageLink('core-manage-threads', X_Env::_('manage_goto_threadstitle'));
$item->setTitle(X_Env::_('manage_goto_threads'))->setIcon('/images/manage/threads.png')->setLink(array('controller' => 'tmanager', 'action' => 'index'), 'default', true);
$manageLinks->append($item);
$manageLinks->merge(X_VlcShares_Plugins::broker()->getIndexManageLinks($this));
// fetch links from plugins
$actionLinks = X_VlcShares_Plugins::broker()->getIndexActionLinks($this);
$statistics = X_VlcShares_Plugins::broker()->getIndexStatistics($this);
$this->view->version = X_VlcShares::VERSION;
//$this->view->configPath = X_VlcShares::config();
//$this->view->test = $this->_helper->url('index', 'test');
//$this->view->pcstream = $this->_helper->url('pcstream', 'index');
//$this->view->pcstream_enabled = ($this->options->pcstream->get('commanderEnabled', false) && $this->vlc->isRunning());
$this->view->actionLinks = $actionLinks;
$this->view->manageLinks = $manageLinks;
$this->view->statistics = $statistics;
$this->view->news = $news;
$this->view->messages = $messages;
// i need to get first class links
}
示例12: init
public function init()
{
$this->setName('aclresource');
// Set the method for the display form to POST
$this->setMethod('post');
$this->addElement('text', 'key', array('label' => X_Env::_('p_auth_form_acl_resource_key_label'), 'description' => X_Env::_('p_auth_form_acl_resource_key_desc'), 'required' => true, 'filters' => array('StringTrim')));
$this->addElement('select', 'class', array('label' => X_Env::_('p_auth_form_acl_resource_class_label'), 'description' => X_Env::_('p_auth_form_acl_resource_class_desc'), 'required' => true));
$this->addElement('select', 'generator', array('label' => X_Env::_('p_auth_form_acl_resource_generator_label'), 'description' => X_Env::_('p_auth_form_acl_resource_generator_desc'), 'required' => true));
// Add the submit button
$this->addElement('submit', 'submit', array('ignore' => true, 'label' => X_Env::_('submit'), 'decorators' => array('ViewHelper')));
// And finally add some CSRF protection
$this->addElement('hash', 'csrf', array('ignore' => true, 'salt' => __CLASS__));
$this->addDisplayGroup(array('submit', 'csrf'), 'buttons', array('decorators' => $this->getDefaultButtonsDisplayGroupDecorators()));
}
示例13: init
public function init()
{
// Set the method for the display form to POST
$this->setMethod('post');
$decorators = array(array('ViewHelper'), array('Errors'), array('Description', array('tag' => 'p', 'class' => 'description')));
$this->addElement('text', 'label', array('label' => X_Env::_('p_youtube_form_account_label'), 'description' => X_Env::_('p_youtube_form_account_label_desc'), 'required' => true, 'filters' => array('StringTrim')));
// Add the submit button
$this->addElement('submit', 'submit', array('ignore' => true, 'label' => X_Env::_('submit')));
// Add the submit button
$this->addElement('reset', 'abort', array('ignore' => true, 'label' => X_Env::_('abort')));
// And finally add some CSRF protection
$this->addElement('hash', 'csrf', array('ignore' => true, 'salt' => 'p_youtube_account_new_salt'));
$this->addElement('hidden', 'id', array('ignore' => true, 'required' => false));
$this->addDisplayGroup(array('submit', 'abort', 'csrf', 'id'), 'buttons', array('decorators' => $this->getDefaultButtonsDisplayGroupDecorators()));
}
示例14: 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');
}
}
示例15: init
public function init()
{
// Set the method for the display form to POST
$this->setMethod('post');
$this->addElement('text', 'label', array('label' => X_Env::_('p_filesystem_share_label_label'), 'description' => X_Env::_('p_filesystem_share_label_desc'), 'required' => true, 'filters' => array('StringTrim')));
$this->addElement('text', 'path', array('label' => X_Env::_('p_filesystem_share_path_label'), 'description' => X_Env::_('p_filesystem_share_path_desc'), 'required' => true, 'filters' => array('StringTrim'), 'validators' => array(array('validator' => 'StringLength', 'options' => array(0, 255)))));
// Add the submit button
$this->addElement('submit', 'submit', array('ignore' => true, 'label' => X_Env::_('submit')));
// Add the submit button
$this->addElement('reset', 'abort', array('ignore' => true, 'label' => X_Env::_('abort')));
// And finally add some CSRF protection
$this->addElement('hash', 'csrf', array('ignore' => true, 'salt' => __CLASS__));
$this->addElement('hidden', 'id', array('ignore' => true, 'required' => false));
$this->addDisplayGroup(array('submit', 'csrf', 'id', 'abort'), 'buttons', array('decorators' => $this->getDefaultButtonsDisplayGroupDecorators()));
}