Skip to content

Commit

Permalink
Added new feature to specify compatible theme of template stored with…
Browse files Browse the repository at this point in the history
… plugins
  • Loading branch information
dengenxp committed Mar 6, 2016
1 parent 95b5217 commit d743216
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
3 changes: 2 additions & 1 deletion public_html/layout/denim/functions.php
Expand Up @@ -47,7 +47,8 @@ function theme_config_denim()
return array(
'image_type' => 'png',
'doctype' => 'xhtml5',
'supported_version_theme' => '2.0.0' // support new theme format for the later Geeklog 2.0.0
'supported_version_theme' => '2.0.0', // support new theme format for the later Geeklog 2.0.0
'theme_plugins' => 'denim' // Not requred, you can specify compatible theme of template stored with plugins
);
}

Expand Down
10 changes: 8 additions & 2 deletions public_html/lib-common.php
Expand Up @@ -359,6 +359,7 @@
$_CONF['path_layout_default'] = ''; // Default is none
$_CONF['supported_version_theme'] = '1.8.1'; // if the themes supported version of the theme engine not found assume lowest version
$_CONF['theme_etag'] = false;
$_CONF['theme_plugins'] = ''; // Default is none
$func = "theme_config_" . $_CONF['theme'];
if (function_exists($func)) {
$theme_config = $func();
Expand All @@ -368,12 +369,17 @@
$_CONF['theme_default'] = $theme_config['theme_default'];
$_CONF['path_layout_default'] = $_CONF['path_themes'] . $_CONF['theme_default'] . '/';
}
$_CONF['supported_version_theme'] = (!isset($theme_config['supported_version_theme'])) ? $_CONF['supported_version_theme'] : $theme_config['supported_version_theme'];
$_CONF['theme_etag'] = (!isset($theme_config['etag'])) ? $_CONF['theme_etag'] : $theme_config['etag'];
$_CONF['supported_version_theme'] = (!isset($theme_config['supported_version_theme']))
? $_CONF['supported_version_theme'] : $theme_config['supported_version_theme'];
$_CONF['theme_etag'] = (!isset($theme_config['etag']))
? $_CONF['theme_etag'] : $theme_config['etag'];
if ($_CONF['theme_etag'] AND !file_exists($_CONF['path_layout'] . 'style.css.php')) {
// See if style.css.php file exists that is required
$_CONF['theme_etag'] = false;
}
if (isset($theme_config['theme_plugins'])) {
$_CONF['theme_plugins'] = $theme_config['theme_plugins'];
}
}
/**
* themes can specify the default image type
Expand Down
13 changes: 13 additions & 0 deletions system/lib-template.php
Expand Up @@ -145,6 +145,19 @@ function CTL_plugin_templatePath($plugin, $path = '')
$retval[] = $layout_path;
}

// Check to see if compatible theme templates stored with plugin
if (!empty($_CONF['theme_plugins'])) {
if (empty($path)) {
$layout_path = "{$_CONF['path']}plugins/$plugin/templates/{$_CONF['theme_plugins']}";
} else {
$layout_path = "{$_CONF['path']}plugins/$plugin/templates/{$_CONF['theme_plugins']}/$path";
}

if (is_dir($layout_path)) {
$retval[] = $layout_path;
}
}

// Now Check to see if default theme exists for templates stored with plugin
if (!empty($_CONF['theme_default'])) {
if (empty($path)) {
Expand Down

0 comments on commit d743216

Please sign in to comment.