public function display_home() { $params = array(); if (isset($_GET['criteria'])) { $params['criteria'] = $_GET['criteria']; $this->template->criteria = $_GET['criteria']; } if (isset($_GET['page'])) { $params['page'] = $_GET['page']; $this->template->page = $_GET['page']; } if (isset($_GET['dates'])) { // @todo convert this into a usable format for Messages::get() $params['dates'] = $_GET['dates']; $this->template->date = $_GET['dates']; } if (isset($_GET['sender'])) { $params['sender'] = $_GET['sender']; $this->template->sender = $_GET['sender']; } $this->template->messages = Messages::get($params); $this->template->pager = Logbox::paginate('Messages', $params, 'http://logbox.localhost/'); // retrieve senders for the select filter $senders = DB::connect()->query('SELECT DISTINCT sender FROM message ORDER BY sender ASC')->fetchAll(PDO::FETCH_COLUMN); $this->template->senders = $senders; // retrieve dates for the select filter $dates = DB::connect()->query('SELECT UNIX_TIMESTAMP(sent_at) FROM message ORDER BY sent_at DESC')->fetchAll(PDO::FETCH_COLUMN); $dates = array_map(create_function('$date', 'return date("F Y", $date);'), $dates); $dates = array_unique($dates); $this->template->dates = $dates; $this->template->display('home.php'); }
/** * Test the Messages::get method. * * @group laravel */ public function testMessagesRespectFormat() { $this->messages->add('email', 'test'); $this->assertEquals('<p>test</p>', $this->messages->first('email', '<p>:message</p>')); $this->assertEquals(array('<p>test</p>'), $this->messages->get('email', '<p>:message</p>')); $this->assertEquals(array('<p>test</p>'), $this->messages->all('<p>:message</p>')); }
public function get($lastMessageId) { if (Fari_Filter::isInt($lastMessageId)) { // get is the freshest messages $newMessages = Messages::get($lastMessageId); // handle with JSON echo json_encode($newMessages); } }
public function run($form) { $this->load('10%'); $lang = Messages::$PT_br; $this->load('30%'); $usr_name = SessionManager::getUser()->getNome(); $this->load('50%'); SessionManager::cleanUser(); $this->load('70%'); SessionManager::clean(); $this->load('90%'); $this->setMessage(str_replace(":usr", $usr_name, Messages::get($lang, Messages::$MSG_USUARIO_DESLOGADO)), Constants::$_MSG_SUCCESS); $this->load('100%'); $this->setForward(HomePage::$NM_PAGINA); }
/** * Returns any error messages that are generated * * @return array */ public function getMessages() { return $this->_messages->get(); }
<a href="/"></a> </div> <div> </div> </header> <div class="wrapper"> <div class="content"> <div class="content_inner"> <h1>Авторизация</h1> <div class="block"> <form method="post" action="/login"> <input type="text" placeholder="Логин" name="login" class="input_big"> <input type="password" placeholder="Пароль" name="password" class="input_big"> <button class="btn">Войти</button> </form> </div> <? $messages = Messages::get(); if(!empty($messages)){ foreach($messages as $message){ echo '<div class="message message-'.$message['type'].'">'.$message['text'].'<span class="message_close icon-cancel"></span></div>'; } } ?> </div> </div> </div> </body> </html>
/** * Test the Messages::get method. * * @group laravel */ public function testMessageFormattingReturnsEntryCopy() { $this->messages->add_typed('ok', 'success'); $this->assertEquals(array(new Entry('<p>ok</p>', 'success')), $this->messages->get('success', '<p>:message</p>')); $this->assertEquals(array('success' => array(new Entry('ok', 'success'))), $this->messages->messages); }
$ADK_USERGROUP_CDE = $_SESSION['ADK_USERGROUP_CDE']; $ADK_USER_ID = intval($_SESSION['ADK_USER_ID']); $ADK_TO_USER_ID = null; if (isset($_GET['_']) && is_numeric($_GET['_'])) { $ADK_TO_USER_ID = $_GET['_']; } $con = connect_db(); if ($ADK_TO_USER_ID) { $ADK_TO_USER = new User(); $ADK_TO_USER->id = $ADK_TO_USER_ID; $ADK_TO_USER->get($con); } $ADK_MESSAGES = new Messages(); $ADK_MESSAGES->userid = $ADK_USER_ID; $ADK_MESSAGES->foldername = 'Inbox'; $ADK_MESSAGES->get($con); switch ($ADK_USERGROUP_CDE) { case 'ADM': require_once 'includes/classes/Template.php'; $ADK_MSG_TMPLS = new Templates(); $ADK_MSG_TMPLS->get($con, $_SESSION['ADK_USER_ID']); $ADK_HIKERS = new Hikers(); $ADK_HIKERS->get($con, $ADK_USER_ID); break; case 'COR': require_once 'includes/classes/Template.php'; $ADK_MSG_TMPLS = new Templates(); $ADK_MSG_TMPLS->get($con, $_SESSION['ADK_USER_ID']); $ADK_HIKERS = new Hikers(); $ADK_HIKERS->get($con, $ADK_USER_ID); break;
public function init_media() { $this->template_js_params = array('CURRENT_URL' => Request::current()->url(TRUE) . URL::query(), 'BASE_URL' => URL::backend(ADMIN_DIR_NAME, TRUE), 'SITE_URL' => URL::base(TRUE), 'ADMIN_DIR_NAME' => ADMIN_DIR_NAME, 'ADMIN_RESOURCES' => ADMIN_RESOURCES, 'PUBLIC_URL' => PUBLIC_URL, 'LOCALE' => I18n::lang(), 'CONTROLLER' => strtolower(Request::current()->controller()), 'ACTION' => Request::current()->action(), 'USER_ID' => Auth::get_id(), 'DATE_FORMAT' => Config::get('site', 'date_format'), 'IS_BACKEND' => IS_BACKEND, 'CLOSE_POPUP' => Session::instance()->get_once('close_popup', FALSE)); foreach (Messages::get() as $type => $messages) { $this->template_js_params['MESSAGE_' . strtoupper($type)] = $messages; } }
/** * редактирование карты */ public function action_card_edit() { $params = $this->request->post('params'); $result = Model_Card::editCard($params, Model_Card::CARD_ACTION_EDIT); if (empty($result)) { $this->jsonResult(false); } $messages = Messages::get(); if (!empty($messages)) { $this->jsonResult(false, $messages); } $this->jsonResult(true, $result); }