• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP VmConfig类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getOptions

 protected function getOptions()
 {
     //check com_vituemart existed
     $path = JPATH_ADMINISTRATOR . '/components/com_virtuemart';
     if (!is_dir($path) || !file_exists(JPATH_ADMINISTRATOR . '/components/com_virtuemart/helpers/config.php')) {
         $this->options[] = JHtml::_('select.option', '', JText::_('COM_VIRTUEMART_NOT_EXIST'));
     } else {
         // Initialize variables
         require_once JPATH_ADMINISTRATOR . '/components/com_virtuemart/helpers/config.php';
         require_once JPATH_ADMINISTRATOR . '/components/com_virtuemart/models/category.php';
         VmConfig::loadConfig();
         $categoryModel = new VirtueMartModelCategory();
         $categoryModel->_noLimit = true;
         $categories = $categoryModel->getCategories();
         if (count($categories)) {
             // iterating
             $temp_options = array();
             foreach ($categories as $item) {
                 array_push($temp_options, array($item->virtuemart_category_id, $item->category_name, $item->category_parent_id));
             }
             foreach ($temp_options as $option) {
                 if ($option[2] == 0) {
                     $this->options[] = JHtml::_('select.option', $option[0], $option[1]);
                     $this->recursive_options($temp_options, 1, $option[0]);
                 }
             }
         }
     }
     return $this->options;
 }
开发者ID:thumbs-up-sign,项目名称:TuVanDuAn,代码行数:30,代码来源:vmcategories.php


示例2: save

 /**
  * Save the file to the specified path
  * @return boolean TRUE on success
  */
 function save($path, $filename)
 {
     $input = fopen("php://input", "r");
     $temp = tmpfile();
     $realSize = stream_copy_to_stream($input, $temp);
     fclose($input);
     if ($realSize != $this->getSize()) {
         return false;
     }
     $target = fopen($path, "w");
     fseek($temp, 0, SEEK_SET);
     stream_copy_to_stream($temp, $target);
     fclose($target);
     //insert data into attachment table
     if (!class_exists('VmConfig')) {
         require JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php';
     }
     $thumb_width = VmConfig::loadConfig()->get('img_width');
     $user_s =& JFactory::getUser();
     $user_id = $user_s->id;
     $product_vm_id = JRequest::getInt('virtuemart_product_id');
     $database =& JFactory::getDBO();
     $gallery = new stdClass();
     $gallery->id = 0;
     $gallery->virtuemart_user_id = $user_id;
     $gallery->virtuemart_product_id = $product_vm_id;
     $gallery->file_name = $filename;
     $gallery->created_on = date('Y-m-d,H:m:s');
     if (!$database->insertObject('#__virtuemart_product_attachments', $gallery, 'id')) {
         echo $database->stderr();
         return false;
     }
     // end of insert data
     return true;
 }
开发者ID:naka211,项目名称:compac,代码行数:39,代码来源:php.php


示例3: getInput

 /**
  * Method to get the field input markup.
  *
  * @return	string	The field input markup.
  * @since	1.6
  */
 function getInput()
 {
     $key = $this->element['key_field'] ? $this->element['key_field'] : 'value';
     $val = $this->element['value_field'] ? $this->element['value_field'] : $this->name;
     VmConfig::loadConfig();
     return JHtml::_('select.genericlist', $this->_getProducts(), $this->name, 'class="inputbox"   ', 'value', 'text', $this->value, $this->id);
 }
开发者ID:cybershocik,项目名称:Darek,代码行数:13,代码来源:product.php


示例4: linkIcon

 function linkIcon($link, $altText = '', $boutonName, $verifyConfigValue = false, $modal = true, $use_icon = true, $use_text = false)
 {
     if ($this->document->_type == 'pdf') {
         return;
     }
     if ($verifyConfigValue) {
         if (!VmConfig::get($verifyConfigValue, 0)) {
             return '';
         }
     }
     // $folder = '/media/system/images/'; // use of relative path, $folder is not needed in j3
     $text = '';
     // if ( $use_icon ) $text .= JHtml::_('image', $boutonName.'.png', JText::_($altText),  null, true);
     if ($use_icon) {
         $text .= '<span class="' . $boutonName . '"> </span>';
     }
     //JHtml::_('image', $boutonName.'.png', JText::_($altText),  null, true);
     if ($use_text) {
         $text .= '&nbsp;' . JText::_($altText);
     }
     if ($text == '') {
         $text .= '&nbsp;' . JText::_($altText);
     }
     if ($modal) {
         return '<a class="modal btn btn-default" rel="{handler: \'iframe\', size: {x: 700, y: 550}}" title="' . JText::_($altText) . '" href="' . JRoute::_($link) . '">' . $text . '</a>';
     } else {
         return '<a class="btn btn-default" title="' . JText::_($altText) . '" href="' . JRoute::_($link, FALSE) . '">' . $text . '</a>';
     }
 }
开发者ID:denis1001,项目名称:Virtuemart-2-Joomla-3-Bootstrap,代码行数:29,代码来源:vmview.php


示例5: __construct

	public function __construct()
	{
		parent::__construct();
		$this->useSSL = VmConfig::get('useSSL',0);
		$this->useXHTML = true;

	}
开发者ID:rubengarcia0510,项目名称:tienda,代码行数:7,代码来源:user.php


示例6: onAfterRoute

 function onAfterRoute()
 {
     if (JFactory::getApplication()->isAdmin()) {
         return;
     }
     $input = JFactory::getApplication()->input;
     $document = JFactory::getDocument();
     $app = JFactory::getApplication();
     $template = $app->getTemplate(true);
     if (!class_exists('VmConfig')) {
         require JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_virtuemart' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'config.php';
     }
     VmConfig::loadConfig();
     $uri = JFactory::getURI();
     $input = JFactory::getApplication()->input;
     $post = $input->post->getArray();
     $_option = $input->getString('option');
     $_view = $input->getString('view');
     $_format = $input->getString('format');
     $_task = $input->getString('task');
     $_tmpl = $input->getString('tmpl');
     if ($_option == 'com_virtuemart' && $_view == 'cart' && $_format != 'json') {
         require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'cart' . DIRECTORY_SEPARATOR . 'view.html.php';
     } else {
         if ($_option == 'com_virtuemart' && $_view == 'vmplg' && $_task == "pluginUserPaymentCancel") {
             require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'cart' . DIRECTORY_SEPARATOR . 'view.html.php';
         } else {
             if ($_option == 'com_virtuemart' && $_view == 'pluginresponse' && $_task == "pluginUserPaymentCancel") {
                 require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'cart' . DIRECTORY_SEPARATOR . 'view.html.php';
             }
         }
     }
 }
开发者ID:joomlaproffs,项目名称:vmonepage,代码行数:33,代码来源:onepage_generic.php


示例7: fetchElement

 function fetchElement($name, $value, &$node, $control_name)
 {
     VmConfig::loadJLang('com_virtuemart', false);
     if (!class_exists('VirtueMartModelVendor')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'vendor.php';
     }
     $vendorId = 1;
     //VirtueMartModelVendor::getLoggedVendor();
     $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'];
     }
     $q = 'SELECT `virtuemart_currency_id` AS value ,CONCAT_WS(" ",`currency_name`,`currency_symbol`) as text FROM `#__virtuemart_currencies` WHERE `virtuemart_currency_id` IN (' . $vendor_currency['vendor_accepted_currencies'] . ') and (`virtuemart_vendor_id` = "' . $vendorId . '" OR `shared`="1") AND published = "1" ORDER BY `ordering`,`currency_name`';
     $db->setQuery($q);
     $currencies = $db->loadObjectList();
     $options = array();
     $options[] = array('value' => 0, 'text' => JText::_('COM_VIRTUEMART_DEFAULT_VENDOR_CURRENCY'));
     if (!is_array($currencies)) {
         $currencies = (array) $currencies;
     }
     foreach ($currencies as $currency) {
         $options[] = array('value' => $currency->value, 'text' => $currency->text);
     }
     $class = $node->attributes('class') ? 'class="' . $node->attributes('class') . '"' : '';
     return JHTML::_('select.genericlist', $options, $control_name . '[' . $name . ']', $class, 'value', 'text', $value, $control_name . $name);
 }
开发者ID:juanmcortez,项目名称:Lectorum,代码行数:29,代码来源:vmacceptedcurrency.php


示例8: plgVmDisplayListFEPayment

 /**
  * This shows the plugin for choosing in the payment list of the checkout process.
  *
  * @author Valerie Cartan Isaksen
  */
 public function plgVmDisplayListFEPayment(VirtueMartCart $cart, $selected = 0, &$htmlIn)
 {
     if ($this->getPluginMethods($cart->vendorId) === 0) {
         if (empty($this->_name)) {
             $app = JFactory::getApplication();
             $app->enqueueMessage(vmText::_('COM_VIRTUEMART_CART_NO_' . strtoupper($this->_psType)));
             return false;
         } else {
             return false;
         }
     }
     $html = array();
     $method_name = $this->_psType . '_name';
     VmConfig::loadJLang('com_virtuemart', true);
     vmJsApi::jCreditCard();
     $htmla = '';
     $html = array();
     foreach ($this->methods as $_currentMethod) {
         $this->_currentMethod = $_currentMethod;
         if ($this->checkConditions($cart, $this->_currentMethod, $cart->cartPrices)) {
             $cartPrices = $cart->cartPrices;
             $methodSalesPrice = $this->setCartPrices($cart, $cartPrices, $this->_currentMethod);
             $this->_currentMethod->{$method_name} = $this->renderPluginName($this->_currentMethod);
             $sandbox = $this->_currentMethod->sandbox;
             $html = $this->getPluginHtml($this->_currentMethod, $selected, $methodSalesPrice);
             if ($selected == $this->_currentMethod->virtuemart_paymentmethod_id && $this->hasBillingAddress($cart)) {
                 $html .= $this->displayForm($cart, $sandbox);
             }
             $htmla[] = $html;
         }
     }
     $htmlIn[] = $htmla;
     return true;
 }
开发者ID:everypay,项目名称:everypay-virtuemart,代码行数:39,代码来源:everypay.php


示例9: linkIcon

 function linkIcon($link, $altText = '', $boutonName, $verifyConfigValue = false, $modal = true, $use_icon = true, $use_text = false, $class = '')
 {
     if ($verifyConfigValue) {
         if (!VmConfig::get($verifyConfigValue, 0)) {
             return '';
         }
     }
     $folder = 'media/system/images/';
     //shouldn't be root slash before media, as it automatically tells to look in root directory, for media/system/ which is wrong it should append to root directory.
     $text = '';
     if ($use_icon) {
         $text .= JHtml::_('image', $folder . $boutonName . '.png', vmText::_($altText), null, false, false);
     }
     //$folder shouldn't be as alt text, here it is: image(string $file, string $alt, mixed $attribs = null, boolean $relative = false, mixed $path_rel = false) : string, you should change first false to true if images are in templates media folder
     if ($use_text) {
         $text .= '&nbsp;' . vmText::_($altText);
     }
     if ($text == '') {
         $text .= '&nbsp;' . vmText::_($altText);
     }
     if ($modal) {
         return '<a ' . $class . ' class="modal" rel="{handler: \'iframe\', size: {x: 700, y: 550}}" title="' . vmText::_($altText) . '" href="' . JRoute::_($link, FALSE) . '">' . $text . '</a>';
     } else {
         return '<a ' . $class . ' title="' . vmText::_($altText) . '" href="' . JRoute::_($link, FALSE) . '">' . $text . '</a>';
     }
 }
开发者ID:lenard112,项目名称:cms,代码行数:26,代码来源:vmview.php


示例10: 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 ($this->showVendors()) {
             $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);
 }
开发者ID:thumbs-up-sign,项目名称:TuVanDuAn,代码行数:60,代码来源:view.html.php


示例11: __construct

 function __construct()
 {
     parent::__construct();
     // Load the database and execute our sql file
     $this->db = JFactory::getDBO();
     // Get information of our plugin so we can pass it on to MDS Collivery for Logs
     $sel_query = "SELECT * FROM `#__extensions` where type = 'plugin' and element = 'mds_shipping' and folder = 'vmshipment';";
     $this->db->setQuery($sel_query);
     $this->db->query();
     $this->extension_id = $this->db->loadObjectList()[0]->extension_id;
     $this->app_name = $this->db->loadObjectList()[0]->extension_id;
     $this->app_info = json_decode($this->db->loadObjectList()[0]->manifest_cache);
     // Get our login information
     $config_query = "SELECT * FROM `#__mds_collivery_config` where id = 1;";
     $this->db->setQuery($config_query);
     $this->db->query();
     $this->password = $this->db->loadObjectList()[0]->password;
     $this->username = $this->db->loadObjectList()[0]->username;
     $this->risk_cover = $this->db->loadObjectList()[0]->risk_cover;
     $version = new JVersion();
     require_once preg_replace('|com_installer|i', "", JPATH_COMPONENT_ADMINISTRATOR) . '/helpers/config.php';
     $config = array('app_name' => $this->app_info->name, 'app_version' => $this->app_info->version, 'app_host' => "Joomla: " . $version->getShortVersion() . ' - Virtuemart: ' . VmConfig::getInstalledVersion(), 'app_url' => JURI::base(), 'user_email' => $this->username, 'user_password' => $this->password);
     // Use the MDS API Files
     require_once JPATH_PLUGINS . '/vmshipment/mds_shipping/Mds/Cache.php';
     require_once JPATH_PLUGINS . '/vmshipment/mds_shipping/Mds/Collivery.php';
     $this->collivery = new Mds\Collivery($config);
     // Get some information from the API
     $this->towns = $this->collivery->getTowns();
     $this->services = $this->collivery->getServices();
     $this->location_types = $this->collivery->getLocationTypes();
     $this->suburbs = $this->collivery->getSuburbs(null);
 }
开发者ID:Zash22,项目名称:Collivery-Virtuemart,代码行数:32,代码来源:view.json.php


示例12: display

	function display ($tpl = null) {

		// Load the helper(s)


		jimport('joomla.filesystem.file');
		$config = JFactory::getConfig();
		$log_path = $config->get('log_path', VMPATH_ROOT . "/log");
		$layoutName = vRequest::getCmd('layout', 'default');
		VmConfig::loadJLang('com_virtuemart_log');

		if ($layoutName == 'edit') {
			$logFile = vRequest::getString('logfile', '');
			$this->SetViewTitle('LOG', $logFile);
			$fileContent = file_get_contents($log_path . DS . $logFile);
			$fileContentByLine = explode("\n", $fileContent);

			$this->assignRef('fileContentByLine', $fileContentByLine);
			JToolBarHelper::cancel();

		} else {
			if(!class_exists('JFolder')) require(VMPATH_LIBS.DS.'joomla'.DS.'filesystem'.DS.'folder.php');

			$logFiles = JFolder::files($log_path, $filter = '.', true, false, array('index.html'));

			$this->SetViewTitle('LOG');
			$this->assignRef('logFiles', $logFiles);
			$this->assignRef('path', $log_path);
		}

		parent::display($tpl);
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:32,代码来源:view.html.php


示例13: Img2Thumb

 /**
 *   Constructor - requires following vars:
 *
 *	@param string $filename			image path
 *
 *	These are additional vars:
 *
 *	@param int $newxsize			new maximum image width
 *	@param int $newysize			new maximum image height
 *	@param string $fileout			output image path
 *	@param int $thumbMaxSize		whether thumbnail should have background fill to make it exactly $newxsize x $newysize
 *	@param int $bgred				0-255 - red color variable for background filler
 *	@param int $bggreen				0-255 - green color variable for background filler
 *	@param int $bgblue				0-255 - blue color variable for background filler
 *
 */
 function Img2Thumb($filename, $newxsize = 60, $newysize = 60, $fileout = '', $thumbMaxSize = 0, $bgred = 0, $bggreen = 0, $bgblue = 0)
 {
     //Some big pictures need that
     VmConfig::ensureMemoryLimit(128);
     //	New modification - checks color int to be sure within range
     if ($thumbMaxSize) {
         $this->maxSize = true;
     } else {
         $this->maxSize = false;
     }
     if ($bgred >= 0 || $bgred <= 255) {
         $this->bg_red = $bgred;
     } else {
         $this->bg_red = 0;
     }
     if ($bggreen >= 0 || $bggreen <= 255) {
         $this->bg_green = $bggreen;
     } else {
         $this->bg_green = 0;
     }
     if ($bgblue >= 0 || $bgblue <= 255) {
         $this->bg_blue = $bgblue;
     } else {
         $this->bg_blue = 0;
     }
     $this->NewImgCreate($filename, $newxsize, $newysize, $fileout);
 }
开发者ID:juanmcortez,项目名称:Lectorum,代码行数:43,代码来源:img2thumb.php


示例14: display

 function display($tpl = null)
 {
     // Load the helper(s)
     if (!class_exists('VmConfig')) {
         require JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'config.php';
     }
     VmConfig::loadConfig();
     VmConfig::loadJLang('com_virtuemart_countries');
     if (!class_exists('VmHTML')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
     }
     $model = VmModel::getModel('country');
     $zoneModel = VmModel::getModel('worldzones');
     $this->SetViewTitle();
     $layoutName = JRequest::getWord('layout', 'default');
     if ($layoutName == 'edit') {
         $country = $model->getData();
         $this->assignRef('country', $country);
         $wzsList = $zoneModel->getWorldZonesSelectList();
         $this->assignRef('worldZones', $wzsList);
         $this->addStandardEditViewCommands();
     } else {
         $this->addStandardDefaultViewCommands(true, false);
         //First the view lists, it sets the state of the model
         $this->addStandardDefaultViewLists($model, 0, 'ASC');
         $filter_country = JRequest::getWord('filter_country', false);
         $countries = $model->getCountries(false, false, $filter_country);
         $this->assignRef('countries', $countries);
         $pagination = $model->getPagination();
         $this->assignRef('pagination', $pagination);
     }
     parent::display($tpl);
 }
开发者ID:juanmcortez,项目名称:Lectorum,代码行数:33,代码来源:view.html.php


示例15: display

 function display($tpl = null)
 {
     $db = JFactory::getDBO();
     if ($field = JRequest::getVar('field')) {
         if (strpos($field, 'plugin') !== false) {
             if (JVM_VERSION === 1) {
                 $table = '#__plugins';
                 //$ext_id = 'id';
             } else {
                 $table = '#__extensions';
                 //$ext_id = 'extension_id';
             }
             $field = substr($field, 6);
             $q = 'SELECT `params`,`element` FROM `' . $table . '` WHERE `element` = "' . $field . '"';
             $db->setQuery($q);
             $this->plugin = $db->loadObject();
             if (!class_exists('vmParameters')) {
                 require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'parameterparser.php';
             }
             $parameters = new vmParameters($this->plugin, $this->plugin->element, 'plugin', 'vmuserfield');
             $lang = JFactory::getLanguage();
             $filename = 'plg_vmuserfield_' . $this->plugin->element;
             if (VmConfig::get('enableEnglish', 1)) {
                 $lang->load($filename, JPATH_ADMINISTRATOR, 'en-GB', true);
             }
             $lang->load($filename, JPATH_ADMINISTRATOR, $lang->getDefault(), true);
             $lang->load($filename, JPATH_ADMINISTRATOR, null, true);
             echo $parameters->render();
             //echo '<input type="hidden" value="'.$this->plugin->element.'" name="custom_value">';
             jExit();
         }
     }
     jExit();
 }
开发者ID:Arturogcalleja,项目名称:herbolario,代码行数:34,代码来源:view.json.php


示例16: save

	/**
	 * Handle the save task
	 */
	function save($data = 0){

		vRequest::vmCheckToken();
		$model = VmModel::getModel('config');

		$data = vRequest::getPost();

		if(strpos($data['offline_message'],'|')!==false){
			$data['offline_message'] = str_replace('|','',$data['offline_message']);
		}

		$msg = '';
		if ($model->store($data)) {
			$msg = vmText::_('COM_VIRTUEMART_CONFIG_SAVED');
			// Load the newly saved values into the session.
			VmConfig::loadConfig();
		}

		$redir = 'index.php?option=com_virtuemart';
		if(vRequest::getCmd('task') == 'apply'){
			$redir = $this->redirectPath;
		}

		$this->setRedirect($redir, $msg);


	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:30,代码来源:config.php


示例17: display

 function display($tpl = null)
 {
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $this->vendorId = VmConfig::isSuperVendor();
     // TODO add icon for media view
     $this->SetViewTitle();
     $model = VmModel::getModel('media');
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $this->media = $model->getFile();
         $this->addStandardEditViewCommands();
     } else {
         $virtuemart_product_id = vRequest::getInt('virtuemart_product_id');
         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;
         }
         $cat_id = vRequest::getInt('virtuemart_category_id', 0);
         JToolBarHelper::custom('synchronizeMedia', 'new', 'new', vmText::_('COM_VIRTUEMART_TOOLS_SYNC_MEDIA_FILES'), false);
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model, null, null, 'searchMedia');
         $options = array('' => vmText::_('COM_VIRTUEMART_LIST_ALL_TYPES'), 'product' => vmText::_('COM_VIRTUEMART_PRODUCT'), 'category' => vmText::_('COM_VIRTUEMART_CATEGORY'), 'manufacturer' => vmText::_('COM_VIRTUEMART_MANUFACTURER'), 'vendor' => vmText::_('COM_VIRTUEMART_VENDOR'));
         $this->lists['search_type'] = VmHTML::selectList('search_type', vRequest::getVar('search_type'), $options, 1, '', 'onchange="this.form.submit();"');
         $options = array('' => vmText::_('COM_VIRTUEMART_LIST_ALL_ROLES'), 'file_is_displayable' => vmText::_('COM_VIRTUEMART_FORM_MEDIA_DISPLAYABLE'), 'file_is_downloadable' => vmText::_('COM_VIRTUEMART_FORM_MEDIA_DOWNLOADABLE'), 'file_is_forSale' => vmText::_('COM_VIRTUEMART_FORM_MEDIA_SET_FORSALE'));
         $this->lists['search_role'] = VmHTML::selectList('search_role', vRequest::getVar('search_role'), $options, 1, '', 'onchange="this.form.submit();"');
         $this->files = $model->getFiles(false, false, $virtuemart_product_id, $cat_id);
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
开发者ID:naka211,项目名称:studiekorrektur,代码行数:33,代码来源:view.html.php


示例18: display

 function display($tpl = null)
 {
     // Load the helper(s)
     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);
     if ($layoutName == 'edit') {
         //For shoppergroup specific price display
         VmConfig::loadJLang('com_virtuemart_config');
         VmConfig::loadJLang('com_virtuemart_shoppers', true);
         $shoppergroup = $model->getShopperGroup();
         $this->SetViewTitle('SHOPPERGROUP', $shoppergroup->shopper_group_name);
         $vendors = ShopFunctions::renderVendorList($shoppergroup->virtuemart_vendor_id);
         $this->assignRef('vendorList', $vendors);
         $this->assignRef('shoppergroup', $shoppergroup);
         $this->addStandardEditViewCommands();
     } else {
         $this->SetViewTitle();
         $showVendors = $this->showVendors();
         $this->assignRef('showVendors', $showVendors);
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model);
         $shoppergroups = $model->getShopperGroups(false, true);
         $this->assignRef('shoppergroups', $shoppergroups);
         $pagination = $model->getPagination();
         $this->assignRef('sgrppagination', $pagination);
     }
     parent::display($tpl);
 }
开发者ID:cybershocik,项目名称:Darek,代码行数:33,代码来源:view.html.php


示例19: vm_require

 protected function vm_require()
 {
     if (!class_exists('VmConfig')) {
         if (file_exists(JPATH_ADMINISTRATOR . '/components/com_virtuemart/helpers/config.php')) {
             require JPATH_ADMINISTRATOR . '/components/com_virtuemart/helpers/config.php';
         } else {
             $this->error = 'Could not find VmConfig helper';
             return false;
         }
     }
     VmConfig::loadConfig();
     VmConfig::loadJLang('com_virtuemart', true);
     if (!class_exists('VmModel')) {
         if (defined('JPATH_VM_ADMINISTRATOR') && file_exists(JPATH_VM_ADMINISTRATOR . '/helpers/vmmodel.php')) {
             require JPATH_VM_ADMINISTRATOR . '/helpers/vmmodel.php';
         } else {
             $this->error = 'Could not find VmModel helper';
             return false;
         }
     }
     if (defined('JPATH_VM_ADMINISTRATOR')) {
         JTable::addIncludePath(JPATH_VM_ADMINISTRATOR . '/tables');
     }
     if (!class_exists('VirtueMartModelCustom')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'custom.php';
     }
     if (!class_exists('VirtueMartModelCustomfields')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'customfields.php';
     }
     return true;
 }
开发者ID:proyectoseb,项目名称:ShoppyStore,代码行数:31,代码来源:sjvmcustomfields.php


示例20: paste

 /**
  * Paste the table  in json format
  *
  */
 public function paste()
 {
     // TODO Test user ?
     $json = array();
     $json['fields'] = 'error';
     $json['msg'] = 'Invalid Token';
     $json['structure'] = 'empty';
     if (!JSession::checkToken('get')) {
         echo json_encode($json);
         jexit();
     }
     $lang = JRequest::getvar('lg');
     $langs = VmConfig::get('active_languages', array());
     $language = JFactory::getLanguage();
     if (!in_array($lang, $langs)) {
         $json['msg'] = 'Invalid language ! ' . $lang;
         $json['langs'] = $langs;
         echo json_encode($json);
         jexit();
     }
     $lang = strtolower($lang);
     // Remove tag if defaut or
     // if ($language->getDefault() == $lang ) $dblang ='';
     $dblang = strtr($lang, '-', '_');
     $id = JRequest::getInt('id', 0);
     $viewKey = JRequest::getWord('editView');
     // we have here 2 access user & vendor give same results
     if ($viewKey == 'user') {
         $viewKey = 'vendor';
     }
     // Not needed , vendor is checked in constructor
     //if ($viewKey == 'vendor') $id = 1 ;
     $tables = array('category' => 'categories', 'product' => 'products', 'manufacturer' => 'manufacturers', 'manufacturercategories' => 'manufacturercategories', 'vendor' => 'vendors', 'paymentmethod' => 'paymentmethods', 'shipmentmethod' => 'shipmentmethods');
     if (!isset($tables[$viewKey])) {
         $json['msg'] = "Invalid view " . $viewKey;
         echo json_encode($json);
         jExit();
     }
     $tableName = '#__virtuemart_' . $tables[$viewKey] . '_' . $dblang;
     $db = JFactory::getDBO();
     $q = 'select * FROM `' . $tableName . '` where `virtuemart_' . $viewKey . '_id` =' . $id;
     $db->setQuery($q);
     if ($json['fields'] = $db->loadAssoc()) {
         $json['structure'] = 'filled';
         $json['msg'] = jText::_('COM_VIRTUEMART_SELECTED_LANG') . ':' . $lang;
     } else {
         $json['structure'] = 'empty';
         $db->setQuery('SHOW COLUMNS FROM ' . $tableName);
         $tableDescribe = $db->loadAssocList();
         array_shift($tableDescribe);
         $fields = array();
         foreach ($tableDescribe as $key => $val) {
             $fields[$val['Field']] = $val['Field'];
         }
         $json['fields'] = $fields;
         $json['msg'] = JText::sprintf('COM_VIRTUEMART_LANG_IS_EMPTY', $lang, jText::_('COM_VIRTUEMART_' . strtoupper($viewKey)));
     }
     echo json_encode($json);
     jExit();
 }
开发者ID:denis1001,项目名称:Virtuemart-2-Joomla-3-Bootstrap,代码行数:64,代码来源:translate.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP VmController类代码示例发布时间:2022-05-23
下一篇:
PHP Visitor类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap