本文整理汇总了PHP中vmJsApi::jSite方法的典型用法代码示例。如果您正苦于以下问题:PHP vmJsApi::jSite方法的具体用法?PHP vmJsApi::jSite怎么用?PHP vmJsApi::jSite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vmJsApi
的用法示例。
在下文中一共展示了vmJsApi::jSite方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: jPrice
static function jPrice()
{
if (!VmConfig::get('jprice', TRUE) and !self::isAdmin()) {
return FALSE;
}
static $jPrice;
// If exist exit
if ($jPrice) {
return;
}
vmJsApi::jQuery();
VmConfig::loadJLang('com_virtuemart', true);
vmJsApi::jSite();
if (VmConfig::get('addtocart_popup', 1)) {
self::loadPopUpLib();
}
vmJsApi::addJScript('vmprices', false, false);
//Fallbacks!
$jsVars = "";
$jsVars .= "vmSiteurl = '" . JURI::root() . "' ;\n";
$jsVars .= 'vmLang = "&lang=' . VmConfig::$vmlangSef . '";' . "\n";
$jsVars .= 'vmLangTag = "' . VmConfig::$vmlangSef . '";' . "\n";
$Get = vRequest::getGet();
if (!empty($Get['Itemid'])) {
$jsVars .= "Itemid = '&Itemid=" . (int) $Get['Itemid'] . "';\n";
} else {
$jsVars .= 'Itemid = "";' . "\n";
}
$onReady = $jsVars . 'jQuery(document).ready(function($) {
Virtuemart.addtocart_popup = "' . VmConfig::get('addtocart_popup', 1) . '"' . " ; \n" . '
Virtuemart.product(jQuery("form.product"));
});';
vmJsApi::addJScript('ready.vmprices', $onReady);
$jPrice = TRUE;
return TRUE;
}
示例2: jPrice
static function jPrice()
{
if (!VmConfig::get('jprice', TRUE) and JFactory::getApplication()->isSite()) {
return FALSE;
}
static $jPrice;
// If exist exit
if ($jPrice) {
return;
}
vmJsApi::jQuery();
//JPlugin::loadLanguage('com_virtuemart');
$lang = JFactory::getLanguage();
$lang->load('com_virtuemart');
vmJsApi::jSite();
$closeimage = JURI::root(TRUE) . '/components/com_virtuemart/assets/images/facebox/closelabel.png';
$jsVars = "vmSiteurl = '" . JURI::root() . "' ;\n";
if (VmConfig::get('vmlang_js', 1)) {
$jsVars .= "vmLang = '&lang=" . substr(VMLANG, 0, 2) . "' ;\n";
} else {
$jsVars .= 'vmLang = ""' . "\n";
}
$jsVars .= "vmCartText = '" . addslashes(JText::_('COM_VIRTUEMART_MINICART_ADDED_JS')) . "' ;\n";
$jsVars .= "vmCartError = '" . addslashes(JText::_('COM_VIRTUEMART_MINICART_ERROR_JS')) . "' ;\n";
$jsVars .= "loadingImage = '" . JURI::root(TRUE) . "/components/com_virtuemart/assets/images/facebox/loading.gif' ;\n";
$jsVars .= "closeImage = '" . $closeimage . "' ; \n";
$jsVars .= "Virtuemart.addtocart_popup = '" . VmConfig::get('addtocart_popup', 1) . "' ; \n";
// $jsVars .= 'faceboxHtml = \'<div id="facebox" style="display:none;"><div class="popup"><div class="content"></div> <a href="#" class="close"><img src="'.$closeimage.'" title="close" alt="X" class="close_image" /></a></div></div>\' '."\n";
$jsVars .= 'faceboxHtml = \'<div id="facebox" style="display:none;"><div class="popup"><div class="content"></div> <a href="#" class="close"></a></div></div>\' ' . " ;\n";
$document = JFactory::getDocument();
$document->addScriptDeclaration($jsVars);
vmJsApi::js('facebox');
vmJsApi::js('vmprices');
vmJsApi::css('facebox');
$jPrice = TRUE;
return TRUE;
}
示例3: elseif
vmJsApi::loadBECSS();
$router = $app->getRouter();
$router->setMode(0);
} else {
$session->set('manage', 0, 'vm');
vRequest::setVar('manage', 0);
$basePath = VMPATH_SITE;
$app->redirect('index.php?option=com_virtuemart', tsmText::_('COM_VIRTUEMART_RESTRICTED_ACCESS'));
}
} elseif ($_controller) {
if ($_controller != 'productdetails') {
$session->set('manage', 0, 'vm');
vRequest::setVar('manage', '0');
}
vmJsApi::jQuery();
vmJsApi::jSite();
vmJsApi::cssSite();
$basePath = VMPATH_SITE;
}
}
// controller alias
if ($_controller == 'pluginresponse') {
$_controller = 'vmplg';
}
/* Create the controller name */
$_class = 'VirtuemartController' . ucfirst($_controller);
if (file_exists($basePath . DS . 'controllers' . DS . $_controller . '.php')) {
if (!class_exists($_class)) {
require $basePath . DS . 'controllers' . DS . $_controller . '.php';
}
} else {
示例4: jPrice
static function jPrice()
{
if (!VmConfig::get('jprice', TRUE) and !self::isAdmin()) {
return FALSE;
}
static $jPrice;
// If exist exit
if ($jPrice) {
return;
}
vmJsApi::jQuery();
VmConfig::loadJLang('com_virtuemart', true);
vmJsApi::jSite();
$jsVars = "";
$jsVars .= "vmSiteurl = '" . JURI::root() . "' ;\n";
$jsVars .= 'vmLang = "&lang=' . VmConfig::$vmlangSef . '";' . "\n";
$jsVars .= 'vmLangTag = "' . VmConfig::$vmlangSef . '";' . "\n";
$Get = vRequest::getGet();
if (!empty($Get['Itemid'])) {
$jsVars .= "Itemid = '&Itemid=" . (int) $Get['Itemid'] . "';\n";
} else {
$jsVars .= 'Itemid = "";' . "\n";
}
if (VmConfig::get('addtocart_popup', 1)) {
$jsVars .= "Virtuemart.addtocart_popup = '" . VmConfig::get('addtocart_popup', 1) . "' ; \n";
if (VmConfig::get('usefancy', 1)) {
$jsVars .= "usefancy = true;";
vmJsApi::addJScript('fancybox/jquery.fancybox-1.3.4.pack', false);
vmJsApi::css('jquery.fancybox-1.3.4');
} else {
//This is just there for the backward compatibility
$jsVars .= "vmCartText = '" . addslashes(vmText::_('COM_VIRTUEMART_CART_PRODUCT_ADDED')) . "' ;\n";
$jsVars .= "vmCartError = '" . addslashes(vmText::_('COM_VIRTUEMART_MINICART_ERROR_JS')) . "' ;\n";
//This is necessary though and should not be removed without rethinking the whole construction
$jsVars .= "usefancy = false;";
vmJsApi::addJScript('facebox');
vmJsApi::css('facebox');
}
}
self::addJScript('jsVars', $jsVars);
vmJsApi::addJScript('vmprices', false, false);
$onReady = 'jQuery(document).ready(function($) {
Virtuemart.product(jQuery("form.product"));
/*$("form.js-recalculate").each(function(){
if ($(this).find(".product-fields").length && !$(this).find(".no-vm-bind").length) {
var id= $(this).find(\'input[name="virtuemart_product_id[]"]\').val();
Virtuemart.setproducttype($(this),id);
}
});*/
});';
vmJsApi::addJScript('ready.vmprices', $onReady);
$jPrice = TRUE;
return TRUE;
}
示例5: jPrice
static function jPrice()
{
if (!VmConfig::get('jprice', TRUE) and JFactory::getApplication()->isSite()) {
return FALSE;
}
static $jPrice;
// If exist exit
if ($jPrice) {
return;
}
vmJsApi::jQuery();
$lang = JFactory::getLanguage();
$lang->load('com_virtuemart');
vmJsApi::jSite();
$closeimage = JURI::root(TRUE) . '/components/com_virtuemart/assets/images/fancybox/fancy_close.png';
$jsVars = "//<![CDATA[ \n";
$jsVars .= "vmSiteurl = '" . JURI::root() . "' ;\n";
if (VmConfig::get('vmlang_js', 1)) {
//$jsVars .= "vmLang = '" . substr (VmConfig::$vmlang, 0, 2) . "' ;\n";
$jsVars .= "vmLang = '&lang=" . substr(VmConfig::$vmlang, 0, 2) . "' ;\n";
} else {
$jsVars .= 'vmLang = "";' . "\n";
}
if (VmConfig::get('addtocart_popup', 1)) {
$jsVars .= "Virtuemart.addtocart_popup = '" . VmConfig::get('addtocart_popup', 1) . "' ; \n";
if (VmConfig::get('usefancy', 0)) {
$jsVars .= "usefancy = true;";
vmJsApi::js('fancybox/jquery.fancybox-1.3.4.pack');
vmJsApi::css('jquery.fancybox-1.3.4');
} else {
//This is just there for the backward compatibility
$jsVars .= "vmCartText = '" . addslashes(vmText::_('COM_VIRTUEMART_CART_PRODUCT_ADDED')) . "' ;\n";
$jsVars .= "vmCartError = '" . addslashes(vmText::_('COM_VIRTUEMART_MINICART_ERROR_JS')) . "' ;\n";
$jsVars .= "loadingImage = '" . JURI::root(TRUE) . "/components/com_virtuemart/assets/images/facebox/loading.gif' ;\n";
$jsVars .= "closeImage = '" . $closeimage . "' ; \n";
//This is necessary though and should not be removed without rethinking the whole construction
$jsVars .= "usefancy = false;";
vmJsApi::js('facebox');
vmJsApi::css('facebox');
}
}
$jsVars .= '
//]]>
';
$document = JFactory::getDocument();
$document->addScriptDeclaration($jsVars);
vmJsApi::js('vmprices');
$jPrice = TRUE;
return TRUE;
}
示例6: _prepareDocument
/**
* Prepares the document
*/
protected function _prepareDocument()
{
//JHTML::stylesheet('vmsite-ltr.css',JURI::base().'components/com_virtuemart/assets/css/');
//JHTML::script('jquery.min.js','http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/');
//JHTML::script('jquery-ui.min.js','http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/');
//use the vm functions for loading scripts and css
if (!class_exists('VmConfig')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'config.php';
}
VmConfig::loadConfig();
vmJsApi::cssSite();
vmJsApi::jSite();
//layout
$this->_setPath('template', JPATH_BASE . DS . 'components' . DS . 'com_virtuemart' . DS . 'views' . DS . 'category' . DS . 'tmpl');
$params = JComponentHelper::getParams('com_customfilters');
$layout = $params->get('cfresults_layout');
$this->setLayout($layout);
//echo $layout;
$title = $params->get('results_page_title', JText::_('CF_SEARCH_RESULTS'));
$this->document->setTitle($title);
//add pathway
$app = JFactory::getApplication();
$pathway = $app->getPathway();
$pathway->addItem($title);
//load the virtuemart language files
$language = JFactory::getLanguage();
$language->load('com_virtuemart');
}