function display($tpl = null) { JHTML::_('behavior.keepalive'); require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_k2' . DS . 'models' . DS . 'categories.php'; $model = new K2ModelCategories(); $categories = $model->categoriesTree(NULL, false, false); $options = array(); $options[] = JHTML::_('select.optgroup', JText::_('K2MART_CREATE_NEW_K2_CATEGORY')); $options[] = JHTML::_('select.option', 0, JText::_('K2MART_TYPE_CATEGORY_NAME')); $options[] = JHTML::_('select.optgroup', JText::_('K2MART_USE_EXISTING_K2_CATEGORY')); foreach ($categories as $category) { $options[] = JHTML::_('select.option', $category->value, $category->text); } $lists['category'] = JHTML::_('select.genericlist', $options, 'catid', 'class="inputbox"', 'value', 'text', 0); $vmLanguages = vmConfig::get('active_languages', array()); if (count($vmLanguages) > 1) { jimport('joomla.language.helper'); $languages = JLanguageHelper::createLanguageList(NULL, constant('JPATH_SITE'), true); foreach ($languages as $key => &$language) { if (!in_array($language['value'], $vmLanguages)) { unset($languages[$key]); } } $lists['language'] = JHTML::_('select.genericlist', $languages, 'vmlang', '', 'value', 'text', NULL, 'vmlang'); } $this->assignRef('lists', $lists); $this->loadHelper('html'); K2martHTMLHelper::title('K2MART_VIRTUEMART_MIGRATOR'); K2martHTMLHelper::toolbar(); K2martHTMLHelper::subMenu(); parent::display($tpl); }
private function setCartLayout ($cart, $intoSession = true) { if (!class_exists('VmConfig')) { require(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php'); } VmConfig::loadConfig(); $olgConfig = vmConfig::get('oncheckout_opc', true); $this->saveVMOPCConfigInSession($olgConfig); vmConfig::set('oncheckout_opc', true); $cart->layoutPath = vmPlugin::getTemplatePath($this->_name, 'payment', 'cart'); $cart->layout = 'cart'; if ($intoSession) { $cart->setCartIntoSession(); } }
/** * Used when the vmOPC is set to OFF * @param $cart * @param $payment_advertise * @return null * In case OPC is off: the login widget is displayed on the cart, and on the payment list */ function plgVmOnCheckoutAdvertise($cart, &$payment_advertise) { if (vmConfig::get('oncheckout_opc') == 0) { $html = NULL; $this->displayListFE($cart, $cart->virtuemart_paymentmethod_id, $html); } }
/** * Sets the file information and paths/urls and so on. * * @author Max Milbers * @param unknown_type $filename * @param unknown_type $url * @param unknown_type $path */ function setFileInfo($type = 0) { $this->file_url_folder = ''; $this->file_path_folder = ''; $this->file_url_folder_thumb = ''; if ($this->file_is_forSale == 0 and $type != 'forSale') { $this->file_url_folder = $this->getMediaUrlByView($type); $this->file_url_folder_thumb = $this->file_url_folder . 'resized/'; $this->file_path_folder = str_replace('/', DS, $this->file_url_folder); } else { $safePath = VmConfig::get('forSale_path', 0); if (empty($safePath)) { $lastIndex = strrpos(JPATH_ROOT, DS); $suggestedPath = substr(JPATH_ROOT, 0, $lastIndex) . DS . 'vmfiles'; VmWarn('COM_VIRTUEMART_WARN_NO_SAFE_PATH_SET', JText::_('COM_VIRTUEMART_ADMIN_CFG_MEDIA_FORSALE_PATH'), $suggestedPath); return false; } $this->file_path_folder = $safePath; $this->file_url_folder = $this->file_path_folder; //str_replace(DS,'/',$this->file_path_folder); $this->file_url_folder_thumb = VmConfig::get('forSale_path_thumb'); } //Clean from possible injection while (strpos($this->file_path_folder, '..') !== false) { $this->file_path_folder = str_replace('..', '', $this->file_path_folder); } $this->file_path_folder = preg_replace('#[/\\\\]+#', DS, $this->file_path_folder); if (empty($this->file_url)) { $this->file_url = $this->file_url_folder; $this->file_name = ''; $this->file_extension = ''; } else { if (!class_exists('JFile')) { require JPATH_VM_LIBRARIES . DS . 'joomla' . DS . 'filesystem' . DS . 'file.php'; } // $lastIndexOfSlash= strrpos($this->file_url,'/'); // $name = substr($this->file_url,$lastIndexOfSlash+1); $name = str_replace($this->file_url_folder, '', $this->file_url); if (!empty($name) && $name !== '/') { $this->file_name = JFile::stripExt($name); //Ensure using right directory if ($this->file_is_forSale == 0) { $file_url = $this->getMediaUrlByView($type) . $this->file_name; } else { $file_url = vmConfig::get('forSale_path'); } if (JFile::exists($file_url)) { $this->file_url = $file_url; } $this->file_extension = strtolower(JFile::getExt($name)); } } if ($this->file_is_downloadable) { $this->media_role = 'file_is_downloadable'; } if ($this->file_is_forSale) { $this->media_role = 'file_is_forSale'; } if (empty($this->media_role)) { $this->media_role = 'file_is_displayable'; } // vmdebug('$this->media_role',$this->media_role); $this->determineFoldersToTest(); if (!empty($this->file_url) && empty($this->file_url_thumb)) { $this->displayMediaThumb('', true, '', false); } }