本文整理汇总了PHP中hikashop_getFormToken函数的典型用法代码示例。如果您正苦于以下问题:PHP hikashop_getFormToken函数的具体用法?PHP hikashop_getFormToken怎么用?PHP hikashop_getFormToken使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hikashop_getFormToken函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: importFromVM
function importFromVM()
{
@ob_clean();
echo $this->getHtmlPage();
$this->token = hikashop_getFormToken();
$app = JFactory::getApplication();
flush();
if (isset($_GET['import']) && $_GET['import'] == '1') {
$time = microtime(true);
$this->vmprefix = $app->getUserState($this->sessionParams . 'vmPrefix');
$this->vm_current_lng = $app->getUserState($this->sessionParams . 'language');
$processed = $this->doImport();
if ($processed) {
$elasped = microtime(true) - $time;
if (!$this->refreshPage) {
echo '<p><a' . $this->linkstyle . ' href="' . hikashop_completeLink('import&task=import&importfrom=vm&' . $this->token . '=1&import=1&time=' . time()) . '">' . JText::_('HIKA_NEXT') . '</a></p>';
}
echo '<p style="font-size:0.85em; color:#605F5D;">Elasped time: ' . round($elasped * 1000, 2) . 'ms</p>';
} else {
echo '<a' . $this->linkstyle . ' href="' . hikashop_completeLink('import&task=show') . '">' . JText::_('HIKA_BACK') . '</a>';
}
} else {
echo $this->getStartPage();
}
if ($this->refreshPage == true) {
echo "<script type=\"text/javascript\">\r\nr = true; \r\n</script>";
}
echo '</body></html>';
exit;
}
示例2: importFromRedshop
function importFromRedshop()
{
@ob_clean();
echo $this->getHtmlPage();
$this->token = hikashop_getFormToken();
flush();
if (isset($_GET['import']) && $_GET['import'] == '1') {
$time = microtime(true);
$processed = $this->doImport();
if ($processed) {
$elasped = microtime(true) - $time;
if (!$this->refreshPage) {
echo '<p></br><a' . $this->linkstyle . 'href="' . hikashop_completeLink('import&task=import&importfrom=redshop&' . $this->token . '=1&import=1&time=' . time()) . '">' . JText::_('HIKA_NEXT') . '</a></p>';
}
echo '<p style="font-size:0.85em; color:#605F5D;">Elasped time: ' . round($elasped * 1000, 2) . 'ms</p>';
} else {
echo '<a' . $this->linkstyle . 'href="' . hikashop_completeLink('import&task=show') . '">' . JText::_('HIKA_BACK') . '</a>';
}
} else {
echo $this->getStartPage();
}
if ($this->refreshPage) {
echo "<script type=\"text/javascript\">\r\nr = true;\r\n</script>";
}
echo '</body></html>';
exit;
}
示例3: fetchElement
function fetchElement($name, $value, &$node, $control_name)
{
if (!(include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_hikashop' . DS . 'helpers' . DS . 'helper.php')) {
return 'This plugin can not work without the Hikashop Component';
}
$id = hikashop_getCID('id');
if (!empty($id)) {
$text = '<a title="' . JText::_('Trigger') . '" href="' . JRoute::_('index.php?option=com_hikashop&ctrl=plugins&task=trigger&function=' . $value . '&cid=' . $id . '&' . hikashop_getFormToken() . '=1') . '" >' . JText::_('Trigger') . '</a>';
}
return $text;
}
示例4: getInput
function getInput()
{
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
if (!function_exists('hikashop_getCID') && !(include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_hikashop' . DS . 'helpers' . DS . 'helper.php')) {
return 'This plugin can not work without the Hikashop Component';
}
$id = hikashop_getCID('extension_id');
if (!empty($id)) {
$text = '<fieldset class="radio"><a id="' . $this->id . '" title="' . JText::_('Trigger') . '" href="' . JRoute::_('index.php?option=com_hikashop&ctrl=plugins&task=trigger&function=' . $this->value . '&cid=' . $id . '&' . hikashop_getFormToken() . '=1') . '" >' . JText::_('Trigger') . '</a></fieldset>';
}
return $text;
}
示例5: importFromOpenc
function importFromOpenc()
{
@ob_clean();
echo $this->getHtmlPage();
$this->token = hikashop_getFormToken();
flush();
if (isset($_GET['import']) && $_GET['import'] == '1') {
$app = JFactory::getApplication();
$config = JFactory::getConfig();
$this->opencDatabase = $app->getUserState($this->sessionParams . 'dbName');
$this->opencRootPath = $app->getUserState($this->sessionParams . 'rootPath');
$this->opencPrefix = $app->getUserState($this->sessionParams . 'prefix');
if (HIKASHOP_J30) {
$this->hikaDatabaseName = $config->get('db');
} else {
$this->hikaDatabaseName = $config->getValue('db');
}
$this->importcurrencies = $app->getUserState($this->sessionParams . 'importcurrencies');
if (substr($this->opencRootPath, -1) != '/') {
$this->opencRootPath = $this->opencRootPath . '/';
}
@(include_once $this->opencRootPath . 'admin/config.php');
$time = microtime(true);
$processed = $this->doImport();
if ($processed) {
$elasped = microtime(true) - $time;
if (!$this->refreshPage) {
echo '<p></br><a' . $this->linkstyle . 'href="' . hikashop_completeLink('import&task=import&importfrom=openc&' . $this->token . '=1&import=1&time=' . time()) . '">' . JText::_('HIKA_NEXT') . '</a></p>';
}
echo '<p style="font-size:0.85em; color:#605F5D;">Elasped time: ' . round($elasped * 1000, 2) . 'ms</p>';
} else {
echo '<a' . $this->linkstyle . 'href="' . hikashop_completeLink('import&task=show') . '">' . JText::_('HIKA_BACK') . '</a>';
}
} else {
echo $this->getStartPage();
}
if ($this->refreshPage) {
echo "<script type=\"text/javascript\">\r\nr = true;\r\n</script>";
}
echo '</body></html>';
exit;
}
示例6: foreach
foreach ($this->fields as $field) {
$fieldname = $field->field_namekey;
if (!empty($address->{$fieldname})) {
$html = str_replace('{' . $fieldname . '}', $this->fieldsClass->show($field, @$address->{$fieldname}), $html);
}
}
echo str_replace("\n", "<br/>\n", str_replace("\n\n", "\n", preg_replace('#{(?:(?!}).)*}#i', '', $html)));
?>
</span>
</td>
<td class="hikashop_address_listing_item_actions">
<?php
global $Itemid;
?>
<a href="<?php
echo hikashop_completeLink('address&task=delete&address_id=' . $address->address_id . '&' . hikashop_getFormToken() . '=1&Itemid=' . $Itemid);
?>
" title="<?php
echo JText::_('HIKA_DELETE');
?>
"><img src="<?php
echo HIKASHOP_IMAGES;
?>
delete.png" alt="<?php
echo JText::_('HIKA_DELETE');
?>
" /></a>
<?php
echo $this->popup->display('<img src="' . HIKASHOP_IMAGES . 'edit.png" alt="' . JText::_('HIKA_EDIT') . '" />', 'HIKA_EDIT', hikashop_completeLink('address&task=edit&address_id=' . $address->address_id . '&Itemid=' . $Itemid, true), 'hikashop_edit_address_popup_' . $address->address_id, 760, 480, '', '', 'link');
?>
</td>
示例7: form
function form()
{
$dashboard = false;
$config =& hikashop_config();
$widget_id = hikashop_getCID('widget_id');
$class = hikashop_get('class.widget');
$db = JFactory::getDBO();
if (!empty($widget_id)) {
$element = $class->get($widget_id);
$task = 'edit';
} else {
$element = new stdClass();
$element->widget_published = 1;
$task = 'add';
$element->widget_params = new stdClass();
$element->widget_params->display = 'line';
$element->widget_params->content = 'sales';
$element->widget_params->date_group = '%j %Y';
$element->widget_params->date_type = 'created';
$element->widget_params->periodType = 'proposedPeriod';
$element->widget_params->proposedPeriod = 'thisMonth';
$element->widget_params->format = 'UTF-8';
$element->widget_params->period_compare = 'none';
$element->widget_name = 'New report ' . $widget_id;
$element->widget_params->limit = '7';
}
$class->loadDatas($element);
if (isset($element->widget_params->table)) {
$row_id = count($element->widget_params->table);
$this->assignRef('row_id', $row_id);
foreach ($element->widget_params->table as $row) {
$class->loadDatas($row);
}
} else {
$row_id = 0;
$this->assignRef('row_id', $row_id);
}
if ($element->widget_params->display != 'table') {
if ($element->widget_params->display != 'listing' && ($element->widget_params->content == 'products' || $element->widget_params->content == 'categories' || $element->widget_params->content == 'discount')) {
$element->widget_params->content = 'orders';
}
}
hikashop_setTitle(JText::_($this->nameForm), $this->icon, $this->ctrl . '&task=' . $task . '&widget_id=' . $widget_id);
$this->toolbar = array(array('name' => 'link', 'icon' => 'archive', 'alt' => JText::_('HIKA_EXPORT'), 'url' => hikashop_completeLink('report&task=csv&cid[]=' . $widget_id) . '&' . hikashop_getFormToken() . '=1', 'display' => hikashop_level(2) && !empty($widget_id) && hikashop_isAllowed($config->get('acl_report_view', 'all'))), '|', array('name' => 'save', 'display' => hikashop_isAllowed($config->get('acl_report_manage', 'all'))), array('name' => 'save2new', 'display' => version_compare(JVERSION, '1.7', '>=') && hikashop_isAllowed($config->get('acl_report_manage', 'all'))), array('name' => 'apply', 'display' => hikashop_isAllowed($config->get('acl_report_manage', 'all'))), 'cancel', '|', array('name' => 'pophelp', 'target' => $this->ctrl . '-form'));
$this->assignRef('element', $element);
$translation = false;
$transHelper = hikashop_get('helper.translation');
if ($transHelper && $transHelper->isMulti()) {
$translation = true;
$transHelper->load('hikashop_widget', @$element->widget_id, $element);
$config =& hikashop_config();
$multilang_display = $config->get('multilang_display', 'tabs');
if ($multilang_display == 'popups') {
$multilang_display = 'tabs';
}
$tabs = hikashop_get('helper.tabs');
$this->assignRef('tabs', $tabs);
$this->assignRef('transHelper', $transHelper);
}
$toggle = hikashop_get('helper.toggle');
$this->assignRef('toggle', $toggle);
$this->assignRef('translation', $translation);
$currencyClass = hikashop_get('class.currency');
$this->assignRef('currencyHelper', $currencyClass);
$periodType = hikashop_get('type.period');
$this->assignRef('periodType', $periodType);
$widget_dataType = hikashop_get('type.widget_data');
$this->assignRef('widget_dataType', $widget_dataType);
$status = hikashop_get('type.categorysub');
$status->type = 'status';
$this->assignRef('status', $status);
$delay = hikashop_get('type.delay');
$this->assignRef('delay', $delay);
$region = hikashop_get('type.region');
$this->assignRef('region', $region);
if (hikashop_level(2)) {
$encoding = hikashop_get('type.charset');
$this->assignRef('encoding', $encoding);
}
$widgetClass = hikashop_get('class.widget');
$this->assignRef('widgetClass', $widgetClass);
$dateGroup = hikashop_get('type.dategroup');
$this->assignRef('dateGroup', $dateGroup);
$dateType = hikashop_get('type.datetype');
$this->assignRef('dateType', $dateType);
$shippingMethods = hikashop_get('type.plugins');
$shippingMethods->type = 'shipping';
$shippingMethods->manualOnly = true;
$this->assignRef('shippingMethods', $shippingMethods);
$paymentMethods = hikashop_get('type.plugins');
$paymentMethods->type = 'payment';
$paymentMethods->manualOnly = true;
$this->assignRef('paymentMethods', $paymentMethods);
$dashboard = JRequest::getVar('dashboard');
$this->assignRef('dashboard', $dashboard);
$nameboxType = hikashop_get('type.namebox');
$this->assignRef('nameboxType', $nameboxType);
JHTML::_('behavior.modal');
$script = "\r\n\tfunction deleteRow(divName,inputName,rowName){\r\n\t\tvar d = document.getElementById(divName);\r\n\t\tvar olddiv = document.getElementById(inputName);\r\n\t\tif(d && olddiv){\r\n\t\t\td.removeChild(olddiv);\r\n\t\t\tdocument.getElementById(rowName).style.display='none';\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfunction updatePeriodSelection(){\r\n\t\tselectedPeriod = document.getElementById('display_proposed_period').checked;\r\n\t\tdocument.getElementById('period_start').disabled=false;\r\n\t\tdocument.getElementById('period_end').disabled=false;\r\n\t\tdocument.getElementById('delayvalue1').disabled=false;\r\n\t\tdocument.getElementById('delaytype1').disabled=false;\r\n\t\tdocument.getElementById('datawidgetwidget_paramsproposedPeriod').disabled=false;\r\n\t\tif(selectedPeriod==true){\r\n\t\t\tdocument.getElementById('period_start').disabled=true;\r\n\t\t\tdocument.getElementById('period_end').disabled=true;\r\n\t\t\tdocument.getElementById('delayvalue1').disabled=true;\r\n\t\t\tdocument.getElementById('delaytype1').disabled=true;\r\n\t\t}else{\r\n\t\t\tdocument.getElementById('datawidgetwidget_paramsproposedPeriod').disabled=true;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction updateCompare(){\r\n\t\tselectedCompare = document.getElementById('compare_with_values').checked;\r\n\t\tdocument.getElementById('compares_order_status').disabled=false;\r\n\t\tdocument.getElementById('compares_order_currency_id').disabled=false;\r\n\t\tdocument.getElementById('compares_order_payment_method').disabled=false;\r\n\t\tdocument.getElementById('compares_order_shipping_method').disabled=false;\r\n\t\tdocument.getElementById('compares_order_discount_code').disabled=false;\r\n\t\tdocument.getElementById('compares_products').disabled=false;\r\n\t\tdocument.getElementById('compares_categories').disabled=false;\r\n\t\tdocument.getElementById('compare_period').disabled=false;\r\n\t\tif(selectedCompare==true){\r\n\t\t\tdocument.getElementById('compare_period').disabled=true;\r\n\t\t}else{\r\n\t\t\tdocument.getElementById('compares_order_status').disabled=true;\r\n\t\t\tdocument.getElementById('compares_order_currency_id').disabled=true;\r\n\t\t\tdocument.getElementById('compares_order_payment_method').disabled=true;\r\n\t\t\tdocument.getElementById('compares_order_shipping_method').disabled=true;\r\n\t\t\tdocument.getElementById('compares_order_discount_code').disabled=true;\r\n\t\t\tdocument.getElementById('compares_products').disabled=true;\r\n\t\t\tdocument.getElementById('compares_categories').disabled=true;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction updateDisplayType(){\r\n\t\ttheType=false;\r\n\t\tvalues = new Array('gauge', 'column', 'graph', 'line', 'pie', 'area', 'map', 'listing', 'table');\r\n\t\tfor(var i=0; i<values.length; i++){\r\n\t\t\tnewType = document.getElementById('widget_display_'+values[i]).checked;\r\n\t\t\tif(newType==true){\r\n\t\t\t\tdisplayType = document.getElementById('widget_display_'+values[i]).value;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(displayType=='pie'){\r\n\t\t\tvalues = new Array('orders', 'sales', 'taxes', 'partners', 'customers');\r\n\t\t\tfor(var i=0; i<values.length; i++){\r\n\t\t\t\tnewType = document.getElementById('type_'+values[i]).checked;\r\n\t\t\t\tif(newType==true){\r\n\t\t\t\t\t\ttheType = document.getElementById('type_'+values[i]).value;\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(theType=='customers' || theType=='partners'){\r\n\t\t\t\t document.getElementById('type_orders').checked=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(displayType=='map'){\r\n\t\t\tvalues = new Array('orders', 'sales', 'taxes', 'partners', 'customers');\r\n\t\t\tfor(var i=0; i<values.length; i++){\r\n\t\t\t\tnewType = document.getElementById('type_'+values[i]).checked;\r\n\t\t\t\tif(newType==true){\r\n\t\t\t\t\ttheType = document.getElementById('type_'+values[i]).value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tdocument.getElementById('map_options').style.display='none';\r\n\t\t\tdocument.getElementById('filters').style.display='';\r\n\t\t\tif(theType=='orders' || theType=='sales' || theType=='taxes'){\r\n\t\t\t\tdocument.getElementById('map_options').style.display='';\r\n\t\t\t}\r\n\t\t\tif(theType=='customers' || theType=='partners'){\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(displayType=='gauge' || displayType=='line' || displayType=='area' || displayType=='graph' || displayType=='column'){\r\n\t\t\tvalues = new Array('orders', 'sales', 'taxes', 'partners', 'customers');\r\n\t\t\tfor(var i=0; i<values.length; i++){\r\n\t\t\t\tnewType = document.getElementById('type_'+values[i]).checked;\r\n\t\t\t\tif(newType==true){\r\n\t\t\t\t\t\ttheType = document.getElementById('type_'+values[i]).value;\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(theType==false){\r\n\t\t\t\ttheType='orders';\r\n\t\t\t \ttheType = document.getElementById('type_orders').checked=true;\r\n\t\t\t}\r\n\t\t\tdocument.getElementById('widget_compare').style.display='';\r\n\t\t\tif(theType=='orders' || theType=='sales' || theType=='taxes'){\r\n\t\t\t\tdocument.getElementById('widget_compare').style.display='';\r\n\t\t\t}\r\n\t\t\tif(theType=='customers' || theType=='partners'){\r\n\t\t\t\tdocument.getElementById('widget_compare').style.display='none';\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(displayType=='table'){\r\n\t\t\tdocument.getElementById('products_options').style.display='none';\r\n\t\t\tdocument.getElementById('filters').style.display='none';\r\n\t\t\tdocument.getElementById('customers_options').style.display='none';\r\n\t\t\tdocument.getElementById('partners_options').style.display='none';\r\n\t\t\tdocument.getElementById('orders_options').style.display='none';\r\n\t\t\tdocument.getElementById('product_datas').style.display='none';\r\n\t\t\tdocument.getElementById('widget_compare').style.display='none';\r\n\t\t\tdocument.getElementById('widget_limit').style.display='none';\r\n\t\t\tdocument.getElementById('widget_region').style.display='none';\r\n\t\t\tdocument.getElementById('map_options').style.display='none';\r\n\t\t}\r\n\t\tif(displayType!='listing'){ return 0; }\r\n\r\n\t\tvalues = new Array('orders', 'products', 'customers', 'partners', 'categories', 'discounts');\r\n\t\tfor(var i=0; i<values.length; i++){\r\n\t\t\tnewType = document.getElementById('type_'+values[i]).checked;\r\n\t\t\tif(newType==true){\r\n\t\t\t\ttheType = document.getElementById('type_'+values[i]).value;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(!theType){\r\n\t\t\tdocument.getElementById('type_orders').checked=true;\r\n\t\t\ttheType='orders';\r\n\t\t}\r\n\t\tdocument.getElementById('products_options').style.display='none';\r\n\t\tdocument.getElementById('filters').style.display='none';\r\n\t\tdocument.getElementById('customers_options').style.display='none';\r\n\t\tdocument.getElementById('partners_options').style.display='none';\r\n\t\tdocument.getElementById('orders_options').style.display='none';\r\n\t\tdocument.getElementById('product_datas').style.display='none';\r\n\r\n\t\tif(theType=='orders' || theType=='products' || theType=='categories' || theType=='discounts' || theType=='customers' || theType== 'partners'){\r\n\t\t\tdocument.getElementById('filters').style.display='';\r\n\t\t\tdocument.getElementById('product_datas').style.display='';\r\n\t\t\tif(theType=='categories'){\r\n\t\t\t\tdocument.getElementById('data_hits').style.display='none';\r\n\t\t\t\tclicksValue = document.getElementById('data_clicks').checked;\r\n\t\t\t\tif(clicksValue==true){\r\n\t\t\t\t\tdocument.getElementById('data_orders').checked=true;\r\n\t\t\t\t}\r\n\t\t\t}else if(theType=='products'){\r\n\t\t\t\tdocument.getElementById('data_hits').style.display='';\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(theType=='discounts'){\r\n\t\t\tdocument.getElementById('product_datas').style.display='none';\r\n\t\t}\r\n\t\tif(theType=='products' || theType=='categories' || theType=='discounts'){\r\n\t\t\tdocument.getElementById('products_options').style.display='';\r\n\t\t}\r\n\t\tif(theType=='customers'){\r\n\t\t\tdocument.getElementById('customers_options').style.display='';\r\n\t\t}\r\n\t\tif(theType=='partners'){\r\n\t\t\tdocument.getElementById('partners_options').style.display='';\r\n\t\t}\r\n\t\tif(theType=='orders'){\r\n\t\t\tdocument.getElementById('orders_options').style.display='';\r\n\t\t}\r\n\r\n\t}\r\n\twindow.hikashop.ready( function(){ updateDisplayType(); });\r\n\twindow.hikashop.ready( function(){ updatePeriodSelection(); });\r\n\twindow.hikashop.ready( function(){ updateCompare(); });\r\n\r\n\t\t\t\t";
if (!HIKASHOP_PHP5) {
//.........这里部分代码省略.........
示例8: onDisplay
function onDisplay($name, $asset = '', $author = '')
{
$extension = JRequest::getCmd('option');
if (!in_array($extension, array('com_content', 'com_tz_portfolio', 'com_k2'))) {
return;
}
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 (version_compare(JVERSION, '1.6.0', '<')) {
global $mainframe;
$params = JComponentHelper::getParams('com_media');
$acl = JFactory::getACL();
switch ($params->get('allowed_media_usergroup')) {
case '1':
$acl->addACL('com_media', 'upload', 'users', 'publisher');
break;
case '2':
$acl->addACL('com_media', 'upload', 'users', 'publisher');
$acl->addACL('com_media', 'upload', 'users', 'editor');
break;
case '3':
$acl->addACL('com_media', 'upload', 'users', 'publisher');
$acl->addACL('com_media', 'upload', 'users', 'editor');
$acl->addACL('com_media', 'upload', 'users', 'author');
break;
case '4':
$acl->addACL('com_media', 'upload', 'users', 'publisher');
$acl->addACL('com_media', 'upload', 'users', 'editor');
$acl->addACL('com_media', 'upload', 'users', 'author');
$acl->addACL('com_media', 'upload', 'users', 'registered');
break;
}
$user = JFactory::getUser();
if (!$user->authorize('com_media', 'popup')) {
return;
}
$doc = JFactory::getDocument();
$template = $mainframe->getTemplate();
$pluginsClass = hikashop_get('class.plugins');
$plugin = $pluginsClass->getByName('editors-xtd', 'hikashopproduct');
$link = 'index.php?option=com_hikashop&ctrl=plugins&task=trigger&function=productDisplay&tmpl=component&cid=' . $plugin->id . '&' . hikashop_getFormToken() . '=1';
JHtml::_('behavior.modal');
$button = new JObject();
$button->set('modal', true);
$button->set('link', $link);
$button->set('text', JText::_('PRODUCT'));
$button->set('name', 'hikashopproduct');
$button->set('options', "{handler: 'iframe', size: {x: 800, y: 450}}");
$doc = JFactory::getDocument();
if (!HIKASHOP_J30) {
JHTML::_('behavior.mootools');
} else {
JHTML::_('behavior.framework');
}
$img_name = 'hikashopproduct.png';
$path = '../plugins/editors-xtd/' . $img_name;
$doc->addStyleDeclaration('.button2-left .hikashopproduct {background: url(' . $path . ') 100% 0 no-repeat; }');
return $button;
} else {
$app = JFactory::getApplication();
$params = JComponentHelper::getParams('com_media');
$user = JFactory::getUser();
if ($asset == '') {
$asset = $extension;
}
if ($user->authorise('core.edit', $asset) || $user->authorise('core.create', $asset) || count($user->getAuthorisedCategories($asset, 'core.create')) > 0 || $user->authorise('core.edit.own', $asset) && $author == $user->id || count($user->getAuthorisedCategories($extension, 'core.edit')) > 0 || count($user->getAuthorisedCategories($extension, 'core.edit.own')) > 0 && $author == $user->id) {
$pluginsClass = hikashop_get('class.plugins');
$plugin = $pluginsClass->getByName('editors-xtd', 'hikashopproduct');
$link = 'index.php?option=com_hikashop&ctrl=plugins&task=trigger&function=productDisplay&editor_name=' . urlencode($name) . '&tmpl=component&cid=' . $plugin->extension_id . '&' . hikashop_getFormToken() . '=1';
JHtml::_('behavior.modal');
$button = new JObject();
$button->set('modal', true);
$button->set('link', $link);
$button->set('text', JText::_('PRODUCT'));
$button->set('class', 'btn');
$button->set('name', 'hikashopproduct');
$button->set('options', "{handler: 'iframe', size: {x: 800, y: 450}}");
$doc = JFactory::getDocument();
if (!HIKASHOP_J30) {
JHTML::_('behavior.mootools');
} else {
JHTML::_('behavior.framework');
}
$img_name = 'hikashopproduct.png';
$path = '../plugins/editors-xtd/hikashopproduct/' . $img_name;
$doc->addStyleDeclaration('.button2-left .hikashopproduct {background: url(' . $path . ') 100% 0 no-repeat; }');
return $button;
} else {
return false;
}
}
}
示例9: displayErrors
function displayErrors($id)
{
static $displayed = false;
if (!$displayed) {
$displayed = true;
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('MENU_WITHOUT_ASSOCIATED_MODULE'));
$app->enqueueMessage(JText::_('ASSOCIATED_MODULE_NEEDED'));
$app->enqueueMessage(JText::sprintf('ADD_MODULE_AUTO', hikashop_completeLink('menus&task=add_module&cid=' . $id . '&' . hikashop_getFormToken() . '=1')));
}
}
示例10: echo
</td>
<td>
<?php
echo $row->file_name;
?>
</td>
<td width="1%" align="right">
<?php
echo (int) @$row->download_number . ' / ';
if (!is_numeric($row->file_limit) || $row->file_limit > 0) {
echo $row->file_limit;
} else {
echo JText::_('UNLIMITED');
}
if (@$row->download_number) {
echo ' <a href="' . hikashop_completeLink('file&task=resetdownload&file_id=' . $row->file_id . '&' . hikashop_getFormToken() . '=1&return=' . urlencode(base64_encode(hikashop_completeLink('product&task=edit&cid=' . @$this->element->product_id, false, true)))) . '"><img src="' . HIKASHOP_IMAGES . 'delete.png" alt="' . JText::_('HIKA_DELETE') . '" /></a>';
}
?>
</td>
<td width="1%" align="center">
<input type="checkbox" disabled="disabled" <?php
echo !empty($row->file_free_download) ? 'checked="checked"' : '';
?>
/>
</td>
<td width="1%" align="center">
<a href="#" onclick="return deleteRow('file_div_<?php
echo $row->file_id . '_' . $id;
?>
','file[<?php
echo $row->file_id;
示例11: loadJS
function loadJS()
{
static $done = false;
if ($done) {
return true;
}
$done = true;
$current_url = hikashop_currentURL();
$baseUrl = hikashop_completelink('vote&task=save&' . hikashop_getFormToken() . '=1');
$ajaxUrl = hikashop_completelink('vote&task=save', true, true);
if (strpos($baseUrl, '?') !== false) {
$baseUrl .= '&';
} else {
$baseUrl .= '?';
}
$config = hikashop_config();
$email_comment = $config->get('email_comment', 0);
if ($config->get('enable_status_vote', 0) == 'both') {
$vote_comment = 1;
} else {
$vote_comment = 0;
}
$note_comment = $config->get('register_note_comment', 0);
if ($config->get('access_vote', 0) == 'buyed' || $config->get('access_vote', 0) == 'registered') {
$hikashop_vote_con_req = 1;
} else {
$hikashop_vote_con_req = 0;
}
$js = '
function trim(myString){
myString = myString.replace(/(^\\s|&)+/g,\'\').replace(/\\s+$/g,\'\').replace(/\\n/g,\'<br \\/>\');
return myString;
}
function hikashop_vote_useful(hikashop_vote_id,val){
var hikashop_vote_user_id = "";
if(document.getElementById("hikashop_vote_user_id")) hikashop_vote_user_id = document.getElementById("hikashop_vote_user_id").value;
var hikashop_vote_note_comment = ' . $note_comment . ';
if((hikashop_vote_note_comment == 1 && hikashop_vote_user_id != "") || hikashop_vote_note_comment == 0){
data = "hikashop_vote_type=useful";
data += "&value=" + encodeURIComponent(val);
data += "&hikashop_vote_id=" + encodeURIComponent(hikashop_vote_id);
data += "&hikashop_vote_user_id=" + encodeURIComponent(hikashop_vote_user_id);
window.Oby.xRequest("' . $ajaxUrl . '", {mode: "POST", data: data}, function(xhr) {
var el = document.getElementById(hikashop_vote_id);
if(xhr.responseText == "1"){el.innerHTML = " ' . JText::_('THANK_FOR_VOTE', true) . '";}
else if(xhr.responseText == "3"){el.innerHTML = " ' . JText::_('ALREADY_VOTE_USEFUL', true) . '";}
else{el.innerHTML = " ' . JText::_('VOTE_ERROR', true) . '";}
});
setTimeout("document.location=\'' . $current_url . '\'",2250);
}
else{
document.getElementById(hikashop_vote_id).innerHTML = " ' . JText::_('ONLY_REGISTERED_CAN_VOTE', true) . '";
setTimeout("document.getElementById(\'hikashop_vote_id\').innerHTML = \'\'",2250);
}
}
function hikashop_send_vote(hikashop_vote, from){
var re = new RegExp(\'id_(.*?)_hikashop\');
var m = re.exec(from);
if(m != null){
var hikashop_vote_ref_id = "";
for (i = 1; i < m.length; i++) {
hikashop_vote_ref_id = hikashop_vote_ref_id + m[i] + "\\n";
}
}else{
var hikashop_vote_ref_id = document.getElementById("hikashop_vote_ref_id").value;
}
document.getElementById("hikashop_vote_ok_"+parseInt(hikashop_vote_ref_id)).value = "1";
var hikashop_vote_vote_comment = ' . $vote_comment . ';
var hikashop_vote_con_req = ' . $hikashop_vote_con_req . ';
var hikashop_vote_user_id = document.getElementById("hikashop_vote_user_id_"+parseInt(hikashop_vote_ref_id)).value;
var vote_type = document.getElementById("vote_type_"+parseInt(hikashop_vote_ref_id)).value;
var div_vote_status = "hikashop_vote_status_"+parseInt(hikashop_vote_ref_id);
if((hikashop_vote_con_req == 1 && hikashop_vote_user_id != "") || hikashop_vote_con_req == 0){
if(hikashop_vote_vote_comment == 1){//User must enter a comment to note a product
if(from =="hikashop_vote_rating_id"){
document.getElementById("hikashop_vote_status_form").innerHTML = " ' . JText::_('LET_COMMENT_TO_VALID_VOTE', true) . '";
setTimeout("document.getElementById(\'hikashop_vote_status_form\').innerHTML = \'\'",2250);
}else{
var el = document.getElementById(div_vote_status);
el.innerHTML = " ' . JText::_('LET_COMMENT_TO_VALID_VOTE', true) . '";
setTimeout(function(){el.innerHTML = "";},2250);
}
}
else{// Only vote - sending request to saveFrontend() function, and analysing the result, status(thanks, bought, error)
if(from =="hikashop_vote_rating_id"){
var el = document.getElementById("hikashop_vote_status_form");
}else{
var el = document.getElementById(div_vote_status);
}
data = "vote_type=" + encodeURIComponent(vote_type);
data += "&hikashop_vote_type=vote";
data += "&hikashop_vote=" + encodeURIComponent(hikashop_vote);
data += "&hikashop_vote_user_id=" + encodeURIComponent(hikashop_vote_user_id);
data += "&hikashop_vote_ref_id=" + encodeURIComponent(hikashop_vote_ref_id);
window.Oby.xRequest("' . $ajaxUrl . '", {mode: "POST", data: data}, function(xhr) {
if(xhr.responseText == "1"){
el.innerHTML = " ' . JText::_('VOTE_UPDATED', true) . '";
//.........这里部分代码省略.........
示例12: function
window.productMgr.deleteVariants = function(el, id) {
var w = window, d = document, o = w.Oby, ve = window.productMgr.variantEdition, data = '';
if(ve.checked.length == 0)
return false;
var msg = '<?php
echo str_replace('\'', '\\\'', JText::_('PLEASE_CONFIRM_DELETION_X_VARIANTS'));
?>
';
if(!confirm(msg.replace('{NUM}', ve.checked.length)))
return false;
for(var i = ve.checked.length - 1; i >= 0; i--) {
if(data.length > 0) data += '&';
data += 'cid[]=' + ve.checked[i];
}
o.xRequest('<?php
echo hikashop_completeLink('product&task=variants&subtask=delete&product_id=' . $this->product->product_id . '&' . hikashop_getFormToken() . '=1', true, false, true);
?>
',
{mode: 'POST', data: data},
function(x,p) {
window.productMgr.refreshVariantList();
}
);
return false;
};
</script>
<?php
} else {
?>
<script type="text/javascript">
if(window.productMgr.variantEdition)
示例13: hikashop_completeLink
?>
_address_buttons">
<?php
if ($nb_addresses > 1) {
?>
<a onclick="if(!confirm('<?php
echo JText::_('HIKASHOP_CONFIRM_DELETE_ADDRESS', true);
?>
')){return false;}else{return true;}" title="<?php
echo JText::_('HIKA_DELETE');
?>
" class="hikashop_checkout_<?php
echo $this->type;
?>
_address_delete" href="<?php
echo hikashop_completeLink('checkout&step=' . $this->step . '&redirect=checkout&task=deleteaddress&address_id=' . $address->address_id . '&' . hikashop_getFormToken() . '=1' . $this->url_itemid);
?>
"><img alt="<?php
echo JText::_('HIKA_DELETE');
?>
" src="<?php
echo HIKASHOP_IMAGES;
?>
delete.png" border="0" /></a>
<?php
}
?>
<a id="hikashop_checkout_<?php
echo $this->type;
?>
_address_edit_<?php
示例14: processOptions
private function processOptions(&$options, $mode = 'image')
{
$t = hikashop_getFormToken();
if (!empty($options['uploader'])) {
$params = '';
if (!empty($options['vars'])) {
$options['formData'] = $options['vars'];
$options['formData'][$t] = 1;
foreach ($options['vars'] as $k => $v) {
$params .= '&' . urlencode($k) . '=' . urlencode($v);
}
}
if (!empty($options['upload'])) {
if (empty($options['upload_base_url'])) {
$options['uploadUrls'] = array(0 => hikashop_completeLink('upload&task=' . $mode . '&uploader=' . $options['uploader'][0] . '&field=' . $options['uploader'][1] . $params . '&' . $t . '=1', true), 1 => hikashop_completeLink('upload&task=upload&upload=' . $mode . '&uploader=' . $options['uploader'][0] . '&field=' . $options['uploader'][1], true, false, true));
} else {
$options['uploadUrls'] = array(0 => JRoute::_($options['upload_base_url'] . '&task=' . $mode . '&uploader=' . $options['uploader'][0] . '&field=' . $options['uploader'][1] . $params . '&' . $t . '=1&tmpl=component'), 1 => str_replace('&', '&', JRoute::_($options['upload_base_url'] . '&task=upload&upload=' . $mode . '&uploader=' . $options['uploader'][0] . '&field=' . $options['uploader'][1] . '&tmpl=component')));
}
}
if (!empty($options['gallery']) && $mode == 'image') {
if (empty($options['upload_base_url'])) {
$options['browseUrl'] = hikashop_completeLink('upload&task=galleryimage&uploader=' . $options['uploader'][0] . '&field=' . $options['uploader'][1] . $params, true);
} else {
$options['browseUrl'] = JRoute::_($options['upload_base_url'] . '&task=galleryimage&uploader=' . $options['uploader'][0] . '&field=' . $options['uploader'][1] . $params . '&tmpl=component');
}
}
}
if (empty($options['classes'])) {
$options['classes'] = array('mainDiv' => 'hikashop_main_' . $mode . '_div');
}
if (!isset($options['classes']['mainDiv'])) {
$options['classes']['mainDiv'] = '';
}
if (!isset($options['classes']['firstImg'])) {
$options['classes']['firstImg'] = 'hikashop_upload_imagethumb_main';
}
if (!isset($options['classes']['otherImg'])) {
$options['classes']['otherImg'] = 'hikashop_upload_imagethumb_small';
}
if (!isset($options['classes']['contentClass'])) {
$options['classes']['contentClass'] = '';
}
if (empty($options['classes']['btn_upload'])) {
$options['classes']['btn_upload'] = 'hika_upload_btn';
}
if (empty($options['classes']['btn_add'])) {
$options['classes']['btn_add'] = 'hika_add_btn';
}
$maxSize = min(hikashop_bytes(ini_get('upload_max_filesize')), hikashop_bytes(ini_get('post_max_size')));
if (empty($options['maxSize'])) {
$options['maxSize'] = $maxSize;
} else {
$size = (int) $options['maxSize'];
if ('' . $size != $options['maxSize']) {
$size = hikashop_bytes($options['maxSize']);
}
$options['maxSize'] = min($size, $maxSize);
}
if (empty($options['uploadUrls'])) {
$options['uploadUrls'] = null;
}
if (empty($options['browseUrl'])) {
$options['browseUrl'] = null;
}
if (empty($options['text'])) {
$options['text'] = '';
}
if (!empty($options['formData']) && !is_string($options['formData'])) {
$options['formData'] = json_encode($options['formData']);
} else {
$options['formData'] = '{\'' . $t . '\':1}';
}
}
示例15: cell
function cell()
{
$url = 'massaction&task=process';
$url .= '&' . hikashop_getFormToken() . '=1';
if (isset($_POST['hikashop'])) {
$hikashop = JRequest::getVar('hikashop', '');
$this->params = new stdClass();
$this->params->data = $hikashop['data'];
$this->params->table = $hikashop['table'];
$this->params->tab_id = $hikashop['tabid'];
$this->params->column = $hikashop['column'];
if (isset($hikashop['values']) && isset($_POST['data']['values'])) {
foreach ($hikashop['values'] as $key => $value) {
$values[$key] = $value;
}
foreach ($_POST['data']['values'] as $key => $value) {
$values[$key] = $value;
}
} else {
if (isset($hikashop['values'])) {
$values = $hikashop['values'];
} else {
if (isset($_POST['data']['values'])) {
$values = $_POST['data']['values'];
}
}
}
$this->params->values = $values;
$this->params->action[$this->params->table][$this->params->column] = new stdClass();
$this->params->action[$this->params->table][$this->params->column] = $this->params->column;
$this->params->types[$this->params->column] = new stdClass();
$this->params->types[$this->params->column]->type = $hikashop['type'];
if (isset($hikashop['dataid'])) {
if (!isset($this->dispatcher)) {
JPluginHelper::importPlugin('hikashop');
$this->dispatcher = JDispatcher::getInstance();
}
$reload = array();
$this->dispatcher->trigger('onReloadPageMassActionAfterEdition', array(&$reload));
$this->assignRef('reload', $reload);
$this->params->data_id = $hikashop['dataid'];
if (is_array($hikashop['ids'])) {
$this->params->ids = $hikashop['ids'];
} else {
$this->params->ids[] = $hikashop['ids'];
}
$rows = array();
if (isset($reload[$this->params->table][$this->params->column])) {
echo '<script type="text/javascript">
url = \'' . hikashop_completeLink($url, false, true) . '\';
url += \'&cid=\' + document.getElementById(\'cidformmassaction\').value;
window.location = url;
</script>';
return;
}
foreach ($this->params->ids as $id) {
if (isset($this->params->values[$id])) {
$row = $this->_loadResults($this->params->data, $this->params->data_id, $this->params->table, $this->params->column, $hikashop['type'], $id, $this->params->values[$id]);
if (is_array($row)) {
$rows = $row;
break;
} else {
$rows[] = $row;
}
}
}
$table_id = $this->params->table . '_id';
$this->params->ids = array();
echo '<script type="text/javascript">';
foreach ($rows as $row) {
foreach ($this->params->values as $id_replaced => $id) {
if ($id == $row->{$table_id}) {
echo 'modifyLinesData(\'' . $id_replaced . '\',\'' . $this->params->data_id . '\',\'' . $this->params->table . '\',\'' . $row->{$table_id} . '\',\'' . $this->params->tab_id . '\');';
}
}
$this->params->ids[] = $row->{$table_id};
}
echo '</script>';
$currency = hikashop_get('class.currency');
$this->assignRef('currency', $currency);
$table = $this->params->table;
$this->params->elements = array();
if ($table == $this->params->data) {
foreach ($rows as $row) {
$this->params->elements[] = $row;
}
} else {
$this->params->elements[0] = new stdClass();
$this->params->elements[0]->{$table} = $rows;
}
$massaction = hikashop_get('class.massaction');
$this->params = $massaction->sortResult($this->params->table, $this->params);
$this->loadFields($this->params);
} else {
}
}
}