本文整理汇总了PHP中common_node::initConfiguration方法的典型用法代码示例。如果您正苦于以下问题:PHP common_node::initConfiguration方法的具体用法?PHP common_node::initConfiguration怎么用?PHP common_node::initConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common_node
的用法示例。
在下文中一共展示了common_node::initConfiguration方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mainAction
/**
* main action
*/
public function mainAction()
{
$this->Customer = new client_customer();
$this->Company = new client_company();
$this->Customer->setCacheable(false);
$this->Company->setCacheable(false);
$this->auth = Onxshop_Bo_Authentication::getInstance();
if (is_numeric($this->GET['id'])) {
$customer_id = $this->GET['id'];
} else {
$customer_id = 0;
}
/**
* include node configuration
*/
$node_conf = common_node::initConfiguration();
$this->tpl->assign('NODE_CONF', $node_conf);
/**
* check access
*/
if (!$this->auth->hasPermission('customers', 'view')) {
return false;
}
$this->saveForm($customer_id);
$this->parseDetails($customer_id);
return true;
}
示例2: paymentPrepare
/**
* prepare data for payment gateway
*/
function paymentPrepare($order_id)
{
require_once 'models/common/common_node.php';
$node_conf = common_node::initConfiguration();
//$this->tpl->assign('NODE_CONF', $node_conf);
$order_data = $this->Transaction->getOrderDetail($order_id);
/**
* process payment method only if status = 0 unpaid or 5 failed payment
*
*/
if (!$this->checkOrderStatusValidForPayment($order_data['status'])) {
return false;
}
if ($_SERVER['HTTPS']) {
$protocol = 'https';
} else {
$protocol = 'http';
}
$server_url = "{$protocol}://{$_SERVER['HTTP_HOST']}";
require_once 'models/ecommerce/ecommerce_order.php';
$Order = new ecommerce_order();
$worldpay_amount = $Order->calculatePayableAmount($order_data);
$worldpay = array('URL' => ECOMMERCE_TRANSACTION_WORLDPAY_URL, 'instId' => ECOMMERCE_TRANSACTION_WORLDPAY_INSID, 'cartId' => $order_data['id'], 'amount' => $worldpay_amount, 'currency' => GLOBAL_DEFAULT_CURRENCY, 'desc' => ECOMMERCE_TRANSACTION_WORLDPAY_DESCRIPTION, 'testMode' => ECOMMERCE_TRANSACTION_WORLDPAY_TESTMODE, 'name' => $order_data['client']['customer']['title_before'] . ' ' . $order_data['client']['customer']['first_name'] . ' ' . $order_data['client']['customer']['last_name'], 'address' => $order_data['address']['invoices']['line_1'], 'postcode' => $order_data['address']['invoices']['post_code'], 'country' => $order_data['address']['invoices']['country']['iso_code2'], 'tel' => $order_data['address']['invoices']['telephone'], 'email' => $order_data['client']['customer']['email'], 'MC_callback' => "{$server_url}/page/" . $node_conf['id_map-payment_worldpay_callback'] . "?order_id={$order_data['id']}");
return $worldpay;
}
示例3: mainAction
/**
* main action
*/
public function mainAction()
{
/**
* include node configuration
*/
require_once 'models/common/common_node.php';
$node_conf = common_node::initConfiguration();
/**
* customer detail
*/
require_once 'models/client/client_customer.php';
$Customer = new client_customer();
$Customer->setCacheable(false);
if ($_POST['register'] || $_POST['login']) {
//check validation of submited fields
if ($Customer->checkLoginId($_POST['client']['customer'])) {
$_SESSION['r_client'] = $_POST['client'];
$this->dispatchToRegistration($node_conf);
} else {
$this->tpl->assign('CLIENT', $_POST['client']);
$this->tpl->parse('content.login');
}
} else {
$this->tpl->parse('content.form');
}
/**
* check status
*/
if ($_SESSION['client']['customer']['id'] > 0 && is_numeric($_SESSION['client']['customer']['id'])) {
$this->actionAfterLogin();
}
return true;
}
示例4: mainAction
/**
* main action
*/
public function mainAction()
{
/**
* include node configuration
*/
require_once 'models/common/common_node.php';
$node_conf = common_node::initConfiguration();
//$this->tpl->assign('NODE_CONF', $node_conf);
/**
* customer detail
*/
require_once 'models/client/client_customer.php';
$Customer = new client_customer();
$Customer->setCacheable(false);
if ($_POST['register']) {
//check validation of submited fields
if ($Customer->checkLoginId($_POST['client']['customer'])) {
$_SESSION['r_client'] = $_POST['client'];
$this->dispatchToRegistration($node_conf);
} else {
msg("User email {$_POST['client']['customer']['email']} is already registered", 'error', 0, 'account_exists');
$this->tpl->assign('CLIENT', $_POST['client']);
}
}
return true;
}
示例5: mainAction
/**
* main action
*/
public function mainAction()
{
require_once 'models/common/common_node.php';
$node_conf = common_node::initConfiguration();
$this->tpl->assign("NODE_CONF", $node_conf);
return true;
}
示例6: paymentPrepare
/**
* prepare data for payment gateway
*/
function paymentPrepare($order_id)
{
require_once 'models/common/common_node.php';
$node_conf = common_node::initConfiguration();
$order_data = $this->Transaction->getOrderDetail($order_id);
if ($_SERVER['HTTPS']) {
$protocol = 'https';
} else {
$protocol = 'http';
}
$server_url = "{$protocol}://{$_SERVER['HTTP_HOST']}";
$protx = array('URL' => ECOMMERCE_TRANSACTION_PROTX_URL, 'VPSProtocol' => ECOMMERCE_TRANSACTION_PROTX_VPSPROTOCOL, 'Vendor' => ECOMMERCE_TRANSACTION_PROTX_VENDOR, 'TxType' => ECOMMERCE_TRANSACTION_PROTX_TXTYPE, 'Crypt' => '', 'VendorEmail' => ECOMMERCE_TRANSACTION_PROTX_VENDOR_EMAIL);
require_once 'models/ecommerce/ecommerce_order.php';
$Order = new ecommerce_order();
$protx_amount = $Order->calculatePayableAmount($order_data);
$protx['Crypt']['VendorTxCode'] = $order_data['id'] . '_' . time();
$protx['Crypt']['Amount'] = $protx_amount;
$protx['Crypt']['Currency'] = GLOBAL_DEFAULT_CURRENCY;
$protx['Crypt']['Description'] = "Payment for Basket created {$order_data['basket']['created']}";
$protx['Crypt']['SuccessURL'] = "{$server_url}/page/" . $node_conf['id_map-payment_protx_success'] . "?order_id={$order_data['id']}";
$protx['Crypt']['FailureURL'] = "{$server_url}/page/" . $node_conf['id_map-payment_protx_success'] . "?order_id={$order_data['id']}";
$protx['Crypt']['CustomerEMail'] = $order_data['client']['customer']['email'];
$protx['Crypt']['VendorEMail'] = $protx['VendorEmail'];
$protx['Crypt']['eMailMessage'] = ECOMMERCE_TRANSACTION_PROTX_MAIL_MESSAGE;
$protx['Crypt']['BillingSurname'] = $order_data['client']['customer']['last_name'];
$protx['Crypt']['BillingFirstNames'] = $order_data['client']['customer']['first_name'];
$protx['Crypt']['BillingAddress1'] = $order_data['address']['invoices']['line_1'];
$protx['Crypt']['BillingCity'] = $order_data['address']['invoices']['city'];
$protx['Crypt']['BillingPostCode'] = $order_data['address']['invoices']['post_code'];
$protx['Crypt']['BillingCountry'] = $order_data['address']['invoices']['country']['iso_code2'];
$protx['Crypt']['DeliverySurname'] = $order_data['client']['customer']['last_name'];
$protx['Crypt']['DeliveryFirstNames'] = $order_data['client']['customer']['first_name'];
$delivery_name = explode(" ", trim($order_data['address']['delivery']['name']));
foreach ($delivery_name as $i => $item) {
if ($i == 0) {
$protx['Crypt']['DeliveryFirstNames'] = trim($item);
}
if ($i == count($delivery_name) - 1) {
$protx['Crypt']['DeliverySurname'] = trim($item);
}
}
$protx['Crypt']['DeliveryAddress1'] = $order_data['address']['delivery']['line_1'];
$protx['Crypt']['DeliveryCity'] = $order_data['address']['delivery']['city'];
$protx['Crypt']['DeliveryPostCode'] = $order_data['address']['delivery']['post_code'];
$protx['Crypt']['DeliveryCountry'] = $order_data['address']['delivery']['country']['iso_code2'];
$protx['Crypt']['Basket'] = '';
$basket = count($order_data['basket']['items']);
//Number of items in basket:Item 1 Description:Quantity of item 1:Unit cost item 1 minus tax:Tax of item 1:Cost of Item 1 inc tax:Total cost of item 1 (Quantity x cost inc tax):Item 2 Description:Quantity of item 2: .... :Cost of Item n inc tax:Total cost of item n
foreach ($order_data['basket']['items'] as $item) {
$basket = $basket . ':' . $item['product']['variety']['sku'] . ' - ' . $item['product']['name'] . ':' . $item['quantity'] . ':' . $item['product']['variety']['price'][GLOBAL_DEFAULT_CURRENCY]['price']['common']['value'] . ':' . $item['product']['variety']['price'][GLOBAL_DEFAULT_CURRENCY]['vat'] . ':' . $item['product']['variety']['price'][GLOBAL_DEFAULT_CURRENCY]['price']['common']['value_vat'] . ':' . $item['total_inc_vat'];
}
$protx['Crypt']['Basket'] = $basket;
foreach ($protx['Crypt'] as $key => $val) {
$crypt = $crypt . '&' . $key . '=' . $val;
}
$crypt = ltrim($crypt, '&');
$protx['Crypt'] = self::encryptAes($crypt, ECOMMERCE_TRANSACTION_PROTX_PASSWORD);
return $protx;
}
示例7: mainAction
/**
* main action
*/
function mainAction()
{
/**
* include node configuration
*/
require_once 'models/common/common_node.php';
$node_conf = common_node::initConfiguration();
$this->tpl->assign('NODE_CONF', $node_conf);
/**
* create product object
*/
$this->Product = new ecommerce_product();
$this->ProductVariety = new ecommerce_product_variety();
$product_id = $this->GET['product_id'];
$sku = $this->GET['sku'];
if ($sku && !is_numeric($product_id)) {
$variety_list = $this->ProductVariety->getVarietyListForSKU($sku);
} else {
$variety_list = $this->Product->getProductVarietyList($product_id);
}
if ($variety_list) {
$product = $this->Product->getDetail($product_id);
/**
* variety list
*/
foreach ($variety_list as $key => $variety) {
if ($variety['publish'] == 1) {
//mark first variety checked
if ($key == 0) {
$variety['checked'] = "checked='checked'";
}
$this->tpl->assign('PRODUCT', $product);
$this->tpl->assign('VARIETY', $variety);
$Price = new Onxshop_Request("component/ecommerce/price~product_variety_id={$variety['id']}~");
$this->tpl->assign("PRICE", $Price->getContent());
if ($variety['stock'] > 0) {
if (trim($variety['subtitle']) != '') {
$this->tpl->parse("content.variety.item.onstock.subtitle");
}
$this->tpl->parse("content.variety.item.onstock");
} else {
if ($variety['stock'] < 0) {
$this->tpl->parse("content.variety.item.special");
} else {
$this->tpl->parse("content.variety.item.outofstock");
}
}
$this->tpl->parse("content.variety.item");
}
}
/**
* product options
*/
$this->addProductOptions($product_id);
$this->tpl->parse('content.variety');
return true;
}
}
示例8: 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;
}
示例9: mainAction
/**
* public action
*/
public function mainAction()
{
parent::mainAction();
if ($_SESSION['client']['customer']['id'] == 0) {
$node_conf = common_node::initConfiguration();
onxshopGoto($node_conf['id_map-checkout_login']);
}
if ($_POST['node_id'] == $this->GET['node_id'] && is_numeric($_POST['selected_address_id'])) {
onxshopGoto("page/{$_SESSION['active_pages'][0]}");
}
return true;
}
示例10: initModels
/**
* init basket
*/
protected function initModels()
{
$node_conf = common_node::initConfiguration();
$this->tpl->assign('NODE_CONF', $node_conf);
$this->Basket = new ecommerce_basket();
$this->Basket->setCacheable(false);
$this->Basket_content = new ecommerce_basket_content();
$this->Basket_content->setCacheable(false);
$this->Order = new ecommerce_order();
$this->Order->setCacheable(false);
return $Basket;
}
示例11: getCheckoutPagesIdMap
/**
* get checkout pages ids
*/
public function getCheckoutPagesIdMap()
{
require_once 'models/common/common_node.php';
$node_conf = common_node::initConfiguration();
$this->tpl->assign('NODE_CONF', $node_conf);
$conf['id_map-checkout_basket'] = $node_conf['id_map-checkout_basket'];
$conf['id_map-checkout_login'] = $node_conf['id_map-checkout_login'];
$conf['id_map-checkout_delivery_options'] = $node_conf['id_map-checkout_delivery_options'];
$conf['id_map-checkout_gift'] = $node_conf['id_map-checkout_gift'];
$conf['id_map-checkout_summary'] = $node_conf['id_map-checkout_summary'];
$conf['id_map-checkout_payment'] = $node_conf['id_map-checkout_payment'];
$conf['id_map-checkout_payment_success'] = $node_conf['id_map-checkout_payment_success'];
$conf['id_map-checkout_payment_failure'] = $node_conf['id_map-checkout_payment_failure'];
return $conf;
}
示例12: mainAction
/**
* main action
*/
public function mainAction()
{
/**
* include node configuration
*/
require_once 'models/common/common_node.php';
$node_conf = common_node::initConfiguration();
$this->tpl->assign('NODE_CONF', $node_conf);
/**
* basket
*/
if (is_numeric($_SESSION['basket']['id']) && $this->customerData()) {
$_Onxshop_Request = new Onxshop_Request("component/ecommerce/basket_detail");
$this->tpl->assign("BASKET_DETAIL", $_Onxshop_Request->getContent());
}
return true;
}
示例13: mainAction
public function mainAction()
{
$this->node_conf = common_node::initConfiguration();
$this->tpl->assign('NODE_CONF', $this->node_conf);
$this->Watchdog = new common_watchdog();
$this->Product = new ecommerce_product();
$this->Watchdog->setCacheable(false);
// disable db cache for front-end users
$customer_id = (int) $_SESSION['client']['customer']['id'];
if ($this->GET['unsubscribe']) {
$this->processUnsubscription($this->GET['wid'], $this->GET['unsubscribe'], $customer_id);
} else {
$this->forceLogin($customer_id);
$this->processSubscription($customer_id, $this->GET['product_variety_id']);
$this->listWatchedItems($customer_id);
}
return true;
}
示例14: mainAction
/**
* main action
*/
public function mainAction()
{
if ($_SESSION['client']['customer']['id'] > 0) {
$customer_id = $_SESSION['client']['customer']['id'];
} else {
if (Onxshop_Bo_Authentication::getInstance()->isAuthenticated()) {
$customer_id = $this->GET['customer_id'];
} else {
msg('orders: You must be logged in first.', 'error');
onxshopGoTo("/");
}
}
/**
* include node configuration
*/
require_once 'models/common/common_node.php';
$node_conf = common_node::initConfiguration();
$this->tpl->assign('NODE_CONF', $node_conf);
/**
* Get the list
*/
require_once 'models/ecommerce/ecommerce_order.php';
$Order = new ecommerce_order();
$Order->setCacheable(false);
$records = $Order->getOrderList($customer_id);
/**
* parse output
*/
if (count($records) > 0) {
foreach ($records as $item) {
$item['order_created'] = strftime('%d/%m/%Y %H:%M', strtotime($item['order_created']));
$item['status_title'] = $Order->getStatusTitle($item['order_status']);
$this->tpl->assign('ITEM', $item);
if ($Order->checkOrderStatusValidForPayment($item['order_status'])) {
$this->tpl->parse('content.orders.item.make_payment');
}
$this->tpl->parse('content.orders.item');
}
$this->tpl->parse('content.orders');
} else {
$this->tpl->parse('content.noorders');
}
return true;
}
示例15: initConfiguration
/**
* init configuration
*/
static function initConfiguration()
{
if (array_key_exists('common_uri_mapping', $GLOBALS['onxshop_conf'])) {
$conf = $GLOBALS['onxshop_conf']['common_uri_mapping'];
} else {
$conf = array();
}
require_once 'models/common/common_node.php';
$node_conf = common_node::initConfiguration();
/**
* default settings
*/
if (!array_key_exists('homepage_id', $conf)) {
$conf['homepage_id'] = $node_conf['id_map-homepage'];
}
if (!array_key_exists('404_id', $conf)) {
$conf['404_id'] = $node_conf['id_map-404'];
}
if (!array_key_exists('seo', $conf)) {
$conf['seo'] = true;
}
if (!array_key_exists('rewrite_home', $conf)) {
$conf['rewrite_home'] = true;
}
if (!array_key_exists('delimiter', $conf)) {
$conf['delimiter'] = '/';
}
if (!array_key_exists('append', $conf)) {
$conf['append'] = '';
}
if (!array_key_exists('hash', $conf)) {
$conf['hash'] = false;
}
if (!array_key_exists('and_string', $conf)) {
$conf['and_string'] = I18N_AND;
}
return $conf;
}