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


PHP KSSystem类代码示例

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


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

示例1: onAfterDisplayKSMCartDefault_congratulation

 public function onAfterDisplayKSMCartDefault_congratulation($view, $tpl = null, &$html)
 {
     if (empty($view->order)) {
         return;
     }
     if (empty($view->order->payment_id)) {
         return;
     }
     $payment = KSMWalletone::getPayment($view->order->payment_id, $this->_name);
     if ($payment->id <= 0) {
         return;
     }
     if (empty($view->order->region_id)) {
         return;
     }
     if (!$this->checkRegion($payment->regions, $view->order->region_id)) {
         return;
     }
     $params = new JRegistry();
     $params->loadString($payment->params);
     $view->payment_params = $params;
     $view->payment_form_params = new stdClass();
     $view->payment_form_params->title = 'Оплата заказа №' . $view->order->id . ' на сайте ' . JFactory::getConfig()->get('sitename');
     $paymentTypes = $this->_preparePaymentTypes($view->payment_params->get('payment_types', array()));
     $view->user = KSUsers::getUser();
     KSMWalletone::_setFields(array_merge($paymentTypes, array('WMI_MERCHANT_ID' => $view->payment_params->get('merchant_id', null), 'WMI_PAYMENT_AMOUNT' => $view->order->costs['total_cost'], 'WMI_PAYMENT_NO' => $view->order->id, 'WMI_CURRENCY_ID' => 643, 'WMI_DESCRIPTION' => $view->payment_form_params->title, 'WMI_CUSTOMER_FIRSTNAME' => $view->order->customer_fields->first_name, 'WMI_CUSTOMER_LASTNAME' => $view->order->customer_fields->last_name, 'WMI_CUSTOMER_EMAIL' => $view->order->customer_fields->email, 'WMI_FAIL_URL' => JRoute::_(JURI::base() . 'index.php?option=com_ksenmart&view=cart&layout=pay_error'), 'WMI_SUCCESS_URL' => JRoute::_(JURI::base() . 'index.php?option=com_ksenmart&view=cart&layout=pay_success'))));
     $view->payment_form_params->sign = KSMWalletone::getHash($view->payment_params->get('secretKey', null));
     $html .= KSSystem::loadPluginTemplate($this->_name, $this->_type, $view, 'default_paymentform');
     return true;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:30,代码来源:walletone.php

示例2: getCurrency

 function getCurrency()
 {
     $this->onExecuteBefore('getCurrency');
     $id = JRequest::getInt('id');
     $currency = KSSystem::loadDbItem($id, 'currencies');
     $this->onExecuteAfter('getCurrency', array(&$currency));
     return $currency;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:8,代码来源:currencies.php

示例3: load_order

 public function load_order()
 {
     $session = JFactory::getSession();
     $model = $this->getModel('profile');
     $order = $model->getOrder();
     $session->set('shopcart_discount', $order->coupon);
     $session->set('shop_order_id', $order->id);
     $this->setRedirect(JRoute::_('index.php?option=com_ksenmart&view=cart&Itemid=' . KSSystem::getShopItemid(), false));
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:9,代码来源:profile.php

示例4: getImportStep

 function getImportStep()
 {
     $jinput = JFactory::getApplication()->input;
     $this->view->encoding = $jinput->get('encoding', 'cp1251');
     if (!($this->view->info = $this->importCSV())) {
         return false;
     }
     $html = KSSystem::loadPluginTemplate($this->_name, $this->_type, $this->view, 'result');
     return $html;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:10,代码来源:import_csv.php

示例5: close_order

 function close_order()
 {
     $session = JFactory::getSession();
     $order_id = $session->get('shop_order_id', 0);
     if ($order_id != 0) {
         $model = $this->getModel('cart');
         $model->closeOrder();
         $this->setRedirect(JRoute::_('index.php?option=com_ksenmart&view=cart&layout=congratulation&Itemid=' . KSSystem::getShopItemid(), false));
     }
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:10,代码来源:cart.php

示例6: getDiscount

 function getDiscount()
 {
     $this->onExecuteBefore('getDiscount');
     $id = JRequest::getInt('id');
     $discount = KSSystem::loadDbItem($id, 'discounts');
     $discount = KSMedia::setItemMedia($discount, 'discount');
     if (empty($discount->from_date)) {
         $discount->from_date = date('d.m.Y');
     }
     if (empty($discount->to_date)) {
         $discount->to_date = date('d.m.Y');
     }
     if (empty($discount->categories)) {
         $discount->categories = '{}';
     }
     if (empty($discount->manufacturers)) {
         $discount->manufacturers = '{}';
     }
     if (empty($discount->regions)) {
         $discount->regions = '{}';
     }
     if (empty($discount->params)) {
         $discount->params = '{}';
     }
     if (empty($discount->user_actions)) {
         $discount->user_actions = '{}';
     }
     if (empty($discount->user_groups)) {
         $discount->user_groups = '{}';
     }
     if (empty($discount->info_methods)) {
         $discount->info_methods = '{}';
     }
     if (empty($discount->type)) {
         $discount->type = $this->getState('discount_type');
     }
     $discount->categories = json_decode($discount->categories, true);
     $discount->manufacturers = json_decode($discount->manufacturers, true);
     $discount->regions = json_decode($discount->regions, true);
     $discount->params = json_decode($discount->params, true);
     $discount->user_actions = json_decode($discount->user_actions, true);
     $discount->user_groups = json_decode($discount->user_groups, true);
     $discount->info_methods = json_decode($discount->info_methods, true);
     $discount->from_date = date('d.m.Y', strtotime($discount->from_date));
     $discount->to_date = date('d.m.Y', strtotime($discount->to_date));
     $this->setState('discount_type', $discount->type);
     $this->setState('discount_params', $discount->params);
     $this->setState('discount_id', $discount->id);
     $this->onExecuteAfter('getDiscount', array(&$discount));
     return $discount;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:51,代码来源:discounts.php

示例7: onLoadKsen

 public function onLoadKsen($ext_name_local, array $hFolders = array(), array $ignoreHelpers = array(), array $config = array())
 {
     global $ext_name, $ext_name_com, $ext_prefix;
     $ext_name = $ext_name_local;
     if (strripos($ext_name_local, '.') !== false) {
         list($ext_name, $ext_prefix) = explode('.', $ext_name_local);
     }
     $ext_name_com = 'com_' . $ext_name;
     $document = JFactory::getDocument();
     $version = new JVersion();
     $this->input = JFactory::getApplication()->input;
     $option = $this->input->get('option', null, 'string');
     $extension = $this->input->get('extension', $ext_name_com, 'string');
     include_once dirname(__FILE__) . '/core/defines.php';
     include_once KSC_ADMIN_PATH_CORE_HELPERS . 'helper.php';
     KSLoader::loadCoreHelpers($hFolders, $ignoreHelpers);
     if (!isset($config['admin'])) {
         $config['admin'] = false;
     }
     JHtml::_('behavior.keepalive');
     if ($version->RELEASE < 3.0) {
     } else {
         JHtml::_('jquery.framework');
         JHtml::_('jquery.ui');
         JHtml::_('bootstrap.framework');
     }
     if ($config['admin']) {
         KSSystem::addCSS(array('style', 'prog-style', 'nprogress', 'ui-lightness/jquery-ui-1.8.20.custom'));
         if ($version->RELEASE >= 3.0) {
             JHtml::_('jquery.ui', array('sortable'));
             JHtml::_('bootstrap.framework');
             JHtml::_('behavior.framework');
         } else {
             $document->addScript('http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js');
         }
         KSSystem::addJS(array('common', 'style', 'nprogress', 'list', 'listmodule'));
     }
     if ($this->params->get('angularJS', 1) && $config['angularJS']) {
     }
     $script = '
         var KS = {
             extension: \'' . $extension . '\',
             option: \'' . $ext_name_com . '\'
         };
     ';
     $document->addScriptDeclaration($script);
     KSSystem::loadPlugins();
     KSSystem::import('libraries.ksdb');
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:49,代码来源:ksencore.php

示例8: __callStatic

 public static function __callStatic($name, array $func_params)
 {
     $params = self::getParams();
     $layouts = $params->get('layouts', array());
     foreach ($layouts as $layout) {
         $func = 'on' . $layout->event . 'DisplayKSM' . $layout->layout;
         if ($name == $func) {
             $view = $func_params[0];
             $tpl =& $func_params[1];
             $html =& $func_params[2];
             $html .= KSSystem::loadModules($layout->position);
         }
     }
     return;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:15,代码来源:modules.php

示例9: add_comment

 public function add_comment()
 {
     $app = JFactory::getApplication();
     $model = $this->getModel('Product', 'KsenmartModel');
     $comments_model = $this->getModel('Comments', 'KsenmartModel');
     $return_url = JRoute::_('index.php?option=com_ksenmart&view=product&id=' . $model->_id . '&Itemid=' . KSSystem::getShopItemid());
     $requestData = $this->input->post->get('jform', array(), 'array');
     $data = array();
     if (count($requestData)) {
         $model->form = 'review';
         $form = $model->getForm();
         if (!$form) {
             JError::raiseError(500, $model->getError());
             return false;
         }
         $data = $model->validate($form, $requestData);
         if ($data === false) {
             $errors = $model->getErrors();
             for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) {
                 if ($errors[$i] instanceof Exception) {
                     $app->enqueueMessage($errors[$i]->getMessage(), 'warning');
                 } else {
                     $app->enqueueMessage($errors[$i], 'warning');
                 }
             }
             $this->setRedirect($return_url);
             return false;
         }
     } else {
         $data = array();
         $data['comment_name'] = $this->input->post->get('comment_name', $user->name, 'string');
         $data['comment_rate'] = $this->input->post->get('comment_rate', 0, 'int');
         $data['comment_comment'] = $this->input->post->get('comment_comment', null, 'string');
         $data['comment_good'] = $this->input->post->get('comment_good', null, 'string');
         $data['comment_name'] = $this->input->post->get('comment_bad', null, 'string');
     }
     $data['product_id'] = $model->_id;
     $comments_model->addComment($data);
     if (!isset($_SESSION['rated']) || !is_array($_SESSION['rated'])) {
         $_SESSION['rated'] = array();
     }
     $_SESSION['rated'][$model->_id] = 1;
     $this->setMessage('Ваш отзыв принят');
     $this->setRedirect($return_url);
     return true;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:46,代码来源:product.php

示例10: getInput

 public function getInput($name, $group = null, $value = null)
 {
     $dispatcher = JDispatcher::getInstance();
     $formname = $this->getName();
     $formname = explode('.', $formname);
     $formname = $formname[count($formname) - 1];
     $html = '';
     $dispatcher->trigger('onBeforeGet' . strtoupper($this->ext_prefix) . 'FormInput' . ucfirst($formname) . ucfirst($name), array(&$this, &$name, &$html));
     if ($name != 'empty' && ($field = $this->getField($name, $group, $value))) {
         $element = $this->findField($name, $group);
         $field_html = $field->input;
         if (isset($element['wrap']) && !empty($element['wrap'])) {
             $field_html = KSSystem::wrapFormField($element['wrap'], $element, $field_html);
         }
         $html .= $field_html;
     }
     $dispatcher->trigger('onAfterGet' . strtoupper($this->ext_prefix) . 'FormInput' . ucfirst($formname) . ucfirst($name), array(&$this, &$name, &$html));
     return $html;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:19,代码来源:ksform.php

示例11: AddHeadTags

 public static function AddHeadTags()
 {
     if (self::$_headAdded == true) {
         return;
     }
     $session = JFactory::getSession();
     $document = JFactory::getDocument();
     JDispatcher::getInstance()->trigger('onLoadKsen', array('ksenmart.KSM', array('common'), array(), array('angularJS' => 0)));
     KSLoader::loadLocalHelpers(array('common'));
     $params = JComponentHelper::getParams('com_ksenmart');
     $document->addScript(JURI::base() . 'administrator/components/com_ksenmart/js/jquery.custom.min.js');
     $document->addScript(JURI::base() . 'components/com_ksenmart/js/common.js');
     $document->addStyleSheet(JURI::base() . 'components/com_ksenmart/css/common.css');
     if ($params->get('include_css', 1)) {
         $document->addStyleSheet(JURI::base() . 'components/com_ksenmart/css/template.css');
     }
     $js = "\n        var URI_ROOT='" . JURI::root() . "';\n        var km_cart_link='" . JRoute::_('index.php?option=com_ksenmart&view=cart&Itemid=' . KSSystem::getShopItemid()) . "';\n        var shopItemid='" . KSSystem::getShopItemid() . "';\n        var order_type='ordering';\n        var order_dir='asc';    \n        var limit=" . $params->get('site_product_limit', 30) . ";\n        var limitstart=0;   \n        var use_pagination=" . $params->get('site_use_pagination', 0) . ";\n        var order_process=" . $params->get('order_process', 0) . ";\n        var cat_id=" . JRequest::getInt('id', 0) . ";\n        var user_id=" . JFactory::getUser()->id . ";\n        var page=1;\n        var session_id='" . $session->getId() . "';\n        ";
     $document->addScriptDeclaration($js);
     self::$_headAdded = true;
     KSSystem::loadPlugins();
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:21,代码来源:head.php

示例12: getInput

 public function getInput()
 {
     $db = JFactory::getDBO();
     $this->value = is_array($this->value) ? $this->value : array();
     $html = '<style>.form-horizontal .controls {margin:0px;}</style>';
     $html .= '<table class="table table-striped" id="articleList">';
     $html .= '	<thead>';
     $html .= '		<tr>';
     $html .= '			<th class="title">' . JText::_('ksm_plugin_modules_module_title') . '</th>';
     $html .= '			<th width="10%" class="nowrap hidden-phone">' . JText::_('ksm_plugin_modules_module_position') . '</th>';
     $html .= '			<th width="30%" class="nowrap hidden-phone">' . JText::_('ksm_plugin_modules_module_pages') . '</th>';
     $html .= '			<th width="30%" class="hidden-phone">' . JText::_('ksm_plugin_modules_module_categories') . '</th>';
     $html .= '		</tr>';
     $html .= '	</thead>';
     $query = $db->getQuery(true);
     $query->select('a.id, a.title, a.position, a.published, map.menuid')->from('#__modules AS a')->join('LEFT', sprintf('#__modules_menu AS map ON map.moduleid = a.id AND map.menuid IN (0, %1$d, -%1$d)', KSSystem::getShopItemid()))->select('(SELECT COUNT(*) FROM #__modules_menu WHERE moduleid = a.id AND menuid < 0) AS ' . $db->quoteName('except'));
     $query->select('ag.title AS access_title')->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access')->where('a.published >= 0')->where('a.client_id = 0')->where('a.title != ' . $db->quote(''))->order('a.position, a.ordering');
     $db->setQuery($query);
     $modules = $db->loadObjectList();
     $page_options = array(JHtml::_('select.option', 0, JText::_('JALL')), JHtml::_('select.option', -1, JText::_('ksm_plugin_modules_noone')));
     foreach ($this->pages as $key => $page) {
         $page_options[] = JHtml::_('select.option', $key, JText::_('ksm_plugin_modules_page_' . $page));
     }
     $cat_options = $this->getCatOptions();
     foreach ($modules as $module) {
         if (is_null($module->menuid) && (!$module->except || $module->menuid < 0)) {
             continue;
         }
         $selected_pages = isset($this->value[$module->position][$module->id]['pages']) ? $this->value[$module->position][$module->id]['pages'] : array(0);
         $selected_cats = isset($this->value[$module->position][$module->id]['categories']) ? $this->value[$module->position][$module->id]['categories'] : array(0);
         $html .= '<tr>';
         $html .= '	<td class="title">' . $module->title . '</th>';
         $html .= '	<td width="10%" class="nowrap hidden-phone">' . $module->position . '</th>';
         $html .= '	<td width="30%" class="nowrap hidden-phone">' . JHtml::_('select.genericlist', $page_options, $this->name . '[' . $module->position . '][' . $module->id . '][pages][]', 'multiple="multiple"', 'value', 'text', $selected_pages) . '</th>';
         $html .= '	<td width="30%" class="hidden-phone">' . JHtml::_('select.genericlist', $cat_options, $this->name . '[' . $module->position . '][' . $module->id . '][categories][]', 'multiple="multiple"', 'value', 'text', $selected_cats) . '</th>';
         $html .= '</tr>';
     }
     $html .= '</table>';
     return $html;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:40,代码来源:ksmodules.php

示例13: getManufacturers

 function getManufacturers($group)
 {
     $db = JFactory::getDBO();
     $session_manufacturers = JRequest::getVar('manufacturers', array());
     JArrayHelper::toInteger($session_manufacturers);
     $query = $db->getQuery(true);
     $query->select('
     		km.*,
     		kf.filename,
     		kf.folder,
     		kf.params
     	')->from('#__ksenmart_manufacturers as km')->leftjoin("#__ksenmart_countries as kc on km.country=kc.id")->leftjoin("#__ksenmart_files as kf on kc.id=kf.owner_id and kf.owner_type='country'")->where('km.published=1')->order('km.title');
     if ($group) {
         $query->select('
                 kc.id AS country_id,
                 kc.title AS country_title
             ');
     } else {
         $query->group('km.id');
     }
     $db->setQuery($query);
     $manufacturers = $db->loadObjectList('id');
     $tmpManufacturers = array();
     foreach ($manufacturers as &$manufacturer) {
         $manufacturer->selected = in_array($manufacturer->id, $session_manufacturers) ? true : false;
         if (!empty($manufacturer->folder)) {
             $manufacturer->small_img = KSMedia::resizeImage($manufacturer->filename, $manufacturer->folder, 25, 30, json_decode($manufacturer->params, true));
         }
         unset($manufacturer->filename);
         unset($manufacturer->folder);
         $manufacturer->link = JRoute::_('index.php?option=com_ksenmart&view=catalog&manufacturers[]=' . $manufacturer->id . '&Itemid=' . KSSystem::getShopItemid());
         if ($group) {
             $tmpManufacturers[$manufacturer->country_title][] = $manufacturer;
         }
     }
     if (!$tmpManufacturers) {
         $tmpManufacturers = $manufacturers;
     }
     return $tmpManufacturers;
 }
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:40,代码来源:helper.php

示例14: defined

<?php

/**
 * @copyright   Copyright (C) 2013. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
defined('_JEXEC') or die;
KSSystem::import('models.modelkslist');
class KsenMartModelSearch extends JModelKSList
{
    public $_correct_string = null;
    public $_limit_relevant = null;
    public $_limit_categories = null;
    public $_limit_manufacture = null;
    public $_limit_products = null;
    private $_search_fields = array('p.title', 'p.introcontent', 'p.tag', 'c.title', 'p.product_code');
    public function __construct()
    {
        parent::__construct();
        $ajax_search = JRequest::getVar('ajax_search', 0);
        if ($ajax_search) {
            $this->params = new JRegistry();
            $module = JModuleHelper::getModule('km_simple_search');
            if (!empty($module->params)) {
                $this->params->loadString($module->params);
            }
            $this->_limit_relevant = $this->params->get('count_relevants', 3);
            $this->_limit_categories = $this->params->get('count_categories', 1);
            $this->_limit_manufacture = $this->params->get('count_manufactured', 1);
            $this->_limit_products = $this->params->get('count_result', 5);
        } else {
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:31,代码来源:search.php

示例15: defined

<?php

/**
 * @copyright   Copyright (C) 2013. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
defined('_JEXEC') or die;
$Itemid = KSSystem::getShopItemid();
$link = JRoute::_('index.php?option=com_ksenmart&view=cart&Itemid=' . $Itemid);
?>
<a href="<?php 
echo $link;
?>
">
	<b class="muted"><?php 
echo JText::_('KSM_CART_MINICART_LABEL');
?>
 [0]</b>
	<small class="muted"><?php 
echo JText::_('KSM_CART_MINICART_TEXT');
?>
</small>
</a>
开发者ID:JexyRu,项目名称:Ksenmart,代码行数:23,代码来源:minicart_empty.php


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