本文整理汇总了PHP中Zend_Controller_Action_Helper_FlashMessenger::getMessages方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Action_Helper_FlashMessenger::getMessages方法的具体用法?PHP Zend_Controller_Action_Helper_FlashMessenger::getMessages怎么用?PHP Zend_Controller_Action_Helper_FlashMessenger::getMessages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Controller_Action_Helper_FlashMessenger
的用法示例。
在下文中一共展示了Zend_Controller_Action_Helper_FlashMessenger::getMessages方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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();
}
示例2: getMessages
/**
* Récupère les messages
*
* @return array
*/
private function getMessages()
{
// Messages
$array_messages = $this->flashMessenger->getMessages();
// Current Messages
$array_currentMessages = $this->flashMessenger->getCurrentMessages();
return $this->arrayUnique(array_merge($array_currentMessages, $array_messages));
}
示例3: 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();
}
示例4: viewAction
public function viewAction()
{
$id = $this->_getParam('id', 0);
$processDb = new Processes_Model_DbTable_Process();
$process = $processDb->getProcess($id);
$process['processdate'] = date('d.m.Y', strtotime($process['processdate']));
//Get positions
$positionsDb = new Processes_Model_DbTable_Processpos();
$positionsObject = $positionsDb->fetchAll($positionsDb->select()->where('processid = ?', $id)->order('ordering'));
$positions = array();
foreach ($positionsObject as $positionObject) {
foreach ($positionObject as $key => $value) {
$positions[$positionObject->id][$key] = $value;
}
$positions[$positionObject->id]['price'] = $this->_currency->toCurrency($positions[$positionObject->id]['price']);
$positions[$positionObject->id]['quantity'] = Zend_Locale_Format::toNumber($positions[$positionObject->id]['quantity'], array('precision' => 2, 'locale' => Zend_Registry::get('Zend_Locale')));
}
//Get units of measurement
$uomDb = new Application_Model_DbTable_Uom();
$uom = $uomDb->fetchAll();
$uoms = array();
foreach ($uom as $value) {
$uoms[$value->title] = $value->title;
}
$toolbar = new Processes_Form_Toolbar();
$this->view->toolbar = $toolbar;
$this->view->process = $process;
$this->view->positions = $positions;
$this->view->uoms = $uoms;
$this->view->evaluate = $this->evaluate($positionsObject, $process['taxfree']);
$this->view->messages = $this->_flashMessenger->getMessages();
}
示例5: viewAction
public function viewAction()
{
$id = $this->_getParam('id', 0);
$locale = Zend_Registry::get('Zend_Locale');
$invoiceDb = new Sales_Model_DbTable_Invoice();
$invoice = $invoiceDb->getInvoice($id);
$invoice['taxes'] = $this->_currency->toCurrency($invoice['taxes']);
$invoice['subtotal'] = $this->_currency->toCurrency($invoice['subtotal']);
$invoice['total'] = $this->_currency->toCurrency($invoice['total']);
$positions = $this->getPositions($id);
foreach ($positions as $position) {
$position->description = str_replace("\n", '<br>', $position->description);
$position->price = $this->_currency->toCurrency($position->price);
$position->quantity = Zend_Locale_Format::toNumber($position->quantity, array('precision' => 2, 'locale' => $locale));
}
//E-Mail form
$email = new Application_Form_Email();
$files = array(0 => "/cache/invoice/" . $id . ".pdf");
$toolbar = new Sales_Form_Toolbar();
$this->view->toolbar = $toolbar;
$this->view->files = $files;
$this->view->invoice = $invoice;
$this->view->positions = $positions;
$this->view->email = $email;
$this->view->messages = $this->_flashMessenger->getMessages();
}
示例6: 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;
}
示例7: 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);
}
示例8: init
public function init()
{
parent::init();
// Messages
$flashMessenger = new Zend_Controller_Action_Helper_FlashMessenger();
$this->view->messages = $flashMessenger->getMessages();
$flashMessenger->clearMessages();
}
示例9: indexAction
/**
* The default action - show the home page
*/
public function indexAction()
{
$this->view->messages = $this->_flashMessenger->getMessages();
$loginForm = new Zend_Form();
$unField = new Zend_Form_Element_Text('un');
$unField->setLabel('User Name');
$pwField = new Zend_Form_Element_Password('pw');
$pwField->setLabel('Password');
$loginForm->addElement($unField);
$loginForm->addElement($pwField);
$loginForm->addDisplayGroup(array('un', 'pw'), 'authGroup')->getDisplayGroup('authGroup')->setLegend('Authentication');
//view specific form additions
//TODO: not sure if $_SERVER['HTTP_HOST'] is dependable enough to use in this case .. XSS vulnerability
//TODO: programmatically determine http/https
$loginForm->setAction('http://' . $_SERVER['HTTP_HOST'] . $this->getFrontController()->getBaseUrl() . $this->_helper->url('authenticate'));
$loginForm->addElement('submit', 'login');
$this->view->loginForm = $loginForm;
}
示例10: getMessages
/**
* getMessages() - Get messages from a specific namespace
*
* @param unknown_type $namespace
* @return array
*/
public function getMessages($type = null)
{
if ($type === null) {
return parent::getMessages();
}
if (isset(self::$_messages[$this->_namespace][$type])) {
return self::$_messages[$this->_namespace][$type];
}
return array();
}
示例11: messageAction
/**
* Action - message
* message display
*
* @return void
*/
public function messageAction()
{
$params = $this->_getAllParams();
if (isset($params['message'])) {
$this->view->class_message = $params['class_message'];
$this->view->message = $params['message'];
}
if ($this->_flashMessenger->hasMessages()) {
$this->view->class_message = 'warning';
$this->view->message = $this->_flashMessenger->getMessages();
}
//Добавим путь к действию
$this->_breadcrumbs->addStep('Ошибка');
}
示例12: init
/**
* (non-PHPdoc)
* @see Zend_Controller_Action::init()
*/
public function init()
{
parent::init();
// Load the module, controller and action names
$this->view->module_name = $this->_moduleName = ucfirst($this->getRequest()->getModuleName());
$this->view->controller_name = $this->_controllerName = ucfirst($this->getRequest()->getControllerName());
$this->view->action_name = $this->_actionName = ucfirst($this->getRequest()->getActionName());
// Load the translation name
$this->view->translation_name = $this->_translationName = $this->_moduleName . $this->_controllerName . $this->_actionName;
// Load the log
$this->_log = $this->getInvokeArg('bootstrap')->log;
// Load the flashmessenger
$this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');
$this->view->messages = $this->_flashMessenger->getMessages();
// Load the user
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$this->_user = $auth->getIdentity();
if ($this->_user->isConnected()) {
$this->_user->connect();
}
}
}
示例13: editAction
public function editAction()
{
header('Content-type: application/json');
$this->_helper->viewRenderer->setNoRender();
$this->_helper->getHelper('layout')->disableLayout();
$request = $this->getRequest();
$id = $this->_getParam('id', 0);
$activeTab = $request->getCookie('tab', null);
$categoryDb = new Admin_Model_DbTable_Category();
$category = $categoryDb->getCategory($id);
if ($this->isLocked($category['locked'], $category['lockedtime'])) {
if ($request->isPost()) {
header('Content-type: application/json');
$this->_helper->viewRenderer->setNoRender();
$this->_helper->getHelper('layout')->disableLayout();
echo Zend_Json::encode(array('message' => $this->view->translate('MESSAGES_LOCKED')));
} else {
$this->_flashMessenger->addMessage('MESSAGES_LOCKED');
$this->_helper->redirector('index');
}
} else {
$categoryDb->lock($id, $this->_user['id'], $this->_date);
$form = new Admin_Form_Category();
$options = $this->_helper->Options->getOptions($form);
$params = $this->_helper->Params->getParams($form, $options);
$categories = $this->_helper->Categories->getCategories($form, $params['clientid'], $params['type']);
if ($request->isPost()) {
$data = $request->getPost();
$element = key($data);
if (isset($form->{$element}) && $form->isValidPartial($data)) {
$data['modified'] = $this->_date;
$data['modifiedby'] = $this->_user['id'];
$categoryDb = new Admin_Model_DbTable_Category();
$categoryDb->updateCategory($id, $data);
echo Zend_Json::encode($categoryDb->getCategory($id));
} else {
echo Zend_Json::encode(array('message' => $this->view->translate('MESSAGES_FORM_IS_INVALID')));
}
}
}
$this->view->messages = $this->_flashMessenger->getMessages();
}
示例14: viewAction
public function viewAction()
{
$id = $this->_getParam('id', 0);
$locale = Zend_Registry::get('Zend_Locale');
$deliveryorderDb = new Sales_Model_DbTable_Deliveryorder();
$deliveryorder = $deliveryorderDb->getDeliveryorder($id);
$deliveryorder['taxes'] = $this->_currency->toCurrency($deliveryorder['taxes']);
$deliveryorder['subtotal'] = $this->_currency->toCurrency($deliveryorder['subtotal']);
$deliveryorder['total'] = $this->_currency->toCurrency($deliveryorder['total']);
$positions = $this->getPositions($id);
foreach ($positions as $position) {
$position->description = str_replace("\n", '<br>', $position->description);
$position->price = $this->_currency->toCurrency($position->price);
$position->quantity = Zend_Locale_Format::toNumber($position->quantity, array('precision' => 2, 'locale' => $locale));
}
$toolbar = new Sales_Form_Toolbar();
$this->view->toolbar = $toolbar;
$this->view->deliveryorder = $deliveryorder;
$this->view->positions = $positions;
$this->view->messages = $this->_flashMessenger->getMessages();
}
示例15: getMessages
/**
* Return immediate messages merged with session messages
*
* @return array
*/
public function getMessages()
{
return array_merge(parent::getMessages(), $this->_immediateMessages);
}