Your IP : 216.73.216.55


Current Path : /home/giteleslfp/www/administrator/components/com_templateck/interfaces/
Upload File :
Current File : /home/giteleslfp/www/administrator/components/com_templateck/interfaces/layout_error404.php

<?php
/**
 * @name		Template Creator CK
 * @copyright	Copyright (C) 2013. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 * @author		Cedric Keiflin - http://www.template-creator.com - http://www.joomlack.fr
 */
// No direct access to this file
defined('TCK_LOADED') or die('Restricted access');

$error404_options = $blocsbyname['layout_error404_html'];
$error404error404use = isset($error404_options->error404use) ? $error404_options->error404use : '0';
// check if we need to create the 404 page
if ($error404error404use == '1') {
	$layouterror404custommessage = $input->get('layouterror404custommessage', '', 'html');
	$layouterror404custommessage = str_replace('&lt;', '<', $layouterror404custommessage);
	$layouterror404custommessage = str_replace('&gt;', '>', $layouterror404custommessage);

	// Make replacements for the strings
	$layouterror404custommessage = str_replace('{ERROR_REQUEST}', '<?php echo JText::_( \'TPL_' . strtoupper($templatename) . '_ERROR_REQUEST\'); ?>', $layouterror404custommessage);
	$layouterror404custommessage = str_replace('{SEARCH_FIELD}', '<?php if (JModuleHelper::getModule(\'search\')) : ?><?php echo JText::_( \'TPL_' . strtoupper($templatename) . '_SEARCH_FIELD\'); ?><br /><?php echo $doc->getBuffer(\'module\', \'search\'); ?><?php endif; ?>', $layouterror404custommessage);
	$layouterror404custommessage = str_replace('{GO_HOME}', '<a class="button" href="<?php echo JUri::base(true) ?>"><span class="fa fa-home"></span> <?php echo JText::_(\'JERROR_LAYOUT_GO_TO_THE_HOME_PAGE\'); ?></a>', $layouterror404custommessage);
	$layouterror404custommessage = str_replace('{CONTACT_ADMINISTRATOR}', '<?php echo JText::_( \'TPL_' . strtoupper($templatename) . '_CONTACT_ADMINISTRATOR\'); ?>', $layouterror404custommessage);
	$layouterror404custommessage = str_replace('{ERROR_CODE}', '404', $layouterror404custommessage);
	$layouterror404custommessage = str_replace('{ERROR_MESSAGE}', '<?php echo JText::_(\'TPL_' . strtoupper($templatename) . '_ERROR_MESSAGE\'); ?>', $layouterror404custommessage);

	$error404codeincontent = isset($error404_options->error404codeincontent) ? $error404_options->error404codeincontent : '1';
	if ($error404codeincontent == '1') {
		$indexphp = @file_get_contents($path . '/index.php');
		$error404_php = str_replace('<jdoc:include type="component" />', $layouterror404custommessage, $indexphp);
		$error404_php = str_replace('<jdoc:include type="message" />', '', $error404_php);
		$error404_php = str_replace("defined('_JEXEC') or die('Restricted access');", "defined('_JEXEC') or die('Restricted access');\n\$app = JFactory::getApplication();\n\$doc = JFactory::getDocument();\$this->params = \$app->getTemplate(true)->params;", $error404_php);
		$error404_php = str_replace("\$this->countModules", "JFactory::getDocument()->countModules", $error404_php);
		$error404_php = str_replace("<?php JHtml::_('jquery.framework'); ?>", "", $error404_php);
		$error404_php = str_replace("<?php JHtml::_('bootstrap.framework'); ?>", "", $error404_php);
		$error404_php = str_replace("<?php JHtmlBootstrap::loadCss(\$includeMaincss = false, \$this->direction); ?>", "", $error404_php);
		$error404_php = str_replace('<jdoc:include type="head" />', '<meta charset="utf-8" />
	<title><?php echo $this->title; ?> <?php echo htmlspecialchars($this->error->getMessage(), ENT_QUOTES, \'UTF-8\'); ?></title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<script src="<?php echo JUri::base(true) ?>/media/jui/js/jquery.min.js" type="text/javascript"></script>', $error404_php);
		$error404_php = preg_replace('/<jdoc:include type="modules" name="(.[^=]*)" \/>/', "<?php echo \$doc->getBuffer('modules', '$1'); ?>", $error404_php);
		$error404_php = preg_replace('/<jdoc:include type="modules" name="(.*)" style="(.*)" \/>/Uis', '<?php echo \$doc->getBuffer(\'modules\', \'$1\', array(\'style\' => \'$2\')); ?>', $error404_php);
	} else {
		$error404_php = '<?php
/**
 * Created by Template Creator CK
 * http://www.template-creator.com
 */

 // load the header.php file
?>
' . $layouterror404custommessage . '

<?php
';
	}

	@file_put_contents($path . '/error.php', $error404_php);
} else {
	// TCK_File::delete($path . '/error.php');
}