本文整理汇总了PHP中Vmconfig::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Vmconfig::get方法的具体用法?PHP Vmconfig::get怎么用?PHP Vmconfig::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vmconfig
的用法示例。
在下文中一共展示了Vmconfig::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
// Load the helper(s)
$this->addHelperPath(VMPATH_ADMIN . DS . 'helpers');
if (!class_exists('vmPSPlugin')) {
require VMPATH_PLUGINLIBS . DS . 'vmpsplugin.php';
}
if (!class_exists('VmHTML')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
}
$model = VmModel::getModel();
$layoutName = vRequest::getCmd('layout', 'default');
$this->SetViewTitle();
$layoutName = vRequest::getCmd('layout', 'default');
if ($layoutName == 'edit') {
VmConfig::loadJLang('plg_vmpsplugin', false);
JForm::addFieldPath(VMPATH_ADMIN . DS . 'fields');
$shipment = $model->getShipment();
// Get the payment XML.
$formFile = vRequest::filterPath(VMPATH_ROOT . DS . 'plugins' . DS . 'vmshipment' . DS . $shipment->shipment_element . DS . $shipment->shipment_element . '.xml');
if (file_exists($formFile)) {
$shipment->form = JForm::getInstance($shipment->shipment_element, $formFile, array(), false, '//vmconfig | //config[not(//vmconfig)]');
$shipment->params = new stdClass();
$varsToPush = vmPlugin::getVarsToPushFromForm($shipment->form);
VmTable::bindParameterableToSubField($shipment, $varsToPush);
$shipment->form->bind($shipment->getProperties());
} else {
$shipment->form = null;
}
if (!class_exists('VmImage')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php';
}
if (!class_exists('VirtueMartModelVendor')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php';
}
$vendor_id = 1;
$currency = VirtueMartModelVendor::getVendorCurrency($vendor_id);
$this->assignRef('vendor_currency', $currency->currency_symbol);
if (Vmconfig::get('multix', 'none') !== 'none') {
$vendorList = ShopFunctions::renderVendorList($shipment->virtuemart_vendor_id);
$this->assignRef('vendorList', $vendorList);
}
$this->pluginList = self::renderInstalledShipmentPlugins($shipment->shipment_jplugin_id);
$this->assignRef('shipment', $shipment);
$this->shopperGroupList = ShopFunctions::renderShopperGroupList($shipment->virtuemart_shoppergroup_ids, true);
$this->addStandardEditViewCommands($shipment->virtuemart_shipmentmethod_id);
} else {
JToolBarHelper::custom('cloneshipment', 'copy', 'copy', vmText::_('COM_VIRTUEMART_SHIPMENT_CLONE'), true);
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model);
$this->shipments = $model->getShipments();
VmConfig::loadJLang('com_virtuemart_shoppers', TRUE);
foreach ($this->shipments as &$data) {
// Write the first 5 shoppergroups in the list
$data->shipmentShoppersList = shopfunctions::renderGuiList($data->virtuemart_shoppergroup_ids, 'shoppergroups', 'shopper_group_name', 'shopper');
}
$this->pagination = $model->getPagination();
}
parent::display($tpl);
}
示例2: display
function display($tpl = null)
{
// Load the helper(s)
$this->addHelperPath(JPATH_VM_ADMINISTRATOR . DS . 'helpers');
if (!class_exists('Permissions')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php';
}
if (!class_exists('VmHTML')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
}
if (!class_exists('vmPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmplugin.php';
}
$this->assignRef('perms', Permissions::getInstance());
$model = VmModel::getModel('paymentmethod');
//@todo should be depended by loggedVendor
// $vendorId=1;
// $this->assignRef('vendorId', $vendorId);
// TODO logo
$this->SetViewTitle();
$layoutName = JRequest::getWord('layout', 'default');
$vendorModel = VmModel::getModel('vendor');
$vendorModel->setId(1);
$vendor = $vendorModel->getVendor();
$currencyModel = VmModel::getModel('currency');
$currencyModel = $currencyModel->getCurrency($vendor->vendor_currency);
$this->assignRef('vendor_currency', $currencyModel->currency_symbol);
if ($layoutName == 'edit') {
// Load the helper(s)
if (!class_exists('VmImage')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'image.php';
}
if (!class_exists('vmParameters')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'parameterparser.php';
}
$payment = $model->getPayment();
$this->assignRef('payment', $payment);
$this->assignRef('vmPPaymentList', self::renderInstalledPaymentPlugins($payment->payment_jplugin_id));
// $this->assignRef('PaymentTypeList',self::renderPaymentRadioList($paym->payment_type));
// $this->assignRef('creditCardList',self::renderCreditCardRadioList($paym->payment_creditcards));
// echo 'humpf <pre>'.print_r($paym).'</pre>' ;
//$this->assignRef('creditCardList',ShopFunctions::renderCreditCardList($paym->payment_creditcards,true));
$this->assignRef('shopperGroupList', ShopFunctions::renderShopperGroupList($payment->virtuemart_shoppergroup_ids, true));
if (Vmconfig::get('multix', 'none') !== 'none') {
$vendorList = ShopFunctions::renderVendorList($payment->virtuemart_vendor_id);
$this->assignRef('vendorList', $vendorList);
}
$this->addStandardEditViewCommands($payment->virtuemart_paymentmethod_id);
} else {
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model);
$payments = $model->getPayments();
$this->assignRef('payments', $payments);
$pagination = $model->getPagination();
$this->assignRef('pagination', $pagination);
}
parent::display($tpl);
}
示例3: display
function display($tpl = null)
{
$this->loadHelper('html');
$model = VmModel::getModel();
$layoutName = $this->getLayout();
if ($layoutName == 'edit') {
$category = $model->getCategory('', false);
if (isset($category->category_name)) {
$name = $category->category_name;
} else {
$name = '';
}
$this->SetViewTitle('CATEGORY', $name);
$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 JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'shopfunctions.php';
}
$templateList = ShopFunctions::renderTemplateList(JText::_('COM_VIRTUEMART_CATEGORY_TEMPLATE_DEFAULT'));
$this->assignRef('jTemplateList', $templateList);
if (!class_exists('VirtueMartModelConfig')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'config.php';
}
$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);
$this->loadHelper('permissions');
$perms = Permissions::getInstance();
$this->assignRef('perms', $perms);
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('model', $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('pagination', $pagination);
}
parent::display($tpl);
}
示例4: __construct
/**
* constructs a VmModel
* setMainTable defines the maintable of the model
*
* @author Max Milbers
*/
function __construct()
{
parent::__construct();
//Todo multivendor nasty hack, to get vendor with id 1
if (Vmconfig::get('multix', 'none') == 'none') {
$this->setId(1);
}
$this->setMainTable('vendors');
}
示例5: display
function display($tpl = null)
{
// Load the helper(s)
$this->loadHelper('permissions');
$this->loadHelper('html');
if (!class_exists('vmPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmplugin.php';
}
$this->perms = Permissions::getInstance();
$model = VmModel::getModel('paymentmethod');
//@todo should be depended by loggedVendor
// $vendorId=1;
// $this->assignRef('vendorId', $vendorId);
$vendorModel = VmModel::getModel('vendor');
$vendorModel->setId(1);
$vendor = $vendorModel->getVendor();
$currencyModel = VmModel::getModel('currency');
$currencyModel->setId($vendor->vendor_currency);
$currency = $currencyModel->getData();
$this->vendor_currency = $currency->currency_symbol;
$layoutName = JRequest::getWord('layout', 'default');
if ($layoutName == 'edit') {
// Load the helper(s)
$this->loadHelper('image');
// jimport('joomla.html.pane');
$this->payment = $model->getPayment();
// $this->vmPPaymentList = self::InstalledPaymentPlgSelectList($payment->payment_jplugin_id);
// $this->assignRef('PaymentTypeList',self::renderPaymentRadioList($paym->payment_type));
// $this->assignRef('creditCardList',self::renderCreditCardRadioList($paym->payment_creditcards));
// echo 'humpf <pre>'.print_r($paym).'</pre>' ;
//$this->assignRef('creditCardList',ShopFunctions::renderCreditCardList($paym->payment_creditcards,true));
$this->shopperGroupList = ShopFunctions::renderShopperGroupList($this->payment->virtuemart_shoppergroup_ids, true);
if (Vmconfig::get('multix', 'none') !== 'none') {
$this->vendorList = ShopFunctions::renderVendorList($this->payment->virtuemart_vendor_id);
}
// TODO logo
$this->SetViewTitle('', $this->payment->payment_name);
$this->addStandardEditViewCommands($this->payment->virtuemart_paymentmethod_id);
} else {
if (JRequest::getWord('format', '') === 'raw') {
$tpl = 'results';
} else {
$this->SetViewTitle();
$this->addStandardDefaultViewCommands();
// know payment list
$this->installedPayments = $this->PaymentPlgList();
}
$this->addStandardDefaultViewLists($model);
$this->payments = $model->getPayments();
$this->pagination = $model->getPagination();
}
parent::display($tpl);
if ($tpl === 'results') {
echo $this->AjaxScripts();
}
}
示例6: display
function display($tpl = null)
{
// Load the helper(s)
$this->addHelperPath(JPATH_VM_ADMINISTRATOR . DS . 'helpers');
if (!class_exists('Permissions')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php';
}
if (!class_exists('vmPSPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmpsplugin.php';
}
if (!class_exists('VmHTML')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
}
$model = VmModel::getModel();
$layoutName = JRequest::getWord('layout', 'default');
$this->SetViewTitle();
$layoutName = JRequest::getWord('layout', 'default');
if ($layoutName == 'edit') {
$shipment = $model->getShipment();
if (!class_exists('VmImage')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'image.php';
}
if (!class_exists('vmParameters')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'parameterparser.php';
}
if (!class_exists('VirtueMartModelVendor')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'vendor.php';
}
$vendor_id = 1;
$currency = VirtueMartModelVendor::getVendorCurrency($vendor_id);
$this->assignRef('vendor_currency', $currency->currency_symbol);
if (Vmconfig::get('multix', 'none') !== 'none') {
$vendorList = ShopFunctions::renderVendorList($shipment->virtuemart_vendor_id);
$this->assignRef('vendorList', $vendorList);
}
$this->assignRef('pluginList', self::renderInstalledShipmentPlugins($shipment->shipment_jplugin_id));
$this->assignRef('shipment', $shipment);
$this->assignRef('shopperGroupList', ShopFunctions::renderShopperGroupList($shipment->virtuemart_shoppergroup_ids, true));
$this->addStandardEditViewCommands($shipment->virtuemart_shipmentmethod_id);
} else {
JToolBarHelper::custom('cloneshipment', 'copy', 'copy', JText::_('COM_VIRTUEMART_SHIPMENT_CLONE'), true);
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model);
$shipments = $model->getShipments();
$this->assignRef('shipments', $shipments);
$pagination = $model->getPagination();
$this->assignRef('pagination', $pagination);
}
parent::display($tpl);
}
示例7: save
/**
* We want to allow html so we need to overwrite some request data
*
* @author Max Milbers
*/
function save($data = 0)
{
if ($data === 0) {
$data = JRequest::get('post');
}
$data['product_desc'] = $this->filterText('product_desc');
$data['product_s_desc'] = $this->filterText('product_s_desc');
if (!class_exists('Permissions')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php';
}
if (Permissions::getInstance()->isSuperVendor() != 1) {
$multix = Vmconfig::get('multix', 'none');
if ($multix != 'none') {
unset($data['childs']);
}
}
return parent::save($data);
}
示例8: getVendorAcceptedCurrrenciesList
function getVendorAcceptedCurrrenciesList($vendorId = 0)
{
static $currencies = array();
if ($vendorId === 0) {
$multix = Vmconfig::get('multix', 'none');
if (strpos($multix, 'payment') !== FALSE) {
if (!class_exists('VirtueMartModelVendor')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php';
}
$vendorId = VirtueMartModelVendor::getLoggedVendor();
} else {
$vendorId = 1;
}
}
if (!isset($currencies[$vendorId])) {
$db = JFactory::getDbo();
$q = 'SELECT `vendor_accepted_currencies`, `vendor_currency` FROM `#__virtuemart_vendors` WHERE `virtuemart_vendor_id`=' . $vendorId;
$db->setQuery($q);
$vendor_currency = $db->loadAssoc();
if (!$vendor_currency['vendor_accepted_currencies']) {
$vendor_currency['vendor_accepted_currencies'] = $vendor_currency['vendor_currency'];
vmWarn('No accepted currencies defined');
if (empty($vendor_currency['vendor_accepted_currencies'])) {
$uri = JFactory::getURI();
$link = $uri->root() . 'administrator/index.php?option=com_virtuemart&view=user&task=editshop';
vmWarn(vmText::sprintf('COM_VIRTUEMART_CONF_WARN_NO_CURRENCY_DEFINED', '<a href="' . $link . '">' . $link . '</a>'));
$currencies[$vendorId] = false;
return $currencies[$vendorId];
}
}
$q = 'SELECT `virtuemart_currency_id`,CONCAT_WS(" ",`currency_name`,`currency_symbol`) as currency_txt
FROM `#__virtuemart_currencies` WHERE `virtuemart_currency_id` IN (' . $vendor_currency['vendor_accepted_currencies'] . ')';
if ($vendorId != 1) {
$q .= ' AND (`virtuemart_vendor_id` = "' . $vendorId . '" OR `shared`="1")';
}
$q .= ' AND published = "1"
ORDER BY `ordering`,`currency_name`';
$db->setQuery($q);
$currencies[$vendorId] = $db->loadObjectList();
}
return $currencies[$vendorId];
}
示例9: save
/**
* We want to allow html so we need to overwrite some request data
*
* @author Max Milbers
*/
function save($data = 0)
{
$data = vRequest::getRequest();
$user = JFactory::getUser();
if (!($user->authorise('core.admin', 'com_virtuemart') or $user->authorise('core.manage', 'com_virtuemart'))) {
$data['product_desc'] = vRequest::get('product_desc', '');
$data['product_s_desc'] = vRequest::get('product_s_desc', '');
$data['customtitle'] = vRequest::get('customtitle', '');
} else {
$data['product_desc'] = vRequest::getHtml('product_desc', '');
//Why we have this?
$multix = Vmconfig::get('multix', 'none');
if ($multix != 'none') {
//in fact this shoudl be used, when the mode is administrated and the system is so that
//every product must be approved by an admin.
unset($data['published']);
//unset($data['childs']);
}
}
parent::save($data);
}
示例10: checkVmUserVendor
private function checkVmUserVendor()
{
$db = JFactory::getDBO();
$multix = Vmconfig::get('multix', 'none');
$q = 'select virtuemart_user_id,virtuemart_vendor_id from #__virtuemart_vmusers where user_is_vendor = 1';
// and virtuemart_vendor_id '.$vendorWhere.' limit 1';
$db->setQuery($q);
$r = $db->loadAssocList();
if (empty($r)) {
vmWarn('Your Virtuemart installation contains an error: No user as marked as vendor. Please update all users to be associated with virtuemart_vendor_id 1.');
} else {
if ($multix == 'none' and count($r) != 1) {
vmWarn('You are using single vendor mode, but it seems more than one user is set as vendor');
}
foreach ($r as $entry) {
if (empty($entry['virtuemart_vendor_id'])) {
vmWarn('The user with virtuemart_user_id = ' . $entry['virtuemart_user_id'] . ' is set as vendor, but has no referencing vendorId.');
}
}
}
}
示例11: save
/**
* We want to allow html so we need to overwrite some request data
*
* @author Max Milbers
*/
function save($data = 0){
if($data===0)$data = vRequest::getRequest();
$user = JFactory::getUser();
if($user->authorise('core.admin','com_virtuemart') or $user->authorise('core.manage','com_virtuemart')){
$data['product_desc'] = vRequest::get('product_desc','');
$data['product_s_desc'] = vRequest::get('product_s_desc','');
$data['customtitle'] = vRequest::get('customtitle','');
if(isset($data['field'])){
$data['field'] = vRequest::get('field');
}
if(isset($data['childs'])){
foreach($data['childs'] as $k=>$v){
$data['childs'][$k]['product_name'] = vRequest::get('product_name','',FILTER_UNSAFE_RAW,FILTER_FLAG_NO_ENCODE,$data['childs'][$k]);
}
}
} else {
$data['product_desc'] = vRequest::getHtml('product_desc','');
$data['product_s_desc'] = vRequest::getHtml('product_s_desc','');
$data['customtitle'] = vRequest::getHtml('customtitle','');
if(isset($data['field'])){
$data['field'] = vRequest::getHtml('field');
}
//Why we have this?
$multix = Vmconfig::get('multix','none');
if( $multix != 'none' ){
//in fact this shoudl be used, when the mode is administrated and the system is so that
//every product must be approved by an admin.
unset($data['published']);
//unset($data['childs']);
}
}
parent::save($data);
}
示例12: save
/**
* We want to allow html so we need to overwrite some request data
*
* @author Max Milbers
*/
function save($data = 0)
{
$data = JRequest::get('post');
if (!class_exists('Permissions')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php';
}
if (Permissions::getInstance()->check('admin')) {
$data['product_desc'] = JRequest::getVar('product_desc', '', 'post', 'STRING', 2);
$data['product_s_desc'] = JRequest::getVar('product_s_desc', '', 'post', 'STRING', 2);
$data['customtitle'] = JRequest::getVar('customtitle', '', 'post', 'STRING', 2);
} else {
$data['product_desc'] = JRequest::getVar('product_desc', '', 'post', 'STRING', 2);
$data['product_desc'] = JComponentHelper::filterText($data['product_desc']);
//Why we have this?
$multix = Vmconfig::get('multix', 'none');
if ($multix != 'none') {
//in fact this shoudl be used, when the mode is administrated and the sysetm is so that
//every product must be approved by an admin.
unset($data['published']);
//unset($data['childs']);
}
}
parent::save($data);
}
示例13: renderVendorList
/**
* Creates a Drop Down list of available Vendors
*
* @author Max Milbers
* @access public
* @param int $virtuemart_shoppergroup_id the shopper group to pre-select
* @param bool $multiple if the select list should allow multiple selections
* @return string HTML select option list
*/
public static function renderVendorList($vendorId, $multiple = FALSE)
{
$db = JFactory::getDBO();
if (Vmconfig::get('multix', 'none') == 'none') {
$vendorId = 1;
$q = 'SELECT `vendor_name` FROM `#__virtuemart_vendors` WHERE `virtuemart_vendor_id` = "' . (int) $vendorId . '" ';
$db->setQuery($q);
$vendor = $db->loadResult();
$html = '<input type="text" size="14" name="vendor_name" class="inputbox" value="' . $vendor . '" readonly="">';
} else {
if (!JFactory::getUser()->authorise('core.admin', 'com_virtuemart')) {
if (empty($vendorId)) {
$vendorId = 1;
//Dont delete this message, we need it later for multivendor
//vmWarn('renderVendorList $vendorId is empty, please correct your used model to automatically set the virtuemart_vendor_id to the logged Vendor');
}
$q = 'SELECT `vendor_name` FROM `#__virtuemart_vendors` WHERE `virtuemart_vendor_id` = "' . (int) $vendorId . '" ';
$db->setQuery($q);
$vendor = $db->loadResult();
$html = '<input type="text" size="14" name="vendor_name" class="inputbox" value="' . $vendor . '" readonly="">';
// $html .='<input type="hidden" value="'.$vendorId.'" name="virtuemart_vendor_id">';
return $html;
} else {
return self::renderVendorFullVendorList($vendorId);
}
}
}
示例14: check
/**
* @author Max Milbers
* @param
*/
function check()
{
if (!empty($this->_slugAutoName)) {
$slugAutoName = $this->_slugAutoName;
$slugName = $this->_slugName;
if (in_array($slugAutoName, $this->_translatableFields)) {
$checkTable = $this->_tbl . '_' . VMLANG;
} else {
$checkTable = $this->_tbl;
}
if (empty($this->{$slugName})) {
// vmdebug('table check use _slugAutoName '.$slugAutoName.' '.$slugName);
if (!empty($this->{$slugAutoName})) {
$this->{$slugName} = $this->{$slugAutoName};
} else {
vmError('VmTable ' . $checkTable . ' Check not passed. Neither slug nor obligatory value at ' . $slugAutoName . ' for auto slug creation is given');
return false;
}
}
//if (!class_exists('VmMediaHandler')) require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'mediahandler.php');
//vmdebug('check $slug before stringURLSafe',$this->$slugName);
//$this->$slugName = vmFile::makeSafe( $this->$slugName );
//$lang = JFactory::getLanguage();
//$this->$slugName = $lang->transliterate($this->$slugName);
if (JVM_VERSION === 1) {
$this->{$slugName} = JFilterOutput::stringURLSafe($this->{$slugName});
} else {
$this->{$slugName} = JApplication::stringURLSafe($this->{$slugName});
}
$valid = $this->checkCreateUnique($checkTable, $slugName);
if (!$valid) {
return false;
}
}
foreach ($this->_obkeys as $obkeys => $error) {
if (empty($this->{$obkeys})) {
if (empty($error)) {
$error = 'Serious error cant save ' . $this->_tbl . ' without ' . $obkeys;
} else {
// $error = get_class($this).' '.JText::_($error);
$error = get_class($this) . ' ' . $error;
}
$this->setError($error);
vmError($error);
return false;
}
}
if ($this->_unique) {
if (empty($this->_db)) {
$this->_db = JFactory::getDBO();
}
foreach ($this->_unique_name as $obkeys => $error) {
if (empty($this->{$obkeys})) {
// vmError(JText::sprintf('COM_VIRTUEMART_NON_UNIQUE_KEY',$this->$obkeys));
$this->setError($error);
vmError('Non unique ' . $this->_unique_name . ' ' . $error);
return false;
} else {
$valid = $this->checkCreateUnique($this->_tbl, $obkeys);
if (!$valid) {
return false;
}
}
}
}
if (isset($this->virtuemart_vendor_id)) {
$multix = Vmconfig::get('multix', 'none');
//Lets check if the user is admin or the mainvendor
if (!class_exists('Permissions')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php';
}
$virtuemart_vendor_id = false;
if ($multix == 'none' and get_class($this) !== 'TableVmusers') {
$this->virtuemart_vendor_id = 1;
} else {
$loggedVendorId = Permissions::getInstance()->isSuperVendor();
$admin = Permissions::getInstance()->check('admin');
$tbl_key = $this->_tbl_key;
if (get_class($this) !== 'TableVmusers') {
$q = 'SELECT `virtuemart_vendor_id` FROM `' . $this->_tbl . '` WHERE `' . $this->_tbl_key . '`=' . $this->{$tbl_key};
$this->_db->setQuery($q);
$virtuemart_vendor_id = $this->_db->loadResult();
} else {
$q = 'SELECT `virtuemart_vendor_id`,`user_is_vendor` FROM `' . $this->_tbl . '` WHERE `' . $this->_tbl_key . '`=' . $this->{$tbl_key};
$this->_db->setQuery($q);
$vmuser = $this->_db->loadRow();
if ($vmuser and count($vmuser) === 2) {
$virtuemart_vendor_id = $vmuser[0];
$user_is_vendor = $vmuser[1];
if ($multix == 'none') {
if (empty($user_is_vendor)) {
$this->virtuemart_vendor_id = 0;
} else {
$this->virtuemart_vendor_id = 1;
}
return true;
//.........这里部分代码省略.........
示例15: defined
* @author Max Milbers
* @link http://www.virtuemart.net
* @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
* @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: default.php 6475 2012-09-21 11:54:21Z Milbo $
*/
// Added modal for adding NEW payment. THe customer have to preselect a payment now to add a new one.
// this permit to load directly the config XML and not to save 2 time the paymentmethod form
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die;
//if($virtuemart_vendor_id==1 || $perm->check( 'admin' )){
$multiX = Vmconfig::get('multix', 'none') !== 'none' ? true : false;
$cols = $multiX ? 10 : 9;
?>
<form action="index.php" method="post" name="adminForm" id="adminForm">
<?php
AdminUIHelper::startAdminArea();
?>
<div class="clearfix"> </div>
<div id="results">
<?php
// split to use ajax search
echo $this->loadTemplate('results');
?>
</div>