Пример #1
0
    static function JcountryStateList($stateIds, $prefix = '')
    {
        static $JcountryStateList = array();
        if (isset($JcountryStateList[$prefix]) or !VmConfig::get('jsite', TRUE)) {
            return;
        }
        VmJsApi::jSite();
        self::addJScript('vm.countryState' . $prefix, '
		vmSiteurl = "' . JURI::root() . '";' . "\n" . '
		jQuery( function($) {
			$("#' . $prefix . 'virtuemart_country_id_field").vm2front("list",{dest : "#' . $prefix . 'virtuemart_state_id_field",ids : "' . $stateIds . '",prefiks : "' . $prefix . '"});
		});	');
        $JcountryStateList[$prefix] = TRUE;
        return;
    }
Пример #2
0
    static function JcountryStateList($stateIds)
    {
        static $JcountryStateList;
        // If exist exit
        if ($JcountryStateList) {
            return;
        }
        $document = JFactory::getDocument();
        VmJsApi::jSite();
        $document->addScriptDeclaration(' jQuery( function($) {
			$("select.virtuemart_country_id").vm2front("list",{dest : "#virtuemart_state_id",ids : "' . $stateIds . '"});
		});');
        $JcountryStateList = TRUE;
        return;
    }
Пример #3
0
    static function JcountryStateList($stateIds, $prefix = '')
    {
        static $JcountryStateList = array();
        if (isset($JcountryStateList[$prefix]) or !VmConfig::get('jsite', TRUE)) {
            return;
        }
        VmJsApi::jSite();
        self::addJScript('vm.countryState' . $prefix, '
//<![CDATA[
		jQuery( function($) {
			$("#' . $prefix . 'virtuemart_country_id").vm2front("list",{dest : "#' . $prefix . 'virtuemart_state_id",ids : "' . $stateIds . '",prefiks : "' . $prefix . '"});
		});
//]]>
		');
        $JcountryStateList[$prefix] = TRUE;
        return;
    }
Пример #4
0
    static function JcountryStateList($stateIds, $prefix = '')
    {
        static $JcountryStateList = array();
        // If exist exit
        if (isset($JcountryStateList[$prefix]) or !VmConfig::get('jsite', TRUE)) {
            return;
        }
        $document = JFactory::getDocument();
        VmJsApi::jSite();
        $document->addScriptDeclaration('
//<![CDATA[
		jQuery( function($) {
			$("#' . $prefix . 'virtuemart_country_id").vm2front("list",{dest : "#' . $prefix . 'virtuemart_state_id",ids : "' . $stateIds . '",prefiks : "' . $prefix . '"});
		});
//]]>
		');
        $JcountryStateList[$prefix] = TRUE;
        return;
    }
    static function JcountryStateList($stateIds, $prefix)
    {
        $id = $prefix . 'virtuemart_state_id';
        // prevent using same ID, in all case this break the sate render if id is same.
        static $keys = array();
        if (isset($keys[$id])) {
            return;
        }
        $keys[$id] = true;
        $document = JFactory::getDocument();
        VmJsApi::jSite();
        $document->addScriptDeclaration(' 
//<![CDATA[
		jQuery( function($) {
			$("#' . $prefix . 'virtuemart_country_id").vm2front("list",{dest : "#' . $id . '",ids : "' . $stateIds . '"});
		});
//]]>
		');
        $JcountryStateList = TRUE;
        return;
    }