本文整理汇总了PHP中tsmConfig::get方法的典型用法代码示例。如果您正苦于以下问题:PHP tsmConfig::get方法的具体用法?PHP tsmConfig::get怎么用?PHP tsmConfig::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tsmConfig
的用法示例。
在下文中一共展示了tsmConfig::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filterPath
/**
* This function does not allow unicode, replacement for JPath::clean
* and makesafe
* @param $string
* @param bool $forceNoUni
* @return mixed|string
*/
static function filterPath($str)
{
if (empty($str)) {
vmError('filterPath empty string check your paths ');
vmTrace('Critical error, empty string in filterPath');
return VMPATH_ROOT;
}
$str = trim($str);
// Delete all '?'
$str = str_replace('?', '', $str);
// Replace double byte whitespaces by single byte (East Asian languages)
$str = preg_replace('/\\xE3\\x80\\x80/', ' ', $str);
$unicodeslugs = tsmConfig::get('transliterateSlugs', false);
if ($unicodeslugs) {
$lang = JFactory::getLanguage();
$str = $lang->transliterate($str);
}
//This is a path, so remove all strange slashes
$str = str_replace('/', DS, $str);
//Clean from possible injection
while (strpos($str, '..') !== false) {
$str = str_replace('..', '', $str);
}
$str = preg_replace('#[/\\\\]+#', DS, $str);
$str = filter_var($str, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW);
return $str;
}
示例2: __construct
function __construct()
{
parent::__construct();
if (tsmConfig::get('shop_is_offline') == '1') {
vRequest::setVar('layout', 'off_line');
} else {
vRequest::setVar('layout', 'default');
}
}
示例3: mailAskquestion
/**
* Send the ask question email.
* @author Kohl Patrick, Christopher Roussel
*/
public function mailAskquestion()
{
vRequest::vmCheckToken();
if (!class_exists('shopFunctionsF')) {
require VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
}
$model = tmsModel::getModel('vendor');
$mainframe = JFactory::getApplication();
$vars = array();
$min = tsmConfig::get('asks_minimum_comment_length', 50) + 1;
$max = tsmConfig::get('asks_maximum_comment_length', 2000) - 1;
$commentSize = vRequest::getString('comment');
if (function_exists('mb_strlen')) {
$commentSize = mb_strlen($commentSize);
} else {
$commentSize = strlen($commentSize);
}
$validMail = filter_var(vRequest::getVar('email'), FILTER_VALIDATE_EMAIL);
$virtuemart_vendor_id = vRequest::getInt('virtuemart_vendor_id', 1);
if (!class_exists('VirtueMartModelVendor')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php';
}
$userId = VirtueMartModelVendor::getUserIdByVendorId($virtuemart_vendor_id);
//$vendorUser = JFactory::getUser($userId);
if ($commentSize < $min || $commentSize > $max || !$validMail) {
$this->setRedirect(JRoute::_('index.php?option=com_virtuemart&view=vendor&task=contact&virtuemart_vendor_id=' . $virtuemart_vendor_id, FALSE), tsmText::_('COM_VIRTUEMART_COMMENT_NOT_VALID_JS'));
return;
}
$user = JFactory::getUser();
$fromMail = vRequest::getVar('email');
//is sanitized then
$fromName = vRequest::getVar('name', '');
//is sanitized then
$fromMail = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromMail);
$fromName = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromName);
if (!empty($user->id)) {
if (empty($fromMail)) {
$fromMail = $user->email;
}
if (empty($fromName)) {
$fromName = $user->name;
}
}
$vars['user'] = array('name' => $fromName, 'email' => $fromMail);
$VendorEmail = $model->getVendorEmail($virtuemart_vendor_id);
$vars['vendor'] = array('vendor_store_name' => $fromName);
if (shopFunctionsF::renderMail('vendor', $VendorEmail, $vars, 'vendor')) {
$string = 'COM_VIRTUEMART_MAIL_SEND_SUCCESSFULLY';
} else {
$string = 'COM_VIRTUEMART_MAIL_NOT_SEND_SUCCESSFULLY';
}
$mainframe->enqueueMessage(tsmText::_($string));
// Display it all
$view = $this->getView('vendor', 'html');
$view->setLayout('mail_confirmed');
$view->display();
}
示例4: __construct
/**
* constructs a VmModel
* setMainTable defines the maintable of the model
*
* @author Max Milbers
*/
function __construct()
{
parent::__construct();
//Todo multivendor nasty hack, to get vendor with id 1
if (tsmConfig::get('multix', 'none') == 'none') {
$this->setId(1);
}
$this->setMainTable('vendors');
}
示例5: renderMailLayout
function renderMailLayout($doVendor, $recipient)
{
$tpl = tsmConfig::get('order_mail_html') ? 'mail_html_notify' : 'mail_raw_notify';
$this->doVendor = $doVendor;
$this->fromPdf = false;
$this->uselayout = $tpl;
$this->subject = !empty($this->subject) ? $this->subject : tsmText::_('COM_VIRTUEMART_CART_NOTIFY_MAIL_SUBJECT');
$this->layoutName = $tpl;
$this->setLayout($tpl);
$this->isMail = true;
$this->user = new stdClass();
$this->user->name = $this->vendor->vendor_store_name;
$this->user->email = $this->vendorEmail;
parent::display();
}
示例6: display
function display($tpl = null)
{
$document = JFactory::getDocument();
$mainframe = JFactory::getApplication();
$pathway = $mainframe->getPathway();
if (!class_exists('VmImage')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php';
}
$virtuemart_manufacturer_id = vRequest::getInt('virtuemart_manufacturer_id', 0);
$mf_category_id = vRequest::getInt('mf_category_id', 0);
// get necessary models
$model = tmsModel::getModel('manufacturer');
if ($virtuemart_manufacturer_id != 0) {
$manufacturer = $model->getManufacturer();
$model->addImages($manufacturer, 1);
$manufacturerImage = $manufacturer->images[0]->displayMediaThumb('class="manufacturer-image"', false);
if (tsmConfig::get('enable_content_plugin', 0)) {
if (!class_exists('shopFunctionsF')) {
require VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
}
shopFunctionsF::triggerContentPlugin($manufacturer, 'manufacturer', 'mf_desc');
}
$document->setTitle(tsmText::_('COM_VIRTUEMART_MANUFACTURER_DETAILS') . ' ' . strip_tags($manufacturer->mf_name));
//added so that the canonical points to page with visible products thx to P2Peter
// remove joomla canonical before adding it
foreach ($document->_links as $k => $array) {
if ($array['relation'] == 'canonical') {
unset($document->_links[$k]);
break;
}
}
$document->addHeadLink(JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_manufacturer_id=' . $virtuemart_manufacturer_id, FALSE), 'canonical', 'rel', '');
$this->assignRef('manufacturerImage', $manufacturerImage);
$this->assignRef('manufacturer', $manufacturer);
$pathway->addItem(strip_tags($manufacturer->mf_name));
$this->setLayout('details');
} else {
$document->setTitle(tsmText::_('COM_VIRTUEMART_MANUFACTURER_PAGE'));
$manufacturers = $model->getManufacturers(true, true, true);
$model->addImages($manufacturers, 1);
$this->assignRef('manufacturers', $manufacturers);
$this->setLayout('default');
}
parent::display($tpl);
}
示例7: synchronizeMedia
function synchronizeMedia()
{
if (vmAccess::manager('media')) {
$configPaths = array('assets_general_path', 'media_category_path', 'media_product_path', 'media_manufacturer_path', 'media_vendor_path');
foreach ($configPaths as $path) {
$this->renameFileExtension(VMPATH_ROOT . DS . tsmConfig::get($path));
}
if (!class_exists('Migrator')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'migrator.php';
}
$migrator = new Migrator();
$result = $migrator->portMedia();
$this->setRedirect($this->redirectPath, $result);
} else {
$msg = 'Forget IT';
$this->setRedirect('index.php?option=com_tsmart', $msg);
}
}
示例8: sendPostRequest
function sendPostRequest()
{
$post_variables = $this->getPostVariables();
$jump_url = $this->getJumpUrl();
$html = '';
if ($this->_method->debug) {
$html .= '<form action="' . $jump_url . '" method="post" name="vm_realex_form" target="realex">';
} else {
if (tsmConfig::get('css')) {
$msg = tsmText::_('VMPAYMENT_REALEX_HPP_API_REDIRECT_MESSAGE', true);
} else {
$msg = '';
}
vmJsApi::addJScript('vm.paymentFormAutoSubmit', '
jQuery(document).ready(function($){
jQuery("body").addClass("vmLoading");
var msg="' . $msg . '";
jQuery("body").append("<div class=\\"vmLoadingDiv\\"><div class=\\"vmLoadingDivMsg\\">"+msg+"</div></div>");
jQuery("#vmPaymentForm").submit();
})
');
$html .= '<form action="' . $jump_url . '" method="post" name="vm_realex_form" id="vmPaymentForm" accept-charset="UTF-8">';
}
$html .= '<input type="hidden" name="charset" value="utf-8">';
foreach ($post_variables as $name => $value) {
$html .= '<input type="hidden" name="' . $name . '" value="' . $value . '" />';
}
if ($this->_method->debug) {
$html .= '<div style="background-color:red;color:white;padding:10px;">
<input type="submit" value="The method is in debug mode. Click here to be redirected to Realex" />
</div>';
$this->debugLog($post_variables, 'sendPostRequest:', 'debug');
}
$html .= '</form>';
return $html;
}
示例9: array
<td class="key">
<span class="hasTip" title="<?php echo vmText::_('com_tsmart_ADMIN_CFG_MAIL_FROM_RECIPIENT_EXPLAIN'); ?>">
<label for="mail_from_recipient"><?php echo vmText::_('com_tsmart_ADMIN_CFG_MAIL_FROM_RECIPIENT') ?></span>
</span>
</td>
<td>
<?php echo VmHTML::checkbox('mail_from_recipient', VmConfig::get('mail_from_recipient',0)); ?>
</td>
</tr>
<tr>
<td class="key">
<span class="hasTip" title="<?php echo vmText::_('com_tsmart_ADMIN_CFG_MAIL_FROM_SETSENDER_EXPLAIN'); ?>">
<label for="mail_from_setsender"><?php echo vmText::_('com_tsmart_ADMIN_CFG_MAIL_FROM_SETSENDER') ?></span>
</span>
</td>
<td>
<?php echo VmHTML::checkbox('mail_from_setsender', VmConfig::get('mail_from_setsender',0)); ?>
</td>
</tr --><?php */
$attrlist = 'class="inputbox" multiple="multiple" ';
echo VmHTML::row('genericlist', 'com_tsmart_ADMIN_CFG_STATUS_PDF_INVOICES', $this->osWoP_Options, 'inv_os[]', $attrlist, 'order_status_code', 'order_status_name', tsmConfig::get('inv_os', array('C')), 'inv_os', true);
echo VmHTML::row('genericlist', 'com_tsmart_CFG_OSTATUS_EMAILS_SHOPPER', $this->osWoP_Options, 'email_os_s[]', $attrlist, 'order_status_code', 'order_status_name', tsmConfig::get('email_os_s', array('U', 'C', 'S', 'R', 'X')), 'email_os_s', true);
echo VmHTML::row('genericlist', 'com_tsmart_CFG_OSTATUS_EMAILS_VENDOR', $this->os_Options, 'email_os_v[]', $attrlist, 'order_status_code', 'order_status_name', tsmConfig::get('email_os_v', array('U', 'C', 'R', 'X')), 'email_os_v', true);
echo VmHTML::row('input', 'com_tsmart_CFG_ATTACH', 'attach', tsmConfig::get('attach', ''));
echo VmHTML::row('genericlist', 'com_tsmart_CFG_ATTACH_OS', $this->osWoP_Options, 'attach_os[]', $attrlist, 'order_status_code', 'order_status_name', tsmConfig::get('attach_os', array('U', 'C', 'R', 'X')), 'attach_os', true);
?>
</table>
</fieldset>
示例10: loadJLang
public static function loadJLang($fname, $type, $name)
{
$jlang = JFactory::getLanguage();
$tag = $jlang->getTag();
$path = $basePath = VMPATH_ROOT . DS . 'plugins' . DS . $type . DS . $name;
if (tsmConfig::get('enableEnglish', true) and $tag != 'en-GB') {
$testpath = $basePath . DS . 'language' . DS . 'en-GB' . DS . 'en-GB.' . $fname . '.ini';
if (!file_exists($testpath)) {
$epath = JPATH_ADMINISTRATOR;
} else {
$epath = $path;
}
$jlang->load($fname, $epath, 'en-GB');
}
$testpath = $basePath . DS . 'language' . DS . $tag . DS . $tag . '.' . $fname . '.ini';
if (!file_exists($testpath)) {
$path = JPATH_ADMINISTRATOR;
}
$jlang->load($fname, $path, $tag, true);
}
示例11:
?>
</td>
<td align="center">
<?php
if ($row->default != 0) {
echo JHtml::_('image', 'menu/icon-16-default.png', tsmText::_('com_tsmart_SHOPPERGROUP_DEFAULT'), NULL, true);
}
?>
</td>
<td align="center">
<?php
echo $published;
?>
</td>
<?php
if (tsmConfig::get('multix', 'none') != 'none' && $this->showVendors) {
?>
<td align="left">
<?php
echo $row->tsmart_vendor_id;
?>
</td>
<?php
}
?>
<td align="center">
<?php
if ($row->sgrp_additional == 1) {
echo JHtml::_('image', 'menu/icon-16-apply.png', tsmText::_('com_tsmart_SHOPPERGROUP_ADDITIONAL'), NULL, true);
}
?>
示例12: handleCommunication
/**
* This is a general function to safely open a connection to a server,
* post data when needed and read the result.
* Tries using cURL and switches to fopen/fsockopen if cURL is not available
* @since tsmart 1.1.0
* @static
* @param string $url
* @param string $postData
* @param array $headers
* @param resource $fileToSaveData
* @return mixed
*/
static function handleCommunication($url, $postData = '', $headers = array(), $fileToSaveData = null)
{
$urlParts = parse_url($url);
if (!isset($urlParts['port'])) {
$urlParts['port'] = 80;
}
if (!isset($urlParts['scheme'])) {
$urlParts['scheme'] = 'http';
}
if (isset($urlParts['query'])) {
$urlParts['query'] = '?' . $urlParts['query'];
if (isset($urlParts['path'])) {
$urlParts['path'] = $urlParts['path'] . $urlParts['query'];
}
}
$vm_proxy_url = tsmConfig::get('conf_VM_PROXY_URL', '');
// Check proxy
if (trim($vm_proxy_url) != '') {
if (!stristr($vm_proxy_url, 'http')) {
$proxyURL['host'] = $vm_proxy_url;
$proxyURL['scheme'] = 'http';
} else {
$proxyURL = parse_url($vm_proxy_url);
}
} else {
$proxyURL = '';
}
if (function_exists("curl_init") && function_exists('curl_exec')) {
$CR = curl_init();
curl_setopt($CR, CURLOPT_URL, $url);
// just to get sure the script doesn't die
curl_setopt($CR, CURLOPT_TIMEOUT, 30);
if (!empty($headers)) {
// Add additional headers if provided
curl_setopt($CR, CURLOPT_HTTPHEADER, $headers);
}
curl_setopt($CR, CURLOPT_FAILONERROR, true);
if ($postData) {
curl_setopt($CR, CURLOPT_POSTFIELDS, $postData);
curl_setopt($CR, CURLOPT_POST, 1);
}
if (is_resource($fileToSaveData)) {
curl_setopt($CR, CURLOPT_FILE, $fileToSaveData);
} else {
curl_setopt($CR, CURLOPT_RETURNTRANSFER, 1);
}
// Do we need to set up the proxy?
if (!empty($proxyURL)) {
// $vmLogger->debug( 'Setting up proxy: '.$proxyURL['host'].':'.VM_PROXY_PORT );
//curl_setopt($CR, CURLOPT_HTTPPROXYTUNNEL, true);
curl_setopt($CR, CURLOPT_PROXY, $proxyURL['host']);
curl_setopt($CR, CURLOPT_PROXYPORT, VM_PROXY_PORT);
// Check if the proxy needs authentication
if (trim(@VM_PROXY_USER) != '') {
// $vmLogger->debug( 'Using proxy authentication!' );
curl_setopt($CR, CURLOPT_PROXYUSERPWD, VM_PROXY_USER . ':' . VM_PROXY_PASS);
}
}
if ($urlParts['scheme'] == 'https') {
// No PEER certificate validation...as we don't have
// a certificate file for it to authenticate the host www.ups.com against!
curl_setopt($CR, CURLOPT_SSL_VERIFYPEER, 0);
}
$result = curl_exec($CR);
$error = curl_error($CR);
if (!empty($error) && stristr($error, '502') && !empty($proxyURL)) {
// $vmLogger->debug( 'Switching to NTLM authenticaton.');
curl_setopt($CR, CURLOPT_PROXYAUTH, CURLAUTH_NTLM);
$result = curl_exec($CR);
$error = curl_error($CR);
}
curl_close($CR);
if (!empty($error)) {
//JError::raiseError(1, $error );
return false;
} else {
return $result;
}
} else {
if ($postData) {
if (!empty($proxyURL)) {
// If we have something to post we need to write into a socket
if ($proxyURL['scheme'] == 'https') {
$protocol = 'ssl';
} else {
$protocol = 'http';
}
$fp = fsockopen("{$protocol}://" . $proxyURL['host'], VM_PROXY_PORT, $errno, $errstr, $timeout = 30);
//.........这里部分代码省略.........
示例13: getConfirmedHtml
/**
* @param $post_variables
* @return string
*/
function getConfirmedHtml($post_variables)
{
$pbxServer = $this->getPayboxServerUrl();
// add spin image
$html = '';
if ($this->_method->debug) {
$html .= '<form action="' . $pbxServer . '" method="post" name="vm_paybox_form" target="paybox">';
} else {
if (tsmConfig::get('css')) {
$msg = tsmText::_('VMPAYMENT_PAYBOX_REDIRECT_MESSAGE', true);
} else {
$msg = '';
}
vmJsApi::addJScript('vm.paymentFormAutoSubmit', '
jQuery(document).ready(function($){
jQuery("body").addClass("vmLoading");
var msg="' . $msg . '";
jQuery("body").append("<div class=\\"vmLoadingDiv\\"><div class=\\"vmLoadingDivMsg\\">"+msg+"</div></div>");
jQuery("#vmPaymentForm").submit();
})
');
$html .= '<form action="' . $pbxServer . '" method="post" name="vm_paybox_form" id="vmPaymentForm">';
}
foreach ($post_variables as $name => $value) {
$html .= '<input type="hidden" name="' . $name . '" value="' . $value . '" />';
}
if ($this->_method->debug) {
$this->plugin->debugLog($this->_method->virtuemart_paymentmethod_id, 'sendPostRequest: payment method', 'debug');
$this->plugin->debugLog($pbxServer, 'sendPostRequest: Server', 'debug');
$html .= '<div style="background-color:red;color:white;padding:10px;">
<input type="submit" value="The method is in debug mode. Click here to be redirected to Paybox" />
</div>';
$this->plugin->debugLog($post_variables, 'sendPostRequest:', 'debug');
} else {
$html .= '<input type="submit" value="' . tsmText::_('VMPAYMENT_PAYBOX_REDIRECT_MESSAGE') . '" />';
}
$html .= '</form>';
return $html;
}
示例14:
?>
<?php
echo $this->lists['readonly'];
?>
<?php
echo $this->lists['published'];
?>
<?php
echo VmHTML::row('input', 'com_tsmart_USERFIELDS_SIZE', 'size', $this->userField->size, 'class="inputbox"', '', 5);
?>
<?php
echo VmHTML::row('raw', 'com_tsmart_ORDERING', $this->ordering);
// VmHTML::row('input','com_tsmart_ORDERING','ordering',$this->userField->ordering,'class="inputbox"','',5);
?>
<?php
if (tsmConfig::get('multix', 'none') !== 'none') {
echo VmHTML::row('raw', 'com_tsmart_VENDOR', $this->lists['vendors']);
}
?>
</table>
</fieldset>
</div>
<input type="hidden" name="tsmart_userfield_id" value="<?php
echo $this->userField->tsmart_userfield_id;
?>
" />
<input type="hidden" name="valueCount" value="<?php
echo $this->valueCount;
?>
" />
示例15: defined
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
echo '<a class="continue_link" href="' . $this->continue_link . '" >' . tsmText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</a>';
echo '<a class="showcart floatright" href="' . $this->cart_link . '">' . tsmText::_('COM_VIRTUEMART_CART_SHOW') . '</a>';
if ($this->products) {
foreach ($this->products as $product) {
if ($product->quantity > 0) {
echo '<h4>' . tsmText::sprintf('COM_VIRTUEMART_CART_PRODUCT_ADDED', $product->product_name, $product->quantity) . '</h4>';
} else {
if (!empty($product->errorMsg)) {
echo '<div>' . $product->errorMsg . '</div>';
}
}
}
}
if (tsmConfig::get('popup_rel', 1)) {
//VmConfig::$echoDebug=true;
if ($this->products and is_array($this->products) and count($this->products) > 0) {
$product = reset($this->products);
$customFieldsModel = tmsModel::getModel('customfields');
$product->customfields = $customFieldsModel->getCustomEmbeddedProductCustomFields($product->allIds, 'R');
$customFieldsModel->displayProductCustomfieldFE($product, $product->customfields);
if (!empty($product->customfields)) {
?>
<div class="product-related-products">
<h4><?php
echo tsmText::_('COM_VIRTUEMART_RELATED_PRODUCTS');
?>
</h4>
<?php
}