当前位置: 首页>>代码示例>>PHP>>正文


PHP VmTable::bindParameterable方法代码示例

本文整理汇总了PHP中VmTable::bindParameterable方法的典型用法代码示例。如果您正苦于以下问题:PHP VmTable::bindParameterable方法的具体用法?PHP VmTable::bindParameterable怎么用?PHP VmTable::bindParameterable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VmTable的用法示例。


在下文中一共展示了VmTable::bindParameterable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getShipment

 /**
  * Retrieve the detail record for the current $id if the data has not already been loaded.
  *
  * @author RickG
  */
 function getShipment($id = 0)
 {
     if (!empty($id)) {
         $this->_id = (int) $id;
     }
     if (empty($this->_cache[$this->_id])) {
         $this->_cache[$this->_id] = $this->getTable('shipmentmethods');
         $this->_cache[$this->_id]->load((int) $this->_id);
         if (empty($this->_cache[$this->_id]->virtuemart_vendor_id)) {
             if (!class_exists('VirtueMartModelVendor')) {
                 require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'vendor.php';
             }
             $this->_cache[$this->_id]->virtuemart_vendor_id = VirtueMartModelVendor::getLoggedVendor();
         }
         if ($this->_cache[$this->_id]->shipment_jplugin_id) {
             JPluginHelper::importPlugin('vmshipment');
             $dispatcher = JDispatcher::getInstance();
             $blind = 0;
             $retValue = $dispatcher->trigger('plgVmDeclarePluginParamsShipmentVM3', array(&$this->_cache[$this->_id]));
         }
         if (!empty($this->_cache[$this->_id]->_varsToPushParam)) {
             VmTable::bindParameterable($this->_cache[$this->_id], 'shipment_params', $this->_cache[$this->_id]->_varsToPushParam);
         }
         /* Add the shipmentcarreir shoppergroups */
         $q = 'SELECT `virtuemart_shoppergroup_id` FROM #__virtuemart_shipmentmethod_shoppergroups WHERE `virtuemart_shipmentmethod_id` = "' . $this->_id . '"';
         $this->_db->setQuery($q);
         $this->_cache[$this->_id]->virtuemart_shoppergroup_ids = $this->_db->loadResultArray();
         if (empty($this->_cache[$this->_id]->virtuemart_shoppergroup_ids)) {
             $this->_cache[$this->_id]->virtuemart_shoppergroup_ids = 0;
         }
     }
     return $this->_cache[$this->_id];
 }
开发者ID:lenard112,项目名称:cms,代码行数:38,代码来源:shipmentmethod.php

示例2: display

 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmHTML')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
     }
     if (!class_exists('vmCustomPlugin')) {
         require JPATH_VM_PLUGINS . DS . 'vmcustomplugin.php';
     }
     $model = VmModel::getModel('custom');
     // TODO Make an Icon for custom
     $this->SetViewTitle('PRODUCT_CUSTOM_FIELD');
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $this->addStandardEditViewCommands();
         $customPlugin = '';
         $this->custom = $model->getCustom();
         $customfields = VmModel::getModel('customfields');
         //vmdebug('VirtuemartViewCustom',$this->custom);
         JPluginHelper::importPlugin('vmcustom');
         $dispatcher = JDispatcher::getInstance();
         $retValue = $dispatcher->trigger('plgVmOnDisplayEdit', array($this->custom->virtuemart_custom_id, &$customPlugin));
         $this->SetViewTitle('PRODUCT_CUSTOM_FIELD', $this->custom->custom_title);
         $selected = 0;
         if (!empty($this->custom->custom_jplugin_id)) {
             VmConfig::loadJLang('plg_vmpsplugin', false);
             JForm::addFieldPath(JPATH_VM_ADMINISTRATOR . DS . 'fields');
             $selected = $this->custom->custom_jplugin_id;
             // Get the payment XML.
             $formFile = JPath::clean(JPATH_ROOT . DS . 'plugins' . DS . 'vmcustom' . DS . $this->custom->custom_element . DS . $this->custom->custom_element . '.xml');
             if (file_exists($formFile)) {
                 $this->custom->form = JForm::getInstance($this->custom->custom_element, $formFile, array(), false, '//vmconfig | //config[not(//vmconfig)]');
                 $this->custom->params = new stdClass();
                 $varsToPush = vmPlugin::getVarsToPushByXML($formFile, 'customForm');
                 $this->custom->params->custom_params = $this->custom->custom_params;
                 VmTable::bindParameterable($this->custom->params, 'custom_params', $varsToPush);
                 $this->custom->form->bind($this->custom);
             } else {
                 $this->custom->form = null;
             }
         }
         $this->pluginList = self::renderInstalledCustomPlugins($selected);
         $this->assignRef('customPlugin', $customPlugin);
         $this->assignRef('customfields', $customfields);
     } else {
         JToolBarHelper::custom('createClone', 'copy', 'copy', vmText::_('COM_VIRTUEMART_CLONE'), true);
         JToolBarHelper::custom('toggle.admin_only.1', 'publish', '', vmText::_('COM_VIRTUEMART_TOGGLE_ADMIN'), true);
         JToolBarHelper::custom('toggle.admin_only.0', 'unpublish', '', vmText::_('COM_VIRTUEMART_TOGGLE_ADMIN'), true);
         JToolBarHelper::custom('toggle.is_hidden.1', 'publish', '', vmText::_('COM_VIRTUEMART_TOGGLE_HIDDEN'), true);
         JToolBarHelper::custom('toggle.is_hidden.0', 'unpublish', '', vmText::_('COM_VIRTUEMART_TOGGLE_HIDDEN'), true);
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model);
         $customs = $model->getCustoms(vRequest::getInt('custom_parent_id'), vRequest::getCmd('keyword'));
         $this->assignRef('customs', $customs);
         $pagination = $model->getPagination();
         $this->assignRef('pagination', $pagination);
     }
     parent::display($tpl);
 }
开发者ID:lenard112,项目名称:cms,代码行数:59,代码来源:view.html.php

示例3: display

 function display($tpl = null)
 {
     $db = JFactory::getDBO();
     if ($field = vRequest::getVar('field')) {
         if (strpos($field, 'plugin') !== false) {
             JForm::addFieldPath(JPATH_VM_ADMINISTRATOR . DS . 'fields');
             $table = '#__extensions';
             $field = substr($field, 6);
             $q = 'SELECT `params`,`element`,`type` FROM `' . $table . '` WHERE `element` = "' . $field . '"';
             $db->setQuery($q);
             $this->userField = $db->loadObject();
             //$this->userField->element = substr($this->userField->type, 6);
             if (!class_exists('vmPlugin')) {
                 require JPATH_VM_PLUGINS . DS . 'vmplugin.php';
             }
             vmPlugin::loadJLang('plg_vmuserfield_' . $this->userField->element, 'vmuserfield', $this->userField->element);
             $path = JPATH_ROOT . DS . 'plugins' . DS . 'vmuserfield' . DS . $this->userField->element . DS . $this->userField->element . '.xml';
             // Get the payment XML.
             $formFile = JPath::clean($path);
             if (file_exists($formFile)) {
                 if (!class_exists('VmConfig')) {
                     require JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php';
                 }
                 if (!class_exists('VmTable')) {
                     require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'vmtable.php';
                 }
                 $this->userField->form = JForm::getInstance($this->userField->element, $formFile, array(), false, '//vmconfig | //config[not(//vmconfig)]');
                 $this->userField->params = new stdClass();
                 $varsToPush = vmPlugin::getVarsToPushByXML($formFile, 'customForm');
                 /*
                 					$this->userField->params->userfield_params = $this->userField->params;
                 					VmTable::bindParameterable($this->userField->params,'userfield_params',$varsToPush);*/
                 if (empty($this->userField->userfield_params)) {
                     $this->userField->userfield_params = '';
                 }
                 $this->userField->params->userfield_params = $this->userField->userfield_params;
                 VmTable::bindParameterable($this->userField->params, 'userfield_params', $varsToPush);
                 $this->userField->form->bind($this->userField);
             } else {
                 $this->userField->form = false;
                 vmdebug('renderUserfieldPlugin could not find xml for ' . $this->userField->type . ' at ' . $path);
             }
             //vmdebug('renderUserfieldPlugin ',$this->userField->form);
             if ($this->userField->form) {
                 $form = $this->userField->form;
                 ob_start();
                 include JPATH_VM_ADMINISTRATOR . DS . 'fields' . DS . 'formrenderer.php';
                 $body = ob_get_contents();
                 ob_end_clean();
                 echo $body;
             }
         }
     }
     jExit();
 }
开发者ID:lenard112,项目名称:cms,代码行数:55,代码来源:view.json.php

示例4: getPayment

 /**
  * Retrieve the detail record for the current $id if the data has not already been loaded.
  *
  * @author Max Milbers
  */
 public function getPayment($id = 0)
 {
     if (!empty($id)) {
         $this->_id = (int) $id;
     }
     if (empty($this->_cache[$this->_id])) {
         $this->_cache[$this->_id] = $this->getTable('paymentmethods');
         $this->_cache[$this->_id]->load((int) $this->_id);
         if (empty($this->_cache->virtuemart_vendor_id)) {
             if (!class_exists('VirtueMartModelVendor')) {
                 require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'vendor.php';
             }
             $this->_cache[$this->_id]->virtuemart_vendor_id = VirtueMartModelVendor::getLoggedVendor();
         }
         if ($this->_cache[$this->_id]->payment_jplugin_id) {
             JPluginHelper::importPlugin('vmpayment');
             $dispatcher = JDispatcher::getInstance();
             $retValue = $dispatcher->trigger('plgVmDeclarePluginParamsPaymentVM3', array(&$this->_cache[$this->_id]));
             //$retValue = $dispatcher->trigger('plgVmDeclarePluginParamsPayment',array($this->_cache[$this->_id]->payment_element,$this->_cache[$this->_id]->payment_jplugin_id,&$this->_cache));
         }
         if (!empty($this->_cache[$this->_id]->_varsToPushParam)) {
             VmTable::bindParameterable($this->_cache[$this->_id], 'payment_params', $this->_cache[$this->_id]->_varsToPushParam);
         }
         //todo check if we still need this
         /*if($this->_data[$this->_id]->getCryptedFields()){
         				if(!class_exists('vmCrypt')){
         					require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'vmcrypt.php');
         				}
         
         				if(isset($this->_data[$this->_id]->modified_on)){
         					$date = JFactory::getDate($this->_data[$this->_id]->modified_on);
         					$date = $date->toUnix();
         				} else {
         					$date = 0;
         				}
         
         				foreach($this->_data[$this->_id]->getCryptedFields() as $field){
         					if(isset($this->_data[$this->_id]->$field)){
         						$this->_data[$this->_id]->$field = vmCrypt::decrypt($this->_data[$this->_id]->$field,$date);
         					}
         				}
         			}*/
         $q = 'SELECT `virtuemart_shoppergroup_id` FROM #__virtuemart_paymentmethod_shoppergroups WHERE `virtuemart_paymentmethod_id` = "' . $this->_id . '"';
         $this->_db->setQuery($q);
         $this->_cache[$this->_id]->virtuemart_shoppergroup_ids = $this->_db->loadResultArray();
         if (empty($this->_cache[$this->_id]->virtuemart_shoppergroup_ids)) {
             $this->_cache[$this->_id]->virtuemart_shoppergroup_ids = 0;
         }
     }
     return $this->_cache[$this->_id];
 }
开发者ID:lenard112,项目名称:cms,代码行数:56,代码来源:paymentmethod.php

示例5: getShipment

 /**
  * Retrieve the detail record for the current $id if the data has not already been loaded.
  *
  * @author RickG
  */
 function getShipment($id = 0)
 {
     if (!empty($id)) {
         $this->_id = (int) $id;
     }
     if (empty($this->_cache[$this->_id])) {
         $this->_cache[$this->_id] = $this->getTable('shipmentmethods');
         $this->_cache[$this->_id]->load((int) $this->_id);
         if (empty($this->_cache[$this->_id]->virtuemart_vendor_id)) {
             if (!class_exists('VirtueMartModelVendor')) {
                 require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php';
             }
             $this->_cache[$this->_id]->virtuemart_vendor_id = VirtueMartModelVendor::getLoggedVendor();
         }
         if ($this->_cache[$this->_id]->shipment_jplugin_id) {
             JPluginHelper::importPlugin('vmshipment');
             $dispatcher = JDispatcher::getInstance();
             $blind = 0;
             $retValue = $dispatcher->trigger('plgVmDeclarePluginParamsShipmentVM3', array(&$this->_cache[$this->_id]));
         }
         if (!empty($this->_cache[$this->_id]->_varsToPushParam)) {
             VmTable::bindParameterable($this->_cache[$this->_id], 'shipment_params', $this->_cache[$this->_id]->_varsToPushParam);
         }
         //We still need this, because the table is already loaded, but the keys are set later
         if ($this->_cache[$this->_id]->getCryptedFields()) {
             if (!class_exists('vmCrypt')) {
                 require VMPATH_ADMIN . DS . 'helpers' . DS . 'vmcrypt.php';
             }
             if (isset($this->_cache[$this->_id]->modified_on)) {
                 $date = JFactory::getDate($this->_cache[$this->_id]->modified_on);
                 $date = $date->toUnix();
             } else {
                 $date = 0;
             }
             foreach ($this->_cache[$this->_id]->getCryptedFields() as $field) {
                 if (isset($this->_cache[$this->_id]->{$field})) {
                     $this->_cache[$this->_id]->{$field} = vmCrypt::decrypt($this->_cache[$this->_id]->{$field}, $date);
                 }
             }
         }
         /* Add the shipmentcarreir shoppergroups */
         $q = 'SELECT `virtuemart_shoppergroup_id` FROM #__virtuemart_shipmentmethod_shoppergroups WHERE `virtuemart_shipmentmethod_id` = "' . $this->_id . '"';
         $this->_db->setQuery($q);
         $this->_cache[$this->_id]->virtuemart_shoppergroup_ids = $this->_db->loadColumn();
         if (empty($this->_cache[$this->_id]->virtuemart_shoppergroup_ids)) {
             $this->_cache[$this->_id]->virtuemart_shoppergroup_ids = 0;
         }
     }
     return $this->_cache[$this->_id];
 }
开发者ID:sam-akopyan,项目名称:hamradio,代码行数:55,代码来源:shipmentmethod.php

示例6: getCustom

 /**
  * Gets a single custom by virtuemart_custom_id
  * .
  * @param string $type
  * @param string $mime mime type of custom, use for exampel image
  * @return customobject
  */
 function getCustom($id = 0)
 {
     if (!empty($id)) {
         $this->_id = (int) $id;
     }
     if (empty($this->_cache[$this->_id])) {
         $this->_cache[$this->_id] = $this->getTable('customs');
         $this->_cache[$this->_id]->load($this->_id);
         $this->_cache[$this->_id]->_varsToPushParam = self::getVarsToPush($this->_cache[$this->_id]->field_type);
         $this->_cache[$this->_id]->customfield_params = '';
         if ($this->_cache[$this->_id]->field_type == 'E') {
             JPluginHelper::importPlugin('vmcustom');
             $dispatcher = JDispatcher::getInstance();
             $retValue = $dispatcher->trigger('plgVmDeclarePluginParamsCustomVM3', array(&$this->_cache[$this->_id]));
         }
         //exaample 	vm2 withParent="0"|parentOrderable="0"|
         //			vm3 withParent="1"|parentOrderable="1"|
         $this->_cache[$this->_id]->_xParams = 'custom_params';
         if (!empty($this->_cache[$this->_id]->_varsToPushParam)) {
             VmTable::bindParameterable($this->_cache[$this->_id], 'custom_params', $this->_cache[$this->_id]->_varsToPushParam);
         }
     }
     return $this->_cache[$this->_id];
 }
开发者ID:naka211,项目名称:studiekorrektur,代码行数:31,代码来源:custom.php

示例7: getPluginMethods

    /**
     * Fill the array with all plugins found with this plugin for the current vendor
     *
     * @return True when plugins(s) was (were) found for this vendor, false otherwise
     * @author Oscar van Eijk
     * @author max Milbers
     * @author valerie Isaksen
     */
    protected function getPluginMethods($vendorId)
    {
        if (!class_exists('VirtueMartModelUser')) {
            require VMPATH_ADMIN . DS . 'models' . DS . 'user.php';
        }
        $usermodel = VmModel::getModel('user');
        $user = $usermodel->getUser();
        $user->shopper_groups = (array) $user->shopper_groups;
        $db = JFactory::getDBO();
        $select = 'SELECT l.*, v.*, ';
        $extPlgTable = '#__extensions';
        $extField1 = 'extension_id';
        $extField2 = 'element';
        $select .= 'j.`' . $extField1 . '`,j.`name`, j.`type`, j.`element`, j.`folder`, j.`client_id`, j.`enabled`, j.`access`, j.`protected`, j.`manifest_cache`,
			j.`params`, j.`custom_data`, j.`system_data`, j.`checked_out`, j.`checked_out_time`, j.`state`,  s.virtuemart_shoppergroup_id ';
        if (!VmConfig::$vmlang) {
            VmConfig::setdbLanguageTag();
        }
        $q = $select . ' FROM   `#__virtuemart_' . $this->_psType . 'methods_' . VmConfig::$vmlang . '` as l ';
        $q .= ' JOIN `#__virtuemart_' . $this->_psType . 'methods` AS v   USING (`virtuemart_' . $this->_psType . 'method_id`) ';
        $q .= ' LEFT JOIN `' . $extPlgTable . '` as j ON j.`' . $extField1 . '` =  v.`' . $this->_psType . '_jplugin_id` ';
        $q .= ' LEFT OUTER JOIN `#__virtuemart_' . $this->_psType . 'method_shoppergroups` AS s ON v.`virtuemart_' . $this->_psType . 'method_id` = s.`virtuemart_' . $this->_psType . 'method_id` ';
        $q .= ' WHERE v.`published` = "1" AND j.`' . $extField2 . '` = "' . $this->_name . '"
	    						AND  (v.`virtuemart_vendor_id` = "' . $vendorId . '" OR v.`virtuemart_vendor_id` = "0" OR v.`shared` = "1")
	    						AND  (';
        foreach ($user->shopper_groups as $groups) {
            $q .= ' s.`virtuemart_shoppergroup_id`= "' . (int) $groups . '" OR';
        }
        $q .= ' (s.`virtuemart_shoppergroup_id`) IS NULL ) GROUP BY v.`virtuemart_' . $this->_psType . 'method_id` ORDER BY v.`ordering`';
        $db->setQuery($q);
        $this->methods = $db->loadObjectList();
        $err = $db->getErrorMsg();
        if (!empty($err)) {
            vmError('Error reading getPluginMethods ' . $err);
        }
        if ($this->methods) {
            foreach ($this->methods as $method) {
                VmTable::bindParameterable($method, $this->_xParams, $this->_varsToPushParam);
            }
        }
        return count($this->methods);
    }
开发者ID:naka211,项目名称:studiekorrektur,代码行数:50,代码来源:vmpsplugin.php

示例8: getOrderCalc

 private function getOrderCalc($orderDetails)
 {
     $calc = 0;
     if (!empty($orderDetails['calc_rules'])) {
         foreach ($orderDetails['calc_rules'] as $rule) {
             if ($rule->calc_kind == 'taxRulesBill' and $rule->calc_mathop == 'avalara') {
                 $calc = $rule;
                 break;
             }
         }
     }
     if (empty($calc)) {
         avadebug('Retrieving calculation rule for avatax failed', $orderDetails->virtuemart_order_id);
         return false;
     }
     if (is_object($calc)) {
         $calc = get_object_vars($calc);
     }
     if (!empty($calc['calc_params'])) {
         VmTable::bindParameterable($calc, $this->_xParams, $this->_varsToPushParam);
         return $calc;
     } else {
         avadebug('rule had no parameters', $calc);
         return false;
     }
 }
开发者ID:sam-akopyan,项目名称:hamradio,代码行数:26,代码来源:avalara.php

示例9: declarePluginParams

 /**
  * @param $psType
  * @param $name
  * @param $id
  * @param $data
  * @return bool
  */
 protected function declarePluginParams($psType, $name, $id, &$data)
 {
     //vmdebug('declarePluginParams '.$this->_psType.' '.$psType);
     //Todo I know a test only on seledtThis is wrong here, it works now with extra !empty($this->_psType)
     if (!empty($this->_psType) and !$this->selectedThis($psType, $name, $id)) {
         return FALSE;
     }
     if (!class_exists('VmTable')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'vmtable.php';
     }
     VmTable::bindParameterable($data, $this->_xParams, $this->_varsToPushParam);
     return TRUE;
     // 			vmdebug('getDeclaredPluginParams return '.$this->_xParams);
     // 			return array($this->_xParams,$this->_varsToPushParam);
     // 		} else {
     // 			return false;
     // 		}
 }
开发者ID:Arturogcalleja,项目名称:herbolario,代码行数:25,代码来源:vmplugin.php

示例10: bindCustomEmbeddedFieldParams

 static function bindCustomEmbeddedFieldParams(&$obj, $fieldtype)
 {
     //vmdebug('bindCustomEmbeddedFieldParams begin',$obj);
     if (!class_exists('VirtueMartModelCustom')) {
         require VMPATH_ADMIN . DS . 'models' . DS . 'custom.php';
     }
     if ($obj->field_type == 'E') {
         JPluginHelper::importPlugin('vmcustom');
         $dispatcher = JDispatcher::getInstance();
         $retValue = $dispatcher->trigger('plgVmDeclarePluginParamsCustomVM3', array(&$obj));
         if (!empty($obj->_varsToPushParam)) {
             if (empty($obj->_varsToPushParamCustom)) {
                 $obj->_varsToPushParamCustom = $obj->_varsToPushParam;
             }
             if (empty($obj->_varsToPushParamCustomField)) {
                 $obj->_varsToPushParamCustomField = $obj->_varsToPushParam;
             }
         }
     } else {
         $obj->_varsToPushParamCustom = VirtueMartModelCustom::getVarsToPush($fieldtype);
         $obj->_varsToPushParam = $obj->_varsToPushParamCustomField = $obj->_varsToPushParamCustom;
         //vmdebug('my $obj->_varsToPushParamCustom',$obj->_varsToPushParamCustomField);
     }
     if (!empty($obj->_varsToPushParam)) {
         //$obj ->_xParams = 'custom_params';
         VmTable::bindParameterable($obj, 'custom_params', $obj->_varsToPushParamCustom);
         $obj->_xParams = 'customfield_params';
         VmTable::bindParameterable($obj, $obj->_xParams, $obj->_varsToPushParamCustomField);
     }
 }
开发者ID:proyectoseb,项目名称:Matrix,代码行数:30,代码来源:customfields.php

示例11: declarePluginParams

 protected function declarePluginParams($psType, $name, $id, &$data)
 {
     // 		if($this->selectedThis($psType,$name,$id)){
     if (!class_exists('VmTable')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'vmtable.php';
     }
     VmTable::bindParameterable($data, $this->_xParams, $this->_varsToPushParam);
     return true;
     // 			vmdebug('getDeclaredPluginParams return '.$this->_xParams);
     // 			return array($this->_xParams,$this->_varsToPushParam);
     // 		} else {
     // 			return false;
     // 		}
 }
开发者ID:joselapria,项目名称:virtuemart,代码行数:14,代码来源:vmplugin.php

示例12: bindParameterableByFieldType

 static function bindParameterableByFieldType(&$table, $type = 0)
 {
     if ($type === 0) {
         $type = $table->field_type;
     }
     $varsToPush = self::getVarsToPush($type);
     if (!empty($varsToPush)) {
         VmTable::bindParameterable($table, 'custom_param', $varsToPush);
     }
 }
开发者ID:denis1001,项目名称:Virtuemart-2-Joomla-3-Bootstrap,代码行数:10,代码来源:customfields.php

示例13: getVmPluginMethod

 public function getVmPluginMethod($int, $cache = true)
 {
     $class = $this->myClass();
     if (OPCJ3) {
         $db = JFactory::getDBO();
         if (!class_exists($this->_configTableClassName)) {
             require JPATH_VM_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'tables' . DIRECTORY_SEPARATOR . $this->_configTableFileName . '.php';
         }
         $this->_vmpCtable = new $this->_configTableClassName($db);
         if ($this->_xParams !== 0) {
             $this->_vmpCtable->setParameterable($this->_configTableFieldName, $this->_varsToPushParam);
         }
         if ($this->_cryptedFields) {
             $this->_vmpCtable->setCryptedFields($this->_cryptedFields);
         }
         $ret = $this->_vmpCtable->load($int);
         if (isset(vmPlugin::$xmlDefaults[$this->_name . 'Form'])) {
             $defaults = vmPlugin::$xmlDefaults[$this->_name . 'Form'];
             foreach ($defaults as $key => $name) {
                 $this->{$key} = $name;
             }
         }
         VmTable::bindParameterable($ret, $this->_xParams, $this->_varsToPushParam);
         return $ret;
     }
     $x = vmPlugin::getCache('getVmPluginMethod', $class . $int);
     $this->_vmpCtable = $x;
     // vm 2.0.20
     if (!empty($x)) {
         if (!isset($x->tax_id)) {
             $x->tax_id = -1;
         }
     }
     if (!empty($x)) {
         return $x;
     }
     $x = $this->selectedThisByMethodId($int);
     if (empty($x)) {
         $res = false;
         return vmPlugin::setCache($res, 'getVmPluginMethod', $class . $int);
     }
     /*
     static $lastInt; 
     if (!empty($lastInt))
     {
       if ($int != $lastInt) 
        $refresh = true; 
       else $refresh = false;
     }
     else 
     {
       $refresh = true; 
       $lastInt = $int; 
     }
     */
     if (!class_exists('VmTable')) {
         require JPATH_VM_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'vmtable.php';
     }
     if (empty($this->_vmpCtableAll)) {
         $this->_vmpCtableAll = array();
     }
     $type = $this->_psType;
     if (empty($this->_vmpCtableAll[$type . $int])) {
         $db = JFactory::getDBO();
         if (!class_exists($this->_configTableClassName)) {
             require JPATH_VM_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'tables' . DIRECTORY_SEPARATOR . $this->_configTableFileName . '.php';
         }
         $this->_vmpCtableAll[$type . $int] = new $this->_configTableClassName($db);
         if ($this->_xParams !== 0) {
             if (method_exists($this->_vmpCtableAll[$type . $int], 'setParameterable')) {
                 $this->_vmpCtableAll[$type . $int]->setParameterable($this->_xParams, $this->_varsToPushParam);
             }
         }
         if ($this->_cryptedFields) {
             if (method_exists($this->_vmpCtableAll[$type . $int], 'setCryptedFields')) {
                 $this->_vmpCtableAll[$type . $int]->setCryptedFields($this->_cryptedFields);
             }
         }
     }
     // some plugins are missing some of the params:
     $this->_vmpCtableAll[$type . $int]->setParameterable($this->_xParams, $this->_varsToPushParam);
     $x = $this->_vmpCtableAll[$type . $int]->load($int);
     $this->_vmpCtable = $this->_vmpCtableAll[$type . $int];
     if (!empty($x)) {
         if (!isset($x->payment_logos)) {
             $x->payment_logos = '';
         }
         if (!isset($x->cost_per_transaction)) {
             $x->cost_per_transaction = 0;
         }
         if (!isset($x->cost_percent_total)) {
             $x->cost_percent_total = 0;
         }
         if (!isset($x->tax_id)) {
             $x->tax_id = -1;
         }
         if (!isset($x->weight_unit)) {
             $x->weight_unit = 'KG';
         }
     }
//.........这里部分代码省略.........
开发者ID:aldegtyarev,项目名称:stelsvelo,代码行数:101,代码来源:vmplugin.php

示例14: plgVmGetPluginInternalDataCalc

 public function plgVmGetPluginInternalDataCalc(&$calcData)
 {
     $calcData->setParameterable($this->_xParams, $this->_varsToPushParam);
     if (!class_exists('VmTable')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'vmtable.php';
     }
     VmTable::bindParameterable($calcData, $this->_xParams, $this->_varsToPushParam);
     return TRUE;
 }
开发者ID:romuland,项目名称:khparts,代码行数:9,代码来源:avalara.php

示例15: getPluginMethods

    /**
     * Fill the array with all plugins found with this plugin for the current vendor
     *
     * @return True when plugins(s) was (were) found for this vendor, false otherwise
     * @author Oscar van Eijk
     * @author max Milbers
     * @author valerie Isaksen
     */
    protected function getPluginMethods($vendorId)
    {
        if (!class_exists('VirtueMartModelUser')) {
            require VMPATH_ADMIN . DS . 'models' . DS . 'user.php';
        }
        $usermodel = VmModel::getModel('user');
        $user = $usermodel->getUser();
        $user->shopper_groups = (array) $user->shopper_groups;
        $db = JFactory::getDBO();
        if (empty($vendorId)) {
            $vendorId = 1;
        }
        $select = 'SELECT i.*, ';
        $extPlgTable = '#__extensions';
        $extField1 = 'extension_id';
        $extField2 = 'element';
        $select .= 'j.`' . $extField1 . '`,j.`name`, j.`type`, j.`element`, j.`folder`, j.`client_id`, j.`enabled`, j.`access`, j.`protected`, j.`manifest_cache`,
			j.`params`, j.`custom_data`, j.`system_data`, j.`checked_out`, j.`checked_out_time`, j.`state`,  s.virtuemart_shoppergroup_id ';
        if (!VmConfig::$vmlang) {
            VmConfig::setdbLanguageTag();
        }
        $joins = array();
        if (VmConfig::$defaultLang != VmConfig::$vmlang and Vmconfig::$langCount > 1) {
            $langFields = array($this->_psType . '_name', $this->_psType . '_desc');
            $useJLback = false;
            if (VmConfig::$defaultLang != VmConfig::$jDefLang) {
                $joins[] = ' LEFT JOIN `#__virtuemart_' . $this->_psType . '_' . VmConfig::$jDefLang . '` as ljd';
                $useJLback = true;
            }
            foreach ($langFields as $langField) {
                $expr2 = 'ld.' . $langField;
                if ($useJLback) {
                    $expr2 = 'IFNULL(ld.' . $langField . ',ljd.' . $langField . ')';
                }
                $select .= ', IFNULL(l.' . $langField . ',' . $expr2 . ') as ' . $langField . '';
            }
            $joins[] = ' LEFT JOIN `#__virtuemart_' . $this->_psType . 'methods_' . VmConfig::$defaultLang . '` as ld using (`virtuemart_' . $this->_psType . 'method_id`)';
            $joins[] = ' LEFT JOIN `#__virtuemart_' . $this->_psType . 'methods_' . VmConfig::$vmlang . '` as l using (`virtuemart_' . $this->_psType . 'method_id`)';
        } else {
            $select .= ', l.* ';
            $joins[] = ' LEFT JOIN `#__virtuemart_' . $this->_psType . 'methods_' . VmConfig::$vmlang . '` as l using (`virtuemart_' . $this->_psType . 'method_id`)';
        }
        $q = $select . ' FROM   `#__virtuemart_' . $this->_psType . 'methods' . '` as i ';
        //$joins[] = ' JOIN `#__virtuemart_' . $this->_psType . 'methods` AS i USING (`virtuemart_' . $this->_psType . 'method_id`) ';
        $joins[] = ' LEFT JOIN `' . $extPlgTable . '` as j ON j.`' . $extField1 . '` =  i.`' . $this->_psType . '_jplugin_id` ';
        $joins[] = ' LEFT OUTER JOIN `#__virtuemart_' . $this->_psType . 'method_shoppergroups` AS s ON i.`virtuemart_' . $this->_psType . 'method_id` = s.`virtuemart_' . $this->_psType . 'method_id` ';
        $q .= implode(' ' . "\n", $joins);
        $q .= ' WHERE i.`published` = "1" AND j.`' . $extField2 . '` = "' . $this->_name . '"
	    						AND  (i.`virtuemart_vendor_id` = "' . $vendorId . '" OR i.`virtuemart_vendor_id` = "0" OR i.`shared` = "1")
	    						AND  (';
        foreach ($user->shopper_groups as $groups) {
            $q .= ' s.`virtuemart_shoppergroup_id`= "' . (int) $groups . '" OR';
        }
        $q .= ' (s.`virtuemart_shoppergroup_id`) IS NULL ) GROUP BY i.`virtuemart_' . $this->_psType . 'method_id` ORDER BY i.`ordering`';
        $db->setQuery($q);
        $this->methods = $db->loadObjectList();
        if ($this->methods) {
            foreach ($this->methods as $method) {
                VmTable::bindParameterable($method, $this->_xParams, $this->_varsToPushParam);
            }
        } else {
            if ($this->methods === false) {
                vmError('Error reading getPluginMethods ' . $q);
            }
        }
        return count($this->methods);
    }
开发者ID:thumbs-up-sign,项目名称:TuVanDuAn,代码行数:75,代码来源:vmpsplugin.php


注:本文中的VmTable::bindParameterable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。