本文整理汇总了PHP中tsmConfig::loadConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP tsmConfig::loadConfig方法的具体用法?PHP tsmConfig::loadConfig怎么用?PHP tsmConfig::loadConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tsmConfig
的用法示例。
在下文中一共展示了tsmConfig::loadConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
tsmConfig::loadConfig();
return JHtml::_('select.genericlist', $this->_getProducts(), $this->name, 'class="inputbox" ', 'value', 'text', $this->value, $this->id);
}
示例2: getOptions
protected function getOptions()
{
tsmConfig::loadConfig();
// if VM is not installed
if (!JFolder::exists(JPATH_ROOT . '/administrator/components/com_virtuemart') or !class_exists('ShopFunctions')) {
// add the root item
$option = new stdClass();
$option->text = JText::_('MOD_SLIDESHOWCK_VIRTUEMART_NOTFOUND');
$option->value = '0';
$options[] = $option;
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
return $options;
}
$categorylist = ShopFunctions::categoryListTree();
// $categorylist = 'testced';
$categorylist = trim($categorylist, '</option>');
$categorylist = explode("</option><option", $categorylist);
// add the root item
$option = new stdClass();
$option->text = JText::_('MOD_SLIDESHOWCK_VIRTUEMART_ROOTNODE');
$option->value = '0';
$options[] = $option;
foreach ($categorylist as $cat) {
$option = new stdClass();
$text = explode(">", $cat);
$option->text = trim($text[1]);
$option->value = strval(trim(trim(trim($text[0]), '"'), 'value="'));
$options[] = $option;
}
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
return $options;
}
示例3: getInput
function getInput()
{
tsmConfig::loadConfig();
tsmConfig::loadJLang('com_tsmart');
$model = tmsModel::getModel('Manufacturer');
$manufacturers = $model->getManufacturers(true, true, false);
return JHtml::_('select.genericlist', $manufacturers, $this->name, 'class="inputbox" ', 'value', 'text', $this->value, $this->id);
}
示例4: getInput
/**
* Method to get the field input markup for Access Control Lists.
* This is an overload of the core Rules form field
* It address the issue where several rules cannot be used in the same configuration file
*/
protected function getInput()
{
tsmConfig::loadConfig();
JHtml::_('behavior.tooltip');
if (JVM_VERSION < 3) {
return $this->vmRulesJ25();
} else {
return $this->vmRules();
}
}
示例5: getInput
function getInput()
{
tsmConfig::loadConfig();
tsmConfig::loadJLang('com_tsmart');
$key = $this->element['key_field'] ? $this->element['key_field'] : 'value';
$val = $this->element['value_field'] ? $this->element['value_field'] : $this->name;
$model = tmsModel::getModel('vendor');
$vendors = $model->getVendors(true, true, false);
return JHtml::_('select.genericlist', $vendors, $this->name, 'class="inputbox" size="1"', 'tsmart_vendor_id', 'vendor_name', $this->value, $this->id);
}
示例6: getInput
/**
* Method to get the field input markup.
*
* @return string The field input markup.
* @since 1.6
*/
protected function getInput()
{
tsmConfig::loadConfig();
tsmConfig::loadJLang('com_tsmart');
$categorylist = ShopFunctions::categoryListTree(array($this->value));
$html = '<select class="inputbox" name="' . $this->name . '" >';
$html .= '<option value="0">' . tsmText::_('com_tsmart_CATEGORY_FORM_TOP_LEVEL') . '</option>';
$html .= $categorylist;
$html .= "</select>";
return $html;
}
示例7: getInput
function getInput()
{
tsmConfig::loadConfig();
$model = tmsModel::getModel('Manufacturer');
$manufacturers = $model->getManufacturers(true, true, false);
$emptyOption = JHtml::_('select.option', '', tsmText::_('com_tsmart_LIST_EMPTY_OPTION'), 'tsmart_manufacturer_id', 'mf_name');
if (!empty($manufacturers) and is_array($manufacturers)) {
array_unshift($manufacturers, $emptyOption);
} else {
$manufacturers = array($emptyOption);
}
return JHtml::_('select.genericlist', $manufacturers, $this->name, 'class="inputbox" size="1"', 'tsmart_manufacturer_id', 'mf_name', $this->value, $this->id);
}
示例8: getOptions
protected function getOptions()
{
tsmConfig::loadConfig();
tsmConfig::loadJLang('com_tsmart', false);
$cModel = tmsModel::getModel('currency');
$values = $cModel->getVendorAcceptedCurrrenciesList();
$options[] = JHtml::_('select.option', 0, tsmText::_('com_tsmart_DEFAULT_VENDOR_CURRENCY'));
$options[] = JHtml::_('select.option', -1, tsmText::_('com_tsmart_SELECTED_MODULE_CURRENCY'));
foreach ($values as $v) {
$options[] = JHtml::_('select.option', $v->tsmart_currency_id, $v->currency_txt);
}
return $options;
}
示例9: getInput
/**
* Method to get the field input markup.
*
* @return string The field input markup.
*
* @since 11.1
*/
protected function getInput()
{
tsmConfig::loadConfig();
tsmConfig::loadJLang('com_tsmart');
$option = vRequest::getCmd('option');
if (!function_exists('curl_init') or !function_exists('curl_exec')) {
return tsmText::_('com_tsmart_PS_CURL_LIBRARY_NOT_INSTALLED');
} else {
$js = "\n jQuery(document).ready(function( \$ ) {\n \$( '#vmcurl' ) .closest('.control-group').hide();\n });\n ";
$doc = JFactory::getDocument();
$doc->addScriptDeclaration($js);
return '<span id="vmcurl"></span>';
}
}
示例10: getLabel
protected function getLabel()
{
$description = $this->element['description'];
tsmConfig::loadConfig();
$html = '';
$class = !empty($this->class) ? 'class="' . $this->class . '"' : '';
if (empty($class)) {
$class .= "style=\"font-weight: bold; padding: 5px; background-color: #cacaca; float:none; clear:both;\"";
}
if ($this->value) {
$html .= '<div ' . $class . '>';
$html .= tsmText::_($this->value);
$html .= '</div>';
}
return $html;
}
示例11: loadVm
/**
* method must be called after preflight
* Sets the paths and loads VMFramework config
*/
public function loadVm()
{
// $this->path = JInstaller::getInstance()->getPath('extension_administrator');
if (empty($this->path)) {
$this->path = VMPATH_ADMIN;
}
if (!class_exists('tsmConfig')) {
require_once $this->path . '/helpers/config.php';
}
tsmConfig::loadConfig(false, true);
if (!class_exists('tsmTable')) {
require_once $this->path . '/helpers/tsmtable.php';
}
if (!class_exists('tmsModel')) {
require_once $this->path . '/helpers/tsmmodel.php';
}
tsmTable::addIncludePath($this->path . DS . 'tables');
tmsModel::addIncludePath($this->path . DS . 'models');
}
示例12: getInput
function getInput()
{
defined('DS') or define('DS', DIRECTORY_SEPARATOR);
if (!class_exists('tsmConfig')) {
require JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_tsmart' . DS . 'helpers' . DS . 'config.php';
}
if (!class_exists('tmsModel')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'tsmmodel.php';
}
tsmConfig::loadConfig();
tsmConfig::loadJLang('com_tsmart');
$key = $this->element['key_field'] ? $this->element['key_field'] : 'value';
$val = $this->element['value_field'] ? $this->element['value_field'] : $this->name;
$model = tmsModel::getModel('Orderstatus');
$orderStatus = $model->getOrderStatusList(true);
foreach ($orderStatus as $orderState) {
$orderState->order_status_name = tsmText::_($orderState->order_status_name);
}
return JHtml::_('select.genericlist', $orderStatus, $this->name, 'class="inputbox" multiple="true" size="1"', 'order_status_code', 'order_status_name', $this->value, $this->id);
}
示例13: save
/**
* Handle the save task
*/
function save($data = 0)
{
vRequest::vmCheckToken();
$model = tmsModel::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 = tsmText::_('com_tsmart_CONFIG_SAVED');
// Load the newly saved values into the session.
tsmConfig::loadConfig();
}
$redir = 'index.php?option=com_tsmart';
if (vRequest::getCmd('task') == 'apply') {
$redir = $this->redirectPath;
}
$this->setRedirect($redir, $msg);
}
示例14: getInput
protected function getInput()
{
tsmConfig::loadConfig();
tsmConfig::loadJLang('com_tsmart');
if (!is_array($this->value)) {
$this->value = array($this->value);
}
$categorylist = ShopFunctions::categoryListTree($this->value);
$name = $this->name;
if ($this->multiple) {
$name = $this->name;
$this->multiple = ' multiple="multiple" ';
}
$html = '<select class="inputbox" name="' . $name . '" ' . $this->multiple . ' >';
if (!$this->multiple) {
$html .= '<option value="0">' . tsmText::_('com_tsmart_CATEGORY_FORM_TOP_LEVEL') . '</option>';
}
$html .= $categorylist;
$html .= "</select>";
return $html;
}
示例15: execSQLFile
/**
* Parse a sql file executing each sql statement found.
*
* @author Max Milbers
*/
function execSQLFile($sqlfile)
{
// Check that sql files exists before reading. Otherwise raise error for rollback
if (!file_exists($sqlfile)) {
vmError('execSQLFile, SQL file not found!');
return false;
}
if (!class_exists('tsmConfig')) {
require_once VMPATH_ADMIN . '/helpers/config.php';
tsmConfig::loadConfig(false, true);
}
if (!tsmConfig::$vmlang) {
$params = JComponentHelper::getParams('com_languages');
$lang = $params->get('site', 'en-GB');
//use default joomla
$lang = strtolower(strtr($lang, '-', '_'));
} else {
$lang = tsmConfig::$vmlang;
}
// Create an array of queries from the sql file
jimport('joomla.installer.helper');
$db = JFactory::getDBO();
$queries = $db->splitSql(file_get_contents($sqlfile));
if (count($queries) == 0) {
vmError('SQL file has no queries!');
return false;
}
$ok = true;
// Process each query in the $queries array (split out of sql file).
foreach ($queries as $k => $query) {
if (empty($query)) {
vmWarn('execSQLFile Query was empty in file ' . $sqlfile);
continue;
}
$query = trim($query);
$queryLines = explode("\n", $query);
//vmdebug('test',$queryLines);
foreach ($queryLines as $n => $line) {
if (empty($line)) {
unset($queryLines[$n]);
} else {
if (strpos($line, 'CREATE') !== false or strpos($line, 'INSERT') !== false) {
$queryLines[$n] = str_replace('XLANG', $lang, $line);
}
}
}
$query = implode("\n", $queryLines);
if (!empty($query)) {
$db->setQuery($query);
if (!$db->execute()) {
vmWarn('JInstaller::install: ' . $sqlfile . ' ' . tsmText::_('com_tsmart_SQL_ERROR') . " " . $db->stderr(true));
$ok = false;
}
}
}
return $ok;
}