当前位置: 首页>>代码示例>>PHP>>正文


PHP Alert::set方法代码示例

本文整理汇总了PHP中Alert::set方法的典型用法代码示例。如果您正苦于以下问题:PHP Alert::set方法的具体用法?PHP Alert::set怎么用?PHP Alert::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Alert的用法示例。


在下文中一共展示了Alert::set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: action_update

 /**
  * Update new forum
  */
 public function action_update()
 {
     Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Edit Topic')));
     $topic = new Model_Topic($this->request->param('id'));
     $get_all = Model_Forum::get_all();
     //get all forums to build forum parents in select
     $forum_parents = array();
     foreach ($get_all[0] as $parent) {
         $forum_parents[$parent['id']] = $parent['name'];
     }
     $this->template->content = View::factory('oc-panel/pages/forum/topic', array('topic' => $topic, 'forum_parents' => $forum_parents));
     if ($_POST) {
         $topic->title = core::post('title');
         $topic->id_forum = core::post('id_forum');
         $topic->description = core::post('description');
         if (core::post('seotitle') != $topic->seotitle) {
             $topic->seotitle = $topic->gen_seotitle(core::post('seotitle'));
         }
         if (core::post('status') == 'on') {
             $topic->status = 1;
         } else {
             $topic->status = 0;
         }
         try {
             $topic->save();
             Alert::set(Alert::SUCCESS, __('Topic is updated.'));
         } catch (Exception $e) {
             Alert::set(Alert::ERROR, $e->getMessage());
         }
         HTTP::redirect(Route::url('oc-panel', array('controller' => 'topic', 'action' => 'index')));
     }
 }
开发者ID:JeffPedro,项目名称:project-garage-sale,代码行数:35,代码来源:topic.php

示例2: __construct

 /**
  *
  * Contruct that checks you are loged in before nothing else happens!
  */
 function __construct(Request $request, Response $response)
 {
     if (Theme::get('premium') != 1) {
         Alert::set(Alert::INFO, __('Upgrade your Open Classifieds site to activate this feature.'));
     }
     parent::__construct($request, $response);
 }
开发者ID:kotsios5,项目名称:openclassifieds2,代码行数:11,代码来源:plan.php

示例3: action_pay

 /**
  * [action_form] generates the form to pay at paypal
  */
 public function action_pay()
 {
     $this->auto_render = FALSE;
     $id_order = $this->request->param('id');
     //retrieve info for the item in DB
     $order = new Model_Order();
     $order = $order->where('id_order', '=', $id_order)->where('status', '=', Model_Order::STATUS_CREATED)->limit(1)->find();
     if ($order->loaded()) {
         // include class vendor
         require Kohana::find_file('vendor/authorize/', 'autoload');
         define('AUTHORIZENET_API_LOGIN_ID', Core::config('payment.authorize_login'));
         define('AUTHORIZENET_TRANSACTION_KEY', Core::config('payment.authorize_key'));
         define('AUTHORIZENET_SANDBOX', Core::config('payment.authorize_sandbox'));
         $sale = new AuthorizeNetAIM();
         $sale->amount = $order->amount;
         $sale->card_num = Core::post('card-number');
         $sale->exp_date = Core::post('expiry-month') . '/' . Core::post('expiry-year');
         $response = $sale->authorizeAndCapture();
         if ($response->approved) {
             $order->confirm_payment('authorize', $response->transaction_id);
             //redirect him to his ads
             Alert::set(Alert::SUCCESS, __('Thanks for your payment!') . ' ' . $response->transaction_id);
             $this->redirect(Route::url('oc-panel', array('controller' => 'profile', 'action' => 'orders')));
         } else {
             Alert::set(Alert::INFO, $response->error_message);
             $this->redirect(Route::url('default', array('controller' => 'ad', 'action' => 'checkout', 'id' => $order->id_order)));
         }
     } else {
         Alert::set(Alert::INFO, __('Order could not be loaded'));
         $this->redirect(Route::url('default', array('controller' => 'ad', 'action' => 'checkout', 'id' => $order->id_order)));
     }
 }
开发者ID:nick-catanchin-ie,项目名称:openclassifieds2,代码行数:35,代码来源:authorize.php

示例4: addUser

function addUser($args)
{
    global $dbUsers;
    global $Language;
    // Check if the username already exist in db.
    if (Text::isEmpty($args['username'])) {
        Alert::set($Language->g('username-field-is-empty'));
        return false;
    }
    if ($dbUsers->userExists($args['username'])) {
        Alert::set($Language->g('username-already-exists'));
        return false;
    }
    // Validate password.
    if ($args['password'] != $args['confirm-password'] || Text::isEmpty($args['password'])) {
        Alert::set($Language->g('The password and confirmation password do not match'));
        return false;
    }
    // Add the user.
    if ($dbUsers->add($args)) {
        Alert::set($Language->g('user-has-been-added-successfully'));
        return true;
    } else {
        Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to create the account.');
        return false;
    }
}
开发者ID:roberthchan,项目名称:bludit,代码行数:27,代码来源:add-user.php

示例5: action_index

 public function action_index()
 {
     //template header
     $this->template->title = __('Contact Us');
     $this->template->meta_description = __('Contact') . ' ' . core::config('general.site_name');
     Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Home'))->set_url(Route::url('default')));
     Breadcrumbs::add(Breadcrumb::factory()->set_title(__('Contact Us')));
     if ($this->request->post()) {
         //captcha check
         if (captcha::check('contact')) {
             //check if user is loged in
             if (Auth::instance()->logged_in()) {
                 $email_from = Auth::instance()->get_user()->email;
                 $name_from = Auth::instance()->get_user()->name;
             } else {
                 $email_from = core::post('email');
                 $name_from = core::post('name');
             }
             //akismet spam filter
             if (!core::akismet($name_from, $email_from, core::post('message'))) {
                 $replace = array('[EMAIL.BODY]' => core::post('message'), '[EMAIL.SENDER]' => $name_from, '[EMAIL.FROM]' => $email_from);
                 if (Email::content(core::config('email.notify_email'), core::config('general.site_name'), $email_from, $name_from, 'contact-admin', $replace)) {
                     Alert::set(Alert::SUCCESS, __('Your message has been sent'));
                 } else {
                     Alert::set(Alert::ERROR, __('Message not sent'));
                 }
             } else {
                 Alert::set(Alert::WARNING, __('This email has been considered as spam! We are sorry but we can not send this email.'));
             }
         } else {
             Alert::set(Alert::ERROR, __('Wrong captcha'));
         }
     }
     $this->template->content = View::factory('pages/contact');
 }
开发者ID:Ryanker,项目名称:open-eshop,代码行数:35,代码来源:contact.php

示例6: deleteUser

function deleteUser($args, $deleteContent = false)
{
    global $dbUsers;
    global $dbPosts;
    global $Language;
    global $Login;
    // The user admin cannot be deleted.
    if ($args['username'] == 'admin') {
        return false;
    }
    // The editors cannot delete users.
    if ($Login->role() !== 'admin') {
        return false;
    }
    if ($deleteContent) {
        $dbPosts->deletePostsByUser($args['username']);
    } else {
        $dbPosts->linkPostsToUser($args['username'], 'admin');
    }
    if ($dbUsers->delete($args['username'])) {
        Alert::set($Language->g('User deleted'));
    } else {
        Log::set(__METHOD__ . LOG_SEP . 'Error occurred when trying to delete the user.');
    }
}
开发者ID:veshinak,项目名称:bludit,代码行数:25,代码来源:edit-user.php

示例7: send

 /**
  * sends an email using our configs
  * @param  string/array $to       array(array('name'=>'chema','email'=>'chema@'),)
  * @param  [type] $to_name   [description]
  * @param  [type] $subject   [description]
  * @param  [type] $body      [description]
  * @param  [type] $reply     [description]
  * @param  [type] $replyName [description]
  * @param  [type] $file      [description]
  * @return boolean
  */
 public static function send($to, $to_name = '', $subject, $body, $reply, $replyName, $file = NULL)
 {
     require_once Kohana::find_file('vendor', 'php-mailer/phpmailer', 'php');
     $body = Text::bb2html($body, TRUE);
     //get the template from the html email boilerplate
     $body = View::factory('email', array('title' => $subject, 'content' => nl2br($body)))->render();
     $mail = new PHPMailer();
     $mail->CharSet = Kohana::$charset;
     if (core::config('email.smtp_active') == TRUE) {
         $mail->IsSMTP();
         //SMTP HOST config
         if (core::config('email.smtp_host') != "") {
             $mail->Host = core::config('email.smtp_host');
             // sets custom SMTP server
         }
         //SMTP PORT config
         if (core::config('email.smtp_port') != "") {
             $mail->Port = core::config('email.smtp_port');
             // set a custom SMTP port
         }
         //SMTP AUTH config
         if (core::config('email.smtp_auth') == TRUE) {
             $mail->SMTPAuth = TRUE;
             // enable SMTP authentication
             $mail->Username = core::config('email.smtp_user');
             // SMTP username
             $mail->Password = core::config('email.smtp_pass');
             // SMTP password
             if (core::config('email.smtp_ssl') == TRUE) {
                 $mail->SMTPSecure = "ssl";
                 // sets the prefix to the server
             }
         }
     }
     $mail->From = core::config('email.notify_email');
     $mail->FromName = "no-reply " . core::config('general.site_name');
     $mail->Subject = $subject;
     $mail->MsgHTML($body);
     if ($file !== NULL) {
         $mail->AddAttachment($file['tmp_name'], $file['name']);
     }
     $mail->AddReplyTo($reply, $replyName);
     //they answer here
     if (is_array($to)) {
         foreach ($to as $contact) {
             $mail->AddBCC($contact['email'], $contact['name']);
         }
     } else {
         $mail->AddAddress($to, $to_name);
     }
     $mail->IsHTML(TRUE);
     // send as HTML
     if (!$mail->Send()) {
         //to see if we return a message or a value bolean
         Alert::set(Alert::ALERT, "Mailer Error: " . $mail->ErrorInfo);
         return FALSE;
     } else {
         return TRUE;
     }
 }
开发者ID:Wildboard,项目名称:WbWebApp,代码行数:71,代码来源:email.php

示例8: action_pay

 /**
  * [action_form] generates the form to pay at paypal
  */
 public function action_pay()
 {
     $this->auto_render = FALSE;
     $order_id = $this->request->param('id');
     $order = new Model_Order();
     $order->where('id_order', '=', $order_id)->where('status', '=', Model_Order::STATUS_CREATED)->limit(1)->find();
     if ($order->loaded()) {
         // case when selling advert
         if ($order->id_product == Model_Order::PRODUCT_AD_SELL) {
             $paypal_account = $order->ad->paypal_account();
             $currency = i18n::get_intl_currency_symbol();
             if (isset($order->ad->cf_shipping) and Valid::numeric($order->ad->cf_shipping) and $order->ad->cf_shipping > 0) {
                 $order->amount = $order->amount + $order->ad->cf_shipping;
             }
         } else {
             $paypal_account = core::config('payment.paypal_account');
             $currency = core::config('payment.paypal_currency');
         }
         $paypal_url = Core::config('payment.sandbox') ? Paypal::url_sandbox_gateway : Paypal::url_gateway;
         $paypal_data = array('order_id' => $order_id, 'amount' => number_format($order->amount, 2, '.', ''), 'site_name' => core::config('general.site_name'), 'site_url' => URL::base(TRUE), 'paypal_url' => $paypal_url, 'paypal_account' => $paypal_account, 'paypal_currency' => $currency, 'item_name' => $order->description);
         $this->template = View::factory('paypal', $paypal_data);
         $this->response->body($this->template->render());
     } else {
         Alert::set(Alert::INFO, __('Order could not be loaded'));
         $this->redirect(Route::url('default'));
     }
 }
开发者ID:kotsios5,项目名称:openclassifieds2,代码行数:30,代码来源:paypal.php

示例9: action_status

 public function action_status()
 {
     $status = (bool) $this->request->param('id');
     Model_Config::set_value('general', 'cron', $status);
     Alert::set(Alert::SUCCESS, __('General Configuration updated'));
     $this->redirect(Route::url('oc-panel', array('controller' => 'crontab')));
 }
开发者ID:JeffPedro,项目名称:project-garage-sale,代码行数:7,代码来源:crontab.php

示例10: action_pay

 /**
  * [action_form] generates the form to pay at paypal
  */
 public function action_pay()
 {
     $this->auto_render = FALSE;
     //sandobx doesnt do the x_receipt_link_url redirect so in sanbbox instead we put the order id
     $id_order = Core::config('payment.twocheckout_sandbox') == 1 ? Core::request('x_receipt_link_url') : $this->request->param('id');
     //retrieve info for the item in DB
     $order = new Model_Order();
     $order = $order->where('id_order', '=', $id_order)->where('status', '=', Model_Order::STATUS_CREATED)->limit(1)->find();
     if ($order->loaded()) {
         //its a fraud...lets let him know
         if ($order->is_fraud() === TRUE) {
             Alert::set(Alert::ERROR, __('We had, issues with your transaction. Please try paying with another paymethod.'));
             $this->redirect(Route::url('default', array('controller' => 'product', 'action' => 'checkout', 'id' => $order->id_order)));
         }
         if (($order_id = twocheckout::validate_passback($order)) !== FALSE) {
             //mark as paid
             $order->confirm_payment('2checkout', $order_id, NULL, NULL, NULL, Twocheckout::calculate_fee($order->amount));
             //redirect him to his ads
             Alert::set(Alert::SUCCESS, __('Thanks for your payment!'));
             $this->redirect(Route::url('default', array('controller' => 'product', 'action' => 'goal', 'id' => $order->id_order)));
         } else {
             Alert::set(Alert::INFO, __('Please fill your card details.'));
             $this->redirect(Route::url('default', array('controller' => 'product', 'action' => 'checkout', 'id' => $order->id_order)));
         }
     } else {
         Alert::set(Alert::INFO, __('Order could not be loaded'));
         $this->redirect(Route::url('default'));
     }
 }
开发者ID:Ryanker,项目名称:open-eshop,代码行数:32,代码来源:twocheckout.php

示例11: action_update

 /**
  * CRUD controller: UPDATE
  */
 public function action_update()
 {
     $id_role = $this->request->param('id');
     //we do not allow modify the admin
     if ($id_role == Model_Role::ROLE_ADMIN) {
         Alert::set(Alert::WARNING, __('Admin Role can not be modified!'));
         $this->redirect(Route::url('oc-panel', array('controller' => 'role')));
     }
     $this->template->title = __('Update') . ' ' . __($this->_orm_model) . ' ' . $id_role;
     $role = new Model_Role($id_role);
     if ($this->request->post() and $role->loaded()) {
         //delete all the access
         DB::delete('access')->where('id_role', '=', $role->id_role)->execute();
         //set all the access where post = on
         foreach ($_POST as $key => $value) {
             if ($value == 'on') {
                 DB::insert('access', array('id_role', 'access'))->values(array($role->id_role, str_replace('|', '.', $key)))->execute();
             }
         }
         //saving the role params
         $role->name = core::post('name');
         $role->description = core::post('description');
         $role->save();
         Alert::set(Alert::SUCCESS, __('Item updated'));
         $this->redirect(Route::get($this->_route_name)->uri(array('controller' => Request::current()->controller())));
     }
     //getting controllers actions
     $controllers = Model_Access::list_controllers();
     //get all the access this user has
     $query = DB::select('access')->from('access')->where('id_role', '=', $id_role)->execute();
     $access_in_use = array_keys($query->as_array('access'));
     // d(in_array('access_index',$access_in_use));
     //d($access_in_use);
     return $this->render('oc-panel/pages/role/update', array('role' => $role, 'controllers' => $controllers, 'access_in_use' => $access_in_use));
 }
开发者ID:nick-catanchin-ie,项目名称:common,代码行数:38,代码来源:role.php

示例12: action_result

 public function action_result()
 {
     $this->auto_render = FALSE;
     $id_order = Core::request('id_order');
     //retrieve info for the item in DB
     $order = new Model_Order();
     $order = $order->where('id_order', '=', $id_order)->where('status', '=', Model_Order::STATUS_CREATED)->limit(1)->find();
     if ($order->loaded()) {
         //its a fraud...lets let him know
         if ($order->is_fraud() === TRUE) {
             Alert::set(Alert::ERROR, __('We had, issues with your transaction. Please try paying with another paymethod.'));
             $this->redirect(Route::url('default', array('controller' => 'ad', 'action' => 'checkout', 'id' => $order->id_order)));
         }
         //correct payment?
         if (($result = paguelofacil::check_result()) === TRUE) {
             //mark as paid
             $order->confirm_payment('paguelofacil', Core::request('Oper'));
             //redirect him to his ads
             Alert::set(Alert::SUCCESS, __('Thanks for your payment!'));
             $this->redirect(Route::url('oc-panel', array('controller' => 'profile', 'action' => 'orders')));
         } else {
             Alert::set(Alert::INFO, __('Transaction not successful!'));
             $this->redirect(Route::url('default', array('controller' => 'ad', 'action' => 'checkout', 'id' => $order->id_order)));
         }
     } else {
         Alert::set(Alert::INFO, __('Order could not be loaded'));
         $this->redirect(Route::url('default', array('controller' => 'ad', 'action' => 'checkout', 'id' => $order->id_order)));
     }
 }
开发者ID:kotsios5,项目名称:openclassifieds2,代码行数:29,代码来源:paguelofacil.php

示例13: action_form

 /**
  * [action_form] generates the form to pay at paypal
  */
 public function action_form()
 {
     $this->auto_render = FALSE;
     $order_id = $this->request->param('id');
     $order = new Model_Order();
     $order->where('id_order', '=', $order_id)->where('status', '=', Model_Order::STATUS_CREATED)->limit(1)->find();
     if ($order->loaded()) {
         // dependant on product we have different names
         if ($order->id_product == Paypal::to_featured) {
             $item_name = __('Advertisement to featured');
         } else {
             if ($order->id_product == Paypal::to_top) {
                 $item_name = __('Advertisement to top');
             } else {
                 $item_name = $order->description . __(' category');
             }
         }
         $paypal_url = Core::config('payment.sandbox') ? Paypal::url_sandbox_gateway : Paypal::url_gateway;
         $paypal_data = array('order_id' => $order_id, 'amount' => number_format($order->amount, 2, '.', ''), 'site_name' => core::config('general.site_name'), 'site_url' => URL::base(TRUE), 'paypal_url' => $paypal_url, 'paypal_account' => core::config('payment.paypal_account'), 'paypal_currency' => core::config('payment.paypal_currency'), 'item_name' => $item_name);
         $this->template = View::factory('paypal', $paypal_data);
         $this->response->body($this->template->render());
     } else {
         Alert::set(Alert::INFO, __('Order could not be loaded'));
         $this->request->redirect(Route::url('default'));
     }
 }
开发者ID:Wildboard,项目名称:WbWebApp,代码行数:29,代码来源:paypal.php

示例14: action_pay

 /**
  * [action_form] generates the form to pay at paypal
  */
 public function action_pay()
 {
     $this->auto_render = FALSE;
     $id_order = $this->request->param('id');
     //retrieve info for the item in DB
     $order = new Model_Order();
     $order = $order->where('id_order', '=', $id_order)->where('status', '=', Model_Order::STATUS_CREATED)->limit(1)->find();
     if ($order->loaded()) {
         //its a fraud...lets let him know
         if ($order->is_fraud() === TRUE) {
             Alert::set(Alert::ERROR, __('We had, issues with your transaction. Please try paying with another paymethod.'));
             $this->redirect(Route::url('default', array('controller' => 'ad', 'action' => 'checkout', 'id' => $order->id_order)));
         }
         if (($order_id = twocheckout::validate_passback($order)) !== FALSE) {
             //mark as paid
             $order->confirm_payment('2checkout', $order_id);
             //redirect him to his ads
             Alert::set(Alert::SUCCESS, __('Thanks for your payment!'));
             $this->redirect(Route::url('oc-panel', array('controller' => 'profile', 'action' => 'orders')));
         } else {
             Alert::set(Alert::INFO, __('Please fill your card details.'));
             $this->redirect(Route::url('default', array('controller' => 'ad', 'action' => 'checkout', 'id' => $order->id_order)));
         }
     } else {
         Alert::set(Alert::INFO, __('Order could not be loaded'));
         $this->redirect(Route::url('default', array('controller' => 'ad', 'action' => 'checkout', 'id' => $order->id_order)));
     }
 }
开发者ID:zhangkom,项目名称:openclassifieds2,代码行数:31,代码来源:twocheckout.php

示例15: __construct

 function __construct(Request $request, Response $response)
 {
     if (Theme::get('premium') != 1) {
         Alert::set(Alert::INFO, __('Upgrade your Yclas site to activate this feature.'));
     }
     $this->_filter_fields = array('id_user' => 'INPUT', 'expire_date' => 'DATE', 'created' => 'DATE', 'id_plan' => array('type' => 'SELECT', 'table' => 'plans', 'key' => 'id_plan', 'value' => 'seoname'), 'status' => array(0 => 'Inactive', 1 => 'Active'));
     parent::__construct($request, $response);
 }
开发者ID:kotsios5,项目名称:openclassifieds2,代码行数:8,代码来源:subscription.php


注:本文中的Alert::set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。