コード例 #1
0
	function getUniqueOverrideParameters($srcParams, $overrideParams, $caseInsensitive = false)
	{
		$uniqueParams = array();
		
		foreach ($srcParams as $srcKey => $srcValue)
		{
			if (is_array($srcValue))
			{
				if (isset($overrideParams[$srcKey]) || ($caseInsensitive && isset($overrideParams[strtolower($srcKey)])))
				{
					$subParams = AriParametersHelper::getUniqueOverrideParameters(
						$srcValue, 
						isset($overrideParams[$srcKey]) ? $overrideParams[$srcKey] : $overrideParams[strtolower($srcKey)],
						$caseInsensitive);
					if (count($subParams) > 0)
						$uniqueParams[$srcKey] = $subParams;
				}
			}
			else if (array_key_exists($srcKey, $overrideParams) || ($caseInsensitive && array_key_exists(strtolower($srcKey), $overrideParams)))
			{
				$overrideValue = AriUtils2::parseValueBySample(
					isset($overrideParams[$srcKey]) ? $overrideParams[$srcKey] : $overrideParams[strtolower($srcKey)], 
					$srcValue);
				if ($overrideValue != $srcValue)
					$uniqueParams[$srcKey] = $overrideValue; 
			}
		}
		
		return $uniqueParams;
	}
コード例 #2
0
	function _getClonerOptions(&$node)
	{
		$attrs = $node->attributes();
		$optAttrs = array();
		foreach ($attrs as $key => $value)
		{
			if (strpos($key, 'opt_') !== 0)
				continue;
				
			$optAttrs[$key] = JText::_($value);
		}

		$params = AriParametersHelper::flatParametersToArray($optAttrs);
		$clonerOptions = AriParametersHelper::getUniqueOverrideParameters(
			array(
				'numFormat' => '#{$num}.',
				'enableNumFormat' => true,
				'defaultItemCount' => 3,
				'message' => array(
					'removeConfirm' => 'Are you sure you want to remove this item?',
					'removeAllConfirm' => 'Are you sure you want to remove all items?'
				)
			), 
			isset($params['opt']) ? $params['opt'] : array(),
			true);
			
		return count($clonerOptions) > 0 ? $clonerOptions : new stdClass();
	}
コード例 #3
0
AriKernel::import('Web.HtmlHelper');
AriKernel::import('Web.JSON.JSONHelper');
AriKernel::import('Parameters.ParametersHelper');
AriKernel::import('SexyLightbox.SexyLightbox');

$params->set('key', 'arisexybox_mod_' . $module->id);
$params->set('checkSum', md5($module->params));
$groupName = $params->get('groupName');
$thumbQuality = intval($params->get('thumbQuality', 80), 10);
if (!defined('ASIDO_GD_JPEG_QUALITY'))
	define('ASIDO_GD_JPEG_QUALITY', $thumbQuality);

if (empty($groupName)) $params->set('groupName', uniqid('asexy_'));
$autoShow = $params->get('autoShow');
$showOnClose = $params->get('showOnClose');
$mParams = AriParametersHelper::flatParametersToArray($params);
AriSexyLightboxHelper::includeAssets(
	AriUtils2::parseValueBySample($params->get('includeJQuery'), true),
	AriUtils2::parseValueBySample($params->get('noConflict'), true),
	AriUtils2::parseValueBySample($params->get('jQueryVer', '1.4.4'), '1.4.4'),
	AriUtils2::getParam($mParams, 'opt', array()));

AriSexyLightboxHelper::activateAutoShow(
	trim($params->get('groupName', '')), 
	$autoShow, 
	$params->get('unique', 'aslmod_' . $module->id),
	AriUtils2::getParam($mParams, 'cookie'));
	
AriSexyLightboxHelper::activateAutoShowOnClose(
	trim($params->get('groupName', '')),
	$params->get('onCloseMessage'), 
コード例 #4
0
	function getJsOptions($overrideOptions = array())
	{
		$defOptions = array(
			'showDownloadLink' => false,
			'hoverDownloadLink' => true,
			'downloadLinkTitle' => 'Open the image in new window',
			'disableRightClick' => false,
			'enableShow' => false,
			'pauseDuration' => 5000,
			'autoStart' => false,
			'continiousShow' => false,
			'continious' => false,
			'find' => 'sexylightbox',
			'zIndex' => 32000,
			'color' => 'black',
			'emergefrom' => 'top',
			'showDuration' => 200,
			'closeDuration' => 400,
			'moveDuration' => 1000,
			'moveEffect' => 'easeInOutBack',
			'resizeDuration' => 1000,
			'resizeEffect' => 'easeInOutBack',
			'movieAutoPlay' => false,
			'wMode' => 'transparent',
			'shake' => array(
				'distance' => 10,
                'duration' => 100,
                'loops' => 2,
                'transition' => 'easeInOutBack'
            )
		);

		$jsOptions = AriParametersHelper::getUniqueOverrideParameters($defOptions, $overrideOptions);
		$jsOptions['dir'] = str_replace(' ', '%20', JURI::root(true)) . '/modules/mod_arisexylightbox/includes/js/sexyimages';
		
		if (!empty($overrideOptions['overlayStyle']))
		{
			$fixOverlayStyle = array();
			$overlayStyle = $overrideOptions['overlayStyle'];
			foreach ($overlayStyle as $key => $value)
			{
				if (!is_null($value) && strlen($value) > 0)
					$fixOverlayStyle[$key] = $value;
			}
			
			$jsOptions['overlayStyle'] = $fixOverlayStyle;
		}

		return $jsOptions;
	}