File manager - Edit - /home/jardides/www/Jardi-design/old/administrator/components/com_templateck/views/fonts/view.html.php
Back
<?php /** * @name Template Creator CK 3 * @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('_JEXEC') or die('Restricted access'); jimport('joomla.application.component.view'); /** * Templatecks View */ class TemplateckViewFonts extends JViewLegacy { protected $items; protected $pagination; protected $state; /** * Fonts view display method * @return void * */ function display($tpl = null) { JToolBarHelper::title(JText::_('CK_FONTS_MANAGER'), 'home_templateck'); require_once JPATH_COMPONENT . '/helpers/templateck.php'; $input = new JInput(); if ($input->get('layout') == 'installfontsquirrel' || $input->get('layout') == 'installfontgoogle') { JToolBarHelper::cancel('font.cancel', 'JTOOLBAR_CANCEL'); } else { JToolBarHelper::trash('fonts.delete'); JToolBarHelper::custom('font.installFontsquirrel', 'installTheme', 'installTheme', 'CK_INSTALL_FONTSQUIRREL', false); JToolBarHelper::custom('font.installFontgoogle', 'installTheme', 'installTheme', 'CK_INSTALL_FONTSGOOGLE', false); JToolBarHelper::editList('font.edit', 'JTOOLBAR_EDIT'); } $this->checkDbIntegrity(); // Get categories from the model $fonts = $this->get('fonts'); $this->fonts = $fonts; parent::display($tpl); } /** * Load the fonts from the db and inject the css in the page * @return void */ function _callfonts() { $fontstyles = ''; $fontsheets = ''; $db = JFactory::getDBO(); $query = "SELECT * FROM #__templateck_fonts"; $db->setQuery($query); $rows = $db->loadObjectList(); if (!$rows) return false; foreach ($rows as $row) { if (stristr($row->styles, '@import')) { $fontsheets .= str_replace(");", "' rel='stylesheet' type='text/css'>", str_replace("@import url(", "<link href='", $row->styles)); } else { $fontstyles .= str_replace("url('", "url('" . JURI::base(true) . "/components/com_templateck/fonts/" . $row->name . "/", $row->styles); } } if ($fontstyles) echo "<style type=\"text/css\">" . $fontstyles . "</style>"; if ($fontsheets) echo $fontsheets; } private function checkDbIntegrity() { $db = JFactory::getDbo(); // test if the subset columns not exists $query = "SHOW COLUMNS FROM #__templateck_fonts LIKE 'subset'"; $db->setQuery($query); if ($db->query()) { if ( $db->loadResult()) { //echo 'existe deja!';return; } else { // add the SQL field to the main table $db->setQuery('ALTER TABLE `#__templateck_fonts` ADD `subset` text NOT NULL;'); if (!$db->query()) { echo '<p class="alert alert-danger">Error during table subset update process !</p>'; } else { echo '<p class="alert alert-success">Table subset updated !</p>'; } } } else { echo 'SQL error - Check existing widgets column'; return false; } // test if the alternatives columns not exists $query = "SHOW COLUMNS FROM #__templateck_fonts LIKE 'alternatives'"; $db->setQuery($query); if ($db->query()) { if ( $db->loadResult()) { //echo 'existe deja!';return; } else { // add the SQL field to the main table $db->setQuery('ALTER TABLE `#__templateck_fonts` ADD `alternatives` text NOT NULL;'); if (!$db->query()) { echo '<p class="alert alert-danger">Error during table widgets update process !</p>'; } else { echo '<p class="alert alert-success">Table alternatives updated !</p>'; } } } else { echo 'SQL error - Check existing widgets column'; return false; } } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings