first commit
This commit is contained in:
38
plugins/system/jce/templates/astroid.php
Normal file
38
plugins/system/jce/templates/astroid.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @copyright Copyright (C) 2021 Ryan Demmer. All rights reserved
|
||||
* @license GNU General Public License version 2 or later
|
||||
*/
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
class WfTemplateAstroid extends JPlugin
|
||||
{
|
||||
public function onWfGetTemplateStylesheets(&$files, $template)
|
||||
{
|
||||
// Joomla 4
|
||||
$path = JPATH_SITE . '/media/templates/site/' . $template->name;
|
||||
|
||||
if (is_dir($path . '/astroid')) {
|
||||
$items = glob($path . '/css/compiled-*.css');
|
||||
|
||||
foreach($items as $item) {
|
||||
$files[] = 'media/templates/site/' . $template->name . '/css/' . basename($item);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Joomla 3
|
||||
$path = JPATH_SITE . '/templates/' . $template->name;
|
||||
|
||||
if (is_dir($path . '/astroid')) {
|
||||
$items = glob($path . '/css/compiled-*.css');
|
||||
|
||||
foreach($items as $item) {
|
||||
// add compiled css file
|
||||
$files[] = 'templates/' . $template->name . '/css/' . basename($item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
36
plugins/system/jce/templates/core.php
Normal file
36
plugins/system/jce/templates/core.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @copyright Copyright (C) 2021 Ryan Demmer. All rights reserved
|
||||
* @license GNU General Public License version 2 or later
|
||||
*/
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
class WfTemplateCore extends JPlugin
|
||||
{
|
||||
public function onWfGetTemplateStylesheets(&$files, $template)
|
||||
{
|
||||
// already processed by a framework
|
||||
if (!empty($files)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// search for template.css file using JPath
|
||||
$file = JPath::find(array(
|
||||
JPATH_SITE . '/templates/' . $template->name . '/css',
|
||||
JPATH_SITE . '/media/templates/site/' . $template->name . '/css'
|
||||
), 'template.css');
|
||||
|
||||
if (!$file) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// make relative
|
||||
$file = str_replace(JPATH_SITE, '', $file);
|
||||
|
||||
// remove leading slash
|
||||
$file = trim($file, '/');
|
||||
|
||||
$files[] = $file;
|
||||
}
|
||||
}
|
||||
108
plugins/system/jce/templates/gantry.php
Normal file
108
plugins/system/jce/templates/gantry.php
Normal file
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @copyright Copyright (C) 2021 Ryan Demmer. All rights reserved
|
||||
* @license GNU General Public License version 2 or later
|
||||
*/
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
class WfTemplateGantry extends JPlugin
|
||||
{
|
||||
public function onWfGetTemplateStylesheets(&$files, $template)
|
||||
{
|
||||
$path = JPATH_SITE . '/templates/' . $template->name;
|
||||
|
||||
// not a gantry template
|
||||
if (!is_dir($path . '/gantry') && !is_file($path . '/gantry.config.php')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$name = substr($template->name, strpos($template->name, '_') + 1);
|
||||
|
||||
// try Gantry5 templates
|
||||
$gantry5 = $path . '/custom/css-compiled';
|
||||
$gantry4 = $path . '/css-compiled';
|
||||
|
||||
if (is_dir($gantry5)) {
|
||||
// update url
|
||||
$url = 'templates/' . $template->name . '/custom/css-compiled';
|
||||
|
||||
// editor.css file
|
||||
$editor_css = $gantry5 . '/editor.css';
|
||||
|
||||
// check for editor.css file
|
||||
if (is_file($editor_css) && filesize($editor_css) > 0) {
|
||||
$files[] = $url . '/' . basename($editor_css);
|
||||
return true;
|
||||
}
|
||||
|
||||
// load gantry base files
|
||||
$files[] = 'media/gantry5/assets/css/bootstrap-gantry.css';
|
||||
$files[] = 'media/gantry5/engines/nucleus/css-compiled/nucleus.css';
|
||||
|
||||
$items = array();
|
||||
$custom = array();
|
||||
|
||||
$list = glob($gantry5 . '/*_[0-9]*.css');
|
||||
|
||||
foreach ($list as $file) {
|
||||
if (strpos(basename($file), 'custom_') !== false) {
|
||||
$custom[filemtime($file)] = $file;
|
||||
} else {
|
||||
$items[filemtime($file)] = $file;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($items)) {
|
||||
// sort items by modified time key
|
||||
ksort($items, SORT_NUMERIC);
|
||||
|
||||
// get the last item in the array
|
||||
$item = end($items);
|
||||
|
||||
$path = dirname($item);
|
||||
$file = basename($item);
|
||||
|
||||
// load css files
|
||||
$files[] = $url . '/' . $file;
|
||||
}
|
||||
|
||||
// load custom css file if it exists
|
||||
if (!empty($custom)) {
|
||||
// sort custom by modified time key
|
||||
ksort($custom, SORT_NUMERIC);
|
||||
|
||||
// get the last custom file in the array
|
||||
$custom_file = end($custom);
|
||||
// create custom file url
|
||||
$files[] = $url . '/' . basename($custom_file);
|
||||
}
|
||||
}
|
||||
|
||||
if (is_dir($gantry4)) {
|
||||
// update url
|
||||
$url = 'templates/' . $template->name . '/css-compiled';
|
||||
// load gantry bootstrap files
|
||||
$files[] = $url . '/bootstrap.css';
|
||||
|
||||
$items = array();
|
||||
|
||||
$list = glob($gantry4 . '/master-*.css');
|
||||
|
||||
if (!empty($list)) {
|
||||
foreach ($list as $file) {
|
||||
$items[filemtime($file)] = $file;
|
||||
}
|
||||
|
||||
// sort by modified time key
|
||||
ksort($items, SORT_NUMERIC);
|
||||
|
||||
// get the last item in the array
|
||||
$item = end($items);
|
||||
|
||||
// load css files
|
||||
$files[] = $url . '/' . basename($item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
36
plugins/system/jce/templates/helix.php
Normal file
36
plugins/system/jce/templates/helix.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @copyright Copyright (C) 2021 Ryan Demmer. All rights reserved
|
||||
* @license GNU General Public License version 2 or later
|
||||
*/
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
class WfTemplateHelix extends JPlugin
|
||||
{
|
||||
public function onWfGetTemplateStylesheets(&$files, $template)
|
||||
{
|
||||
$path = JPATH_SITE . '/templates/' . $template->name;
|
||||
|
||||
if (!is_file($path . '/comingsoon.php')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// add bootstrap
|
||||
$files[] = 'templates/' . $template->name . '/css/bootstrap.min.css';
|
||||
|
||||
// add base template.css file
|
||||
$files[] = 'templates/' . $template->name . '/css/template.css';
|
||||
|
||||
$params = new JRegistry($template->params);
|
||||
$preset = $params->get('preset', '');
|
||||
|
||||
$data = json_decode($preset);
|
||||
|
||||
if ($data) {
|
||||
if (isset($data->preset)) {
|
||||
$files[] = 'templates/' . $template->name . '/css/presets/' . $data->preset . '.css';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
39
plugins/system/jce/templates/joomlart.php
Normal file
39
plugins/system/jce/templates/joomlart.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @copyright Copyright (C) 2021 Ryan Demmer. All rights reserved
|
||||
* @license GNU General Public License version 2 or later
|
||||
*/
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
class WfTemplateJoomlart extends JPlugin
|
||||
{
|
||||
public function onWfGetTemplateStylesheets(&$files, $template)
|
||||
{
|
||||
$path = JPATH_SITE . '/templates/' . $template->name;
|
||||
|
||||
if (!is_file($path . '/templateInfo.php')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// add base template.css file
|
||||
$files[] = 'templates/' . $template->name . '/css/template.css';
|
||||
|
||||
$items = array();
|
||||
|
||||
$list = glob(JPATH_SITE . '/media/t4/css/*.css');
|
||||
|
||||
foreach($list as $file) {
|
||||
$items[filemtime($file)] = $file;
|
||||
}
|
||||
|
||||
// sort by modified time key
|
||||
ksort($items, SORT_NUMERIC);
|
||||
|
||||
// get the last item in the array
|
||||
$item = end($items);
|
||||
|
||||
// add compiled css file
|
||||
$files[] = 'media/t4/css/' . basename($item);
|
||||
}
|
||||
}
|
||||
40
plugins/system/jce/templates/sun.php
Normal file
40
plugins/system/jce/templates/sun.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @copyright Copyright (C) 2021 Ryan Demmer. All rights reserved
|
||||
* @license GNU General Public License version 2 or later
|
||||
*/
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
class WfTemplateSun extends JPlugin
|
||||
{
|
||||
public function onWfGetTemplateStylesheets(&$files, $template)
|
||||
{
|
||||
$path = JPATH_SITE . '/templates/' . $template->name;
|
||||
|
||||
if (!is_file($path . '/template.defines.php')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// add bootstrap
|
||||
$files[] = 'plugins/system/jsntplframework/assets/3rd-party/bootstrap/css/bootstrap-frontend.min.css';
|
||||
|
||||
// add base template.css file
|
||||
$files[] = 'templates/' . $template->name . '/css/template.css';
|
||||
|
||||
$params = new JRegistry($template->params);
|
||||
$preset = $params->get('preset', '');
|
||||
|
||||
$data = json_decode($preset);
|
||||
|
||||
if ($data) {
|
||||
if (isset($data->templateColor)) {
|
||||
$files[] = 'templates/' . $template->name . '/css/color/' . $data->templateColor . '.css';
|
||||
}
|
||||
|
||||
if (isset($data->fontStyle) && isset($data->fontStyle->style)) {
|
||||
$files[] = 'templates/' . $template->name . '/css/styles/' . $data->fontStyle->style . '.css';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
34
plugins/system/jce/templates/wright.php
Normal file
34
plugins/system/jce/templates/wright.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @copyright Copyright (C) 2021 Ryan Demmer. All rights reserved
|
||||
* @license GNU General Public License version 2 or later
|
||||
*/
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
class WfTemplateWright extends JPlugin
|
||||
{
|
||||
public function onWfGetTemplateStylesheets(&$files, $template)
|
||||
{
|
||||
$path = JPATH_SITE . '/templates/' . $template->name;
|
||||
|
||||
// not a wright template
|
||||
if (!is_dir($path . '/wright')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// add bootstrap
|
||||
$files[] = 'templates/' . $template->name . '/wright/css/bootstrap.min.css';
|
||||
|
||||
$params = new JRegistry($template->params);
|
||||
$style = $params->get('style', 'default');
|
||||
|
||||
// check style-custom.css file
|
||||
$file = $path . '/css/style-' . $style . '.css';
|
||||
|
||||
// add base theme.css file
|
||||
if (is_file($file)) {
|
||||
$files[] = 'templates/' . $template->name . '/css/style-' . $style . '.css';
|
||||
}
|
||||
}
|
||||
}
|
||||
62
plugins/system/jce/templates/yootheme.php
Normal file
62
plugins/system/jce/templates/yootheme.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @copyright Copyright (C) 2021 Ryan Demmer. All rights reserved
|
||||
* @license GNU General Public License version 2 or later
|
||||
*/
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
class WfTemplateYootheme extends JPlugin
|
||||
{
|
||||
public function onWfGetTemplateStylesheets(&$files, $template)
|
||||
{
|
||||
$path = JPATH_SITE . '/templates/' . $template->name;
|
||||
|
||||
// not a yootheme / warp template
|
||||
if (!is_dir($path . '/warp') && !is_dir($path . '/vendor/yootheme')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_dir($path . '/warp')) {
|
||||
$file = 'css/theme.css';
|
||||
|
||||
$config = $path . '/config.json';
|
||||
|
||||
if (is_file($config)) {
|
||||
$data = file_get_contents($config);
|
||||
$json = json_decode($data);
|
||||
|
||||
$style = '';
|
||||
|
||||
if ($json) {
|
||||
if (!empty($json->layouts->default->style)) {
|
||||
$style = $json->layouts->default->style;
|
||||
}
|
||||
}
|
||||
|
||||
if ($style && $style !== 'default') {
|
||||
$file = 'styles/' . $style . '/css/theme.css';
|
||||
}
|
||||
}
|
||||
|
||||
// add base theme.css file
|
||||
if (is_file($path . '/' . $file)) {
|
||||
$files[] = 'templates/' . $template->name . '/' . $file;
|
||||
}
|
||||
|
||||
// add custom css file
|
||||
if (is_file($path . '/css/custom.css')) {
|
||||
$files[] = 'templates/' . $template->name . '/css/custom.css';
|
||||
}
|
||||
}
|
||||
|
||||
if (is_dir($path . '/vendor/yootheme')) {
|
||||
$files[] = 'templates/' . $template->name . '/css/theme.css';
|
||||
|
||||
// add custom css file
|
||||
if (is_file($path . '/css/custom.css')) {
|
||||
$files[] = 'templates/' . $template->name . '/css/custom.css';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user