english/libraries/joomla/html/html/behavior.php
/**
	 * Add unobtrusive javascript support for modal links.
	 *
	 * Options for the modal behaviour can be:
	 * - ajaxOptions
	 * - size
	 * - shadow
	 * - onOpen
	 * - onClose
	 * - onUpdate
	 * - onResize
	 * - onShow
	 * - onHide
	 *
	 * @param   string  $selector	The class selector for which a modal behaviour is to be applied.
	 * @param   array   $params		An array of parameters for the modal behaviour.
	 *
	 * @return  void
	 * @since   11.1
	 */
Add unobtrusive javascript support for modal links.

@param   string  $selector   The class selector for which a modal behaviour is to be applied.
@param   array   $params             An array of parameters for the modal behaviour.


Add unobtrusive javascript support for modal links . @param string $selector The class selector for which a modal behaviour is to be applied . @param array $params An array of parameters for the modal behaviour .
public static function modal($selector = 'a.modal', $params = array())
	{
		static $modals;
		static $included;
		$document = JFactory::getDocument();
		if (!isset($included)) {
			self::framework();
			$uncompressed	= JFactory::getConfig()->get('debug') ? '-uncompressed' : '';
			JHtml::_('script', 'system/modal'.$uncompressed.'.js', true, true);
			JHtml::_('stylesheet', 'system/modal.css', array(), true);
			$included = true;
		}
		if (!isset($modals)) {
			$modals = array();
		}
		$sig = md5(serialize(array($selector,$params)));
		if (isset($modals[$sig]) && ($modals[$sig])) {
			return;
		}
		$opt['ajaxOptions']		= (isset($params['ajaxOptions']) && (is_array($params['ajaxOptions']))) ? $params['ajaxOptions'] : null;
		$opt['handler']			= (isset($params['handler'])) ? $params['handler'] : null;
		$opt['fullScreen']  	= (isset($params['fullScreen'])) ? (bool) $params['fullScreen'] : null;
		$opt['parseSecure']  	= (isset($params['parseSecure'])) ? (bool) $params['parseSecure'] : null;
		$opt['closable']  		= (isset($params['closable'])) ? (bool) $params['closable'] : null;
		$opt['closeBtn']  		= (isset($params['closeBtn'])) ? (bool) $params['closeBtn'] : null;
		$opt['iframePreload']  	= (isset($params['iframePreload'])) ? (bool) $params['iframePreload'] : null;
		$opt['iframeOptions']	= (isset($params['iframeOptions']) && (is_array($params['iframeOptions']))) ? $params['iframeOptions'] : null;
		$opt['size']			= (isset($params['size']) && (is_array($params['size']))) ? $params['size'] : null;
		$opt['shadow']			= (isset($params['shadow'])) ? $params['shadow'] : null;
		$opt['onOpen']			= (isset($params['onOpen'])) ? $params['onOpen'] : null;
		$opt['onClose']			= (isset($params['onClose'])) ? $params['onClose'] : null;
		$opt['onUpdate']		= (isset($params['onUpdate'])) ? $params['onUpdate'] : null;
		$opt['onResize']		= (isset($params['onResize'])) ? $params['onResize'] : null;
		$opt['onMove']			= (isset($params['onMove'])) ? $params['onMove'] : null;
		$opt['onShow']			= (isset($params['onShow'])) ? $params['onShow'] : null;
		$opt['onHide']			= (isset($params['onHide'])) ? $params['onHide'] : null;
		$options = JHtmlBehavior::_getJSObject($opt);
		$document->addScriptDeclaration("
		window.addEvent('domready', function() {
			SqueezeBox.initialize(".$options.");
			SqueezeBox.assign($$('".$selector."'), {
				parse: 'rel'
			});
		});");
		$modals[$sig] = true;
		return;
	}
public static function modal ( $ selector = 'a.modal' , $ params = array ( ) ) { static $ modals ; static $ included ; $ document = JFactory :: getDocument ( ) ; if ( ! isset ( $ included ) ) { self :: framework ( ) ; $ uncompressed = JFactory :: getConfig ( ) -> get ( 'debug' ) ? '-uncompressed' : '' ; JHtml :: _ ( 'script' , 'system/modal' . $ uncompressed . '.js' , true , true ) ; JHtml :: _ ( 'stylesheet' , 'system/modal.css' , array ( ) , true ) ; $ included = true ; } if ( ! isset ( $ modals ) ) { $ modals = array ( ) ; } $ sig = md5 ( serialize ( array ( $ selector , $ params ) ) ) ; if ( isset ( $ modals [ $ sig ] ) && ( $ modals [ $ sig ] ) ) { return ; } $ opt [ 'ajaxOptions' ] = ( isset ( $ params [ 'ajaxOptions' ] ) && ( is_array ( $ params [ 'ajaxOptions' ] ) ) ) ? $ params [ 'ajaxOptions' ] : null ; $ opt [ 'handler' ] = ( isset ( $ params [ 'handler' ] ) ) ? $ params [ 'handler' ] : null ; $ opt [ 'fullScreen' ] = ( isset ( $ params [ 'fullScreen' ] ) ) ? ( bool ) $ params [ 'fullScreen' ] : null ; $ opt [ 'parseSecure' ] = ( isset ( $ params [ 'parseSecure' ] ) ) ? ( bool ) $ params [ 'parseSecure' ] : null ; $ opt [ 'closable' ] = ( isset ( $ params [ 'closable' ] ) ) ? ( bool ) $ params [ 'closable' ] : null ; $ opt [ 'closeBtn' ] = ( isset ( $ params [ 'closeBtn' ] ) ) ? ( bool ) $ params [ 'closeBtn' ] : null ; $ opt [ 'iframePreload' ] = ( isset ( $ params [ 'iframePreload' ] ) ) ? ( bool ) $ params [ 'iframePreload' ] : null ; $ opt [ 'iframeOptions' ] = ( isset ( $ params [ 'iframeOptions' ] ) && ( is_array ( $ params [ 'iframeOptions' ] ) ) ) ? $ params [ 'iframeOptions' ] : null ; $ opt [ 'size' ] = ( isset ( $ params [ 'size' ] ) && ( is_array ( $ params [ 'size' ] ) ) ) ? $ params [ 'size' ] : null ; $ opt [ 'shadow' ] = ( isset ( $ params [ 'shadow' ] ) ) ? $ params [ 'shadow' ] : null ; $ opt [ 'onOpen' ] = ( isset ( $ params [ 'onOpen' ] ) ) ? $ params [ 'onOpen' ] : null ; $ opt [ 'onClose' ] = ( isset ( $ params [ 'onClose' ] ) ) ? $ params [ 'onClose' ] : null ; $ opt [ 'onUpdate' ] = ( isset ( $ params [ 'onUpdate' ] ) ) ? $ params [ 'onUpdate' ] : null ; $ opt [ 'onResize' ] = ( isset ( $ params [ 'onResize' ] ) ) ? $ params [ 'onResize' ] : null ; $ opt [ 'onMove' ] = ( isset ( $ params [ 'onMove' ] ) ) ? $ params [ 'onMove' ] : null ; $ opt [ 'onShow' ] = ( isset ( $ params [ 'onShow' ] ) ) ? $ params [ 'onShow' ] : null ; $ opt [ 'onHide' ] = ( isset ( $ params [ 'onHide' ] ) ) ? $ params [ 'onHide' ] : null ; $ options = JHtmlBehavior :: _getJSObject ( $ opt ) ; $ document -> addScriptDeclaration ( " 
		window.addEvent('domready', function() {

			SqueezeBox.initialize( " . $ options . " );
			SqueezeBox.assign($$(' " . $ selector . " '), {
				parse: 'rel'
			});
		}); " ) ; $ modals [ $ sig ] = true ; return ; }
Add unobtrusive javascript support for modal links.
Add unobtrusive javascript support for modal links .
// Load the necessary files if they haven't yet been loaded // Include MooTools framework // Load the javascript and css // Setup options object // Attach modal behavior to document // Set static array