Ejemplo n.º 1
0
 public function displayInput($map, $value)
 {
     $attribs = '';
     $label = '';
     $id = str_replace(array('][', '[', ']'), array('__', '_', ''), $map);
     $app = JFactory::getApplication();
     $backend = $app->isAdmin();
     if ($backend && HIKASHOP_BACK_RESPONSIVE || !$backend && HIKASHOP_RESPONSIVE) {
         hikashop_loadJsLib('tooltip');
         $ret = '<div class="input-append">' . '<input type="text" name="' . $map . '" id="' . $id . '" value="' . $value . '" onfocus="this.setSelectionRange(0, this.value.length)" ' . $attribs . '/>' . '<button class="btn" data-toggle="hk-tooltip" data-title="' . JText::_('UNLIMITED', true) . '" onclick="document.getElementById(\'' . $id . '\').value=\'' . JText::_('UNLIMITED') . '\';return false;"><i class="icon-remove"></i></button>' . '</div>';
     } else {
         $ret = '<div class="product_quantity_j25" style="display: inline; margin-left: 2px;"><input type="text" name="' . $map . '" id="' . $id . '" value="' . $value . '" onfocus="this.setSelectionRange(0, this.value.length)" ' . $attribs . '/>' . '<a class="infinityButton" href="#" onclick="document.getElementById(\'' . $id . '\').value=\'' . JText::_('UNLIMITED') . '\';return false;"><span>X</span></a></div>';
     }
     return $ret;
 }
Ejemplo n.º 2
0
?>
</legend>
					<table class="admintable table" cellspacing="1" style="width:100%;">
						<tr>
							<td class="key"><?php 
echo JText::_('CHECKOUT_FLOW');
?>
</td>
							<td>
								<textarea class="inputbox" name="config[checkout]" id="TextCheckoutWorkFlow" cols="30" rows="5"><?php 
echo $this->config->get('checkout');
?>
</textarea>
<?php 
if ($this->config->get('checkout_workflow_edition', 1)) {
    hikashop_loadJsLib('jquery');
    ?>
	<div class="checkout_workflow_zone" style="width:100%">
		<ul id="checkout_delete" class="checkout_trash">
		</ul>
		<ul class="checkout_items">
<?php 
    foreach ($this->checkoutlist as $k => $v) {
        echo '<li class="checkoutElem" rel="' . $k . '">' . $v . '</li>';
    }
    ?>
		</ul>
		<div style="clear:both">
<?php 
    $workflow = explode(',', $this->config->get('checkout'));
    $checkoutRel = 0;
Ejemplo n.º 3
0
    public function displayFileMultiple($id, $content = '', $options = array())
    {
        $this->initialize();
        $this->processOptions($options, 'file');
        $js = '';
        $ret = '
<div id="' . $id . '_main" class="hikashop_dropzone">
	<div class="' . $options['classes']['mainDiv'] . '">
		<div class="hikashop_uploader_file_add ' . $id . '_add">';
        if (!empty($options['tooltip'])) {
            hikashop_loadJsLib('tooltip');
        }
        if (!empty($options['uploadUrls'])) {
            $opt = '';
            if (!empty($options['tooltip'])) {
                $opt = ' data-toggle="hk-tooltip" data-title="' . JText::_('HIKA_UPLOAD_FILE') . '"';
            }
            $ret .= '<span id="' . $id . '-btn" class="opload-btn">' . $this->popup->display('<span class="' . $options['classes']['btn_upload'] . '"></span>', 'HIKA_UPLOAD_FILE', $options['uploadUrls'][0], $id . '_uploadpopup', 750, 460, 'onclick="return window.hkUploaderList[\'' . $id . '\'].uploadFile(this);"' . $opt, '', 'link') . '<input id="' . $id . '" type="file"/></span>';
            $js .= "\r\n" . 'var hkUploader_' . $id . ' = new hkUploaderMgr("' . $id . '", {mode: \'list\', url:\'' . $options['uploadUrls'][1] . '\',formData:' . $options['formData'] . ',options:{maxSize:' . (int) $options['maxSize'] . '}})';
        }
        if (!empty($options['toolbar'])) {
            if (is_array($options['toolbar'])) {
                $ret .= implode('', $options['toolbar']);
            } else {
                $ret .= $options['toolbar'];
            }
        }
        $contentHtml = '';
        if (!empty($content)) {
            if (is_array($content)) {
                $contentHtml .= implode('', $content);
            } else {
                $contentHtml .= $content;
            }
        }
        $ret .= '
		</div>
		<div id="' . $id . '_content" class="hikashop_uploader_multifile_content uploader_data_container">' . $contentHtml . '</div>
		<div style="clear:both"></div>
		<div id="' . $id . '_empty" class="hikashop_uploader_file_empty" style="' . (!empty($content) && empty($options['empty']) ? 'display:none;' : '') . '">
			<span>' . $options['text'] . '</span>
		</div>
	</div>
</div>';
        if (!empty($options['uploadUrls'])) {
            $ret .= '
<div id="' . $id . '_list"></div>
';
        }
        if (!empty($js)) {
            if (empty($options['ajax'])) {
                $doc = JFactory::getDocument();
                $doc->addScriptDeclaration("\r\n" . 'window.hikashop.ready(function(){' . $js . "\r\n" . '});');
            } else {
                $ret .= "\r\n" . '<script type="text/javascript">' . "\r\n" . 'window.hikashop.ready(function(){' . $js . "\r\n" . '});' . "\r\n" . '</script>';
            }
        }
        return $ret;
    }
Ejemplo n.º 4
0
 public function form()
 {
     $app = JFactory::getApplication();
     $db = JFactory::getDBO();
     $ctrl = '';
     $this->paramBase = HIKASHOP_COMPONENT . '.' . $this->getName() . '.edit';
     $task = 'add';
     JHTML::_('behavior.tooltip');
     hikashop_loadJsLib('tooltip');
     $config = hikashop_config();
     $this->assignRef('config', $config);
     $product_id = hikashop_getCID('product_id');
     $productClass = hikashop_get('class.product');
     $main_currency = $config->get('main_currency', 1);
     $this->assignRef('main_currency_id', $main_currency);
     $this->loadRef(array('toggleClass' => 'helper.toggle', 'currencyClass' => 'class.currency', 'popup' => 'helper.popup', 'quantityType' => 'type.quantity', 'productsType' => 'type.products', 'nameboxType' => 'type.namebox', 'nameboxVariantType' => 'type.namebox', 'uploaderType' => 'type.uploader', 'imageHelper' => 'helper.image', 'currencyType' => 'type.currency', 'weight' => 'type.weight', 'volume' => 'type.volume', 'productDisplayType' => 'type.productdisplay', 'quantityDisplayType' => 'type.quantitydisplay'));
     $categoryType = hikashop_get('type.categorysub');
     $categoryType->type = 'tax';
     $categoryType->field = 'category_id';
     $this->assignRef('categoryType', $categoryType);
     hikashop_loadJslib('jquery');
     $product = new stdClass();
     $product->product_description = '';
     $product->product_id = $product_id;
     $template_id = 0;
     $variant_id = 0;
     $failed_product = JRequest::getVar('fail', null);
     if (!empty($product_id)) {
         $product = $productClass->getRaw($product_id, true);
     }
     if (!empty($product_id)) {
         $task = 'edit';
         if ((int) $product->product_parent_id > 0) {
             $parentProduct = $productClass->getRaw((int) $product->product_parent_id, true);
             if (!empty($parentProduct)) {
                 $variant_id = $product_id;
                 $product_id = (int) $product->product_parent_id;
                 unset($product);
                 $product = $parentProduct;
             } else {
                 unset($parentProduct);
             }
         }
         $query = 'SELECT b.* FROM ' . hikashop_table('product_category') . ' AS a LEFT JOIN ' . hikashop_table('category') . ' AS b ON a.category_id = b.category_id WHERE a.product_id = ' . (int) $product_id . ' ORDER BY a.product_category_id';
         $db->setQuery($query);
         $product->categories = $db->loadObjectList('category_id');
         $query = 'SELECT * FROM ' . hikashop_table('file') . ' WHERE file_ref_id = ' . (int) $product_id . ' AND file_type=\'product\' ORDER BY file_ordering, file_id';
         $db->setQuery($query);
         $product->images = $db->loadObjectList();
         $query = 'SELECT file.*, SUM(download.download_number) AS download_number FROM ' . hikashop_table('file') . ' AS file ' . ' LEFT JOIN ' . hikashop_table('download') . ' AS download ON file.file_id = download.file_id ' . ' WHERE file_ref_id = ' . (int) $product_id . ' AND file.file_type=' . $db->Quote('file') . ' ' . ' GROUP BY file.file_id ' . ' ORDER BY file.file_ordering, file.file_id';
         $db->setQuery($query);
         $product->files = $db->loadObjectList('file_id');
         $query = 'SELECT a.*,b.* FROM ' . hikashop_table('product_related') . ' AS a LEFT JOIN ' . hikashop_table('product') . ' AS b ON a.product_related_id=b.product_id WHERE a.product_related_type=\'related\' AND a.product_id = ' . (int) $product_id . ' ORDER BY a.product_related_ordering';
         $db->setQuery($query);
         $product->related = $db->loadObjectList();
         $query = 'SELECT a.*,b.* FROM ' . hikashop_table('product_related') . ' AS a LEFT JOIN ' . hikashop_table('product') . ' AS b ON a.product_related_id=b.product_id WHERE a.product_related_type=\'options\' AND a.product_id = ' . (int) $product_id . ' ORDER BY a.product_related_ordering';
         $db->setQuery($query);
         $product->options = $db->loadObjectList();
         $query = 'SELECT variant.*, characteristic.* FROM ' . hikashop_table('variant') . ' as variant LEFT JOIN ' . hikashop_table('characteristic') . ' as characteristic ON variant.variant_characteristic_id = characteristic.characteristic_id WHERE variant.variant_product_id = ' . (int) $product_id . ' ORDER BY variant.ordering ASC, characteristic.characteristic_ordering ASC, ordering ASC';
         $db->setQuery($query);
         $product->characteristics = $db->loadObjectList('characteristic_id');
         $query = 'SELECT p.* FROM ' . hikashop_table('product') . ' as p WHERE p.product_type = ' . $db->Quote('variant') . ' AND p.product_parent_id = ' . (int) $product_id;
         $db->setQuery($query);
         $product->variants = $db->loadObjectList('product_id');
         if (!empty($product->variants)) {
             $variant_ids = array_keys($product->variants);
             $query = 'SELECT * FROM ' . hikashop_table('price') . ' WHERE price_product_id IN (' . (int) $product_id . ',' . implode(',', $variant_ids) . ')';
             $db->setQuery($query);
             $prices = $db->loadObjectList();
             $product->prices = array();
             foreach ($prices as $price) {
                 $ppid = (int) $price->price_product_id;
                 if ($ppid == $product_id) {
                     $product->prices[] = $price;
                 } elseif (isset($product->variants[$ppid])) {
                     if (empty($product->variants[$ppid]->prices)) {
                         $product->variants[$ppid]->prices = array();
                     }
                     $product->variants[$ppid]->prices[] = $price;
                 }
             }
             unset($prices);
             $query = 'SELECT v.*, c.* FROM ' . hikashop_table('variant') . ' AS v ' . ' INNER JOIN ' . hikashop_table('characteristic') . ' AS c ON c.characteristic_id = v.variant_characteristic_id ' . ' WHERE v.variant_product_id IN (' . implode(',', $variant_ids) . ')' . ' ORDER BY v.ordering ASC, c.characteristic_ordering ASC, v.variant_product_id ASC, v.variant_characteristic_id ASC';
             $db->setQuery($query);
             $variant_data = $db->loadObjectList();
             foreach ($variant_data as $d) {
                 $ppid = (int) $d->variant_product_id;
                 if (!isset($product->characteristics[$d->characteristic_parent_id])) {
                     continue;
                 }
                 if (!isset($product->variants[$ppid])) {
                     continue;
                 }
                 if (empty($product->variants[$ppid]->characteristics)) {
                     $product->variants[$ppid]->characteristics = array();
                 }
                 $pcid = $product->characteristics[$d->characteristic_parent_id]->characteristic_id;
                 $value = new stdClass();
                 $value->id = $d->characteristic_id;
                 $value->value = $d->characteristic_value;
                 $product->variants[$ppid]->characteristics[$pcid] = $value;
             }
         } else {
             $query = 'SELECT * FROM ' . hikashop_table('price') . ' WHERE price_product_id = ' . (int) $product_id;
             $db->setQuery($query);
             $product->prices = $db->loadObjectList();
         }
     } else {
         if (!empty($failed_product)) {
             $product = $failed_product;
             if (!empty($product->related)) {
                 $tmp_ids = array();
                 foreach ($product->related as $v) {
                     $tmp_ids[(int) $v->product_related_id] = (int) $v->product_related_ordering;
                 }
                 $query = 'SELECT p.* FROM ' . hikashop_table('product') . ' AS p WHERE p.product_id IN (' . implode(',', array_keys($tmp_ids)) . ')';
                 $db->setQuery($query);
                 $product->related = $db->loadObjectList();
                 foreach ($product->related as $k => $v) {
                     $product->related[$k]->product_related_id = $v->product_id;
                     $product->related[$k]->product_related_ordering = $tmp_ids[$v->product_id];
                 }
             }
             if (!empty($element->options)) {
                 $tmp_ids = array();
                 foreach ($product->options as $v) {
                     $rel_ids[(int) $v->product_related_id] = (int) $v->product_related_ordering;
                 }
                 $query = 'SELECT p.* FROM ' . hikashop_table('product') . ' AS p WHERE p.product_id IN (' . implode(',', array_keys($tmp_ids)) . ')';
                 $db->setQuery($query);
                 $product->options = $db->loadObjectList();
                 foreach ($product->options as $k => $v) {
                     $product->options[$k]->product_related_id = $v->product_id;
                     $product->options[$k]->product_related_ordering = $tmp_ids[$v->product_id];
                 }
             }
             if (!empty($product->characteristics)) {
                 $tmp_ids = array();
                 foreach ($product->characteristics as $k => $v) {
                     $tmp_ids[(int) $v->characteristic_id] = $k;
                 }
                 $query = 'SELECT c.* FROM ' . hikashop_table('characteristic') . ' AS c WHERE c.characteristic_id IN (' . implode(',', array_keys($tmp_ids)) . ')';
                 $db->setQuery($query);
                 $characteristics = $db->loadObjectList();
                 foreach ($characteristics as $char) {
                     $product->characteristics[$tmp_ids[$char->characteristic_id]]->characteristic_value = $char->characteristic_value;
                 }
                 unset($characteristics);
             }
             if (!empty($product->categories)) {
                 JArrayHelper::toInteger($product->categories);
                 $query = 'SELECT c.* FROM ' . hikashop_table('category') . ' AS c WHERE c.category_id IN (' . implode(',', $product->categories) . ')';
                 $db->setQuery($query);
                 $product->categories = $db->loadObjectList('category_id');
             }
         } else {
             $product = new stdClass();
             $product->product_published = 1;
             $product->product_type = 'main';
             $product->product_quantity = -1;
             $product->product_description = '';
             $categoryClass = hikashop_get('class.category');
             $mainTaxCategory = 'tax';
             $categoryClass->getMainElement($mainTaxCategory);
             $query = 'SELECT category_id FROM ' . hikashop_table('category') . ' WHERE category_type = ' . $db->Quote('tax') . ' AND category_parent_id = ' . (int) $mainTaxCategory . ' ORDER BY category_ordering DESC';
             $db->setQuery($query);
             $product->product_tax_id = $db->loadResult();
         }
     }
     if (empty($product_id) && empty($product->categories)) {
         $rootCategory = 0;
         $categoryClass = hikashop_get('class.category');
         $category_explorer = $config->get('show_category_explorer', 1);
         if ($category_explorer) {
             $rootCategory = JRequest::getVar('filter_id', '1');
         }
         if (empty($rootCategory) || $rootCategory == 1) {
             $rootCategory = 'product';
             $categoryClass->getMainElement($rootCategory);
         }
         if (!empty($rootCategory)) {
             if (empty($product->categories)) {
                 $product->categories = array($rootCategory => $categoryClass->get($rootCategory));
             } else {
                 $product->categories[$rootCategory] = $categoryClass->get($rootCategory);
             }
         }
     }
     if (!empty($product->product_tax_id)) {
         $main_tax_zone = explode(',', $config->get('main_tax_zone', ''));
         if (count($main_tax_zone)) {
             $main_tax_zone = array_shift($main_tax_zone);
         }
     }
     $price_currencies = array();
     if (!empty($product->prices)) {
         foreach ($product->prices as $key => $price) {
             if (empty($price->price_value)) {
                 unset($product->prices[$key]);
             }
             $price_currencies[(int) $price->price_currency_id] = (int) $price->price_currency_id;
         }
         if (!empty($product->product_tax_id)) {
             foreach ($product->prices as &$price) {
                 $price->price_value_with_tax = $this->currencyClass->getTaxedPrice($price->price_value, $main_tax_zone, $product->product_tax_id);
             }
         } else {
             foreach ($product->prices as $key => $price) {
                 $price->price_value_with_tax = $price->price_value;
             }
         }
     }
     if (empty($product->prices)) {
         $obj = new stdClass();
         $obj->price_value = 0;
         $obj->price_value_with_tax = 0;
         $obj->price_currency_id = $main_currency;
         $product->prices = array($obj);
     }
     $editor = hikashop_get('helper.editor');
     $editor->setEditor($config->get('editor', ''));
     $editor->name = 'product_description';
     $editor->content = $product->product_description;
     $editor->height = 200;
     $this->assignRef('editor', $editor);
     if (!isset($product->product_quantity) || $product->product_quantity < 0) {
         $product->product_quantity = JText::_('UNLIMITED');
     }
     if (!isset($product->product_max_per_order) || $product->product_max_per_order <= 0) {
         $product->product_max_per_order = JText::_('UNLIMITED');
     }
     $this->assignRef('product', $product);
     if (hikashop_level(2)) {
         hikashop_loadJslib('otree');
         $joomlaAcl = hikashop_get('type.joomla_acl');
         $this->assignRef('joomlaAcl', $joomlaAcl);
     }
     $translationHelper = hikashop_get('helper.translation');
     if ($translationHelper && $translationHelper->isMulti()) {
         $translationHelper->load('hikashop_product', @$product->product_id, $product);
         $this->assignRef('translationHelper', $translationHelper);
     }
     $manufacturerType = hikashop_get('type.categorysub');
     $manufacturerType->type = 'manufacturer';
     $manufacturerType->field = 'category_id';
     $this->assignRef('manufacturerType', $manufacturerType);
     $main_currency = (int) $config->get('main_currency');
     $this->currencyType->load($main_currency);
     $currencies = $this->currencyType->currencies;
     $this->assignRef('currencies', $currencies);
     $default_currency = $this->currencyType->currencies[$main_currency];
     $this->assignRef('default_currency', $default_currency);
     if (!empty($price_currencies)) {
         $missing_currencies = array_diff($price_currencies, array_keys($currencies));
         if (!empty($missing_currencies)) {
             $this->currencyType->currencies = array();
             $this->currencyType->load($price_currencies);
             $currencies = $this->currencyType->currencies;
             $missing_currencies_codes = array();
             foreach ($missing_currencies as $k) {
                 $missing_currencies_codes[] = $currencies[$k]->currency_code;
             }
             $app->enqueueMessage(JText::sprintf('PRICES_USING_UNPUBLISHED_CURRENCY', implode(',', $missing_currencies_codes)), 'warning');
         }
     }
     $fieldsClass = hikashop_get('class.field');
     $fields = $fieldsClass->getFields('backend', $product, 'product', 'field&task=state');
     $null = array();
     $fieldsClass->addJS($null, $null, $null);
     $fieldsClass->jsToggle($fields, $product, 0);
     $this->assignRef('fieldsClass', $fieldsClass);
     $this->assignRef('fields', $fields);
     hikashop_setTitle(JText::_($this->nameForm), $this->icon, $this->ctrl . '&task=' . $task . '&product_id=' . $product_id);
     if (!HIKASHOP_J16) {
         $url = hikashop_completeLink('product&task=updatecart&cid=' . $product_id, true);
     } else {
         $url = 'index.php?option=com_hikashop&ctrl=product&task=updatecart&tmpl=component&cid=' . $product_id;
     }
     $this->toolbar = array(array('name' => 'popup', 'icon' => 'upload', 'alt' => JText::_('ADD_TO_CART_HTML_CODE'), 'url' => $url), '|', 'save', array('name' => 'save2new', 'display' => HIKASHOP_J17), 'apply', 'cancel' => 'cancel', '|', array('name' => 'pophelp', 'target' => $this->ctrl . '-form'));
     $cancel_url = JRequest::getVar('cancel_redirect');
     if (!empty($cancel_url)) {
         $url = base64_decode($cancel_url);
         $this->toolbar['cancel'] = array('name' => 'link', 'icon' => 'cancel', 'alt' => JText::_('HIKA_BACK'), 'url' => $url);
     }
     $cancel_action = JRequest::getCmd('cancel_action', '');
     $this->assignRef('cancel_action', $cancel_action);
     $cancel_url = JRequest::getCmd('cancel_url', '');
     $this->assignRef('cancel_url', $cancel_url);
 }
Ejemplo n.º 5
0
	var d = document, node = tree.get(id);
	if( node.value && node.name ) {
		document.location = "<?php 
echo hikashop_completeLink('product&task=galleryimage&id=' . JRequest::getInt('id') . '&cid=' . @$this->cid . '&product_id=' . JRequest::getInt('product_id'), true, true);
?>
&folder=" + node.value;
	}
}
</script>
					</div>
				</td>
				<td>
					<ul class="hikaGallery">
<?php 
if (!empty($this->dirContent)) {
    hikashop_loadJsLib('tooltip');
    foreach ($this->dirContent as $k => $content) {
        $chk_uid = 'hikaGalleryChk_' . $k . '_' . uniqid();
        $tooltip = '';
        if (strlen($content->filename) > 5) {
            $tooltip = ' data-toggle="hk-tooltip" data-title="' . htmlentities($content->filename) . '"';
        }
        ?>
	<li class="hikaGalleryItem">
		<a class="hikaGalleryPhoto" href="#" onclick="return window.hikagallery.select(this, '<?php 
        echo $chk_uid;
        ?>
');"<?php 
        echo $tooltip;
        ?>
>
Ejemplo n.º 6
0
    private function init()
    {
        static $init = null;
        if ($init !== null) {
            return $init;
        }
        hikashop_loadJsLib('jquery');
        $doc = JFactory::getDocument();
        $lang = JFactory::getLanguage();
        $tag = $lang->getTag();
        $conversionTable = array('af-ZA' => 'af', 'ar-AR' => 'ar', 'eu-ES' => 'eu', 'bg-BG' => 'bg', 'ca-ES' => 'ca', 'zh-CN' => 'zh-CN', 'zh-TW' => 'zh-TW', 'bs-BA' => 'bs', 'cs-CZ' => 'cs', 'da-DK' => 'da', 'nl-NL' => 'nl', 'en-AU' => 'en-AU', 'en-NZ' => 'en-NZ', 'fi-FI' => 'fi', 'fr-FR' => 'fr', 'fr-CA' => 'fr', 'fr-CH' => 'fr-CH', 'gl-ES' => 'gl', 'de-DE' => 'de', 'el-GR' => 'el', 'he-IL' => 'he', 'hu-HU' => 'hu', 'it-IT' => 'it', 'ja-JP' => 'ja', 'ko-KR' => 'ko', 'lv-LV' => 'lv', 'lt-LT' => 'lt', 'mk-MK' => 'mk', 'nb-NO' => 'no', 'fa-IR' => 'fa', 'pl-PL' => 'pl', 'pt-BR' => 'pt-BR', 'pt-PT' => 'pt', 'ro-RO' => 'ro', 'ru-RU' => 'ru', 'sr-RS' => 'sr', 'es-ES' => 'es', 'sk-SK' => 'sk', 'sl-SL' => 'sl', 'sv-SE' => 'sv', 'th-TH' => 'th', 'tr-TR' => 'tr', 'uk-UA' => 'uk', 'vi-VN' => 'vi');
        if (isset($conversionTable[$tag])) {
            $tag = $conversionTable[$tag];
        } else {
            $tag = 'en-GB';
        }
        $doc->addScript('//jquery-ui.googlecode.com/svn/tags/latest/ui/minified/i18n/jquery-ui-i18n.min.js');
        $js = '
hkjQuery(function() {
	var excludeWDays = function(date, w, d, dt, rg) {
		var day = date.getDay(),
			md = (date.getMonth()+1) * 100 + date.getDate(),
			fd = date.getFullYear() * 10000 + md,
			r = true;
		if(w) { for(var i = w.length - 1; r && i >= 0; i--) { r = (day != w[i]); }}
		if(d) { for(var i = d.length - 1; r && i >= 0; i--) { r = (md != d[i]); }}
		if(dt) { for(var i = dt.length - 1; r && i >= 0; i--) { r = (fd != dt[i]); }}
		if(rg) { for(var i = rg.length - 1; r && i >= 0; i--) {
			if(rg[i][2] == 2)
				r = (md < rg[i][0] || md > rg[i][1]);
			else
				r = (fd < rg[i][0] || fd > rg[i][1]);
		}}
		return [r, \'\'];
	};
	hkjQuery(".hikashop_datepicker").each(function(){
		var t = hkjQuery(this), options = {};
		if(t.attr("data-options")) {
			options = Oby.evalJSON( t.attr("data-options") );
		}
		if(options["exclude"] || options["excludeDays"] || options["excludeDates"] || options["excludeRanges"]) {
			options["beforeShowDay"] = function(date){ return excludeWDays(date, options["exclude"], options["excludeDays"], options["excludeDates"], options["excludeRanges"]); };
		}
		options["altField"] = "#"+t.attr("data-picker");
		options["altFormat"] = "yy/mm/dd";
		hkjQuery.datepicker.setDefaults(hkjQuery.datepicker.regional[\'' . $tag . '\']);
		t.datepicker(options);

		t.change(function(){
			var e = hkjQuery(this), format = e.datepicker("option", "dateFormat");
			if(e.val() == "") {
				hkjQuery("#"+e.attr("data-picker")).val("");
			} else {
				try{
					hkjQuery.datepicker.parseDate(format, e.val());
				}catch(ex) {
					hkjQuery("#"+e.attr("data-picker")).val("");
				}
			}
		});
	});
});';
        $doc->addScriptDeclaration($js);
        $doc->addStyleSheet('//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css');
        $init = true;
        return $init;
    }
Ejemplo n.º 7
0
"><?php 
            echo JHTML::tooltip(JText::_('CVC_TOOLTIP_TEXT'), JText::_('CVC_TOOLTIP_TITLE'), '', JText::_('CARD_VALIDATION_CODE'));
            ?>
</label></td>
			<td><span class="hikashop_credit_ccv"><?php 
            echo str_repeat("X", strlen($cc_CCV));
            ?>
</span></td>
		</tr>
<?php 
        }
        ?>
	</table>
<?php 
    } else {
        hikashop_loadJsLib('creditcard');
        ?>
	<table width="100%">
<?php 
        if (!empty($this->method->ask_owner)) {
            ?>
		<tr>
			<td style="text-align:right"><label for="hikashop_credit_card_owner_<?php 
            echo $this->method->payment_type . '_' . $this->method->payment_id;
            ?>
"><?php 
            echo JText::_('CREDIT_CARD_OWNER');
            ?>
</label></td>
			<td><input type="text" autocomplete="off" style="text-align: center;" id="hikashop_credit_card_owner_<?php 
            echo $this->method->payment_type . '_' . $this->method->payment_id;
Ejemplo n.º 8
0
Archivo: vote.php Proyecto: rodhoff/MNW
    function loadJS()
    {
        static $done = false;
        if ($done) {
            return true;
        }
        $done = true;
        hikashop_loadJsLib('tooltip');
        $config = hikashop_config();
        $voteType = 0;
        if ($config->get('enable_status_vote', '0') == 'both') {
            $voteType = 1;
        }
        $js = '
hikaVote.setOptions({
	itemId : "' . hikashop_getCID() . '",
	urls : {
		save : "' . hikashop_completelink('vote&task=save', true, true) . '",
		show : "' . hikashop_completelink('vote&task=show', true, true) . '"
	},ctrl : "' . JRequest::getVar('ctrl', 'product') . '",
	both : "' . $voteType . '"
});

function hikashop_vote_useful(hikashop_vote_id, val) { return hikaVote.useful(hikashop_vote_id, val); }
function hikashop_send_comment(){ return hikaVote.vote(0,"hikashop_vote_rating_id"); }
function hikashop_send_vote(rating, from){ return hikaVote.vote(rating, from); }
		';
        $doc = JFactory::getDocument();
        $doc->addScriptDeclaration("\n<!--\n" . $js . "\n//-->\n");
    }
Ejemplo n.º 9
0
 function displayVex($text, $title, $url, $id, $params)
 {
     if (!isset($params['attr'])) {
         $params['attr'] = '';
     }
     if (!isset($params['icon'])) {
         $params['icon'] = '';
     }
     if (!isset($params['type'])) {
         $params['type'] = 'button';
     }
     if (!isset($params['dynamicUrl'])) {
         $params['dynamicUrl'] = false;
     }
     $isOnclick = strpos($params['attr'], 'onclick="') !== false;
     $html = '';
     hikashop_loadJsLib('vex');
     if ($text === null) {
         return $html;
     }
     $onClick = '';
     if ($params['dynamicUrl']) {
         if (!$isOnclick) {
             $onClick = ' onclick="this.href=' . str_replace('"', '\\"', $url) . '; return window.hikashop.openBox(this,this.href,false);"';
         }
         $isOnclick = true;
         $url = '#';
     }
     $a = $params['attr'];
     if (!empty($id) && !$isOnclick) {
         $onClick = ' onclick="return window.hikashop.openBox(this);"';
     }
     $html = '<a ' . $a . $onClick . ' id="' . $id . '" href="' . $url . '" data-hk-popup="vex" data-vex="{x:' . $params['width'] . ', y:' . $params['height'] . '}">';
     if ($params['type'] == 'button') {
         $html .= '<button class="btn" onclick="return false">';
     }
     $html .= $text;
     if ($params['type'] == 'button') {
         $html .= '</button>';
     }
     $html .= '</a>';
     return $html;
 }