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); }
function start() { ENTER("mailMenu::start", __LINE__); if (!$this->_myConf->isBuild()) { return; } $this->_generalProperties(); do { unset($aMenu); $aIndex = -1; $aAction[++$aIndex] = "ADD"; $aMenu[$aIndex] = gettext("Add a mailbox"); // Is there already a mailbox ? if ($aNumberOfMailsource = $this->_myConf->getNumberOfMailSource()) { $aAction[++$aIndex] = "MODIFY"; $aMenu[$aIndex] = gettext("Modify a mailbox"); $aAction[++$aIndex] = "DELETE"; $aMenu[$aIndex] = gettext("Delete a mailbox"); } $aAction[++$aIndex] = "QUIT"; $aMenu[$aIndex] = gettext("Return to main menu"); $aDialog = new cliDialog($this->_myTerminal, false); $aText = NULL; $aSelectedOption = NULL; $aKeyIsDisplayed = true; $aKeyPressed = $aDialog->menu(gettext("About mail boxes"), $aMenu, $aResult, $aText, $aSelectedOption, $aKeyIsDisplayed); unset($aDialog); if ($aKeyPressed == OkPressedValue) { switch ($aAction[$aResult]) { case "ADD": $aKeyPressed = $this->_addMailbox(); break; case "MODIFY": $aKeyPressed = $this->_modifyMailbox(); break; case "DELETE": $aKeyPressed = $this->_deleteMailbox(); break; case "QUIT": default: $aKeyPressed = EscapePressedValue; break; } } } while ($aKeyPressed == OkPressedValue); $aDialog = new cliDialog($this->_myTerminal, false); $aKeyPressed = $aDialog->yesNo(gettext("Do you want to save your changes")); unset($aDialog); if ($aKeyPressed == OkPressedValue) { $this->_myConf->save(); $a = new vmConfig($this->_myConf); $a->save(); $a = new emacsConfig($this->_myConf); if ($a->save() == TRUE) { echo gettext("\nYour changes have been saved"); } } }
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); } }
<table> <tr> <td align="left" width="100%"> <?php echo vmText::_('COM_VIRTUEMART_ORDERSTATUS') . $this->lists['state_list']; ?> <?php echo vmText::_('COM_VIRTUEMART_REPORT_INTERVAL') . $this->lists['intervals']; ?> <?php echo vmText::_('COM_VIRTUEMART_REPORT_SET_PERIOD') . $this->lists['select_date']; echo vmText::_('COM_VIRTUEMART_REPORT_FROM_PERIOD') . vmJsApi::jDate($this->from_period, 'from_period'); echo vmText::_('COM_VIRTUEMART_REPORT_UNTIL_PERIOD') . vmJsApi::jDate($this->until_period, 'until_period'); if (VmConfig::get('multix', 'none') != 'none') { $vendorId = vmConfig::isSuperVendor(); if (vmAccess::manager('managevendors')) { $vendorId = vRequest::getInt('virtuemart_vendor_id', $vendorId); } echo ShopFunctions::renderVendorList($vendorId); } ?> <button class="btn btn-small" onclick="this.form.period.value='';this.form.submit();"><?php echo vmText::_('COM_VIRTUEMART_GO'); ?> </button> </td> </tr> </table> </div> <div id="resultscounter">