当前位置: 首页>>代码示例>>PHP>>正文


PHP vmJsApi::JcountryStateList方法代码示例

本文整理汇总了PHP中vmJsApi::JcountryStateList方法的典型用法代码示例。如果您正苦于以下问题:PHP vmJsApi::JcountryStateList方法的具体用法?PHP vmJsApi::JcountryStateList怎么用?PHP vmJsApi::JcountryStateList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vmJsApi的用法示例。


在下文中一共展示了vmJsApi::JcountryStateList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: renderStateList

    /**
     * Render a simple state list
     *
     * @author jseros, Patrick Kohl
     *
     * @param int $stateID Selected state id
     * @param int $countryID Selected country id
     * @param string $dependentField Parent <select /> ID attribute
     * @param string $_prefix Optional prefix for the formtag name attribute
     * @return string HTML containing the <select />
     */
    public static function renderStateList($stateId = '0', $_prefix = '', $multiple = FALSE, $required = 0)
    {
        if (is_array($stateId)) {
            $stateId = implode(",", $stateId);
        }
        vmJsApi::JcountryStateList($stateId, $_prefix);
        if ($multiple) {
            $attrs = 'multiple="multiple" size="12" name="' . $_prefix . 'virtuemart_state_id[]" ';
            //$class = 'class="inputbox multiple"';
        } else {
            /*$app = JFactory::getApplication();
            		if($app->isSite()) {
            			$class = 'class="chzn-select"';
            		} else {
            			$class = 'class="inputbox multiple"';
            		}*/
            $attrs = 'name="' . $_prefix . 'virtuemart_state_id" ';
        }
        if ($required != 0) {
            $attrs .= ' required';
        }
        $attrs .= ' class="vm-chzn-select"';
        $listHTML = '<select  id="' . $_prefix . 'virtuemart_state_id" ' . $attrs . '>
						<option value="">' . JText::_('COM_VIRTUEMART_LIST_EMPTY_OPTION') . '</option>
						</select>';
        return $listHTML;
    }
开发者ID:Roma48,项目名称:abazherka_old,代码行数:38,代码来源:shopfunctions.php

示例2: renderStateList

    /**
     * Render a simple state list
     *
     * @author Patrick Kohl
     * NOte Patrick Kohl added unique ID, javascript is broken if you have 2 lists
     * @param int $stateID Selected state id
     * @param int $countryID Selected country id
     * @param string $dependentField Parent <select /> ID attribute
     * @param string $_prefix Optional prefix for the formtag name attribute
     * @return string HTML containing the <select />
     */
    public static function renderStateList($stateId = '0', $prefix = '', $multiple = FALSE, $required = 0)
    {
        $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;
        if (is_array($stateId)) {
            $stateId = implode(",", $stateId);
        }
        vmJsApi::JcountryStateList($stateId, $prefix);
        if ($multiple) {
            $attrs = 'multiple="multiple" size="12" name="' . $id . '[]" ';
            //$class = 'class="inputbox multiple"';
        } else {
            $attrs = 'size="1"  name="' . $id . '" ';
        }
        if ($required != 0) {
            $attrs .= ' required';
        }
        $class = 'class="inputbox multiple"';
        $listHTML = '<select ' . $class . ' id="' . $id . '" ' . $attrs . '>
						<option value="">' . JText::_('COM_VIRTUEMART_LIST_EMPTY_OPTION') . '</option>
						</select>';
        return $listHTML;
    }
开发者ID:denis1001,项目名称:Virtuemart-2-Joomla-3-Bootstrap,代码行数:39,代码来源:shopfunctions.php

示例3: renderStateList

    /**
     * Render a simple state list
     *
     * @author Valerie Isaksen, Max Milbers
     *
     * @param int $stateID Selected state id
     * @param int $countryID Selected country id
     * @param string $dependentField Parent <select /> ID attribute
     * @param string $_prefix Optional prefix for the formtag name attribute
     * @return string HTML containing the <select />
     */
    public static function renderStateList($stateId = '0', $_prefix = '', $multiple = FALSE, $required = 0, $attribs = array())
    {
        if (is_array($stateId)) {
            $stateId = implode(",", $stateId);
        }
        vmJsApi::JcountryStateList($stateId, $_prefix);
        $attrs['class'] = 'vm-chzn-select';
        if ($multiple) {
            $attrs['name'] = $_prefix . 'virtuemart_state_id[]';
            $attrs['multiple'] = 'multiple';
        } else {
            $attrs['name'] = $_prefix . 'virtuemart_state_id';
        }
        /*if ($required != 0) {
        			$attrs['class'] .= ' required ';
        		}*/
        if (is_array($attribs)) {
            $attrs = array_merge($attrs, $attribs);
        }
        $attrString = JArrayHelper::toString($attrs);
        $listHTML = '<select  id="' . $_prefix . 'virtuemart_state_id" ' . $attrString . '>
						<option value="">' . JText::_('COM_VIRTUEMART_LIST_EMPTY_OPTION') . '</option>
						</select>';
        return $listHTML;
    }
开发者ID:sergy444,项目名称:joomla,代码行数:36,代码来源:shopfunctions.php

示例4: renderStateList

    /**
     * Render a simple state list
     *
     * @author jseros, Patrick Kohl
     *
     * @param int $stateID Selected state id
     * @param int $countryID Selected country id
     * @param string $dependentField Parent <select /> ID attribute
     * @param string $_prefix Optional prefix for the formtag name attribute
     * @return string HTML containing the <select />
     */
    public static function renderStateList($stateId = '0', $_prefix = '', $multiple = FALSE, $required = 0)
    {
        if (is_array($stateId)) {
            $stateId = implode(",", $stateId);
        }
        vmJsApi::JcountryStateList($stateId);
        if ($multiple) {
            $attrs = 'multiple="multiple" size="12" name="' . $_prefix . 'virtuemart_state_id[]" ';
        } else {
            $attrs = 'size="1"  name="' . $_prefix . 'virtuemart_state_id" ';
        }
        if ($required != 0) {
            $attrs .= ' required';
        }
        $listHTML = '<select class="inputbox multiple" id="virtuemart_state_id" ' . $attrs . '>
						<option value="">' . JText::_('COM_VIRTUEMART_LIST_EMPTY_OPTION') . '</option>
						</select>';
        return $listHTML;
    }
开发者ID:romuland,项目名称:khparts,代码行数:30,代码来源:shopfunctions.php


注:本文中的vmJsApi::JcountryStateList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。