コード例 #1
0
	function includeCssFile($cssUrl, $type = 'text/css', $media = null, $attrs = array())
	{
		if (AriJoomlaUtils::isJoomla15())
		{
			$document =& JFactory::getDocument();
			$document->addStyleSheet($cssUrl, $type, $media, $attrs);
		}
		else
		{
			if (is_null($media)) $media = 'screen';
			$tag = sprintf('<link rel="stylesheet" href="%s" type="%s" media="%s"%s />', 
				$cssUrl,
				$type,
				$media,
				AriHtmlHelper::getAttrStr($attrs));
			AriDocumentHelper::includeCustomHeadTag($tag);
		}
	}
コード例 #2
0
	function includeAssets($loadJQuery, $noConflict, $jQueryVer = '1.4.4', $options = array())
	{
		static $loaded;

		if ($loaded)
			return ;

		$baseUri = JURI::root(true) . '/modules/mod_arisexylightbox/includes/js/';
		if ($loadJQuery) 
		{
			AriDocumentHelper::includeJsFile('http://ajax.googleapis.com/ajax/libs/jquery/' . $jQueryVer . '/jquery.min.js');
			
			if ($noConflict)
			{
				AriDocumentHelper::includeJsFile($baseUri . 'jquery.noconflict.js');
			}
		}
			
		AriDocumentHelper::includeJsFile($baseUri . 'jquery.easing.js');
		AriDocumentHelper::includeJsFile($baseUri . 'jquery.sexylightbox.min.js');
		
		$lang =& JFactory::getLanguage();
		if ($lang->isRTL())
			AriDocumentHelper::includeCssFile($baseUri . 'sexylightbox_rtl.css');
		
		AriDocumentHelper::includeCustomHeadTag(sprintf('<!--[if lt IE 7]><link rel="stylesheet" href="%s" type="text/css" /><![endif]-->',
			$baseUri . 'sexylightbox.ie6.css'));
		AriDocumentHelper::includeCustomHeadTag(sprintf('<link rel="stylesheet" href="%s" type="text/css" />',
			$baseUri . 'sexylightbox.css'));

		AriDocumentHelper::includeCustomHeadTag(sprintf('<!--[if IE]><link rel="stylesheet" href="%s" type="text/css" /><![endif]-->',
			$baseUri . 'sexylightbox.ie.css'));			

		$jsOptions = AriSexyLightboxHelper::getJsOptions($options);
		$document =& JFactory::getDocument();
		$document->addScriptDeclaration(sprintf(';(window["jQueryASL"] || jQuery)(document).ready(function(){ SexyLightbox.initialize(%s); });',
			!empty($jsOptions) ? AriJSONHelper::encode($jsOptions) : ''));
			
		$loaded = true;
	}