當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Controller_Action_Helper_FlashMessenger類代碼示例

本文整理匯總了PHP中Zend_Controller_Action_Helper_FlashMessenger的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Controller_Action_Helper_FlashMessenger類的具體用法?PHP Zend_Controller_Action_Helper_FlashMessenger怎麽用?PHP Zend_Controller_Action_Helper_FlashMessenger使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Zend_Controller_Action_Helper_FlashMessenger類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: preDispatch

 /**
  * Called before an action is dispatched by Zend_Controller_Dispatcher.
  *
  * This callback allows for proxy or filter behavior.  By altering the
  * request and resetting its dispatched flag (via
  * {@link Zend_Controller_Request_Abstract::setDispatched() setDispatched(false)}),
  * the current action may be skipped.
  *
  * @param  Zend_Controller_Request_Abstract $request
  * @return void
  */
 public function preDispatch(Zend_Controller_Request_Abstract $request)
 {
     $oAuth = Zend_Auth::getInstance();
     $oAcl = $this->getAcl();
     // Default role
     $sRole = 'all';
     if ($oAuth->hasIdentity()) {
         $oIdentity = $oAuth->getIdentity();
         $sRole = isset($oIdentity->sRole) ? $oIdentity->sRole : 'identify';
     }
     $sModule = $request->module;
     $sController = $request->controller;
     $sAction = $request->action;
     $sResource = $sController . ':' . $sAction;
     if ($oAcl->has($sResource)) {
         if (!$oAcl->isAllowed('all', $sResource)) {
             // Access is not allowed
             if (!$oAcl->isAllowed($sRole, $sResource)) {
                 //$flashMessenger = new Zend_Controller_Action_Helper_FlashMessenger();
                 //$flashMessenger->addMessage('Acesso negado');
                 $request->setModuleName('default');
                 $request->setControllerName('index');
                 $request->setActionName('index');
             }
         }
     } else {
         $flashMessenger = new Zend_Controller_Action_Helper_FlashMessenger();
         $flashMessenger->addMessage('Acesso negado');
         $request->setModuleName('default');
         $request->setControllerName('index');
         $request->setActionName('index');
     }
 }
開發者ID:julioprotzek,項目名稱:eventos,代碼行數:44,代碼來源:Acl.php

示例2: addMessage

 /**
  * addMessage() - Add a message to flash message
  *
  * @param  string $message
  * @param  string $namespace
  * @return LoSo_Zend_Controller_Action_Helper_FlashMessenger Provides a fluent interface
  */
 public function addMessage($message, $namespace = null)
 {
     if (!empty($namespace)) {
         $this->setNamespace($namespace);
     }
     return parent::addMessage($message);
 }
開發者ID:nuxwin,項目名稱:losolib,代碼行數:14,代碼來源:FlashMessenger.php

示例3: addMessage

 /**
  * addMessage() - Add a message to flash message
  *
  * @param  string $message
  * @return Zend_Controller_Action_Helper_FlashMessenger Provides a fluent interface
  */
 public function addMessage($message, $type = self::MSG_SUCCESS)
 {
     $msg = new stdClass();
     $msg->type = $type;
     $msg->message = $message;
     return parent::addMessage($msg);
 }
開發者ID:ncsuwebdev,項目名稱:otframework,代碼行數:13,代碼來源:Messenger.php

示例4: indexAction

 public function indexAction()
 {
     $toolbar = new Statistics_Form_Toolbar();
     $options = $this->_helper->Options->getOptions($toolbar, $this->_user['clientid']);
     $params = $this->_helper->Params->getParams($toolbar, $options);
     $charts = new Statistics_Model_Charts();
     $charts->createCharts(13, 500, 300, $this->view->translate('STATISTICS_UNCATEGORIZED'), $params, $options);
     $quotesDb = new Sales_Model_DbTable_Quote();
     $quotes = $quotesDb->fetchAll($quotesDb->select()->where('quoteid = ?', 0)->order('id desc')->limit(5));
     $this->view->quotes = $quotes;
     $salesordersDb = new Sales_Model_DbTable_Salesorder();
     $salesorders = $salesordersDb->fetchAll($salesordersDb->select()->where('salesorderid = ?', 0)->order('id desc')->limit(5));
     $this->view->salesorders = $salesorders;
     $invoicesDb = new Sales_Model_DbTable_Invoice();
     $invoices = $invoicesDb->fetchAll($invoicesDb->select()->where('invoiceid = ?', 0)->order('id desc')->limit(5));
     $this->view->invoices = $invoices;
     $quoterequestsDb = new Purchases_Model_DbTable_Quoterequest();
     $quoterequests = $quoterequestsDb->fetchAll($quoterequestsDb->select()->where('quoterequestid = ?', 0)->order('id desc')->limit(5));
     $this->view->quoterequests = $quoterequests;
     $purchaseordersDb = new Purchases_Model_DbTable_Purchaseorder();
     $purchaseorders = $purchaseordersDb->fetchAll($purchaseordersDb->select()->where('purchaseorderid = ?', 0)->order('id desc')->limit(5));
     $this->view->purchaseorders = $purchaseorders;
     $this->view->options = $options;
     $this->view->toolbar = new Application_Form_Toolbar();
     $this->view->messages = $this->_flashMessenger->getMessages();
 }
開發者ID:dewawi,項目名稱:dewawi,代碼行數:26,代碼來源:IndexController.php

示例5: checkAuth

 public function checkAuth()
 {
     if (!$this->isPublic() && !Zend_Auth::getInstance()->hasIdentity()) {
         $this->_flash->addMessage('You must be logged in');
         $this->_redirector->gotoSimple('login', 'account');
     }
 }
開發者ID:ajbrown,項目名稱:bitnotion,代碼行數:7,代碼來源:Action.php

示例6: _flash

 /**
  * Uklada stavove zpravy
  *
  * @param string $message Zprava
  * @param const $status Status
  * @param bool $nextRequest Zobrazit hned, nebo az pri dalsim requestu
  */
 protected function _flash($message, $status, $nextRequest = true)
 {
     if ($nextRequest == false) {
         $this->view->flash = array('message' => $message, 'status' => $status);
     } else {
         $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');
         $this->_flashMessenger->addMessage(array('message' => $message, 'status' => $status));
     }
 }
開發者ID:besters,項目名稱:My-Base,代碼行數:16,代碼來源:Action.php

示例7: testClearMessages

 public function testClearMessages()
 {
     $this->helper->addMessage('foo');
     $this->helper->addMessage('bar');
     $this->assertTrue($this->helper->hasMessages());
     $this->assertEquals(2, count($this->helper));
     $this->helper->clearMessages();
     $this->assertFalse($this->helper->hasMessages());
     $this->assertEquals(0, count($this->helper));
 }
開發者ID:jorgenils,項目名稱:zend-framework,代碼行數:10,代碼來源:FlashMessengerTest.php

示例8: authenticateAction

 public function authenticateAction()
 {
     try {
         $user = Pocs_User::login($this->getRequest()->getParam('un'), $this->getRequest()->getParam('pw'), $this->_getAuth(), $this->_getAcl());
     } catch (Exception $e) {
         $this->_flashMessenger->addMessage($e->getMessage());
         $this->_helper->redirector('index', 'login');
     }
     $this->_flashMessenger->addMessage(Zend_Debug::dump($user, 'Authenticated User', false));
     //TODO: Redirect somewhere useful..
     $this->_helper->redirector('index', 'login');
 }
開發者ID:stm555,項目名稱:proof-of-concepts,代碼行數:12,代碼來源:LoginController.php

示例9: searchAction

 public function searchAction()
 {
     $this->_helper->viewRenderer->setRender('index');
     $this->_helper->getHelper('layout')->disableLayout();
     $lenght = $this->_getParam('lenght', 25);
     $toolbar = new Statistics_Form_Toolbar();
     $options = $this->_helper->Options->getOptions($toolbar, $this->_user['clientid']);
     $params = $this->_helper->Params->getParams($toolbar, $options);
     $chart = new Statistics_Model_Charts();
     $chart->createCharts($lenght, 1000, 400, $this->view->translate("STATISTICS_UNCATEGORIZED"), $params, $options);
     $this->view->lenght = $lenght;
     $this->view->options = $options;
     $this->view->toolbar = $toolbar;
     $this->view->messages = $this->_flashMessenger->getMessages();
 }
開發者ID:dewawi,項目名稱:dewawi,代碼行數:15,代碼來源:IndexController.php

示例10: addMessage

 /**
  * Agrega un mensaje
  *
  * @param string $message Mensaje a mostrar en pantalla
  * @param string $level   Nivel del mensaje
  *
  * @return void
  */
 public function addMessage($message, $level = self::INFO)
 {
     $msg = new stdClass();
     $msg->message = $message;
     $msg->level = $level;
     parent::addMessage($msg);
 }
開發者ID:luismayta,項目名稱:zrt,代碼行數:15,代碼來源:MyFlashMessenger.php

示例11: postDispatch

 /**
  * Events after the controller dispatching
  */
 public function postDispatch()
 {
     $infoProfiler = '';
     //-------------------------
     $request = $this->getRequest();
     if ($this->_breadcrumbs) {
         $this->view->breadcrumbs = $this->_breadcrumbs;
         $this->view->title = $this->_breadcrumbs->getTitle();
     }
     //Передадим признак Ajax запроса
     $this->view->isAjaxRequest = $this->_isAjaxRequest;
     //Передадим сообщения в шаблоны
     $this->view->messages = $this->_flashMessenger->getMessages();
     // Запомним время выполения цикла диспетчеризации
     $params = $request->getParams();
     foreach ($params as $key => $value) {
         if (!is_string($value)) {
             continue;
         }
         if ($infoProfiler) {
             $infoProfiler .= "{$key} = {$value}<br>";
         } else {
             $infoProfiler .= $this->Translate("Время выполнения запроса") . ":<br />{$key} = {$value}<br />";
         }
     }
     $infoProfiler .= "<br />" . $this->Translate("Равно") . " = ";
     Default_Plugin_SysBox::profilerTime2Registry($this->_startTimeDispatch, $infoProfiler);
 }
開發者ID:bsa-git,項目名稱:zf-myblog,代碼行數:31,代碼來源:BaseController.php

示例12: testDirectProxiesToAddMessage

 public function testDirectProxiesToAddMessage()
 {
     $this->markTestSkipped();
     $this->helper->direct('foo');
     $this->assertTrue($this->helper->hasMessages());
     $this->assertEquals(1, count($this->helper));
 }
開發者ID:stunti,項目名稱:zf2,代碼行數:7,代碼來源:FlashMessengerTest.php

示例13: verifyEmailAction

 public function verifyEmailAction()
 {
     $user_id = (int) $this->getRequest()->getParam('id');
     $guid = (string) $this->getRequest()->getParam('guid');
     if (!empty($user_id) && !empty($guid)) {
         $model = new Model_User();
         $model = $model->find($user_id);
         if ($model->getEnabled()) {
             $this->_flashMessenger->addMessage("Your account has already been activated, you can now Login.");
             $this->_redirect('/user/login/');
             return;
         }
         if ($guid == hash('sha1', $model->getSalt() . $model->getId() . $model->getPassword())) {
             $model->setEnabled(1);
             $model->setEmailVerified(1);
             $model->save();
             $this->user = $model;
             $this->_flashMessenger->addMessage("Thanks for activating your account, you can now Login.");
             $this->_redirect('/user/login/');
             return;
         } else {
             $this->_redirect('/user/register/');
             return;
         }
     } else {
         $this->_redirect('/');
     }
 }
開發者ID:Zerone,項目名稱:ImJob.org,代碼行數:28,代碼來源:UserController.php

示例14: addAction

 public function addAction()
 {
     $form = new Front_Form_Contact();
     if ($this->_request->isPost()) {
         $data = $this->_request->getPost();
         if ($form->isValid($data)) {
             $dataFiltrees = $form->getValues();
             $contact = new Application_Model_Contact();
             $contact->setPrenom($dataFiltrees['prenom'])->setNom($dataFiltrees['nom'])->setEmail($dataFiltrees['email'])->setTelephone($dataFiltrees['telephone']);
             $this->mapper->insert($contact);
             $this->_flashMessenger->addMessage('Le contact ' . $contact->getPrenom() . ' a bien été créé');
             $this->_redirector->gotoRouteAndExit(['controller' => 'contact'], null, true);
         }
     }
     $this->view->contactForm = $form;
 }
開發者ID:bioub,項目名稱:Formation_ZF1_Viveris_2016_02,代碼行數:16,代碼來源:ContactController.php

示例15: viewAction

 /**
  * View feed information
  * 
  * @return void
  */
 public function viewAction()
 {
     //get flash messages
     $this->view->messages = $this->_flashMessenger->getMessages();
     $id = $this->getRequest()->getParam('id');
     //get feedinfo
     $feeds = new Feeds();
     $this->view->feed = $feeds->getBySlug($id);
     if (!$this->view->feed) {
         throw new Zend_Exception('Feed doesn\'t exist');
     }
     $this->view->feed->views++;
     $this->view->feed->save();
     //get posts
     $limit = 5;
     $page = $this->getRequest()->getParam('page') ? $this->getRequest()->getParam('page') : 1;
     $posts = new Posts();
     $this->view->posts = $posts->getByFeedId($this->view->feed->id, $page, $limit);
     $total = $posts->getByFeedId($this->view->feed->id, $page, 0, true)->total;
     $this->view->paginator = Zend_Paginator::factory($total);
     $this->view->paginator->setCurrentPageNumber($page);
     $this->view->paginator->setItemCountPerPage($limit);
     $this->view->keywords = implode('', array('ifphp', 'news aggragator', 'support,' . $this->view->feed->title));
     $this->view->description = 'ifPHP, The PHP news Aggragator: ' . $this->view->feed->description;
 }
開發者ID:aprondak,項目名稱:ifphp,代碼行數:30,代碼來源:FeedController.php


注:本文中的Zend_Controller_Action_Helper_FlashMessenger類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。