Your IP : 216.73.216.55


Current Path : /home/giteleslfp/www/administrator/components/com_templateck/controllers/
Upload File :
Current File : /home/giteleslfp/www/administrator/components/com_templateck/controllers/font.php

<?php

/**
 * @name		Template Creator CK
 * @copyright	Copyright (C) since 2011. 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();
require_once TEMPLATECREATORCK_PATH . '/controller.php';

class TemplateckControllerFont extends TemplateckController {

	/**
	 * constructor (registers additional tasks to methods)
	 * @return void
	 */
	function __construct() {
		parent::__construct();
	}

	/**
	 * display input form to select a zip file
	 * @return void
	 */
	function installTheme() {
		$this->input->set('view', 'fonts');
		$this->input->set('layout', 'install');

		parent::display();
	}

	/**
	 * display input form to select a zip file
	 * @return void
	 */
	function installFontsquirrel() {
		$this->input->set('view', 'fonts');
		$this->input->set('layout', 'installfontsquirrel');

		parent::display();
	}

	/**
	 * display input form to select a zip file
	 * @return void
	 */
	function installFontgoogle() {
		$this->input->set('view', 'fonts');
		$this->input->set('layout', 'installfontgoogle');

		parent::display();
	}

	/**
	 * import a font from fontsquirrel
	 * @return void
	 */
	function importzipfromsquirrel() {
		$model = $this->getModel('font');
		if (!$model->installFontsquirrel()) {
			$msg = TCK_Text::_('CK_INSTALL_FONT_ERROR');
			$link = 'index.php?option=com_templateck&view=fonts&layout=install';
			$type = 'error';
		} else {
			$msg = TCK_Text::_('CK_FONT_INSTALLED');
			$link = 'index.php?option=com_templateck&view=fonts';
			$type = 'message';
		}

		$this->setRedirect($link, $msg, $type);
	}

	/**
	 * import a font from google
	 * @return void
	 */
	function importstylesfromgoogle() {
		$model = $this->getModel('font');
		if (!$model->installFontgoogle()) {
			$msg = TCK_Text::_('CK_INSTALL_FONT_ERROR');
			$link = 'index.php?option=com_templateck&view=fonts&layout=install';
			$type = 'error';
		} else {
			$msg = TCK_Text::_('CK_FONT_INSTALLED');
			$link = 'index.php?option=com_templateck&view=fonts';
			$type = 'message';
		}

		$this->setRedirect($link, $msg, $type);
	}

	/**
	 * import a font from google
	 * @return void
	 */
	function delete() {
		$model = $this->getModel('font');
		$cids = $this->input->get('cid', array(0), 'post', 'array');
		if (!$model->delete($cids)) {
			$msg = TCK_Text::_('CK_DELETE_FONT_ERROR');
			$link = 'index.php?option=com_templateck&view=fonts&layout=install';
			$type = 'error';
		} else {
			$msg = TCK_Text::_('CK_FONT_DELETED');
			$link = 'index.php?option=com_templateck&view=fonts';
			$type = 'message';
		}

		$this->setRedirect($link, $msg, $type);
	}
}