本文整理汇总了PHP中juri类的典型用法代码示例。如果您正苦于以下问题:PHP juri类的具体用法?PHP juri怎么用?PHP juri使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了juri类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayFileHandler
/**
* This displays a media handler. It displays the full and the thumb (icon) of the media.
* It also gives a possibility to upload/change/thumbnail media
*
* @param string $imageArgs html atttributes, Just for displaying the fullsized image
*/
public function displayFileHandler()
{
if (!class_exists('VmHTML')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
}
VmConfig::loadJLang('com_virtuemart_media');
$identify = '';
// ':'.$this->virtuemart_media_id;
if (Permissions::getInstance()->isSuperVendor() > 1) {
$params = JComponentHelper::getParams('com_virtuemart', true);
$max_uploads = $params->get('max_uploads', 1);
if (!$max_uploads) {
return;
}
}
$this->addHiddenByType();
$html = '
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" href="#image_desc_accordion">
' . JText::_('COM_VIRTUEMART_IMAGE_INFORMATION') . '<i class="pull-right icon icon-info-2"></i>
</a>
</div>
<div id="image_desc_accordion" class="accordion-body collapse">
<div class="accordion-inner">
<div class="vm__img_autocrop">
' . $this->displayMediaFull('id="vm_display_image" ', false, '', false) . '
</div>
<div class="row-fluid">
<table class="adminform span6"> ';
if ($this->published || $this->virtuemart_media_id === 0) {
$checked = 1;
} else {
$checked = 0;
}
// The following was removed bacause the check box (publish/unpublish) was not functioning...
// $this->media_published = $this->published;
$html .= VmHTML::row('booleanlist', 'COM_VIRTUEMART_FILES_FORM_FILE_PUBLISHED', 'media_published', $checked);
if (!$this->file_url_thumb) {
$thumbnail = '';
} else {
$thumbnail = 'src="' . juri::root() . $this->file_url_thumb . '"';
}
$html .= VmHTML::row('raw', '<img ' . $thumbnail . ' alt="' . $this->file_meta . '" title="' . $this->file_meta . '" id="vm_thumb_image">', '');
if (!class_exists('Permissions')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php';
}
if (!Permissions::getInstance()->check('admin')) {
$readonly = 'readonly';
} else {
$readonly = '';
}
$html .= $this->displayRow('COM_VIRTUEMART_FILES_FORM_FILE_TITLE', 'file_title');
$html .= $this->displayRow('COM_VIRTUEMART_FILES_FORM_FILE_DESCRIPTION', 'file_description');
$html .= $this->displayRow('COM_VIRTUEMART_FILES_FORM_FILE_META', 'file_meta');
$html .= '</table><table class="span6">';
$html .= $this->displayRow('COM_VIRTUEMART_FILES_FORM_FILE_URL', 'file_url', $readonly);
//remove the file_url_thumb in case it is standard
if (!empty($this->file_url_thumb) and is_a($this, 'VmImage')) {
$file_url_thumb = $this->createThumbFileUrl();
//vmdebug('my displayFileHandler ',$this,$file_url_thumb);
if ($this->file_url_thumb == $file_url_thumb) {
$this->file_url_thumb = JText::sprintf('COM_VIRTUEMART_DEFAULT_URL', $file_url_thumb);
}
}
$html .= $this->displayRow('COM_VIRTUEMART_FILES_FORM_FILE_URL_THUMB', 'file_url_thumb', $readonly);
$this->addMediaAttributesByType();
$html .= '
<tr>
<td class="key">' . JText::_('COM_VIRTUEMART_FILES_FORM_ROLE') . '</td>
<td><fieldset class="checkboxes radio btn-group">' . JHTML::_('select.radiolist', $this->getOptions($this->_mRoles), 'media_roles' . $identify, '', 'value', 'text', $this->media_role) . '</fieldset>
</td>
</tr>';
// $html .= '<tr><td class="key">'.VmHTML::checkbox('file_is_forSale', $this->file_is_forSale);
// $html .= VmHTML::checkbox('file_is_downloadable', $this->file_is_downloadable);
if (!empty($this->file_type)) {
$html .= '
<tr>
<td class="key">' . JText::_('COM_VIRTUEMART_FILES_FORM_LOCATION') . '</td>
<td><fieldset class="checkboxes radio">' . JText::_('COM_VIRTUEMART_FORM_MEDIA_SET_' . strtoupper($this->file_type)) . '</fieldset></td>
</tr>';
} else {
$mediaattribtemp = $this->media_attributes;
if (empty($this->media_attributes)) {
$mediaattribtemp = 'product';
}
$html .= '
<tr>
<td class="key">' . JText::_('COM_VIRTUEMART_FILES_FORM_LOCATION') . '</td>
<td><fieldset class="checkboxes radio btn-group">' . JHTML::_('select.radiolist', $this->getOptions($this->_mLocation), 'media_attributes' . $identify, '', 'value', 'text', $mediaattribtemp) . '</fieldset>
</td>
</tr>';
}
// select language for image
//.........这里部分代码省略.........
示例2: display
function display($tpl = null)
{
if (!class_exists('VirtueMartModelConfig')) {
require VMPATH_ADMIN . 'models/config.php';
}
if (!class_exists('VmHTML')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
}
$model = VmModel::getModel();
$layoutName = $this->getLayout();
$task = vRequest::getCmd('task', $layoutName);
$this->assignRef('task', $task);
$this->user = $user = JFactory::getUser();
if ($layoutName == 'edit') {
$category = $model->getCategory('', false);
// Toolbar
$text = '';
if (isset($category->category_name)) {
$name = $category->category_name;
} else {
$name = '';
}
if (!empty($category->virtuemart_category_id)) {
$text = '<a href="' . juri::root() . 'index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $category->virtuemart_category_id . '" target="_blank" >' . $name . '<span class="vm2-modallink"></span></a>';
}
$this->SetViewTitle('CATEGORY', $text);
$model->addImages($category);
if ($category->virtuemart_category_id > 1) {
$relationInfo = $model->getRelationInfo($category->virtuemart_category_id);
$this->assignRef('relationInfo', $relationInfo);
}
$parent = $model->getParentCategory($category->virtuemart_category_id);
$this->assignRef('parent', $parent);
if (!class_exists('ShopFunctions')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'shopfunctions.php';
}
$templateList = ShopFunctions::renderTemplateList(vmText::_('COM_VIRTUEMART_CATEGORY_TEMPLATE_DEFAULT'));
$this->assignRef('jTemplateList', $templateList);
$categoryLayoutList = VirtueMartModelConfig::getLayoutList('category');
$this->assignRef('categoryLayouts', $categoryLayoutList);
$productLayouts = VirtueMartModelConfig::getLayoutList('productdetails');
$this->assignRef('productLayouts', $productLayouts);
//Nice fix by Joe, the 4. param prevents setting an category itself as child
$categorylist = ShopFunctions::categoryListTree(array($parent->virtuemart_category_id), 0, 0, (array) $category->virtuemart_category_id);
if (Vmconfig::get('multix', 'none') !== 'none') {
$vendorList = ShopFunctions::renderVendorList($category->virtuemart_vendor_id, false);
$this->assignRef('vendorList', $vendorList);
}
$this->assignRef('category', $category);
$this->assignRef('categorylist', $categorylist);
$this->addStandardEditViewCommands($category->virtuemart_category_id, $category);
} else {
$this->SetViewTitle('CATEGORY_S');
$keyWord = '';
$this->assignRef('catmodel', $model);
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model, 'category_name');
$categories = $model->getCategoryTree(0, 0, false, $this->lists['search']);
$this->assignRef('categories', $categories);
$pagination = $model->getPagination();
$this->assignRef('catpagination', $pagination);
//we need a function of the FE shopfunctions helper to cut the category descriptions
if (!class_exists('shopFunctionsF')) {
require VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
}
}
parent::display($tpl);
}
示例3: fullPaths
private function fullPaths($data)
{
$this->Creator .= ' ' . $this->jdoc->engineName;
$header = $footer = '';
if (!strpos($data, 'html>')) {
$full = juri::root();
$short = juri::root(true) . '/';
if (!empty($this->jdoc->header_title)) {
$title = $this->jdoc->header_title;
} else {
$title = $this->jdoc->title;
}
$langTag = JFactory::getLanguage()->getTag();
// missing header create it
$header = '
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . $langTag . '" lang="' . $langTag . '" dir="' . $this->directionality . '">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>' . $title . '</title>
<meta name="title" content="' . $title . '" />
<meta name="generator" content="' . $this->Creator . '" />
<meta name="description" content="' . $this->Subject . '" />
<meta name="keywords" content="' . $this->Keywords . '" />';
// add scripts
// foreach ($this->jdoc->_scripts as $src => $script) {
// if ($src[1] === "/" ) $src = str_replace($short, $full, $src);
// $header.='<script src="'.$src.'" type="'.$script['mime'].'"></script>';
// }
// add css
foreach ($this->jdoc->_styleSheets as $src => $css) {
// relative to absolute path
$pos = strpos($src, $short);
if ($pos === 0) {
$src = str_replace($short, $full, $src);
}
// relative path with missing joomla root
$pos = strpos($src, '//');
if ($pos === false) {
$src = $full . $src;
}
$header .= '<link rel="stylesheet" href="' . $src . '" type="' . $css['mime'] . '">';
}
$header .= '</head>';
$footer = '</html>';
//public 'HTMLHeader' => string '<h1>Amazon Kindle Fire HD 8,9</h1>' (length=34)
if (!strpos($data, 'body>')) {
// add renderengine class to body
$header .= '<body class="' . $this->jdoc->engineName . '">';
$footer = '</body>' . $footer;
}
}
if (!empty($this->HTMLHeader)) {
// $logo_height = $this->jdoc->params->get('logo_height',48);
// $header .='
// <style>
// #HTMLHeader { position: fixed; padding-left:'.$this->jdoc->_margin_left.'mm; padding-right:'.$this->jdoc->_margin_right.'mm; padding-top:'.$this->jdoc->_margin_header.'mm; left: 0px; top: 0px; right: 0px; height: 30px; text-align: right;}
// #HTMLHeader h1{margin:0px}
// #HTMLHeader img{ position: fixed; padding-left:'.$this->jdoc->_margin_left.'mm; padding-right:'.$this->jdoc->_margin_right.'mm; padding-top:'.$this->jdoc->_margin_header.'mm; left: 0px; top: 0px; right: 0px; height: '.$logo_height.'px;}
// </style>
// ';
// $header .= '<div id="HTMLHeader">'.$this->HTMLHeader.'</div>' ;
}
if (!empty($this->HTMLfooter)) {
//@page { margin: 180px 50px; }
$header .= '<div id="HTMLfooter">' . $this->HTMLfooter . '</div>';
} else {
$siteUrl = JURI::getInstance()->toString();
$siteUrl = str_replace("format=pdf", "", $siteUrl);
$app = JFactory::getApplication();
$title = $app->getCfg('sitename') . ' - ' . $this->Title;
$path = dirname(__FILE__) . DIRECTORY_SEPARATOR;
if (file_exists($path . 'header.html')) {
$this->setOptions(array('header-html' => $path . 'header.html'));
}
// $date =& JFactory::getDate();
// $jDate = JHTML::_('date',$date,JText::_('DATE_FORMAT_LC3'));
// $header .='
// <style>
// .pdf-footer,#HTMLPages { position: fixed; padding-left:'.$this->jdoc->_margin_left.'mm; padding-right:'.$this->jdoc->_margin_right.'mm; padding-top:'.$this->jdoc->_margin_footer.'mm; bottom: -10px; height: 40px; text-align: left;}
// </style>
// ';
// $header .= '<div class="pdf-footer" style="left:'.$this->jdoc->_margin_left.'mm"><a href="'.$siteUrl.'">'.$title.'</a>
// <div id="HTMLPages" style="right:'.$this->jdoc->_margin_right.'mm">Page <span id="page_current">page</span> of <span id="page_count">toPage]</span></div></div>
// <script>
// var pdfInfo = {};
// var x = document.location.search.substring(1).split("&");
// for (var i in x) { var z = x[i].split("=",2); pdfInfo[z[0]] = unescape(z[1]); }
// function getPdfInfo() {
// var page = pdfInfo.page || 1;
// var pageCount = pdfInfo.topage || 1;
// document.getElementById("page_current").textContent = page;
// document.getElementById("page_count").textContent = pageCount;
// }
// </script> ';
}
// $options= array();
// $option['header-right']= '""Page [page] of [toPage]""';
// $option['footer-right']= '""[date]""';
// $option[1]= 'grayscale';
// $this->setOptions($option);
//.........这里部分代码省略.........
示例4: displayProductCustomfieldBE
//.........这里部分代码省略.........
case 'B':
return JHTML::_('select.booleanlist', 'field[' . $row . '][custom_value]', 'class="inputbox"', $field->custom_value) . '</td><td>' . $priceInput;
break;
/* parent */
/* parent */
case 'P':
return $field->custom_value . '<input type="hidden" value="' . $field->custom_value . '" name="field[' . $row . '][custom_value]" /></td><td>';
break;
/* related category*/
/* related category*/
case 'Z':
if (!$field->custom_value) {
return '';
}
// special case it's category ID !
$q = 'SELECT * FROM `#__virtuemart_categories_' . VMLANG . '` JOIN `#__virtuemart_categories` AS p using (`virtuemart_category_id`) WHERE `published`=1 AND `virtuemart_category_id`= "' . (int) $field->custom_value . '" ';
$this->_db->setQuery($q);
//echo $this->_db->_sql;
if ($category = $this->_db->loadObject()) {
$q = 'SELECT `virtuemart_media_id` FROM `#__virtuemart_category_medias` WHERE `virtuemart_category_id`= "' . (int) $field->custom_value . '" ';
$this->_db->setQuery($q);
$thumb = '';
if ($media_id = $this->_db->loadResult()) {
$thumb = $this->displayCustomMedia($media_id, 'category');
}
$display = '<input type="hidden" value="' . $field->custom_value . '" name="field[' . $row . '][custom_value]" />';
return $display . JHTML::link(JRoute::_('index.php?option=com_virtuemart&view=category&task=edit&virtuemart_category_id=' . (int) $field->custom_value, FALSE), $thumb . ' ' . $category->category_name, array('title' => $category->category_name)) . $display;
} else {
return 'no result/unpublished';
}
/* related product*/
/* related product*/
case 'R':
/* product kit(bundle)*/
/* product kit(bundle)*/
case 'K':
if (!$field->custom_value) {
return '';
}
$param = json_decode($field->custom_param);
if (!empty($param->is_hidden)) {
$isHidden = 1;
} else {
$isHidden = 0;
}
$pModel = VmModel::getModel('product');
$related = $pModel->getProduct((int) $field->custom_value, FALSE, FALSE, FALSE, 1, FALSE);
$thumb = '';
if (!empty($related->virtuemart_media_id[0])) {
$thumb = $this->displayCustomMedia($related->virtuemart_media_id[0]) . ' ';
} else {
$thumb = $this->displayCustomMedia(0) . ' ';
}
$display = '<input type="hidden" value="' . $field->custom_value . '" name="field[' . $row . '][custom_value]" />';
$display .= JHTML::link(juri::root() . 'index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $related->virtuemart_product_id . '&virtuemart_category_id=' . $related->virtuemart_category_id, $thumb . $related->product_name, array('title' => $related->product_name, 'target' => 'blank'));
$display .= JText::_('COM_VIRTUEMART_CUSTOM_IS_HIDDEN') . ' ' . VmHTML::checkbox('custom_param[' . $row . '][is_hidden]', $isHidden, 1, 0, '');
return $display;
break;
/* image */
/* image */
case 'M':
if (empty($product)) {
$vendorId = 1;
} else {
$vendorId = $product->virtuemart_vendor_id;
}
$q = 'SELECT `virtuemart_media_id` as value,`file_title` as text FROM `#__virtuemart_medias` WHERE `published`=1
AND (`virtuemart_vendor_id`= "' . $vendorId . '" OR `shared` = "1")';
$this->_db->setQuery($q);
$options = $this->_db->loadObjectList();
return JHTML::_('select.genericlist', $options, 'field[' . $row . '][custom_value]', '', 'value', 'text', $field->custom_value) . '</td><td>' . $priceInput;
break;
/* Child product Group */
/* Child product Group */
case 'G':
break;
/* Child product */
/* case 'C':
if (empty($product)){
$virtuemart_product_id = JRequest::getInt('virtuemart_product_id', 0);
} else {
$virtuemart_product_id = $product->virtuemart_product_id;
}
$html = '';
$q='SELECT concat(`product_sku`,":",`product_name`) as text ,`virtuemart_product_id`,`product_in_stock` FROM `#__virtuemart_products` WHERE `published`=1
AND `virtuemart_product_id`= "'.$field->custom_value.'"';
//$db->setQuery(' SELECT virtuemart_product_id, product_name FROM `#__virtuemart_products` WHERE `product_parent_id` ='.(int)$product_id);
$this->_db->setQuery($q);
if ($child = $this->_db->loadObject()) {
$html .= JHTML::link ( JRoute::_ ( 'index.php?option=com_virtuemart&view=product&task=edit&virtuemart_product_id='.$field->custom_value), $child->text.' ('.$field->custom_value.')', array ('title' => $child->text ));
$html .= ' '.JText::_('COM_VIRTUEMART_PRODUCT_FORM_IN_STOCK').':'.$child->product_in_stock ;
$html .= '<input type="hidden" value="'.$child->virtuemart_product_id.'" name="field['.$row.'][custom_value]" /></div><div>'.$priceInput;
return $html;
// return '<input type="text" value="'.$field->custom_value.'" name="field['.$row.'][custom_value]" />';
}
else return JText::_('COM_VIRTUEMART_CUSTOM_NO_CHILD_PRODUCT');
break;*/
}
}
}
示例5: display
function display($tpl = null)
{
// Get the task
$task = JRequest::getWord('task', $this->getLayout());
vmdebug('VirtuemartViewProduct ' . $task);
$this->task = $task;
// Load helpers
$this->loadHelper('currencydisplay');
$this->loadHelper('html');
$this->loadHelper('image');
$model = VmModel::getModel();
// Handle any publish/unpublish
switch ($task) {
case 'add':
case 'edit':
VmConfig::loadJLang('com_virtuemart_orders', TRUE);
VmConfig::loadJLang('com_virtuemart_shoppers', TRUE);
$this->jsonPath = JFactory::getApplication()->isSite() ? juri::root() : '';
$virtuemart_product_id = JRequest::getVar('virtuemart_product_id', array());
if (is_array($virtuemart_product_id) && count($virtuemart_product_id) > 0) {
$virtuemart_product_id = (int) $virtuemart_product_id[0];
} else {
$virtuemart_product_id = (int) $virtuemart_product_id;
}
$product = $model->getProductSingle($virtuemart_product_id, false);
$product_parent = $model->getProductParent($product->product_parent_id);
$mf_model = VmModel::getModel('manufacturer');
$manufacturers = $mf_model->getManufacturerDropdown($product->virtuemart_manufacturer_id);
$this->manufacturers = $manufacturers;
// set category in front edit link
if ($task == 'add') {
if ($category_id = jRequest::getInt('virtuemart_category_id', 0)) {
$product->categories = array($category_id);
}
}
// Get the category tree
if (isset($product->categories)) {
$this->category_tree = ShopFunctions::categoryListTree($product->categories);
} else {
$this->category_tree = ShopFunctions::categoryListTree();
}
//Get the shoppergoup list - Cleanshooter Custom Shopper Visibility
if (isset($product->shoppergroups)) {
$this->shoppergroupList = ShopFunctions::renderShopperGroupList($product->shoppergroups);
} else {
$this->shoppergroupList = '';
}
// Load the product price
$this->loadHelper('calculationh');
$product_childIds = $model->getProductChildIds($virtuemart_product_id);
$product_childs = array();
foreach ($product_childIds as $id) {
$product_childs[] = $model->getProductSingle($id, false);
}
$this->assignRef('product_childs', $product_childs);
JLoader::register('VirtueMartModelConfig', JPATH_VM_ADMINISTRATOR . '/models/config.php');
$this->productLayouts = VirtueMartModelConfig::getLayoutList('productdetails', $product->layout);
// Load Images
$model->addImages($product);
if (is_Dir(VmConfig::get('vmtemplate') . DS . 'images' . DS . 'availability' . DS)) {
$imagePath = VmConfig::get('vmtemplate') . '/images/availability/';
} else {
$imagePath = '/components/com_virtuemart/assets/images/availability/';
}
$this->imagePath = $imagePath;
// Load the vendors
$vendor_model = VmModel::getModel('vendor');
if (Vmconfig::get('multix', 'none') !== 'none') {
if ($task == 'add') {
$vendor_id = $this->adminVendor;
} else {
$vendor_id = $product->virtuemart_vendor_id;
}
$lists['vendors'] = Shopfunctions::renderVendorList($vendor_id);
}
// Load the currencies
$currency_model = VmModel::getModel('currency');
$this->loadHelper('permissions');
$vendor_model->setId(Permissions::getInstance()->isSuperVendor());
$vendor = $vendor_model->getVendor();
if (empty($product->product_currency)) {
$product->product_currency = $vendor->vendor_currency;
}
//STUDIO42 fix for currency, old method set 2 time same currency symbol
// TODO verify all others
$currencyModel = VmModel::getModel('currency');
$currencyModel->setId($vendor->vendor_currency);
$currency = $currencyModel->getData();
$this->vendor_currency = $currency->currency_symbol;
$currencyModel->setId($product->product_currency);
$currency = $currencyModel->getData();
$this->product_currency = $currency->currency_symbol;
if (count($manufacturers) > 0) {
$lists['manufacturers'] = JHTML::_('select.genericlist', $manufacturers, 'virtuemart_manufacturer_id', 'class="inputbox"', 'value', 'text', $product->virtuemart_manufacturer_id);
}
$lists['product_weight_uom'] = ShopFunctions::renderWeightUnitList('product_weight_uom', $task == 'add' ? VmConfig::get('weight_unit_default') : $product->product_weight_uom);
$lists['product_iso_uom'] = ShopFunctions::renderUnitIsoList('product_unit', $task == 'add' ? VmConfig::get('weight_unit_default') : $product->product_unit);
$lists['product_lwh_uom'] = ShopFunctions::renderLWHUnitList('product_lwh_uom', $task == 'add' ? VmConfig::get('lwh_unit_default') : $product->product_lwh_uom);
if (empty($product->product_available_date)) {
$product->product_available_date = date("Y-m-d");
//.........这里部分代码省略.........
示例6: display
//.........这里部分代码省略.........
require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmcountries.php';
$product->list_tsmart_country_id = tsmcountries::get_list_tsmart_country_id_by_tour_id($product->tsmart_product_id);
//end get list group size
require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmprice.php';
$this->list_price_type = vmprice::get_list_price_type();
require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmproduct.php';
$this->list_tour_method = vmproduct::get_list_tour_method();
$this->assignRef('product', $product);
$this->assignRef('product_parent', $product_parent);
/* Assign label values */
$this->assignRef('action', $action);
$this->assignRef('info_label', $info_label);
$this->assignRef('status_label', $status_label);
$this->assignRef('dim_weight_label', $dim_weight_label);
$this->assignRef('images_label', $images_label);
$this->assignRef('delete_message', $delete_message);
$this->assignRef('lists', $lists);
// Toolbar
if ($product->product_sku) {
$sku = ' (' . $product->product_sku . ')';
} else {
$sku = "";
}
//if (!empty($product->canonCatLink)) $canonLink = '&tsmart_category_id=' . $product->canonCatLink; else $canonLink = '';
if (!empty($product->tsmart_product_id)) {
if (!class_exists('shopFunctionsF')) {
require VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
}
$menuItemID = shopFunctionsF::getMenuItemId(JFactory::getLanguage()->getTag());
$canonLink = '';
if ($product->canonCatId) {
$canonLink = '&tsmart_category_id=' . $product->canonCatId;
}
$text = '<a href="' . juri::root() . 'index.php?option=com_tsmart&view=productdetails&tsmart_product_id=' . $product->tsmart_product_id . $canonLink . '&Itemid=' . $menuItemID . '" target="_blank" >' . $product->product_name . $sku . '<span class="vm2-modallink"></span></a>';
if (JFactory::getApplication()->isSite()) {
$bar = JToolBar::getInstance('toolbar');
$bar->appendButton('Link', 'back', 'com_tsmart_LEAVE_TO_PRODUCT', juri::root() . 'index.php?option=com_tsmart&view=productdetails&tsmart_product_id=' . $product->tsmart_product_id . $canonLink . '&Itemid=' . $menuItemID);
}
} else {
$text = $product->product_name . $sku;
}
$this->SetViewTitle('PRODUCT', $text);
$this->addStandardEditViewCommandsNoValidate($product->tsmart_product_id);
break;
case 'massxref_cats':
case 'massxref_cats_exe':
$this->SetViewTitle('PRODUCT_MASSXREF');
$showVendors = $this->showVendors();
$this->assignRef('showVendors', $showVendors);
$keyWord = '';
$catmodel = tmsModel::getModel('category');
$this->assignRef('catmodel', $catmodel);
$this->addStandardDefaultViewCommandsNoValidate();
$this->addStandardDefaultViewLists($catmodel, 'category_name');
$session = JFactory::getSession();
$reset = $session->get('reset_pag', false, 'vm');
$limit = '';
if ($reset) {
$limit = 0;
$session->set('reset_pag', false, 'vm');
}
$this->categories = $catmodel->getCategoryTree(0, 0, false, $this->lists['search'], $limit);
$catpagination = $catmodel->getPagination();
$this->assignRef('catpagination', $catpagination);
$this->setLayout('massxref');
JToolBarHelper::custom('massxref_cats_exe', 'new', 'new', tsmText::_('com_tsmart_PRODUCT_XREF_CAT_EXE'), false);
示例7: display
//.........这里部分代码省略.........
$status_label = JText::_('COM_VIRTUEMART_PRODUCT_FORM_PRODUCT_STATUS_LBL');
$dim_weight_label = JText::_('COM_VIRTUEMART_PRODUCT_FORM_PRODUCT_DIM_WEIGHT_LBL');
$images_label = JText::_('COM_VIRTUEMART_PRODUCT_FORM_PRODUCT_IMAGES_LBL');
$delete_message = JText::_('COM_VIRTUEMART_PRODUCT_FORM_DELETE_PRODUCT_MSG');
}
$config = JFactory::getConfig();
$tzoffset = $config->getValue('config.offset');
$this->assignRef('tzoffset', $tzoffset);
// Assign the values
$this->assignRef('pane', $pane);
$this->assignRef('editor', $editor);
$this->assignRef('product', $product);
$this->assignRef('currencies', $currencies);
//no need moved to top $this->assignRef('manufacturers', $manufacturers);
$this->assignRef('related_products', $related_products);
$this->assignRef('product_parent', $product_parent);
/* Assign label values */
$this->assignRef('action', $action);
$this->assignRef('info_label', $info_label);
$this->assignRef('status_label', $status_label);
$this->assignRef('dim_weight_label', $dim_weight_label);
$this->assignRef('images_label', $images_label);
$this->assignRef('delete_message', $delete_message);
$this->assignRef('lists', $lists);
// Toolbar
$text = "";
if ($task == 'edit') {
if ($product->product_sku) {
$sku = ' (' . $product->product_sku . ')';
} else {
$sku = "";
}
if (!empty($product->virtuemart_product_id)) {
$text = '<a href="' . juri::root() . 'index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $product->virtuemart_product_id . '" target="_blank" >' . $product->product_name . $sku . '<span class="vm2-modallink"></span></a>';
} else {
$text = $product->product_name . $sku;
}
}
$this->SetViewTitle('PRODUCT', $text);
//JToolBarHelper::custom('sentproductemailtocustomer', 'email_32', 'email_32', 'COM_VIRTUEMART_PRODUCT_EMAILTOSHOPPER' ,false);
$this->addStandardEditViewCommands($product->virtuemart_product_id);
break;
default:
if ($product_parent_id = JRequest::getInt('product_parent_id', false)) {
$product_parent = $model->getProduct($product_parent_id);
$title = 'PRODUCT_CHILDREN_LIST';
$link_to_parent = JHTML::_('link', JRoute::_('index.php?view=product&task=edit&virtuemart_product_id=' . $product_parent->virtuemart_product_id . '&option=com_virtuemart'), $product_parent->product_name, array('title' => JText::_('COM_VIRTUEMART_EDIT_PARENT') . ' ' . $product_parent->product_name));
$msg = JText::_('COM_VIRTUEMART_PRODUCT_OF') . " " . $link_to_parent;
} else {
$title = 'PRODUCT';
$msg = "";
}
$this->db = JFactory::getDBO();
$this->SetViewTitle($title, $msg);
$this->addStandardDefaultViewLists($model, 'created_on');
/* Get the list of products */
$productlist = $model->getProductListing(false, false, false, false, true);
//The pagination must now always set AFTER the model load the listing
$pagination = $model->getPagination();
$this->assignRef('pagination', $pagination);
/* Get the category tree */
$categoryId = $model->virtuemart_category_id;
//OSP switched to filter in model, was JRequest::getInt('virtuemart_category_id');
$category_tree = ShopFunctions::categoryListTree(array($categoryId));
$this->assignRef('category_tree', $category_tree);
// Check for Media Items and Reviews, set the price
示例8: display
public function display($tpl = null)
{
$mainframe = JFactory::getApplication();
$pathway = $mainframe->getPathway();
$task = JRequest::getWord('task', 'list');
$layoutName = JRequest::getWord('layout', 'list');
$this->setLayout($layoutName);
$_currentUser = JFactory::getUser();
$document = JFactory::getDocument();
if (!empty($tpl)) {
$format = $tpl;
} else {
$format = JRequest::getWord('format', 'html');
}
$this->assignRef('format', $format);
if ($format == 'pdf') {
$document->setTitle(JText::_('COM_VIRTUEMART_INVOICE'));
//PDF needs more RAM than usual
VmConfig::ensureMemoryLimit(96);
} else {
if ($layoutName == 'details') {
$document->setTitle(JText::_('COM_VIRTUEMART_ACC_ORDER_INFO'));
$pathway->additem(JText::_('COM_VIRTUEMART_ACC_ORDER_INFO'));
} else {
$document->setTitle(JText::_('COM_VIRTUEMART_ORDERS_VIEW_DEFAULT_TITLE'));
$pathway->additem(JText::_('COM_VIRTUEMART_ORDERS_VIEW_DEFAULT_TITLE'));
}
}
$orderModel = VmModel::getModel('orders');
if ($layoutName == 'details') {
$order_list_link = FALSE;
$order_list_link = JRoute::_('index.php?option=com_virtuemart&view=orders&layout=list', FALSE);
$this->assignRef('order_list_link', $order_list_link);
$orderDetails = $orderModel->getMyOrderDetails();
if (!$orderDetails or empty($orderDetails['details'])) {
echo JText::_('COM_VIRTUEMART_ORDER_NOTFOUND');
return;
}
$userFieldsModel = VmModel::getModel('userfields');
$_userFields = $userFieldsModel->getUserFields('account', array('captcha' => true, 'delimiters' => true), array('delimiter_userinfo', 'user_is_vendor', 'username', 'password', 'password2', 'agreed', 'address_type'));
$orderbt = $orderDetails['details']['BT'];
$orderst = array_key_exists('ST', $orderDetails['details']) ? $orderDetails['details']['ST'] : $orderbt;
$userfields = $userFieldsModel->getUserFieldsFilled($_userFields, $orderbt);
$_userFields = $userFieldsModel->getUserFields('shipment', array(), array('delimiter_userinfo', 'username', 'email', 'password', 'password2', 'agreed', 'address_type'));
$shipmentfields = $userFieldsModel->getUserFieldsFilled($_userFields, $orderst);
$shipment_name = '';
if (!class_exists('vmPSPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
}
JPluginHelper::importPlugin('vmshipment');
$dispatcher = JDispatcher::getInstance();
$returnValues = $dispatcher->trigger('plgVmOnShowOrderFEShipment', array($orderDetails['details']['BT']->virtuemart_order_id, $orderDetails['details']['BT']->virtuemart_shipmentmethod_id, &$shipment_name));
$payment_name = '';
if (!class_exists('vmPSPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
}
JPluginHelper::importPlugin('vmpayment');
$dispatcher = JDispatcher::getInstance();
$returnValues = $dispatcher->trigger('plgVmOnShowOrderFEPayment', array($orderDetails['details']['BT']->virtuemart_order_id, $orderDetails['details']['BT']->virtuemart_paymentmethod_id, &$payment_name));
if ($format == 'pdf') {
$invoiceNumberDate = array();
$return = $orderModel->createInvoiceNumber($orderDetails['details']['BT'], $invoiceNumberDate);
if (empty($invoiceNumberDate)) {
$invoiceNumberDate[0] = 'no invoice number accessible';
$invoiceNumberDate[1] = 'no invoice date accessible';
}
$this->assignRef('invoiceNumber', $invoiceNumberDate[0]);
$this->assignRef('invoiceDate', $invoiceNumberDate[1]);
}
$this->assignRef('userfields', $userfields);
$this->assignRef('shipmentfields', $shipmentfields);
$this->assignRef('shipment_name', $shipment_name);
$this->assignRef('payment_name', $payment_name);
$this->assignRef('orderdetails', $orderDetails);
if ($_currentUser->guest) {
$details_url = juri::root() . 'index.php?option=com_virtuemart&view=orders&layout=details&tmpl=component&order_pass=' . JRequest::getString('order_pass', false) . '&order_number=' . JRequest::getString('order_number', false);
} else {
$details_url = juri::root() . 'index.php?option=com_virtuemart&view=orders&layout=details&tmpl=component&virtuemart_order_id=' . $this->orderdetails['details']['BT']->virtuemart_order_id;
}
$this->assignRef('details_url', $details_url);
$tmpl = JRequest::getWord('tmpl');
$print = false;
if ($tmpl) {
$print = true;
}
$this->prepareVendor();
$this->assignRef('print', $print);
$vendorId = 1;
$emailCurrencyId = $orderDetails['details']['BT']->user_currency_id;
$exchangeRate = FALSE;
if (!class_exists('vmPSPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
}
JPluginHelper::importPlugin('vmpayment');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('plgVmgetEmailCurrency', array($orderDetails['details']['BT']->virtuemart_paymentmethod_id, $orderDetails['details']['BT']->virtuemart_order_id, &$emailCurrencyId));
if (!class_exists('CurrencyDisplay')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'currencydisplay.php';
}
$currency = CurrencyDisplay::getInstance($emailCurrencyId, $vendorId);
//.........这里部分代码省略.........
示例9: defined
* @license GNU General Public License version 2 or later; see _LICENSE.php
**/
// No Direct Access
defined('_JEXEC') or die;
// -- Initialize
require_once dirname(__FILE__) . DS . 'config.php';
$cck = CCK_Rendering::getInstance($this->template);
if ($cck->initialize() === false) {
return;
}
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$doc->addStyleSheet(juri::base(TRUE) . "/templates/seblod_slider_nivo/css/default.css");
$doc->addStyleSheet(juri::base(TRUE) . "/templates/seblod_slider_nivo/css/nivo-slider.css");
$doc->addScript(juri::base(TRUE) . "/templates/seblod_slider_nivo/js/jquery-1.7.1.min.js");
$doc->addScript(juri::base(TRUE) . "/templates/seblod_slider_nivo/js/jquery.nivo.slider.pack.js");
// -- Render
?>
<div class="slider-wrapper theme-default">
<div class="ribbon"></div>
<div id="slider" class="nivoSlider">
<?php
$items = $cck->getItems();
$captionCount = 1;
foreach ($items as $item) {
$img = $item->getThumb1('art_image_fulltext');
$imgAlt = $item->getValue('art_title');
$captionId = "#caption" . $captionCount;
echo '<img src="' . $img . '" alt="' . $imgAlt . '" title="' . $captionId . '"/>';
$captionCount++;
示例10: defined
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* @version $Id: product_edit.php 6347 2012-08-14 15:49:02Z Milbo $
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
AdminUIHelper::startAdminArea();
$document = JFactory::getDocument();
vmJsApi::JvalideForm();
$this->editor = JFactory::getEditor();
?>
<form method="post" name="adminForm" action="<?php
echo juri::current();
?>
" enctype="multipart/form-data" id="adminForm">
<?php
// Loading Templates in Tabs
$tabarray = array();
$tabarray['information'] = 'COM_VIRTUEMART_PRODUCT_FORM_PRODUCT_INFO_LBL';
$tabarray['description'] = 'COM_VIRTUEMART_PRODUCT_FORM_DESCRIPTION';
if (VmConfig::get('show_product_statut_tab', 1)) {
$tabarray['status'] = 'COM_VIRTUEMART_PRODUCT_FORM_PRODUCT_STATUS_LBL';
}
if (VmConfig::get('show_product_dim_weight_tab', 1)) {
$tabarray['dimensions'] = 'COM_VIRTUEMART_PRODUCT_FORM_PRODUCT_DIM_WEIGHT_LBL';
}
$tabarray['images'] = 'COM_VIRTUEMART_PRODUCT_FORM_PRODUCT_IMAGES_LBL';
示例11: rand
$print_link .= '<span class="hasTip print_32" title="' . tsmText::_('com_tsmart_PRINT') . '"> </span></a>';
$invoice_link = '';
$deliverynote_link = '';
$pdfDummi = '&d=' . rand(0, 100);
if (!$order->invoiceNumber) {
$invoice_url = juri::root() . 'index.php?option=com_tsmart&view=invoice&layout=invoice&format=pdf&tsmart_order_id=' . $order->tsmart_order_id . '&order_number=' . $order->order_number . '&order_pass=' . $order->order_pass . '&create_invoice=' . $order->order_create_invoice_pass . $pdfDummi;
$invoice_link .= "<a href=\"{$invoice_url}\" >" . '<span class="hasTip invoicenew_32" title="' . tsmText::_('com_tsmart_INVOICE_CREATE') . '"></span></a>';
} elseif (!shopFunctions::InvoiceNumberReserved($order->invoiceNumber)) {
$invoice_url = juri::root() . 'index.php?option=com_tsmart&view=invoice&layout=invoice&format=pdf&tsmart_order_id=' . $order->tsmart_order_id . '&order_number=' . $order->order_number . '&order_pass=' . $order->order_pass . $pdfDummi;
$invoice_link = "<a href=\"{$invoice_url}\" >" . '<span class="hasTip invoice_32" title="' . tsmText::_('com_tsmart_INVOICE') . '"></span></a>';
}
if (!$order->invoiceNumber) {
$deliverynote_url = juri::root() . 'index.php?option=com_tsmart&view=invoice&layout=deliverynote&format=pdf&tsmart_order_id=' . $order->tsmart_order_id . '&order_number=' . $order->order_number . '&order_pass=' . $order->order_pass . '&create_invoice=' . $order->order_create_invoice_pass . $pdfDummi;
$deliverynote_link = "<a href=\"{$deliverynote_url}\" >" . '<span class="hasTip deliverynotenew_32" title="' . tsmText::_('com_tsmart_DELIVERYNOTE_CREATE') . '"></span></a>';
} elseif (!shopFunctions::InvoiceNumberReserved($order->invoiceNumber)) {
$deliverynote_url = juri::root() . 'index.php?option=com_tsmart&view=invoice&layout=deliverynote&format=pdf&tsmart_order_id=' . $order->tsmart_order_id . '&order_number=' . $order->order_number . '&order_pass=' . $order->order_pass . $pdfDummi;
$deliverynote_link = "<a href=\"{$deliverynote_url}\" >" . '<span class="hasTip deliverynote_32" title="' . tsmText::_('com_tsmart_DELIVERYNOTE') . '"></span></a>';
}
?>
<td><?php
echo $print_link;
echo $deliverynote_link;
echo $invoice_link;
?>
</td>
<!-- Order date -->
<td><?php
echo vmJsApi::date($order->created_on, 'LC2', TRUE);
?>
</td>
<!-- Last modified -->
示例12: createPrintLinks
function createPrintLinks($order, &$print_link, &$deliverynote_link, &$invoice_link)
{
/* Print view URL */
$print_url = juri::root() . 'index.php?option=com_virtuemart&view=invoice&layout=invoice&tmpl=component&virtuemart_order_id=' . $order->virtuemart_order_id . '&order_number=' . $order->order_number . '&order_pass=' . $order->order_pass;
$print_link = "<a href=\"javascript:void window.open('{$print_url}', 'win2', 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no');\" >";
$print_link .= '<span class="hasTip print_32" title="' . vmText::_('COM_VIRTUEMART_PRINT') . '"> </span></a>';
$invoice_link = '';
$deliverynote_link = '';
$pdfDummi = '&d=' . rand(0, 100);
if (!$order->invoiceNumber) {
$invoice_url = juri::root() . 'index.php?option=com_virtuemart&view=invoice&layout=invoice&format=pdf&tmpl=component&virtuemart_order_id=' . $order->virtuemart_order_id . '&order_number=' . $order->order_number . '&order_pass=' . $order->order_pass . '&create_invoice=' . $order->order_create_invoice_pass . $pdfDummi;
$invoice_link .= "<a href=\"{$invoice_url}\" >" . '<span class="hasTip invoicenew_32" title="' . vmText::_('COM_VIRTUEMART_INVOICE_CREATE') . '"></span></a>';
} elseif (!shopFunctions::InvoiceNumberReserved($order->invoiceNumber)) {
$invoice_url = juri::root() . 'index.php?option=com_virtuemart&view=invoice&layout=invoice&format=pdf&tmpl=component&virtuemart_order_id=' . $order->virtuemart_order_id . '&order_number=' . $order->order_number . '&order_pass=' . $order->order_pass . $pdfDummi;
$invoice_link = "<a href=\"{$invoice_url}\" >" . '<span class="hasTip invoice_32" title="' . vmText::_('COM_VIRTUEMART_INVOICE') . '"></span></a>';
}
if (!$order->invoiceNumber) {
$deliverynote_url = juri::root() . 'index.php?option=com_virtuemart&view=invoice&layout=deliverynote&format=pdf&tmpl=component&virtuemart_order_id=' . $order->virtuemart_order_id . '&order_number=' . $order->order_number . '&order_pass=' . $order->order_pass . '&create_invoice=' . $order->order_create_invoice_pass . $pdfDummi;
$deliverynote_link = "<a href=\"{$deliverynote_url}\" >" . '<span class="hasTip deliverynotenew_32" title="' . vmText::_('COM_VIRTUEMART_DELIVERYNOTE_CREATE') . '"></span></a>';
} elseif (!shopFunctions::InvoiceNumberReserved($order->invoiceNumber)) {
$deliverynote_url = juri::root() . 'index.php?option=com_virtuemart&view=invoice&layout=deliverynote&format=pdf&tmpl=component&virtuemart_order_id=' . $order->virtuemart_order_id . '&order_number=' . $order->order_number . '&order_pass=' . $order->order_pass . $pdfDummi;
$deliverynote_link = "<a href=\"{$deliverynote_url}\" >" . '<span class="hasTip deliverynote_32" title="' . vmText::_('COM_VIRTUEMART_DELIVERYNOTE') . '"></span></a>';
}
}
示例13:
?>
</div>
<?php
echo $this->vendor->vendor_legal_info;
?>
</body>
<?php
} else {
?>
<h1><?php
echo JText::_('COM_VIRTUEMART_ACC_ORDER_INFO');
?>
<?php
/* Print view URL */
$details_url = juri::root() . 'index.php?option=com_virtuemart&view=orders&layout=details&tmpl=component&virtuemart_order_id=' . $this->orderdetails['details']['BT']->virtuemart_order_id;
$details_link = "<a href=\"javascript:void window.open('{$details_url}', 'win2', 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no');\" >";
//$details_link .= '<span class="hasTip print_32" title="' . JText::_('COM_VIRTUEMART_PRINT') . '"> </span></a>';
$button = JVM_VERSION == 1 ? '/images/M_images/printButton.png' : 'system/printButton.png';
$details_link .= JHtml::_('image', $button, JText::_('COM_VIRTUEMART_PRINT'), NULL, true);
$details_link .= '</a>';
echo $details_link;
?>
</h1>
<?php
if ($this->order_list_link) {
?>
<div class='spaceStyle'>
<div class="floatright">
<a href="<?php
echo $this->order_list_link;
示例14: getUrlComponent
/**
*
* get component url - site side
*
*/
public static function getUrlComponent($args, $component = "")
{
if (empty($component)) {
$component = self::$componentName;
}
$url = juri::root() . "index.php?option=" . $component . "&" . $args;
return $url;
}
示例15:
?>
</div>
<?php
echo $this->vendor->vendor_legal_info;
?>
</body>
<?php
} else {
?>
<h1><?php
echo JText::_('COM_VIRTUEMART_ACC_ORDER_INFO');
?>
<?php
/* Print view URL */
$details_url = juri::root() . 'index.php?option=com_virtuemart&view=orders&layout=details&tmpl=component&virtuemart_order_id=' . $this->orderdetails['details']['BT']->virtuemart_order_id . '&order_pass=' . JRequest::getString('order_pass', false) . '&order_number=' . JRequest::getString('order_number', false);
$details_link = "<a href=\"javascript:void window.open('{$details_url}', 'win2', 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no');\" >";
//$details_link .= '<span class="hasTip print_32" title="' . JText::_('COM_VIRTUEMART_PRINT') . '"> </span></a>';
$button = JVM_VERSION == 1 ? '/images/M_images/printButton.png' : 'system/printButton.png';
$details_link .= JHtml::_('image', $button, JText::_('COM_VIRTUEMART_PRINT'), NULL, true);
$details_link .= '</a>';
echo $details_link;
?>
</h1>
<?php
if ($this->order_list_link) {
?>
<div class='spaceStyle'>
<div class="floatright">
<a href="<?php
echo $this->order_list_link;