Exemple #1
0
 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');
 }
Exemple #2
0
<?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.modelksadmin');
jimport('joomla.http.transport.curl');
class KsenMartModelYaMarket extends JModelKSAdmin
{
    private $_sid = null;
    public function __construct($config = array())
    {
        parent::__construct($config);
    }
    public function getUserParams($uid)
    {
        $this->onExecuteBefore('getUserParams', array(&$uid));
        if (!empty($uid) & $uid > 0) {
            $params = array('task' => 'params', 'uid' => $uid);
            $params = json_decode(KSSystem::getLdmApiData('user', null, $params));
            $this->onExecuteAfter('getUserParams', array(&$uid));
            if (!isset($params->error)) {
                return $params;
            } elseif (isset($params->error)) {
                return $params->error;
            }
        }
        return new JObject();
    }
Exemple #3
0
<?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('views.viewksadmin');
class KsenMartViewCallbackkiller extends JViewKSAdmin
{
    function display($tpl = null)
    {
        $this->path->addItem(JText::_('ks_callbackkiller'));
        $this->plg_params = $this->get('PlgParams');
        if (empty($this->plg_params->loginhash)) {
            $model = $this->getModel();
            $model->form = 'callbackkiller';
            $this->form = $model->getForm();
        }
        $this->document->addStyleSheet(JURI::root() . 'plugins/system/callbackkiller/assets/css/callbackkiller.css');
        $this->document->addScript(JURI::root() . 'plugins/system/callbackkiller/assets/js/callbackkiller.js');
        parent::display($tpl);
    }
}
Exemple #4
0
<?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 {
Exemple #5
0
 public function onAfterViewAdminKSMExportImport(&$view)
 {
     KSSystem::import('libraries.roistat');
     JHtml::stylesheet('plg_system_roistat/default.css', false, true, false);
     $roistat = Roistat::getInstance();
     $user_isset = false;
     if (!empty($roistat->login)) {
         if ($roistat->checkUser($roistat->login) && !empty($roistat->project)) {
             $user_isset = true;
         }
     }
     if (!$user_isset) {
         JHtml::script('plg_system_roistat/default.js', false, true);
     } else {
         $view->assign('project', $roistat->project);
     }
     $view->assign('user_isset', $user_isset);
     $view->addTemplatePath(JPATH_ROOT . '/plugins/system/roistat/tmpl/');
     return true;
 }
Exemple #6
0
<?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('helpers.corehelper');
class KSMWalletone extends KSCoreHelper
{
    private static $_fields = array();
    public static function _setFields(array $data)
    {
        if (!empty($data)) {
            foreach ($data as $key => $value) {
                self::$_fields[$key] = $value;
            }
        }
        return $data;
    }
    public static function _getFields()
    {
        if (empty(self::$_fields)) {
            self::$_fields = array();
        }
        return self::$_fields;
    }
    public static function getHash($secretKey)
    {
        $data = self::_getFields();
        if (!empty($data)) {
Exemple #7
0
<?php

/**
 * @copyright   Copyright (C) 2013. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
defined('_JEXEC') or die;
if (!class_exists('KMPlugin')) {
    require JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_ksenmart' . DS . 'classes' . DS . 'kmplugin.php';
}
KSSystem::import('models.form.ksform');
class plgKMExportimportExport_ym extends KMPlugin
{
    var $view = null;
    function __construct(&$subject, $config)
    {
        parent::__construct($subject, $config);
    }
    function onAfterDisplayAdminKSMexportimportdefault_text($view, &$tpl, &$html)
    {
        if ($this->_name != $view->type) {
            return false;
        }
        $this->view = $view;
        $jinput = JFactory::getApplication()->input;
        $step = $jinput->get('step', 'config');
        switch ($step) {
            case 'config':
                $html = $this->getConfigStep();
                break;
            case 'saveconfig':
Exemple #8
0
<?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('tables.ksentable');
class KsenmartTableProducts extends KsenTable
{
    public function __construct(&$_db)
    {
        parent::__construct('#__ksenmart_products', 'id', $_db);
        JTableObserverTags::createObserver($this, array('typeAlias' => 'com_ksenmart.product'));
        JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_ksenmart.product'));
    }
}
Exemple #9
0
<?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('controllers.ksencontroller');
class KsenMartController extends KsenControllerAdmin
{
}
Exemple #10
0
<?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.modelksform');
class KsenMartModelProduct extends JModelKSForm
{
    var $_id = null;
    var $_product = null;
    public function __construct()
    {
        parent::__construct();
        $this->_id = JFactory::getApplication()->input->get('id', null, 'int');
    }
    protected function populateState($ordering = null, $direction = null)
    {
        $this->onExecuteBefore('populateState', array(&$this));
        $this->onExecuteAfter('populateState', array(&$this));
    }
    public function getProduct()
    {
        $this->onExecuteBefore('getProduct');
        $row = KSMProducts::getProduct($this->_id);
        if (!empty($row)) {
            $row->rate = KSMProducts::getProductRate($row->id);
            $row->manufacturer = KSMProducts::getProductManufacturer($row->manufacturer);
            $row->add_link_cart = KSFunctions::getAddToCartLink();
            $row->comments = $this->getProductComments($row->id);
Exemple #11
0
<?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('views.viewks');
class KsenMartViewCatalog extends JViewKS
{
    function display($tpl = null)
    {
        $document = JFactory::getDocument();
        $app = JFactory::getApplication();
        $path = $app->getPathway();
        $this->params = JComponentHelper::getParams('com_ksenmart');
        $session = JFactory::getSession();
        $user = KSUsers::getUser();
        $this->state = $this->get('State');
        $layout_view = $session->get('layout', $user->settings->catalog_layout);
        $layout = $this->getLayout();
        switch ($layout) {
            case 'items':
                $rows = $this->get('Items');
                $this->assignRef('rows', $rows);
                $this->setLayout('catalog_ajax_items');
                break;
            case 'manufacturers':
                $model = $this->getModel();
                $brands = $this->get('Manufacturers');
                $brands = $model->groupBrandsByLet($brands);