本文整理汇总了PHP中Messages::display方法的典型用法代码示例。如果您正苦于以下问题:PHP Messages::display方法的具体用法?PHP Messages::display怎么用?PHP Messages::display使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Messages
的用法示例。
在下文中一共展示了Messages::display方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: before
/**
* @param none
* @throws none
* @returns void
*/
public function before()
{
$result = array();
// users need to be logged in to access this controller
if (!\Sentry::check()) {
$result = array('message' => 'You need to be logged in to access that page.', 'url' => '/admin/login');
// Don't show this message if url is just 'admin'
if (\Uri::string() == 'admin/admin/index') {
unset($result['message']);
}
\Session::set('redirect_to', \Uri::admin('current'));
} else {
if (!\Sentry::user()->is_admin()) {
$result = array('message' => 'Access denied. You need to be a member of staff to access that page.', 'url' => '/admin/login');
\Session::set('redirect_to', \Uri::admin('current'));
}
}
if (!empty($result)) {
if (\Input::is_ajax()) {
\Messages::error('You need to be logged in to complete this action.');
echo \Messages::display('left', false);
exit;
} else {
if (isset($result['message'])) {
\Messages::warning($result['message']);
}
\Response::redirect($result['url']);
}
}
parent::before();
}
示例2:
"><?php
echo Lang::string('home');
?>
</a> <i>/</i> <a href="account.php"><?php
echo Lang::string('account');
?>
</a> <i>/</i> <a href="open-orders.php"><?php
echo $page_title;
?>
</a></div>
</div>
</div>
<div class="container">
<div class="content_right">
<?php
Messages::display();
?>
<?php
Errors::display();
?>
<div class="filters">
<input type="hidden" id="open_orders_user" value="1" />
<input type="hidden" id="uniq" value="<?php
echo $_SESSION["openorders_uniq"];
?>
" />
<form id="filters" method="GET" action="open-orders.php">
<ul class="list_empty">
<li>
<label for="graph_orders_currency"><?php
echo Lang::string('orders-filter-currency');
示例3: action_delete_infotab_image
/**
* Delete content image
*
* @param $image_id = Image ID
* @param $content_id = Content ID
* @param $type = Type of content (infotab or hotspot)
* @param $delete = If type is "hotspot" we can either delete image or video
*/
public function action_delete_infotab_image($image_id = false, $content_id = false, $type = 'infotab', $delete = 'image')
{
if ($image_id && $content_id) {
$images = Model_Application_Image::find(array('where' => array('application_id' => $content_id), 'order_by' => array('sort' => 'asc')), 'id');
if ($images) {
if (isset($images[$image_id])) {
$image = $images[$image_id];
if (strtolower($type) == 'hotspot') {
// Delete only part of hotspot, either image or video
if ($delete == 'image') {
// Delete only image but not whole hotspot
$this->delete_infotab_image($image->image);
$image->set(array('image' => null, 'alt_text' => null));
} else {
// Delete only video but not whole hotspot
$image->set(array('video' => null, 'video_title' => null));
}
$image->save();
\Messages::success(ucfirst($type) . ' ' . strtolower($delete) . ' was successfully deleted.');
} else {
// If there is only one image and image is required
if (count($images) == 1) {
if (\Config::get('infotab.image.required', false) && !\Request::is_hmvc()) {
\Messages::error('You can\'t delete all images. Please add new image in order to delete this one.');
} else {
// Reset sort fields
\DB::update(Model_Application_Image::get_protected('_table_name'))->value('sort', \DB::expr('sort - 1'))->where('sort', '>', $image->sort)->execute();
// Delete image
$this->delete_infotab_image($image->image);
$image->delete();
\Messages::success(ucfirst($type) . ' image was successfully deleted.');
}
} else {
if ($image->cover == 1 && !\Request::is_hmvc()) {
\Messages::error('You can\'t delete cover image. Set different image as cover in order to delete this one.');
} else {
// Reset sort fields
\DB::update(Model_Application_Image::get_protected('_table_name'))->value('sort', \DB::expr('sort - 1'))->where('sort', '>', $image->sort)->execute();
// Delete image
$this->delete_infotab_image($image->image);
$image->delete();
\Messages::success(ucfirst($type) . ' image was successfully deleted.');
}
}
}
} else {
\Messages::error(ucfirst($type) . ' image you are trying to delete don\'t exists. Check your url and try again.');
}
} else {
\Messages::error(ucfirst($type) . ' image you are trying to delete don\'t exists. Check your url and try again.');
}
}
if (\Input::is_ajax()) {
\Messages::reset();
\Messages::success('Hotspot was successfully deleted.');
echo \Messages::display();
} else {
if (\Request::is_hmvc()) {
\Messages::reset();
} else {
\Response::redirect(\Input::referrer());
}
}
}
示例4: action_sort_attr_in_group
public function action_sort_attr_in_group($type = false)
{
//if(!$type) return false;
var_dump($items);
$items = \Input::post('sort');
var_dump($items);
exit;
if (is_array($items)) {
foreach ($items as $item) {
list($item, $old_item) = explode('_', $item);
if (is_numeric($item)) {
$sort[] = $item;
}
if (is_numeric($old_item)) {
$old_sort[] = $old_item;
}
}
if (is_array($sort)) {
// Get starting point for sort
$start = min($old_sort);
$start = $start > 0 ? --$start : $start;
$model = Model_Attribute::factory(ucfirst($type));
foreach ($sort as $key => $id) {
$item = $model::find_one_by_id($id);
$item->set(array('sort' => ++$start));
$item->save();
}
\Messages::success('Items successfully reordered.');
echo \Messages::display('left', false);
}
}
}
示例5: add_to_cart
public function add_to_cart($return = 'return')
{
if (!\Input::post()) {
return false;
}
// check for a valid CSRF token
// if (!\Security::check_token())
// {
// \Messages::error('CSRF attack or expired CSRF token.');
// return false;
// }
$post = \Input::post();
$product_id = $post['product_id'];
if (!($product = Model_Product::find_one_by_id($product_id))) {
return;
}
$selected_attributes = array();
$selected_attributes_json = null;
if (isset($post['select']) && !empty($post['select'])) {
ksort($post['select']);
$selected_attributes_json = json_encode($post['select']);
}
$product_data = Model_Product::product_data($product, $selected_attributes_json, \Input::post('select'), \Input::post('attributeid'));
if (!empty($product_data)) {
$attr_obj = null;
if (!empty($product_data['current_attributes'])) {
$attr_obj = $product_data['current_attributes'][0]->product_attribute;
}
$item = array('title' => $product->title, 'id' => $product->id, 'product_attribute_id' => $attr_obj ? $attr_obj->id : null, 'quantity' => $post['quantity'], 'attributes' => $attr_obj ? $attr_obj->attributes : null, 'product_code' => $product_data['code'], 'unique_id' => uniqid());
if ($product_data['sale']) {
$item += array('price' => $product_data['sale'], 'price_type' => 'sale_price');
} else {
$item += array('price' => $product_data['retail_price'], 'price_type' => 'retail_price');
}
$stock_options = \Config::load('stock-option.db');
if ($stock_options['allow_buy_out_of_stock'] != 1 && $product_data['stock_quantity'] < 1) {
\Messages::error('Product is Out of Stock.');
echo \Messages::display();
return;
}
$uid = \Cart::generateUID($item);
if (\Cart::exists($uid)) {
$cart_item = \Cart::item($uid);
$quantity = $cart_item->get('quantity');
if ($product_data['stock_quantity'] > 0 && $product_data['stock_quantity'] <= $quantity) {
\Messages::error($product->title . ' has not enough stock to fulfill your request.');
echo \Messages::display();
return;
}
}
if ($return == 'return') {
\Cart::add($item);
// Always return cart item id
$uid = \Cart::generateUID($item);
if (\Cart::exists($uid)) {
return $uid;
}
return false;
} else {
$uid = \Cart::generateUID($item);
if (\Cart::exists($uid)) {
echo $uid;
}
echo '';
exit;
}
\Messages::success('Product successfully added to cart.');
echo \Messages::display();
}
return false;
}
示例6: isset
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body class="login-page">
<div class="login-box">
<div class="login-logo">
<a href="../../index2.html"><b>Qsoft </b>VIET NAM</a>
</div><!-- /.login-logo -->
<div class="login-box-body">
<p class="login-box-msg">Sign in to start your session</p>
<?php
//------------------------------------------------------------------------
// Display any messages
//------------------------------------------------------------------------
echo $msg->display();
?>
<form action="#" method="post">
<div class="form-group has-feedback">
<input type="email" class="form-control" placeholder="Email" name="Login[email]"
value="<?php
echo isset($_POST['Login']['email']) ? $_POST['Login']['email'] : '';
?>
"/>
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="password" class="form-control" placeholder="Password" name="Login[password]"
value="<?php
echo isset($_POST['Login']['password']) ? $_POST['Login']['password'] : '';
?>
示例7: display
function display($use_fckeditor = false, $require_email = false, $ask_website = false, $editor_height = false)
{
global $CFG;
if ($CFG->backstage_mode && !($this->record_id > 0) && !$this->show_all) {
return false;
}
$use_fckeditor = $this->use_fckeditor ? $this->use_fckeditor : $use_fckeditor;
$require_email = $this->require_email ? $this->require_email : $require_email;
$ask_website = $this->ask_website ? $this->ask_website : $ask_website;
$editor_height = $this->editor_height ? $this->editor_height : $editor_height;
if ($_REQUEST['comments_' . $this->i] && !$this->comments_closed) {
if (!empty($_REQUEST['comments_' . $this->i]['comments1'])) {
$_REQUEST['comments_' . $this->i]['comments'] = $_REQUEST['comments_' . $this->i]['comments1'];
unset($_REQUEST['comments_' . $this->i]['comments1']);
}
$CFG->save_called = false;
$form = new Form('comments_' . $this->i, false, false, $this->class . '_form', 'comments');
$form->verify();
if (!$form->errors) {
$form->save();
Messages::add($CFG->comments_sent_message);
Messages::display();
} else {
$form->show_errors();
}
}
$comments = Comments::get();
$c = count(Comments::get(false, true));
$show = $this->autoshow ? '' : 'style="display:none;"';
if ($this->label) {
if ($CFG->pm_editor) {
$method_name = Form::peLabel($this->label['method_id'], 'label');
}
echo '<div class="grid_label"><div class="label">' . $this->label['text'] . ' ' . $method_name . '</div><div class="clear"></div></div>';
}
if (!$this->short_version) {
if ($comments) {
echo '<div class="expand">' . str_ireplace('[field]', $c, $CFG->comments_there_are) . ' ' . (!$_REQUEST['comments_' . $this->i] ? '<a href="#" onclick="showComments(' . $this->i . ',this);return false;">' . $CFG->comments_expand . '</a>' : '') . '<a style="display:none;" href="#" onclick="hideComments(' . $this->i . ',this);return false;">' . $CFG->comments_hide . '</a></div>';
} else {
echo '<div class="expand">' . $CFG->comments_none . ' <a href="#" onclick="showComments(' . $this->i . ',this);return false;">' . $CFG->comments_be_first . '</a><a style="display:none;" href="#" onclick="hideComments(' . $this->i . ',this);return false;">' . $CFG->comments_hide . '</a></div>';
}
}
echo '
<div id="comments_' . $this->i . '" class="' . $this->class . '" ' . (!$_REQUEST['comments_' . $this->i] ? $show : '') . '>';
if ($comments) {
Comments::show($comments);
}
echo '
<div id="movable_form" style="display:none;">';
if (!$this->comments_closed) {
Comments::showForm($use_fckeditor, $require_email, $ask_website, 1, $editor_height);
}
echo '
</div>';
if (!$this->comments_closed) {
Comments::showForm($use_fckeditor, $require_email, $ask_website, 0, $editor_height);
}
echo '
<div style="clear:both;height:0;"></div>
</div>';
}
示例8: action_edit_address
public function action_edit_address($type = 'billing')
{
if (!\Input::is_ajax()) {
throw new \HttpNotFoundException();
}
if (!$this->check_logged()) {
\Messages::error('You must be logged in if you want to edit your address.');
echo \Messages::display();
exit;
}
$this->update_address($type);
$user = \Sentry::user();
switch ($type) {
case 'shipping':
$subtitle = 'Edit Shipping Address';
$view = '_shipping_address';
$type = 'shipping';
break;
default:
$subtitle = 'Edit Billing Address';
$view = '_billing_address';
$type = 'billing';
}
$metadata = $user['metadata'];
$content = \Theme::instance()->view('views/order/checkout/' . $view, array('edit' => true, 'user' => $user, 'metadata' => $metadata), false)->render();
echo \Theme::instance()->view('views/order/checkout/address_edit', array('content' => $content, 'subtitle' => $subtitle, 'type' => $type), false);
exit;
}
示例9: action_infotab_hotspot
/**
* Edit product hotspot position
*
* @param $product_id = Product ID
* @param $infotab_id = Infotab ID
*
*/
public function action_infotab_hotspot($produt_id = false, $infotab_id = false, $hotspot_id = false)
{
// Check for product
if (!is_numeric($produt_id)) {
\Response::redirect('admin/product/list');
}
// Get news item to edit
if (!($product = Model_Product::find_one_by_id($produt_id))) {
\Response::redirect('admin/product/list');
}
// Check for infotab
if (!is_numeric($infotab_id)) {
\Response::redirect('admin/product/list');
}
// Get news item to edit
if (!($item = Model_Product_To_Infotabs::find_by_pk($infotab_id))) {
\Response::redirect('admin/product/list');
}
// Get hotspot is exist
if (is_numeric($hotspot_id)) {
if (!($hotspot = Model_Infotab_Image::find_by_pk($hotspot_id))) {
unset($hotspot);
}
}
if (\Input::post()) {
$insert = \Input::post();
if (!\Input::is_ajax()) {
$val = Model_Infotab_Image::validate('create');
if (!$val->run()) {
if ($val->error() != array()) {
// show validation errors
\Messages::error('<strong>There was an error while trying to create hotspot</strong>');
foreach ($val->error() as $e) {
\Messages::error($e->get_message());
}
}
\Response::redirect(\Uri::create('admin/product/infotab_edit/' . $product->id . '/' . $item->unique_id . (isset($hotspot) ? '/' . $hotspot->id : '')));
}
$insert['title'] = trim($insert['title']) != '' ? $insert['title'] : NULL;
$insert['description'] = trim($insert['description']) != '' ? $insert['description'] : NULL;
}
$insert['infotab_id'] = $infotab_id;
if (\Input::post('create', false)) {
$hotspot = Model_Infotab_Image::forge($insert);
try {
$hotspot->save();
if (\Input::is_ajax()) {
$return['hotspot_id'] = $hotspot->id;
echo json_encode($return);
exit;
}
} catch (\Database_Exception $e) {
// show validation errors
\Messages::error('<strong>There was an error while trying to create hotspot</strong>');
// Uncomment lines below to show database errors
$errors = $e->getMessage();
\Messages::error($errors);
if (\Input::is_ajax()) {
$return['message'] = \Messages::display();
$return['hotspot_id'] = false;
echo json_encode($return);
exit;
}
}
}
if (\Input::post('update', false)) {
if (isset($hotspot)) {
/** IMAGES **/
// Upload image and display errors if there are any
$image = $this->upload_infotab_image();
if (!$image['exists'] && \Config::get('infotab.image.required', false) && empty($hotspot->image)) {
// No previous images and image is not selected and it is required
\Messages::error('<strong>There was an error while trying to upload hotspot image</strong>');
\Messages::error('You have to select image');
} elseif ($image['errors']) {
\Messages::error('<strong>There was an error while trying to upload hotspot image</strong>');
foreach ($image['errors'] as $error) {
\Messages::error($error);
}
}
if ($image['is_valid'] && !(!$image['exists'] && \Config::get('infotab.image.required', false) && empty($hotspot->image)) || \Input::post('use_cover_image', false)) {
// Clear previous messages if exists
\Messages::reset();
$item_image['alt_text'] = \Input::post('alt_text', false) ? \Input::post('alt_text', false) : NULL;
// Save images if new files are submitted
if (isset($this->_infotab_image_data)) {
foreach ($this->_infotab_image_data as $image_data) {
$item_image['image'] = $image_data['saved_as'];
// Delete old infotab image
if (\Input::post('image_db', false)) {
$this->delete_infotab_image(\Input::post('image_db', ''));
}
}
//.........这里部分代码省略.........
示例10: Messages
<?php
// swgge@wrgwerg.rg
// uHKlIAeI8zKJxvLEFRvL
/**$show = false;
$msgClass = 'info';
if(isset($_GET['action']) && $_GET['action'] == 'logout'){
$show = true;
$msg = pll__('Jūs atsijungėte');
$msgClass = 'success';
}
if($show == true){ ?>
<div class="alert alert-<?php echo $msgClass;?>"><?php echo $msg;?></div>
<?php }*/
?>
<?php
$flash = new Messages();
echo $flash->display();
示例11: array
<?php
echo \Theme::instance()->view('views/product/infotab/_action_links');
?>
</div>
</div>
<div class="row-fluid">
<?php
echo \Theme::instance()->view('views/_partials/navigation');
?>
<!-- Main Content Holder -->
<div class="content">
<?php
echo \Messages::display();
?>
<!-- Accordions Panel -->
<div class="panel">
<div class="panelHeader">
<h4>Info Tab Manager</h4>
</div>
<?php
// Load page listing table
echo \Theme::instance()->view('views/product/infotab/_listing_table', array('pagination' => $pagination, 'items' => $items), false);
?>
</div><!-- EOF Accordions Panel -->
示例12: action_list
/**
* Manage upsell products
*
* @param $id = Product ID
*/
public function action_list($id)
{
if (!is_numeric($id)) {
\Response::redirect('admin/product/list');
}
// Get news item to edit
if (!($item = Model_Product::find_one_by_id($id))) {
\Response::redirect('admin/product/list');
}
if (\Input::post()) {
$add = \Input::post('products.add', array());
$remove = \Input::post('products.remove', array());
$discounts = \Input::post('discount', array());
if (\Input::post('add', false)) {
foreach ($add as $value) {
$upsell = Model_Product_To_Upsell::forge(array('upsell_id' => $value, 'product_id' => $item->id));
$upsell->save();
}
\Messages::success('Upsell products successfully added.');
} else {
if (\Input::post('remove', false)) {
foreach ($remove as $value) {
$upsell = Model_Product_To_Upsell::find_one_by(array(array('upsell_id', '=', $value), array('product_id', '=', $item->id)));
if (!is_null($upsell)) {
$upsell->delete();
}
}
\Messages::success('Upsell products successfully removed.');
} else {
if (\Input::post('save', false)) {
foreach ($discounts as $key => $value) {
$upsell = Model_Product_To_Upsell::find_one_by(array(array('upsell_id', '=', $key), array('product_id', '=', $item->id)));
if (!is_null($upsell)) {
$upsell->discount = round($value, 0);
$upsell->save();
}
}
\Messages::success('Upsell discounts successfully saved.');
}
}
}
if (\Input::is_ajax()) {
echo \Messages::display('left', false);
exit;
} else {
\Response::redirect(\Input::referrer(\Uri::create('admin/product/list')));
}
}
\View::set_global('title', 'List Upsell Products');
$search = $this->get_search_items($item);
$pagination = $search['pagination'];
$status = $search['status'];
$item = $search['item'];
\Theme::instance()->set_partial('content', $this->view_dir . 'list')->set('product', $item)->set('pagination', $pagination, false)->set('status', $status);
}
示例13: param
$test_install_all_features = param('install_all_features', 'boolean', false);
} else {
$test_install_all_features = false;
}
// fp> TODO: this test should probably be made more generic and applied to upgrade too.
$expected_connection_charset = DB::php_to_mysql_charmap($evo_charset);
if ($DB->connection_charset != $expected_connection_charset) {
display_install_messages(sprintf(T_('In order to install b2evolution with the %s locale, your MySQL needs to support the %s connection charset.') . ' (mysqli::set_charset(%s))', $current_locale, $evo_charset, $expected_connection_charset));
// sam2kb> TODO: If something is not supported we can display a message saying "do this and that, enable extension X etc. etc... or switch to a better hosting".
break;
}
// Progress bar
start_install_progress_bar(T_('Installation in progress'), get_install_steps_count());
echo '<h2>' . T_('Installing b2evolution...') . '</h2>';
// Try to display the messages here because they can be created during checking params of quick installation:
$Messages->display();
if (!empty($basic_config_file_result_messages)) {
// Display messages that were generated on creating basic config file on quick installation:
echo $basic_config_file_result_messages;
}
if ($config_test_install_all_features && $allow_evodb_reset) {
// Allow to quick delete before new installation only when these two settings are enabled in config files
$delete_contents = param('delete_contents', 'integer', 0);
if ($delete_contents) {
// A quick deletion is requested before new installation
require_once dirname(__FILE__) . '/_functions_delete.php';
echo '<h2>' . T_('Deleting b2evolution tables from the datatase...') . '</h2>';
evo_flush();
// Uninstall b2evolution: Delete DB & Cache files
uninstall_b2evolution();
// Update the progress bar status
示例14: action_delete_artwork
public function action_delete_artwork($file_id = null)
{
if (\Input::is_ajax()) {
$ysi = \Yousendit\Base::forge();
$out = $ysi->delete_artwork($file_id, true);
if (isset($out['errormessage'])) {
\Messages::error($out['errormessage']);
} else {
\Messages::success('Product artwork successfully deleted.');
}
echo \Messages::display();
}
}