Ejemplo n.º 1
0
	/**
	 * After component has created its output, this is good place to make global replacements
	 *
	 * @access public
	 * @return boolean
	 */
	public function onAfterRender()
	{
		$fparams = JComponentHelper::getParams('com_flexicontent');
		$session = JFactory::getSession();
		
		// If this is reached we now that the code for setting screen cookie has been added
		if ( $session->get('screenSizeCookieToBeAdded', 0, 'flexicontent') ) {
			$session->set('screenSizeCookieTried', 1, 'flexicontent');
			$session->set('screenSizeCookieToBeAdded', 0, 'flexicontent');
		}
		
		// Load language string for javascript usage in J1.5
		if ( !FLEXI_J16GE && class_exists('fcjsJText') )  fcjsJText::load();
		
		// Add performance message at document's end
		global $fc_performance_msg;
		if ($fc_performance_msg) {
			$html = JResponse::getBody();
			$inline_css = 'margin:12px 1% !important; text-align:left !important; float:none !important; width:auto!important; display:block !important;';
			$inline_js_close_btn = !FLEXI_J30GE ? 'onclick="this.parentNode.parentNode.removeChild(this.parentNode);"' : '';
			$inline_css_close_btn = !FLEXI_J30GE ? 'float:right; display:block; font-size:18px; cursor: pointer;' : '';
			$html = str_replace('</body>',
				'<div class="fc-mssg fc-info" style="'.$inline_css.'" >'.
					'<a class="close" data-dismiss="alert" '.$inline_js_close_btn.' style="'.$inline_css_close_btn.'" >&#215;</a>'.
					$fc_performance_msg.
				'</div>'."\n</body>", $html
			);
			JResponse::setBody($html);
		}
		
		return true;
	}