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


PHP vmJsApi::setPath方法代码示例

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


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

示例1: css

 /**
  * Write a <link ></link > element
  * @param   string   path to file
  * @param   string   library name
  * @param   string   library version
  * @param   boolean   library version
  * @return  nothing
  */
 public static function css($namespace, $path = FALSE, $version = '', $minified = NULL)
 {
     static $loaded = array();
     // Only load once
     // using of namespace assume same css have same namespace
     // loading 2 time css with this method simply return and do not load it the second time
     if (!empty($loaded[$namespace])) {
         return;
     }
     $file = vmJsApi::setPath($namespace, $path, $version = '', $minified, 'css');
     $document = JFactory::getDocument();
     $document->addStyleSheet($file);
     $loaded[$namespace] = TRUE;
 }
开发者ID:romuland,项目名称:khparts,代码行数:22,代码来源:config.php

示例2: jDate

    static function jDate($date = '', $name = "date", $id = NULL, $resetBt = TRUE, $yearRange = '')
    {
        if ($yearRange) {
            $yearRange = 'yearRange: "' . $yearRange . '",';
        }
        $test = (int) str_replace(array('-', ' ', ':'), '', $date);
        if (empty($test)) {
            $date = 0;
        }
        if (empty($id)) {
            $id = str_replace(array('[]', '[', ']'), '.', $name);
            $id = str_replace('..', '.', $id);
        }
        static $jDate;
        if (!class_exists('VmHtml')) {
            require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
        }
        $id = VmHtml::ensureUniqueId($id);
        $dateFormat = vmText::_('COM_VIRTUEMART_DATE_FORMAT_INPUT_J16');
        //="m/d/y"
        $search = array('m', 'd', 'Y');
        $replace = array('mm', 'dd', 'yy');
        $jsDateFormat = str_replace($search, $replace, $dateFormat);
        if ($date) {
            $formatedDate = JHtml::_('date', $date, $dateFormat);
        } else {
            $formatedDate = vmText::_('COM_VIRTUEMART_NEVER');
        }
        $display = '<input class="datepicker-db" id="' . $id . '" type="hidden" name="' . $name . '" value="' . $date . '" />';
        $display .= '<input id="' . $id . '_text" class="datepicker" type="text" value="' . $formatedDate . '" />';
        if ($resetBt) {
            $display .= '<span class="vmicon vmicon-16-logout icon-nofloat js-date-reset"></span>';
        }
        // If exist exit
        if ($jDate) {
            return $display;
        }
        self::addJScript('datepicker', '
			jQuery(document).ready( function($) {
			jQuery(document).on( "focus",".datepicker", function() {
				jQuery( this ).datepicker({
					changeMonth: true,
					changeYear: true,
					' . $yearRange . '
					dateFormat:"' . $jsDateFormat . '",
					altField: $(this).prev(),
					altFormat: "yy-mm-dd"
				});
			});
			jQuery(document).on( "click",".js-date-reset", function() {
				jQuery(this).prev("input").val("' . vmText::_('COM_VIRTUEMART_NEVER') . '").prev("input").val("0");
			});
		});
		');
        vmJsApi::css('ui/jquery.ui.all');
        $lg = JFactory::getLanguage();
        $lang = $lg->getTag();
        $vlePath = vmJsApi::setPath('i18n/jquery.ui.datepicker-' . $lang, FALSE, '', $minified = NULL, 'js', true);
        if (!file_exists($vlePath) or is_dir($vlePath)) {
            $lang = 'en-GB';
        }
        vmJsApi::addJScript('i18n/jquery.ui.datepicker-' . $lang);
        $jDate = TRUE;
        return $display;
    }
开发者ID:virtuemart-fr,项目名称:virtuemart-fr,代码行数:65,代码来源:vmjsapi.php

示例3: JvalideForm

 static function JvalideForm($name = '#adminForm')
 {
     static $jvalideForm;
     // If exist exit
     if ($jvalideForm === $name) {
         return;
     }
     $document = JFactory::getDocument();
     $document->addScriptDeclaration("\r\n//<![CDATA[\r\n\t\t\tjQuery(document).ready(function() {\r\n\t\t\t\tjQuery('" . $name . "').validationEngine();\r\n\t\t\t});\r\n//]]>\r\n");
     if ($jvalideForm) {
         return;
     }
     vmJsApi::js('jquery.validationEngine');
     $lg = JFactory::getLanguage();
     $lang = substr($lg->getTag(), 0, 2);
     /*$existingLang = array("cz", "da", "de", "en", "es", "fr", "it", "ja", "nl", "pl", "pt", "ro", "ru", "tr");
     		if (!in_array ($lang, $existingLang)) {
     			$lang = "en";
     		}*/
     $vlePath = vmJsApi::setPath('languages/jquery.validationEngine-' . $lang, FALSE, '', $minified = NULL, 'js', true);
     if (file_exists($vlePath) and !is_dir($vlePath)) {
         vmJsApi::js('languages/jquery.validationEngine-' . $lang);
     } else {
         vmJsApi::js('languages/jquery.validationEngine-en');
     }
     vmJsApi::css('validationEngine.template');
     vmJsApi::css('validationEngine.jquery');
     $jvalideForm = $name;
 }
开发者ID:sergy444,项目名称:joomla,代码行数:29,代码来源:vmjsapi.php


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