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/ajaxrenamefavorite.php

<?php

/**
 * @name		Template Creator CK
 * @package		com_templateck
 * @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');
$filename = $this->input->get('filename', '', 'string');
$name = $this->input->get('name', '', 'string');

$msg = '';
// load the file
$path = TEMPLATECREATORCK_PATH . '/favorites/';
$content = file_get_contents($path . $filename . '.fck3');
// update the name
$content = json_decode($content);
$content->name = $name;
$content = json_encode($content);
// store the file
$exportfiledest = $path . $filename . '.fck3';
$exportfiletext = $content;

if (! file_put_contents($exportfiledest, $exportfiletext)) {
	$msg = TCK_Text::_('CK_ERROR_CREATING_FAVORITEFILE');
	$status = 0;
} else {
	$msg = '';
	$status = 1;
}

echo '{"status": "' . $status . '", "msg": "' . $msg . '"}';