public function configurationLine($id = 0, $conf = null) { if (empty($this->toggleHelper)) { $this->toggleHelper = hikaserial::get('helper.toggle'); } switch ($id) { case 'packs': if (empty($this->packs)) { $db = JFactory::getDBO(); $db->setQuery('SELECT * FROM ' . hikaserial::table('pack')); $this->packs = $db->loadObjectList('pack_id'); } $ret = array(); if (!empty($conf->plugin_params->packs)) { if (!is_array($conf->plugin_params->packs)) { $conf->plugin_params->packs = array($conf->plugin_params->packs); } foreach ($conf->plugin_params->packs as $p) { if (isset($this->packs[(int) $p])) { $ret[] = '<a href="' . hikaserial::completeLink('pack&task=edit&cid=' . (int) $p) . '">' . $this->packs[(int) $p]->pack_name . '</a>'; } } } return implode(', ', $ret); } return null; }
public function config($tpl = null) { hikaserial::setTitle(JText::_(self::name), self::icon, self::ctrl); $config = hikaserial::config(); $this->assignRef('config', $config); $popup = hikaserial::get('shop.helper.popup'); $this->assignRef('popup', $popup); $serialstatusType = hikaserial::get('type.serial_status'); $this->assignRef('serial_status', $serialstatusType); $orderstatusType = hikaserial::get('type.order_status'); $this->assignRef('orderstatusType', $orderstatusType); $manage = hikaserial::isAllowed($config->get('acl_config_manage', 'all')); $this->assignRef('manage', $manage); $toggleClass = hikaserial::get('helper.toggle'); $languages = array(); $lg = JFactory::getLanguage(); $language = $lg->getTag(); $styleRemind = 'float:right;margin-right:30px;position:relative;'; $loadLink = $popup->display(JText::_('LOAD_LATEST_LANGUAGE'), 'EDIT_LANGUAGE_FILE', hikaserial::completeLink('config&task=latest&code=' . $language, true), 'loadlatest_language_' . $language, 800, 500, 'onclick="window.document.getElementById(\'hikashop_messages_warning\').style.display = \'none\';"', '', 'link'); if (!file_exists(HIKASHOP_ROOT . 'language' . DS . $language . DS . $language . '.' . HIKASERIAL_COMPONENT . '.ini')) { if ($config->get('errorlanguagemissing', 1)) { $noteremind = '<small style="' . $styleRemind . '">' . $toggleClass->delete('hikashop_messages_warning', 'errorlanguagemissing-0', 'config', false, JText::_('DONT_REMIND')) . '</small>'; hikaserial::display(JText::_('MISSING_LANGUAGE') . ' ' . $loadLink . ' ' . $noteremind, 'warning'); } } $edit_image = HIKASHOP_IMAGES . 'icons/icon-16-edit.png'; $new_image = HIKASHOP_IMAGES . 'icons/icon-16-new.png'; jimport('joomla.filesystem.folder'); $path = JLanguage::getLanguagePath(JPATH_ROOT); $dirs = JFolder::folders($path); foreach ($dirs as $dir) { $xmlFiles = JFolder::files($path . DS . $dir, '^([-_A-Za-z]*)\\.xml$'); $xmlFile = array_pop($xmlFiles); if ($xmlFile == 'install.xml') { $xmlFile = array_pop($xmlFiles); } if (empty($xmlFile)) { continue; } $data = JApplicationHelper::parseXMLLangMetaFile($path . DS . $dir . DS . $xmlFile); $oneLanguage = new stdClass(); $oneLanguage->language = $dir; $oneLanguage->name = $data['name']; $languageFiles = JFolder::files($path . DS . $dir, '^(.*)\\.' . HIKASERIAL_COMPONENT . '\\.ini$'); $languageFile = reset($languageFiles); $linkEdit = hikaserial::completeLink('config&task=language&code=' . $oneLanguage->language, true, false, false); if (!empty($languageFile)) { $oneLanguage->edit = $popup->display('<img id="image' . $oneLanguage->language . '" src="' . $edit_image . '" alt="' . JText::_('EDIT_LANGUAGE_FILE', true) . '"/>', 'EDIT_LANGUAGE_FILE', $linkEdit, 'edit_language_' . $oneLanguage->language, 800, 500, '', '', 'link'); } else { $oneLanguage->edit = $popup->display('<img id="image' . $oneLanguage->language . '" src="' . $new_image . '" alt="' . JText::_('ADD_LANGUAGE_FILE', true) . '"/>', 'ADD_LANGUAGE_FILE', $linkEdit, 'edit_language_' . $oneLanguage->language, 800, 500, '', '', 'link'); } $languages[] = $oneLanguage; } $this->assignRef('languages', $languages); $this->toolbar = array('|', 'save', 'apply', 'hikacancel', '|', array('name' => 'pophelp', 'target' => 'config'), 'dashboard'); }
public function refresh() { $app = JFactory::getApplication(); $orderClass = hikaserial::get('class.order'); $orderId = hikaserial::getCID('order_id'); if (empty($orderId)) { $app->redirect(hikaserial::completeLink('dashboard')); } $orderClass->refresh($orderId); $app->redirect(hikaserial::completeLink('shop.order&task=edit&cid[]=' . $orderId, false, true)); }
public function customTool(&$bar, $toolname, $tool) { switch (strtolower($toolname)) { case 'shopdashboard': $bar->appendButton('Link', 'hikashop', JText::_('HIKASHOP_CPANEL'), hikaserial::completeLink('shop.dashboard')); return true; case 'dashboard': $bar->appendButton('Link', HIKASERIAL_LNAME, JText::_('HIKASERIAL_CPANEL'), hikaserial::completeLink('dashboard')); return true; } return false; }
public function listing() { hikaserial::setTitle(JText::_(self::name), self::icon, self::ctrl); $buttons = array(array('name' => JText::_('ADD_NEW_SERIAL'), 'url' => hikaserial::completeLink('serial&task=edit'), 'icon' => 'icon-48-add-serials'), array('name' => JText::_('HIKA_SERIALS'), 'url' => hikaserial::completeLink('serial'), 'icon' => 'icon-48-serials'), array('name' => JText::_('HIKA_PACKS'), 'url' => hikaserial::completeLink('pack'), 'icon' => 'icon-48-pack'), array('name' => JText::_('PLUGINS'), 'url' => hikaserial::completeLink('plugins'), 'icon' => 'icon-48-plugin'), array('name' => JText::_('HIKA_CONFIGURATION'), 'url' => hikaserial::completeLink('config'), 'icon' => 'icon-48-config'), array('name' => JText::_('IMPORT'), 'url' => hikaserial::completeLink('import'), 'icon' => 'icon-48-import'), array('name' => JText::_('UPDATE_ABOUT'), 'url' => hikaserial::completeLink('update'), 'icon' => 'icon-48-install'), array('name' => JText::_('HIKA_HELP'), 'url' => hikaserial::completeLink('documentation'), 'icon' => 'icon-48-help_header')); $this->assignRef('buttons', $buttons); if (HIKASHOP_J16 && JFactory::getUser()->authorise('core.admin', 'com_hikamarket')) { $this->toolbar[] = array('name' => 'preferences', 'component' => 'com_hikaserial'); } $this->toolbar[] = array('name' => 'pophelp', 'target' => 'welcome'); $toggleClass = hikaserial::get('helper.toggle'); $this->assignRef('toggleClass', $toggleClass); }
public function display($tpl = null, $title = '', $menu_style = '') { $this->assignRef('title', $title); $this->assignRef('menu_style', $menu_style); $fct = $this->getLayout(); if (method_exists($this, $fct)) { $this->{$fct}(); } $menus = array(array('name' => JText::_('SYSTEM'), 'check' => 'ctrl=config', 'acl' => 'config', 'task' => 'manage', 'icon' => 'icon-16-config', 'url' => hikaserial::completeLink('config'), 'children' => array(array('name' => JText::_('HIKA_CONFIGURATION'), 'check' => 'ctrl=config', 'acl' => 'config', 'task' => 'manage', 'icon' => 'icon-16-settings', 'url' => hikaserial::completeLink('config')), array('name' => JText::_('PLUGINS'), 'check' => 'ctrl=plugins', 'icon' => 'icon-16-plugin', 'url' => hikaserial::completeLink('plugins')), array('name' => JText::_('VIEWS'), 'check' => 'ctrl=views', 'icon' => 'icon-16-views', 'url' => hikaserial::completeLink('shop.view&component=' . HIKASERIAL_COMPONENT)))), array('name' => JText::_('HIKA_SERIALS'), 'check' => 'ctrl=serial', 'acl' => 'serial', 'icon' => 'icon-16-serial', 'url' => hikaserial::completeLink('serial'), 'children' => array(array('name' => JText::_('HIKA_PACKS'), 'check' => 'ctrl=pack', 'icon' => 'icon-16-pack', 'url' => hikaserial::completeLink('pack')), array('name' => JText::_('HIKA_SERIALS'), 'check' => 'ctrl=serial', 'icon' => 'icon-16-serial', 'url' => hikaserial::completeLink('serial')), array('name' => JText::_('IMPORT'), 'check' => 'ctrl=import', 'icon' => 'icon-16-import', 'url' => hikaserial::completeLink('import')))), array('name' => JText::_('HIKA_HELP'), 'check' => 'ctrl=documentation', 'icon' => 'icon-16-help', 'url' => hikaserial::completeLink('documentation'), 'children' => array(array('name' => JText::_('DOCUMENTATION'), 'check' => 'ctrl=documentation', 'icon' => 'icon-16-help', 'url' => hikaserial::completeLink('documentation')), array('name' => JText::_('UPDATE_ABOUT'), 'check' => 'ctrl=update', 'icon' => 'icon-16-update', 'url' => hikaserial::completeLink('update')), array('name' => JText::_('FORUM'), 'check' => 'support/forum.html', 'icon' => 'icon-16-info', 'url' => HIKASERIAL_URL . 'support/forum.html')))); $this->checkActive($menus); $this->assignRef('menus', $menus); parent::display(null); }
public function update() { $config = hikaserial::config(); if ($config->get('website') != HIKASHOP_LIVE) { $updateHelper = hikaserial::get('helper.update'); $updateHelper->addUpdateSite(); } hikaserial::setTitle(JText::_('UPDATE_ABOUT'), 'install', 'update'); $bar = JToolBar::getInstance('toolbar'); $bar->appendButton('Link', HIKASERIAL_LNAME, JText::_('HIKASHOP_CPANEL'), hikaserial::completeLink('dashboard')); $this->showIframe(HIKASERIAL_UPDATEURL . 'update'); return false; }
public function processView(&$view) { if (empty($view->menus)) { return; } $currentuser = JFactory::getUser(); if (HIKASHOP_J16 && !$currentuser->authorise('core.manage', 'com_hikaserial')) { return; } $market = array('name' => HIKASERIAL_NAME, 'check' => 'ctrl=config', 'acl' => 'config', 'task' => 'manage', 'icon' => 'icon-16-serial', 'url' => hikaserial::completeLink('dashboard'), 'children' => array(array('name' => JText::_('HIKA_CONFIGURATION'), 'check' => 'ctrl=config', 'acl' => 'config', 'task' => 'manage', 'icon' => 'icon-16-settings', 'url' => hikaserial::completeLink('config'), 'display' => !HIKASHOP_J16 || $currentuser->authorise('core.admin', 'com_hikaserial')), array('name' => JText::_('PLUGINS'), 'check' => 'ctrl=plugins', 'icon' => 'icon-16-plugin', 'url' => hikaserial::completeLink('plugins')), array('name' => JText::_('VIEWS'), 'check' => 'ctrl=views', 'icon' => 'icon-16-views', 'url' => hikaserial::completeLink('shop.view&component=' . HIKASERIAL_COMPONENT)), array('name' => ''), array('name' => JText::_('HIKA_PACKS'), 'check' => 'ctrl=pack', 'icon' => 'icon-16-pack', 'url' => hikaserial::completeLink('pack')), array('name' => JText::_('HIKA_SERIALS'), 'check' => 'ctrl=serial', 'icon' => 'icon-16-serial', 'url' => hikaserial::completeLink('serial')), array('name' => JText::_('IMPORT'), 'check' => 'ctrl=import', 'icon' => 'icon-16-import', 'url' => hikaserial::completeLink('import')), array('name' => ''), array('name' => JText::_('DOCUMENTATION'), 'check' => 'ctrl=documentation', 'icon' => 'icon-16-help', 'url' => hikaserial::completeLink('documentation')), array('name' => JText::_('UPDATE_ABOUT'), 'check' => 'ctrl=update', 'icon' => 'icon-16-update', 'url' => hikaserial::completeLink('update')), array('name' => JText::_('FORUM'), 'check' => 'support/forum.html', 'icon' => 'icon-16-info', 'url' => HIKASERIAL_URL . 'support/forum.html'))); $newMenus = array(&$market); $this->checkActive($newMenus, 0, HIKASERIAL_COMPONENT); $last = array_pop($view->menus); array_push($view->menus, $market, $last); }
function listing() { hikaserial::setTitle(JText::_(self::name), self::icon, self::ctrl); $bar = JToolBar::getInstance('toolbar'); $bar->appendButton('Link', HIKASERIAL_LNAME, JText::_('HIKASHOP_CPANEL'), hikaserial::completeLink('dashboard')); $config = hikaserial::config(); $level = $config->get('level'); $url = HIKASERIAL_HELPURL . 'documentation&level=' . $level; $shopConfig = hikaserial::config(false); $menu_style = $shopConfig->get('menu_style', 'title_bottom'); if (HIKASHOP_J30) { $menu_style = 'content_top'; } if ($menu_style == 'content_top') { echo hikaserial::getMenu(); } echo '<div id="hikaserial_div"><iframe allowtransparency="true" scrolling="auto" height="450px" frameborder="0" width="100%" name="hikaserial_frame" id="hikaserial_frame" src="' . $url . '"></iframe></div>'; }
public function form() { $app = JFactory::getApplication(); $db = JFactory::getDBO(); JHTML::_('behavior.modal'); $ctrl = ''; $cid = ''; $cancelUrl = urlencode(base64_encode(hikaserial::completeLink('serial'))); $this->assignRef('cancelUrl', $cancelUrl); $config = hikaserial::config(); $this->assignRef('config', $config); $shopConfig = hikaserial::config(false); $this->assignRef('shopConfig', $shopConfig); $popup = hikaserial::get('shop.helper.popup'); $this->assignRef('popup', $popup); $manage = true; // TODO $this->assignRef('manage', $manage); $manage_shop_order = hikaserial::isAllowed($shopConfig->get('acl_order_manage', 'all')); $this->assignRef('manage_shop_order', $manage_shop_order); $manage_shop_user = hikaserial::isAllowed($shopConfig->get('acl_user_manage', 'all')); $this->assignRef('manage_shop_user', $manage_shop_user); $serial = null; $serial_id = hikaserial::getCID(); if (!empty($serial_id)) { $serialClass = hikaserial::get('class.serial'); $serial = $serialClass->get($serial_id, true); $task = 'edit'; $cid = '&cid[]=' . $serial_id; $cancelUrl = urlencode(base64_encode(hikaserial::completeLink('serial&task=edit&cid[]=' . $serial_id))); } else { $task = 'add'; } $ctrl .= '&task=' . $task . $cid; $this->assignRef('task', $task); $this->assignRef('serial', $serial); JPluginHelper::importPlugin('hikaserial'); $dispatcher = JDispatcher::getInstance(); $serials = array(&$serial); $dispatcher->trigger('onDisplaySerials', array(&$serials, 'back-serial-form')); $packType = hikaserial::get('type.pack'); $this->assignRef('packType', $packType); $serialStatusType = hikaserial::get('type.serial_status'); $this->assignRef('serialStatusType', $serialStatusType); hikaserial::setTitle(JText::_(self::name), self::icon, self::ctrl . $ctrl); $this->toolbar = array('|', 'save', 'apply', 'hikacancel', '|', array('name' => 'pophelp', 'target' => self::ctrl . '-form')); }
public function configurationLine($id = 0, $conf = null) { if (empty($this->discountClass)) { $this->discountClass = hikaserial::get('shop.class.discount'); } switch ($id) { case 1: $d = null; if (!empty($conf->generator_params->discount_id)) { $d = $this->discountClass->get($conf->generator_params->discount_id); } if (empty($d)) { return '<img src="' . HIKASERIAL_IMAGES . 'icon-16/unpublish.png" alt="' . JText::_('ERROR') . '"/>'; } return '<a href="' . hikaserial::completeLink('shop.discount&task=edit&cid=' . $conf->generator_params->discount_id) . '">' . $d->discount_code . '</a>'; case 2: if (!empty($conf->generator_params->discount_percent)) { return $conf->generator_params->discount_percent . '%'; } return ''; case 3: if (empty($conf->generator_params->format)) { return $this->serial_default_format; } return $conf->generator_params->format; case 4: if (empty($conf->generator_params->size)) { return 12; } return $conf->generator_params->size; } return null; }
?> " id="<?php echo $id; ?> "> <td align="center"><?php echo $i + 1; ?> </td> <td align="center"><?php echo JHTML::_('grid.id', $i, $plugin->{$p_id}); ?> </td> <td> <a href="<?php echo hikaserial::completeLink('plugins&plugin_type=' . $this->plugin_type . '&task=edit&name=' . $this->data['pluginName'] . '&subtask=' . $this->plugin_type . '_edit&' . $p_id . '=' . $plugin->{$p_id}); ?> "><?php if (!empty($plugin->{$p_name})) { echo $plugin->{$p_name}; } else { echo '<em>' . JText::_('HIKASERIAL_NO_NAME') . '</em>'; } ?> </a> </td> <?php if (!empty($this->data['listing_header'])) { foreach ($this->data['listing_header'] as $key => $v) { $style = ''; if (is_array($v) && isset($v['cell'])) {
?> " alt="<?php echo JText::_('REMOVE_COUPON'); ?> " /></a> <br/> <?php } ?> <?php echo JText::_('HIKASHOP_ENTER_COUPON'); ?> <input id="hikashop_checkout_serial_coupon_input" type="text" name="hikaserial_coupon" value="" /> <?php $params = null; echo $this->cartHelper->displayButton(JText::_('ADD'), 'refresh', $params, hikaserial::completeLink('shop.checkout'), '', ' onclick="return hikashopCheckCoupon(\'hikashop_checkout_serial_coupon_input\');"'); ?> </span> <script type="text/javascript"> function hikashopCheckCoupon(id) { var el = document.getElementById(id); if(el) { if(el.value == '') { el.className = 'hikashop_red_border'; return false; } el.form.submit(); } return false; } </script>
<a onclick="return hikaserial_unassign('user',this);" href="#"><img src="<?php echo HIKASERIAL_IMAGES; ?> icon-16/delete.png" alt="<?php JText::_('UNASSIGN'); ?> "/></a> </div> <div id="hikaserial_serial_user_add" style="<?php if (!empty($this->serial->serial_user_id)) { echo 'display:none;'; } ?> "> <?php echo $this->popup->display('<img src="' . HIKASERIAL_IMAGES . 'icon-16/add.png" alt="' . JText::_('ASSIGN') . '"/>', 'ASSIGN', hikaserial::completeLink('users&task=select&single=true', true), 'hikaserial_user_assign_serial', 760, 480, 'onclick="return hikaserial_assignUser(this);"', '', 'link'); ?> </div> </td> </tr> </table> <script type="text/javascript"> function hikaserial_unassign(type, el){ var d = document, e = null; switch(type){ case 'order': e = d.getElementById('hikaserial_serial_order_0'); if(e){ e.innerHTML = '<?php echo str_replace("'", "\\'", JText::_('HIKAS_NONE')); ?> '; } e = d.getElementById('hikaserial_serial_order_1'); if(e){ e.innerHTML = '<?php
<?php /** * @package HikaSerial for Joomla! * @version 1.9.1 * @author Obsidev S.A.R.L. * @copyright (C) 2011-2015 OBSIDEV. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?> <div class="iframedoc" id="iframedoc"></div> <form action="<?php echo hikaserial::completeLink('pack'); ?> " method="post" name="adminForm" id="adminForm" enctype="multipart/form-data"> <?php if (!HIKASHOP_BACK_RESPONSIVE) { ?> <table class="admintable" style="width:100%"> <tr> <td valign="top" width="50%"> <?php } else { ?> <div class="row-fluid"> <div class="span6"> <?php } ?> <fieldset class="adminform">
?> </th> <th><?php echo JText::_('ID'); ?> </th> </tr> </thead> <tbody> <?php if (!empty($this->products)) { foreach ($this->products as $key => $product) { ?> <tr> <td><a href="<?php echo hikaserial::completeLink('shop.product&task=edit&cid[]=' . $product->product_id); ?> "><?php echo $product->product_name; ?> </a></td> <td><?php echo $product->product_code; ?> </td> <td align="center"><?php echo $product->quantity; ?> </td> <td align="center"><?php echo $product->product_id;
<?php /** * @package HikaSerial for Joomla! * @version 1.9.1 * @author Obsidev S.A.R.L. * @copyright (C) 2011-2015 OBSIDEV. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?> <form action="<?php echo hikaserial::completeLink('serial'); ?> " method="post" name="adminForm" id="adminForm"> <table class="admintable table" style="width:100%"> <tr> <td class="key"> <label><?php echo JText::_('SERIAL_PACK'); ?> </label> </td> <td><?php $values = array(JHTML::_('select.option', '0', JText::_('HIKASHOP_NO')), JHTML::_('select.option', 's', JText::_('PACK_NAME')), JHTML::_('select.option', '1', JText::_('ID'))); echo JHTML::_('hikaselect.radiolist', $values, 'data[export][pack]', '', 'value', 'text', '0'); ?> </td> </tr> <tr> <td class="key">
if ($this->manage_shop_order) { ?> </a><?php } } else { echo ''; // TODO } ?> </td> <td><?php if ((int) $row->serial_user_id > 0) { if ($this->manage_shop_user) { ?> <a href="<?php echo hikaserial::completeLink('shop.user&task=edit&cid[]=' . $row->serial_user_id); ?> "><?php } echo $row->username; if ($this->manage_shop_user) { ?> </a><?php } } else { echo ''; // TODO } ?> </td> <td align="center"><?php
<thead> <tr> <th class="title"><?php echo JText::_('HIKA_NAME'); ?> </th> <th class="title"><?php echo JText::_('PRODUCT_QUANTITY'); ?> </th> <th class="title"><?php echo JText::_('ID'); ?> </th> <th align="center"><?php echo $this->popupHelper->display('<img src="' . HIKAMARKET_IMAGES . 'icon-16/plus.png" alt="' . JText::_('ADD') . '">', JText::_('ADD'), hikaserial::completeLink('pack&task=select&single=true', true), 'hikamarket_product_plugin_hikaserial' . $this->product_id, 760, 480, 'onclick="return hikaserial_setPack(' . $this->product_id . ',this);"', '', 'link'); ?> </th> </tr> </thead> <tbody> <?php $k = 0; if (empty($this->data)) { $this->data = array(); } foreach ($this->data as $data) { ?> <tr class="row<?php echo $k; ?>
<?php /** * @package HikaSerial for Joomla! * @version 1.9.1 * @author Obsidev S.A.R.L. * @copyright (C) 2011-2015 OBSIDEV. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?> <form action="<?php echo hikaserial::completeLink('config', true); ?> " method="post" name="adminForm" id="adminForm"> <fieldset> <div class="header" style="float: left;"><?php echo JText::_('HIKA_FILE') . ' : ' . $this->file->name; ?> </div> <div class="toolbar" id="toolbar" style="float: right;"> <button class="btn" type="button" onclick="javascript:submitbutton('savelanguage'); return false;"><?php echo JText::_('HIKA_SAVE'); ?> </button> <button class="btn" type="button" onclick="javascript:submitbutton('share'); return false;"><?php echo JText::_('SHARE'); ?> </button> </div> </fieldset>
$publishedid = 'enabled-' . $row->id; } ?> <tr class="row<?php echo $k; ?> "> <td align="center"><?php echo $i + 1; ?> </td> <td><?php if ($this->manage) { ?> <a href="<?php echo hikaserial::completeLink('plugins&task=edit&name=' . $row->element); ?> "><?php } echo $row->name; if ($this->manage) { ?> </a><?php } ?> </td> <td align="center"> <span id="<?php echo $publishedid; ?> " class="loading"><?php
* @author Obsidev S.A.R.L. * @copyright (C) 2011-2015 OBSIDEV. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); if (!defined('DS')) { define('DS', DIRECTORY_SEPARATOR); } include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_hikaserial' . DS . 'helpers' . DS . 'helper.php'; $taskGroup = JRequest::getCmd('ctrl', 'dashboard'); $hikaSerialConfig = hikaserial::config(); JHTML::_('behavior.tooltip'); $bar = JToolBar::getInstance('toolbar'); $bar->addButtonPath(HIKASERIAL_BUTTON); if ($taskGroup != 'update' && !$hikaSerialConfig->get('installcomplete')) { $url = hikaserial::completeLink('update&task=install', false, true); echo '<script>document.location.href="' . $url . '";</script>' . "\r\n" . 'Install not finished... You will be redirected to the second part of the install screen<br/>' . '<a href="' . $url . '">Please click here if you are not automatically redirected within 3 seconds</a>'; return; } $currentuser = JFactory::getUser(); if ($taskGroup != 'update' && HIKASHOP_J16 && !$currentuser->authorise('core.manage', 'com_hikaserial')) { return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); } if ($taskGroup == 'config' && HIKASHOP_J16 && !$currentuser->authorise('core.admin', 'com_hikaserial')) { return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); } if (!(include HIKASERIAL_CONTROLLER . $taskGroup . '.php')) { echo 'controller ' . $taskGroup . ' not found'; return; } ob_start();
public function cancel() { $this->setRedirect(hikaserial::completeLink('dashboard', false, true)); }
</a></td> <td><?php echo hikaserial::getDate($data->serial_assign_date); ?> </td> <td><?php echo $data->order_product_name; ?> </td> </tr> <?php } } ?> </tbody> </table> <?php if (empty($this->ajax)) { ?> </fieldset> <script type="text/javascript"> window.Oby.registerAjax('hikashop.order_update', function(params){ if(params.el === undefined) return; window.Oby.xRequest("<?php echo hikaserial::completeLink('orderserial&task=show&cid=' . $this->order_id, true, false, true); ?> ", {update: 'hikashop_order_field_serial'}); }); </script> <?php }
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); global $Itemid; $url_itemid = ''; if (!empty($Itemid)) { $url_itemid = '&Itemid=' . $Itemid; } $from_module = !empty($this->params) && $this->params->get('from_module', 0) != 0; if ($this->consumed === false) { $app = JFactory::getApplication(); $app->enqueueMessage(JText::_('CONSUME_INVALID_SERIAL')); } ?> <form action="<?php echo hikaserial::completeLink('serial&task=consume' . $url_itemid); ?> " method="post" name="hikaserial_consume_form" enctype="multipart/form-data"> <div class="hikaserial_serial_consume_page"> <fieldset class="input"> <?php if (empty($this->confirmation)) { if (!$from_module) { ?> <h2><?php echo JText::_('HIKASERIAL_ENTER_SERIAL'); ?> </h2> <?php } ?>
* @package HikaSerial for Joomla! * @version 1.9.1 * @author Obsidev S.A.R.L. * @copyright (C) 2011-2015 OBSIDEV. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?> <fieldset class="adminform"> <legend><?php echo JText::_('HIKA_SERIALS'); ?> </legend> <div style="float: right;"> <a onclick="return hikaserial_setPack(this);" href="<?php echo hikaserial::completeLink('pack&task=select&single=true', true); ?> " rel="{handler: 'iframe', size: {x: 760, y: 480}}" class="modal"> <button class="btn" onclick="return false;" type="button"><img src="<?php echo HIKASHOP_IMAGES; ?> add.png"/><?php echo JText::_('ADD'); ?> </button> </a> </div> <table class="adminlist table table-striped" style="cell-spacing:1px"> <thead> <tr> <th class="title"><?php
echo JHTML::_('grid.id', $i, $row->pack_id); ?> </td> <td><?php if ($this->manage) { ?> <a href="<?php echo hikaserial::completeLink('pack&task=edit&cid[]=' . $row->pack_id); ?> "><?php } echo $row->pack_name; if ($this->manage) { ?> </a> [<a href="<?php echo hikaserial::completeLink('serial&filter_pack=' . $row->pack_id); ?> "><?php echo JText::_('SEE_SERIALS'); ?> </a>]<?php } ?> </td> <td><?php echo $row->pack_data; ?> </td> <td><?php $gen = $this->packGeneratorType->get($row->pack_generator); if (!empty($gen)) {
public function displaySingle($map, $value, $delete = false) { static $jsInit = null; if ($jsInit !== true) { $display_format = 'data.pack_name'; if ($this->app->isAdmin()) { $display_format = 'data.id + " - " + data.pack_name'; } $js = ' if(!window.localPage) window.localPage = {}; window.localPage.fieldSetSinglePack = function(el, name) { window.hikaserial.submitFct = function(data) { var d = document, packInput = d.getElementById(name + "_input_id"), packSpan = d.getElementById(name + "_span_id"); if(packInput) { packInput.value = data.id; } if(packSpan) { packSpan.innerHTML = ' . $display_format . '; } }; window.hikaserial.openBox(el,null,(el.getAttribute("rel") == null)); return false; } window.localPage.fieldRemSinglePack = function(el, name) { var d = document, packInput = d.getElementById(name + "_input_id"), packSpan = d.getElementById(name + "_span_id"); if(packInput) { packInput.value = ""; } if(packSpan) { packSpan.innerHTML = " - "; } } '; $doc = JFactory::getDocument(); $doc->addScriptDeclaration($js); } $packClass = hikaserial::get('class.pack'); $popup = hikaserial::get('shop.helper.popup'); $name = str_replace(array('][', '[', ']'), '_', $map); $pack_id = (int) $value; $pack = $packClass->get($pack_id); $pack_name = ''; if (!empty($pack)) { $pack_name = @$pack->pack_name; } else { $pack_id = ''; } $pack_display_name = $pack_name; if ($this->app->isAdmin()) { $pack_display_name = $pack_id . ' - ' . $pack_name; } $ret = '<span id="' . $name . '_span_id">' . $pack_display_name . '</span>' . '<input type="hidden" id="' . $name . '_input_id" name="' . $map . '" value="' . $pack_id . '"/> ' . $popup->display('<img src="' . HIKASERIAL_IMAGES . 'icon-16/edit.png" style="vertical-align:middle;"/>', 'PACK_SELECTION', hikaserial::completeLink('pack&task=select&single=true', true), 'serial_set_pack_' . $name, 760, 480, 'onclick="return window.localPage.fieldSetSinglePack(this,\'' . $name . '\');"', '', 'link'); if ($delete) { $ret .= ' <a title="' . JText::_('HIKA_DELETE') . '" href="#' . JText::_('HIKA_DELETE') . '" onclick="return window.localPage.fieldRemSinglePack(this, \'' . $name . '\');"><img src="' . HIKASERIAL_IMAGES . 'icon-16/delete.png" style="vertical-align:middle;"/></a>'; } return $ret; }
public function generate($tpl = null) { $app = JFactory::getApplication(); $db = JFactory::getDBO(); JHTML::_('behavior.modal'); $ctrl = ''; $pack_id = hikaserial::getCID(); if (empty($pack_id)) { $app->redirect(hikaserial::completeLink('pack&task=list')); } $packClass = hikaserial::get('class.pack'); $pack = $packClass->get($pack_id); $task = 'generate'; $cid = '&cid[]=' . $pack_id; $ctrl .= '&task=' . $task . $cid; $this->assignRef('task', $task); $this->assignRef('pack', $pack); $generator = null; if (substr($pack->pack_generator, 0, 4) == 'plg.') { $pluginName = substr($pack->pack_generator, 4); if (strpos($pluginName, '-') !== false) { list($pluginName, $pluginId) = explode('-', $pluginName, 2); $pack->{$pluginName} = $pluginId; } $generator = hikaserial::import('hikaserial', $pluginName); } if (!empty($generator) && (!method_exists($generator, 'canPopulate') || $generator->canPopulate() != true)) { $app->enqueueMessage(JText::_('PLUGIN_GENERATOR_CAN_NOT_POPULATE')); $app->redirect(hikaserial::completeLink('pack&task=edit&cid[]=' . $pack_id, false, true)); } $populateFormData = ''; if (!empty($generator) && method_exists($generator, 'populateForm')) { $populateFormData = $generator->populateForm($pack); } $this->assignRef('populateFormData', $populateFormData); $packGeneratorType = hikaserial::get('type.pack_generator'); $this->assignRef('packGeneratorType', $packGeneratorType); $serialStatusType = hikaserial::get('type.serial_status'); $this->assignRef('serialStatusType', $serialStatusType); hikaserial::setTitle(JText::_(self::name), self::icon, self::ctrl . $ctrl); $this->toolbar = array(array('name' => 'custom', 'icon' => 'upload', 'task' => 'generate', 'alt' => JText::_('GENERATE'), 'check' => false), array('name' => 'hikacancel', 'url' => hikaserial::completeLink('pack&task=edit&cid[]=' . $pack_id)), '|', array('name' => 'pophelp', 'target' => self::ctrl . '-form')); }