function listing() { hikashop_setTitle(JText::_('DOCUMENTATION'), 'help_header', 'documentation'); if (!HIKASHOP_PHP5) { $bar =& JToolBar::getInstance('toolbar'); } else { $bar = JToolBar::getInstance('toolbar'); } $bar->appendButton('Link', 'hikashop', JText::_('HIKASHOP_CPANEL'), hikashop_completeLink('dashboard')); $config =& hikashop_config(); $level = $config->get('level'); $url = HIKASHOP_HELPURL . 'documentation&level=' . $level; if (hikashop_isSSL()) { $url = str_replace('http://', 'https://', $url); } $config =& hikashop_config(); $menu_style = $config->get('menu_style', 'title_bottom'); if (HIKASHOP_J30) { $menu_style = 'content_top'; } if ($menu_style == 'content_top') { echo hikashop_getMenu('', $menu_style); } ?> <div id="hikashop_div"> <iframe allowtransparency="true" scrolling="auto" height="450px" frameborder="0" width="100%" name="hikashop_frame" id="hikashop_frame" src="<?php echo $url; ?> "> </iframe> </div> <?php }
function onAfterRoute() { $app = JFactory::getApplication(); if ($app->isAdmin() || @$_REQUEST['tmpl'] == 'component') { return true; } if (empty($_REQUEST['ctrl'])) { $_REQUEST['ctrl'] = @$_REQUEST['view']; } if (empty($_REQUEST['task'])) { $_REQUEST['task'] = @$_REQUEST['layout']; } if (@$_REQUEST['option'] == 'com_hikashop' && (@$_REQUEST['ctrl'] == 'checkout' || @$_REQUEST['ctrl'] == 'order' && @$_REQUEST['task'] == 'pay')) { return true; } if (@$_REQUEST['option'] == 'com_ccidealplatform' && @$_REQUEST['task'] == 'bankform') { return true; } if (!empty($_POST)) { return true; } if (!defined('DS')) { define('DS', DIRECTORY_SEPARATOR); } if (!(include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_hikashop' . DS . 'helpers' . DS . 'helper.php')) { return true; } if (hikashop_isSSL()) { $app->setUserState('com_hikashop.ssl_redirect', 0); $app->redirect(str_replace('https://', 'http://', hikashop_currentURL())); } return true; }
public function fetchButton($type = 'Pophelp', $namekey = '', $id = 'pophelp') { $doc = JFactory::getDocument(); $config = hikashop_config(); $level = $config->get('level'); $url = HIKASHOP_HELPURL . $namekey . '&level=' . $level; if (hikashop_isSSL()) { $url = str_replace('http://', 'https://', $url); } $js = ' function displayDoc(){ var d = document, init = false, b = d.getElementById("iframedoc"); if(!b) return true; if(typeof(b.openHelp) == "undefined") { b.openHelp = true; init = true; } if(b.openHelp) { b.innerHTML = \'<iframe src="' . $url . '" width="100%" height="100%" style="border:0px" border="no" scrolling="auto"></iframe>\'; b.setStyle("display","block"); } try { if(typeof(b.fxEffect) == "undefined") { b.fxEffect = b.effects({duration: 1500, transition: Fx.Transitions.Quart.easeOut}); } if(b.openHelp){ if(init) { b.height = 0; b.style.height = 0; } b.fxEffect.stop(); b.fxEffect.start({height: 300}); }else{ b.fxEffect.stop(); b.fxEffect.start({height: 0}).chain(function() { b.innerHTML = ""; b.setStyle("display", "none"); }); } } catch(err) { if(typeof(b.vslide) == "undefined") { b.vslide = new Fx.Slide("iframedoc"); } if(b.openHelp){ if(init) { b.vslide.hide(); } b.vslide.slideIn(); }else{ b.vslide.slideOut().chain(function() { b.innerHTML = ""; b.setStyle("display", "none"); }); } } b.openHelp = !b.openHelp; return false; }'; $doc->addScriptDeclaration($js); if (!HIKASHOP_J30) { return '<a href="' . $url . '" target="_blank" onclick="return displayDoc();" class="toolbar"><span class="icon-32-help" title="' . JText::_('HIKA_HELP', true) . '"></span>' . JText::_('HIKA_HELP') . '</a>'; } return '<button class="btn btn-small" onclick="return displayDoc();"><i class="icon-help"></i> ' . JText::_('HIKA_HELP') . '</button>'; }
function _iframe($url) { $config =& hikashop_config(); $menu_style = $config->get('menu_style', 'title_bottom'); if (HIKASHOP_J30) { $menu_style = 'content_top'; } if ($menu_style == 'content_top') { echo hikashop_getMenu('', $menu_style); } if (hikashop_isSSL()) { $url = str_replace('http://', 'https://', $url); } ?> <div id="hikashop_div"> <iframe allowtransparency="true" scrolling="auto" height="450px" frameborder="0" width="100%" name="hikashop_frame" id="hikashop_frame" src="<?php echo $url . '&level=' . $config->get('level') . '&component=hikashop&version=' . $config->get('version'); ?> "></iframe> </div> <?php }
function step() { if (isset($_POST['unique_id'])) { $unique_id = $_POST['unique_id']; $ck_submital = isset($_SESSION['ck_submital']) ? $_SESSION['ck_submital'] : array(); static $done = false; if (!$done && isset($ck_submital[$unique_id])) { JRequest::setVar('step', JRequest::getInt('previous', 0)); JRequest::setVar('layout', 'step'); return $this->display(); } else { $ck_submital[$unique_id] = true; $_SESSION['ck_submital'] = $ck_submital; $done = true; } } $class = hikashop_get('class.cart'); $class->get(); if (empty($class->cart->cart_id)) { $this->setRedirect($this->redirect_url, JText::_('CART_EMPTY')); return true; } $config =& hikashop_config(); global $Itemid; $redirect = false; $ssl = false; $new_item_id = $Itemid; $itemid_for_checkout = $config->get('checkout_itemid', '0'); if (!empty($itemid_for_checkout)) { if ($new_item_id != $itemid_for_checkout && empty($_SESSION['hikashop_new_itemid'])) { $new_item_id = $itemid_for_checkout; $_SESSION['hikashop_new_itemid'] = $new_item_id; $redirect = true; } else { $_SESSION['hikashop_new_itemid'] = ''; } } $app = JFactory::getApplication(); if (($config->get('force_ssl', 0) == 1 || $config->get('force_ssl', 0) == 'url') && $app->getUserState('com_hikashop.ssl_redirect') != 1) { if (!hikashop_isSSL()) { $ssl = 1; $redirect = true; $app->setUserState('com_hikashop.ssl_redirect', 1); } } if ($redirect) { $url = ''; if (!empty($new_item_id)) { $url = '&Itemid=' . $new_item_id; } if ($config->get('force_ssl', 0) == 'url') { $url = $config->get('force_ssl_url'); $url = str_replace('http://', 'https://', $url); if (strpos($url, "https://") === false) { $url = "https://" . $url; } $app = JFactory::getApplication(); $requestUri = $_SERVER['PHP_SELF']; $str_start = strpos($requestUri, 'index.php'); if (strpos($requestUri, 'index.php') != 0) { $requestUri = substr($requestUri, $str_start - 1, strlen($requestUri)); } if (!empty($_SERVER['QUERY_STRING'])) { $requestUri = rtrim($requestUri, '/') . '?' . $_SERVER['QUERY_STRING']; } $app->redirect($url . $requestUri); } else { $this->setRedirect(JRoute::_('index.php?option=' . HIKASHOP_COMPONENT . '&ctrl=checkout' . $url, false, $ssl)); } return true; } $go_back = false; $this->previous = JRequest::getInt('previous', 0); $this->current = JRequest::getInt('step', 0); JPluginHelper::importPlugin('hikashop'); JPluginHelper::importPlugin('hikashoppayment'); JPluginHelper::importPlugin('hikashopshipping'); $dispatcher = JDispatcher::getInstance(); if (isset($_REQUEST['previous'])) { if (!isset($this->steps[$this->previous])) { $this->previous = 0; } $this->controllers = trim($this->steps[$this->previous]); $this->controllers = explode('_', $this->controllers); $newArray = array(); $found = false; $cart = false; $coupon = false; $login = false; $address = false; foreach ($this->controllers as $v) { if ($v == 'confirm') { $found = true; } elseif ($v == 'cart') { $cart = true; } elseif ($v == 'login') { $login = true; } elseif ($v == 'address') { $address = true; } elseif ($v == 'coupon') { $coupon = true; } else { $newArray[] = $v; } } if ($cart) { array_unshift($newArray, 'cart'); } if ($coupon) { array_unshift($newArray, 'coupon'); } if ($login) { array_unshift($newArray, 'login'); } if ($address) { array_unshift($newArray, 'address'); } if ($found) { $newArray[] = 'confirm'; } $this->controllers = $newArray; $this->beforeControllers = $newArray; foreach ($this->controllers as $controller) { $method = 'after_' . trim($controller); $original_go_back = $go_back; if (method_exists($this, $method)) { if (!$this->{$method}(!$go_back)) { $go_back = true; } } else { $dispatcher->trigger('onAfterCheckoutStep', array($controller, &$go_back, $original_go_back, &$this)); } } } else { if ($this->previous == 0) { $auto_select_default = $config->get('auto_select_default', 2); if ($auto_select_default) { $this->before_shipping(true); $this->before_payment(true); } } } if ($go_back) { JRequest::setVar('step', $this->previous); } else { $this->controllers = trim(@$this->steps[$this->current]); $this->controllers = explode('_', $this->controllers); foreach ($this->controllers as $controller) { $method = 'before_' . trim($controller); $original_go_back = $go_back; if (method_exists($this, $method)) { if (!$this->{$method}()) { $go_back = true; } } else { $dispatcher->trigger('onBeforeCheckoutStep', array($controller, &$go_back, $original_go_back, &$this)); } } if ($go_back && isset($this->previous)) { JRequest::setVar('step', $this->previous); } } JRequest::setVar('layout', 'step'); return $this->display(); }
function widgets() { $widgetClass = hikashop_get('class.widget'); $widgets = $widgetClass->get(); foreach ($widgets as $k => $widget) { $content = @$widget->widget_params->content; if (!empty($content) || $widget->widget_params->display == 'table') { if ($widget->widget_params->display == 'table') { foreach ($widget->widget_params->table as $row) { if (!empty($row)) { $widgetClass->data($row); } } } else { $widgetClass->data($widget); if (isset($widget->widget_params->period_compare) && $widget->widget_params->period_compare != 'none') { $widgetClass->data($widget); } } } } $this->assignRef('widgets', $widgets); if (!HIKASHOP_PHP5) { $doc =& JFactory::getDocument(); } else { $doc = JFactory::getDocument(); } $doc->addScript((hikashop_isSSL() ? 'https://' : 'http://') . 'www.google.com/jsapi'); $currencyHelper = hikashop_get('class.currency'); $this->assignRef('currencyHelper', $currencyHelper); if (hikashop_level(1)) { $config =& hikashop_config(); $manage = hikashop_isAllowed($config->get('acl_dashboard_manage', 'all')); $this->assignRef('manage', $manage); $delete = hikashop_isAllowed($config->get('acl_dashboard_delete', 'all')); $this->assignRef('delete', $delete); $this->toolbar[] = array('name' => 'link', 'icon' => 'new', 'alt' => 'NEW_WIDGET', 'url' => hikashop_completeLink('report&task=add&dashboard=true'), 'display' => $manage); } }