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


PHP onxshopGoTo函数代码示例

本文整理汇总了PHP中onxshopGoTo函数的典型用法代码示例。如果您正苦于以下问题:PHP onxshopGoTo函数的具体用法?PHP onxshopGoTo怎么用?PHP onxshopGoTo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: mainAction

 /**
  * main action
  */
 public function mainAction()
 {
     require_once 'models/ecommerce/ecommerce_product.php';
     require_once 'models/ecommerce/ecommerce_product_variety.php';
     require_once 'models/ecommerce/ecommerce_price.php';
     $Product = new ecommerce_product();
     $Product_variety = new ecommerce_product_variety();
     $Price = new ecommerce_price();
     $this->tpl->assign("VARIETY_CONF", $Product_variety->conf);
     if ($_POST['save']) {
         $product_data = $_POST['product'];
         /**
          * add product
          */
         if ($product_id = $Product->insertFullProduct($product_data)) {
             msg("Product id={$product_id} interted.");
             //TODO: implement two options: 1. save end this, 2. save and add another
             onxshopGoTo("backoffice/products/{$product_id}/edit");
             //empty
             $product_data = array();
         } else {
             msg("Product add has failed.", 'error');
         }
     } else {
         $product_data = array();
         $product_data['variety'] = array();
         $product_data['variety']['price'] = array();
         $product_data['variety']['name'] = 'Item';
         $product_data['variety']['weight_gross'] = 0;
         $product_data['variety']['stock'] = 999;
         $product_data['variety']['price']['value'] = 0;
     }
     $this->tpl->assign('PRODUCT', $product_data);
     return true;
 }
开发者ID:AppChecker,项目名称:onxshop,代码行数:38,代码来源:product_add_quick.php

示例2: mainAction

 /**
  * main action
  */
 public function mainAction()
 {
     /**
      * initialize
      */
     require_once 'models/ecommerce/ecommerce_product.php';
     $Product = new ecommerce_product();
     /**
      * save
      */
     if ($_POST['save']) {
         $product_data = $_POST['product'];
         if ($id = $Product->updateProduct($product_data)) {
             /**
              * forward to product list main page and exit
              */
             onxshopGoTo("/backoffice/products");
             return true;
         }
     }
     /**
      * product detail
      */
     $product = $Product->detail($this->GET['id']);
     $product['publish'] = $product['publish'] == 1 ? 'checked="checked" ' : '';
     $this->tpl->assign('PRODUCT', $product);
     return true;
 }
开发者ID:AppChecker,项目名称:onxshop,代码行数:31,代码来源:product_edit.php

示例3: mainAction

 /**
  * main action
  */
 public function mainAction()
 {
     /**
      * check input
      */
     if ($_SESSION['client']['customer']['id'] == 0 && !Onxshop_Bo_Authentication::getInstance()->isAuthenticated()) {
         msg('controllers/client/customer_detail: You must logged in.', 'error');
         onxshopGoTo("/");
     } else {
         if (is_numeric($this->GET['customer_id']) && constant('ONXSHOP_IN_BACKOFFICE')) {
             $customer_id = $this->GET['customer_id'];
         } else {
             $customer_id = $_SESSION['client']['customer']['id'];
         }
     }
     if (!is_numeric($customer_id)) {
         return false;
     }
     /**
      * initialize
      */
     require_once 'models/client/client_customer.php';
     $Customer = new client_customer();
     $Customer->setCacheable(false);
     /**
      * get customer detail
      */
     $customer_detail = $Customer->getDetail($customer_id);
     if (is_array($customer_detail)) {
         $this->tpl->assign('ITEM', $customer_detail);
     } else {
         msg('controllers/client/customer_detail: cannot get detail', 'error');
     }
     return true;
 }
开发者ID:AppChecker,项目名称:onxshop,代码行数:38,代码来源:customer_detail.php

示例4: mainAction

 /**
  * main action
  */
 public function mainAction()
 {
     $this->Offer_Group = new ecommerce_offer_group();
     $offer_group_id = (int) $this->GET['offer_group_id'];
     if ($_POST['save']) {
         $_POST['offer_group']['schedule_start'] = $this->dateAndTimeToFull($_POST['offer_group']['start_date'], $_POST['offer_group']['start_time']);
         $_POST['offer_group']['schedule_end'] = $this->dateAndTimeToFull($_POST['offer_group']['end_date'], $_POST['offer_group']['end_time']);
         $offer_group_id = $this->processForm($_POST['offer_group'], $offer_group_id);
         onxshopGoTo("/backoffice/products");
     } else {
         $_POST['offer_group']['schedule_start'] = date("Y-m-d", time() + 7 * 24 * 3600);
         $_POST['offer_group']['schedule_end'] = date("Y-m-d", time() + 14 * 24 * 3600);
         $_POST['offer_group']['publish'] = 1;
     }
     if ($offer_group_id > 0) {
         $offer_group = $this->Offer_Group->detail($offer_group_id);
     } else {
         $offer_group = $_POST['offer_group'];
     }
     if ($offer_group['publish']) {
         $offer_group['publish'] = 'checked="checked"';
     } else {
         $offer_group['publish'] = '';
     }
     $this->tpl->assign("OFFER_GROUP", $offer_group);
     return true;
 }
开发者ID:AppChecker,项目名称:onxshop,代码行数:30,代码来源:offer_group_edit.php

示例5: dispatchToRegistration

 /**
  * send to registration
  */
 function dispatchToRegistration($node_conf)
 {
     if ($this->GET['to']) {
         $_SESSION['to'] = $this->GET['to'];
     }
     onxshopGoTo('/page/' . $node_conf['id_map-registration']);
 }
开发者ID:AppChecker,项目名称:onxshop,代码行数:10,代码来源:registration_start.php

示例6: customCommentAction

 /**
  * custom comment action
  */
 public function customCommentAction($data, $options)
 {
     if ($this->checkEditPermission($data)) {
         if (is_numeric($this->GET['comment_id'])) {
             $comment_id = $this->GET['comment_id'];
         } else {
             return false;
         }
         if (is_numeric($this->GET['publish'])) {
             $publish = $this->GET['publish'];
         } else {
             return false;
         }
         $comment_data = $this->Comment->getDetail($comment_id);
         $comment_data['publish'] = $publish;
         if ($this->Comment->updateComment($comment_data)) {
             if ($publish == 1) {
                 msg("Recipe review ID {$comment_id} approved by client ID {$_SESSION['client']['customer']['id']}");
             } else {
                 if ($publish == -1) {
                     msg("Recipe review ID {$comment_id} rejected by client ID {$_SESSION['client']['customer']['id']}");
                 }
             }
             onxshopGoTo($_SESSION['referer'], 2);
         }
     }
     return true;
 }
开发者ID:AppChecker,项目名称:onxshop,代码行数:31,代码来源:recipe_review_approve.php

示例7: mainAction

 /**
  * main action
  */
 public function mainAction()
 {
     $this->initModels();
     /**
      * Store submited data to the SESSION
      */
     if (isset($_POST['comments-filter'])) {
         $_SESSION['bo'][$this->key]['comments-filter'] = $_POST['comments-filter'];
         onxshopGoTo($this->GET["translate"]);
     }
     /**
      * Initialize pagination variables
      */
     if (is_numeric($this->GET['limit_from'])) {
         $from = $this->GET['limit_from'];
     } else {
         $from = 0;
     }
     if (is_numeric($this->GET['limit_per_page'])) {
         $per_page = $this->GET['limit_per_page'];
     } else {
         $per_page = 25;
     }
     $limit = "{$from},{$per_page}";
     /**
      * Prepare filter
      */
     $filter = array();
     $s = $_SESSION['bo'][$this->key]['comments-filter'];
     if ($s['location'] > 0) {
         $filter['node_id'] = $s['location'];
     }
     if (!empty($s['query'])) {
         $filter['query'] = $s['query'];
     }
     $this->tpl->assign("QUERY", $s['query']);
     /**
      * Load List
      */
     $list = $this->Comment->getCommentList($filter, 'id DESC', $limit);
     $count = $this->Comment->getCommentCount($filter);
     /**
      * Display pagination
      */
     $_Onxshop_Request = new Onxshop_Request("component/pagination~limit_from={$from}:limit_per_page={$per_page}:count={$count}~");
     $this->tpl->assign('PAGINATION', $_Onxshop_Request->getContent());
     /**
      * Display comments
      */
     $this->parseList($list);
     /**
      * Get used node ids and corresponding names
      */
     $nodes = $this->Comment->getUsedNodes();
     /**
      * Display location filter dropdown
      */
     $this->parseLocationSelect($nodes);
     return true;
 }
开发者ID:AppChecker,项目名称:onxshop,代码行数:63,代码来源:comment_list.php

示例8: mainAction

 /**
  * main action
  */
 public function mainAction()
 {
     if ($_SESSION['client']['customer']['id'] > 0) {
         require_once 'models/client/client_customer.php';
         $ClientCustomer = new client_customer();
         if ($ClientCustomer->logout()) {
             msg("Logout of {$_SESSION['client']['customer']['email']}", 'ok', 1);
             //$_SESSION['client']['customer']['id'] = 0;
             unset($_SESSION['client']);
             // unlink basket from customer
             unset($_SESSION['basket']);
             // clear gift parameters
             unset($_SESSION['gift']);
             unset($_SESSION['gift_message']);
             $this->invalidateToken();
             //clean facebook auth
             $this->logoutFromFacebook();
         } else {
             msg("Customer logout failed", 'error');
         }
     }
     //forward to the homepage
     onxshopGoTo(AFTER_CLIENT_LOGOUT_URL);
     return true;
 }
开发者ID:AppChecker,项目名称:onxshop,代码行数:28,代码来源:logout.php

示例9: mainAction

 /**
  * main action
  */
 public function mainAction()
 {
     require_once 'models/common/common_node.php';
     $Node = new common_node();
     $node_data = $Node->nodeDetail($this->GET['id']);
     if (!is_array($node_data['component'])) {
         $node_data['component'] = array();
         $node_data['component']['node_controller'] = 'common_simple';
     }
     if ($node_data['component']['sending_failed'] == '') {
         $node_data['component']['sending_failed'] = 'The provided data is not valid! Required items are marked with an asterisk (*)';
     }
     if ($node_data['component']['text'] == '') {
         $node_data['component']['text'] = "Thank you for your feedback.";
     }
     $this->tpl->assign("NODE", $node_data);
     $template_folder = "component/contact_form/";
     $template_name = "{$template_folder}{$node_data['component']['node_controller']}";
     /**
      * check template file exists
      */
     if (!templateExists($template_name)) {
         // try fallback to old _contact_form folder in case it was locally created (used prior to Onxshop 1.7.6)
         $template_folder = "component/_contact_form/";
         $template_name = "{$template_folder}{$node_data['component']['node_controller']}";
         if (!templateExists($template_name)) {
             msg("selected template {$template_name} was not found");
             return false;
         }
     }
     /**
      * execute controller
      */
     $Form = new Onxshop_Request("component/contact_form@{$template_name}&node_id={$node_data['id']}&mail_to={$node_data['component']['mail_to']}&mail_toname={$node_data['component']['mail_toname']}&spam_protection={$node_data['component']['spam_protection']}");
     $this->tpl->assign("FORM", $Form->getContent());
     $reg_key = "form_notify_" . $node_data['id'];
     if (Zend_Registry::isRegistered($reg_key)) {
         if (Zend_Registry::get($reg_key) == 'sent') {
             //forward
             msg($node_data['component']['text'], 'ok');
             if ($node_data['component']['href'] != '') {
                 onxshopGoTo($node_data['component']['href']);
             }
         } else {
             if (Zend_Registry::get($reg_key) == 'failed') {
                 msg($node_data['component']['sending_failed'], 'error');
                 $this->tpl->parse('content.form');
             } else {
                 $this->tpl->parse('content.form');
             }
         }
     } else {
         $this->tpl->parse('content.form');
     }
     if ($node_data['display_title']) {
         $this->tpl->parse('content.title');
     }
     return true;
 }
开发者ID:AppChecker,项目名称:onxshop,代码行数:62,代码来源:contact_form.php

示例10: mainAction

 /**
  * main action
  */
 public function mainAction()
 {
     if ($_SESSION['client']['customer']['id'] == 0 && !Onxshop_Bo_Authentication::getInstance()->isAuthenticated()) {
         msg('client_edit: You must be logged in first.', 'error');
         onxshopGoTo("/");
     }
     require_once 'models/client/client_customer.php';
     $Customer = new client_customer();
     $Customer->setCacheable(false);
     $customer_id = $_SESSION['client']['customer']['id'];
     if (!is_numeric($customer_id)) {
         return false;
     }
     if ($_POST['save']) {
         $_POST['client']['customer']['id'] = $customer_id;
         // do not allow to set certain properties
         unset($_POST['client']['customer']['status']);
         unset($_POST['client']['customer']['group_id']);
         unset($_POST['client']['customer']['group_ids']);
         unset($_POST['client']['customer']['role_ids']);
         unset($_POST['client']['customer']['account_type']);
         unset($_POST['client']['customer']['other_data']);
         /**
          * check birthday field format
          */
         if ($_POST['client']['customer']['birthday']) {
             // check, expected as dd/mm/yyyy
             if (!preg_match('/^\\d{1,2}\\/\\d{1,2}\\/\\d{4}$/', $_POST['client']['customer']['birthday'])) {
                 msg('Invalid format for birthday, use dd/mm/yyyy', 'error');
                 return false;
             }
             // Format to ISO
             $_POST['client']['customer']['birthday'] = strftime('%Y-%m-%d', strtotime(str_replace('/', '-', $_POST['client']['customer']['birthday'])));
         }
         /**
          * update
          */
         if ($Customer->updateClient($_POST['client'])) {
             msg(I18N_CUSTOMER_DATA_UPDATED);
         } else {
             msg("Can't update client data", 'error');
         }
     }
     $client_data = $Customer->getClientData($customer_id);
     $client_data['customer']['newsletter'] = $client_data['customer']['newsletter'] == 1 ? 'checked="checked" ' : '';
     // format birthday only if available to avoid 01/01/1970 by default
     if ($client_data['customer']['birthday'] != '') {
         $client_data['customer']['birthday'] = strftime('%d/%m/%Y', strtotime($client_data['customer']['birthday']));
     }
     $this->tpl->assign('CLIENT', $client_data);
     /**
      * show password field only if previously set
      */
     if ($client_data['customer']['password']) {
         $this->tpl->parse('content.password');
     }
     return true;
 }
开发者ID:AppChecker,项目名称:onxshop,代码行数:61,代码来源:edit.php

示例11: mainAction

 /**
  * main action
  */
 public function mainAction()
 {
     require_once 'models/common/common_node.php';
     $node_conf = common_node::initConfiguration();
     if ($_SESSION['client']['customer']['id'] > 0) {
         onxshopGoTo("page/{$node_conf['id_map-checkout_delivery_options']}");
     } else {
         onxshopGoTo("page/{$node_conf['id_map-checkout_login']}");
     }
     return true;
 }
开发者ID:AppChecker,项目名称:onxshop,代码行数:14,代码来源:checkout_router.php

示例12: mainAction

 /**
  * main action
  */
 public function mainAction()
 {
     // initialize
     require_once 'models/ecommerce/ecommerce_store.php';
     $Store = new ecommerce_store();
     // save
     if ($_POST['save']) {
         // set values
         if (!isset($_POST['store']['publish'])) {
             $_POST['store']['publish'] = 0;
         }
         $_POST['store']['modified'] = date('c');
         // handle other_data
         $_POST['store']['other_data'] = serialize($_POST['store']['other_data']);
         // force numeric types
         $_POST['store']['coordinates_x'] = (int) $_POST['store']['coordinates_x'];
         $_POST['store']['coordinates_y'] = (int) $_POST['store']['coordinates_y'];
         $_POST['store']['latitude'] = (double) $_POST['store']['latitude'];
         $_POST['store']['longitude'] = (double) $_POST['store']['longitude'];
         // serialize street_view_options
         $_POST['store']['street_view_options'] = serialize($_POST['store']['street_view_options']);
         // remove if country_id isn't numeric
         if (!is_numeric($_POST['store']['country_id'])) {
             unset($_POST['store']['country_id']);
         }
         // update store
         if ($id = $Store->update($_POST['store'])) {
             msg("Store ID={$id} updated");
             // update node info (if exists)
             $store_homepage = $Store->getStoreHomepage($_POST['store']['id']);
             if (is_array($store_homepage) && count($store_homepage) > 0) {
                 $store_homepage['publish'] = $_POST['store']['publish'];
                 require_once 'models/common/common_node.php';
                 $Node = new common_node();
                 $Node->nodeUpdate($store_homepage);
             }
             // forward to store list main page and exit
             onxshopGoTo("/backoffice/stores");
             return true;
         } else {
             msg("Cannot update store details", 'error');
         }
     }
     // store detail
     $store = $Store->detail($this->GET['id']);
     $store['publish'] = $store['publish'] == 1 ? 'checked="checked" ' : '';
     $store['street_view_options'] = unserialize($store['street_view_options']);
     $this->tpl->assign('STORE', $store);
     $this->tpl->assign('STREET_VIEW_IMAGE_' . (int) $store['street_view_options']['image'], 'checked="checked"');
     $this->parseTypeSelect($store['type_id']);
     return true;
 }
开发者ID:AppChecker,项目名称:onxshop,代码行数:55,代码来源:store_edit.php

示例13: mainAction

 /**
  * main action
  */
 public function mainAction()
 {
     if ($_SESSION['client']['customer']['id'] == 0) {
         msg('payment_callback_protx: You must be logged in.');
         onxshopGoTo("/");
     }
     require_once 'conf/payment/protx.php';
     $this->transactionPrepare();
     if (is_numeric($this->GET['order_id']) && $this->GET['crypt'] != '') {
         $this->paymentProcess($this->GET['order_id'], $this->GET['crypt']);
     }
     return true;
 }
开发者ID:AppChecker,项目名称:onxshop,代码行数:16,代码来源:protx_callback.php

示例14: mainAction

 /**
  * main action
  */
 public function mainAction()
 {
     if ($customer_data = $_POST['client']['customer']) {
         require_once 'models/client/client_customer.php';
         $Customer = new client_customer();
         if ($id = $Customer->registerCustomer($customer_data)) {
             onxshop_flush_cache();
             onxshopGoTo("/backoffice/customers/{$id}/detail");
         } else {
             msg("Cannot add user", 'error');
         }
     }
     return true;
 }
开发者ID:AppChecker,项目名称:onxshop,代码行数:17,代码来源:customer_add.php

示例15: mainAction

 /**
  * main action
  */
 public function mainAction()
 {
     /**
      * include node configuration
      */
     require_once 'models/common/common_node.php';
     $Node = new common_node();
     /**
      * nothing to do here, forward first parent page
      */
     $first_parent_page_id = $Node->getParentPageId($this->GET['id']);
     onxshopGoTo("page/" . $first_parent_page_id);
     return true;
 }
开发者ID:uralmax89,项目名称:onxshop,代码行数:17,代码来源:default.php


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