本文整理汇总了PHP中VmConfig类的典型用法代码示例。如果您正苦于以下问题:PHP VmConfig类的具体用法?PHP VmConfig怎么用?PHP VmConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VmConfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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);
}
示例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 .= ' ' . JText::_($altText);
}
if ($text == '') {
$text .= ' ' . 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>';
}
}
示例5: __construct
public function __construct()
{
parent::__construct();
$this->useSSL = VmConfig::get('useSSL',0);
$this->useXHTML = true;
}
示例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';
}
}
}
}
示例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);
}
示例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;
}
示例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 .= ' ' . vmText::_($altText);
}
if ($text == '') {
$text .= ' ' . 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>';
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}