mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 09:49:22 +02:00
Allow simultaneous loading of config.ini and config.php in templates
This commit is contained in:
parent
0c207ce12d
commit
f5374e8ce7
@ -54,25 +54,29 @@ else {
|
|||||||
if(file_exists(BASE . $template_path . '/config.php')) {
|
if(file_exists(BASE . $template_path . '/config.php')) {
|
||||||
require BASE . $template_path . '/config.php';
|
require BASE . $template_path . '/config.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tmp = '';
|
||||||
|
if ($cache->enabled() && $cache->fetch('template_ini_' . $template_name, $tmp)) {
|
||||||
|
$template_ini = unserialize($tmp);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
$file = BASE . $template_path . '/config.ini';
|
$file = BASE . $template_path . '/config.ini';
|
||||||
$exists = file_exists($file);
|
$exists = file_exists($file);
|
||||||
if ($exists || ($config['backward_support'] && file_exists(BASE . $template_path . '/layout_config.ini'))) {
|
if ($exists || ($config['backward_support'] && file_exists(BASE . $template_path . '/layout_config.ini'))) {
|
||||||
if (!$exists)
|
if (!$exists) {
|
||||||
$file = BASE . $template_path . '/layout_config.ini';
|
$file = BASE . $template_path . '/layout_config.ini';
|
||||||
|
}
|
||||||
|
|
||||||
|
$template_ini = parse_ini_file($file);
|
||||||
|
|
||||||
if ($cache->enabled()) {
|
if ($cache->enabled()) {
|
||||||
$tmp = '';
|
|
||||||
if ($cache->fetch('template_ini_' . $template_name, $tmp))
|
|
||||||
$template_ini = unserialize($tmp);
|
|
||||||
else {
|
|
||||||
$template_ini = parse_ini_file($file);
|
|
||||||
$cache->set('template_ini_' . $template_name, serialize($template_ini));
|
$cache->set('template_ini_' . $template_name, serialize($template_ini));
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
$template_ini = parse_ini_file($file);
|
}
|
||||||
|
|
||||||
foreach ($template_ini as $key => $value)
|
if (isset($template_ini)) {
|
||||||
|
foreach ($template_ini as $key => $value) {
|
||||||
$config[$key] = $value;
|
$config[$key] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -134,10 +138,17 @@ function get_template_menus() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$new_menus = array();
|
$new_menus = array();
|
||||||
foreach(config('menu_categories') as $id => $options) {
|
/**
|
||||||
if(isset($menus[$id]))
|
* @var array $configMenuCategories
|
||||||
|
* @var int $id
|
||||||
|
* @var array $options
|
||||||
|
*/
|
||||||
|
$configMenuCategories = config('menu_categories');
|
||||||
|
foreach($configMenuCategories as $id => $options) {
|
||||||
|
if(isset($menus[$id])) {
|
||||||
$new_menus[$id] = $menus[$id];
|
$new_menus[$id] = $menus[$id];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $new_menus;
|
return $new_menus;
|
||||||
}
|
}
|
3
templates/kathrine/config.ini
Normal file
3
templates/kathrine/config.ini
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
darkborder = "#d0cdb4"
|
||||||
|
lightborder = "#e5e3d7"
|
||||||
|
vdarkborder = "#afab89"
|
@ -1,7 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
$config['darkborder'] = "#d0cdb4";
|
|
||||||
$config['lightborder'] = "#e5e3d7";
|
|
||||||
$config['vdarkborder'] = "#afab89";
|
|
||||||
$config['menu_categories'] = array(
|
$config['menu_categories'] = array(
|
||||||
MENU_CATEGORY_NEWS => array('id' => 'news', 'name' => 'Latest News'),
|
MENU_CATEGORY_NEWS => array('id' => 'news', 'name' => 'Latest News'),
|
||||||
MENU_CATEGORY_ACCOUNT => array('id' => 'account', 'name' => 'Account'),
|
MENU_CATEGORY_ACCOUNT => array('id' => 'account', 'name' => 'Account'),
|
||||||
@ -9,5 +6,3 @@ $config['menu_categories'] = array(
|
|||||||
MENU_CATEGORY_LIBRARY => array('id' => 'library', 'name' => 'Library'),
|
MENU_CATEGORY_LIBRARY => array('id' => 'library', 'name' => 'Library'),
|
||||||
MENU_CATEGORY_SHOP => array('id' => 'shops', 'name' => 'Shop')
|
MENU_CATEGORY_SHOP => array('id' => 'shops', 'name' => 'Shop')
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
|
||||||
|
18
templates/tibiacom/config.ini
Normal file
18
templates/tibiacom/config.ini
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
darkborder = "#D4C0A1"
|
||||||
|
lightborder = "#F1E0C6"
|
||||||
|
vdarkborder = "#505050"
|
||||||
|
|
||||||
|
logo_monster = "Wyrm"
|
||||||
|
|
||||||
|
; List: newcomer,gallery,premium,poll,highscores,networks
|
||||||
|
boxes = "highscores,newcomer,gallery,networks,poll"
|
||||||
|
|
||||||
|
; leave empty to disable
|
||||||
|
network_facebook = "tibia"
|
||||||
|
|
||||||
|
; leave empty to disable
|
||||||
|
network_twitter = "tibia"
|
||||||
|
|
||||||
|
background_image = "background-artwork.jpg"
|
||||||
|
logo_image = "tibia-logo-artwork-top.gif"
|
||||||
|
gallery_image_id_from_database = 1
|
@ -1,18 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
$config['darkborder'] = "#D4C0A1";
|
|
||||||
$config['lightborder'] = "#F1E0C6";
|
|
||||||
$config['vdarkborder'] = "#505050";
|
|
||||||
$config['logo_monster'] = "Wyrm";
|
|
||||||
// separated by comma
|
|
||||||
// sequence is important! they will be shown in same order that you add them to the list
|
|
||||||
// List: newcomer,gallery,premium,poll,highscores,networks
|
|
||||||
$config['boxes'] = "highscores,newcomer,gallery,networks,poll";
|
|
||||||
$config['network_facebook'] = 'tibia'; // leave empty to disable
|
|
||||||
$config['network_twitter'] = 'tibia'; // leave empty to disable
|
|
||||||
|
|
||||||
$config['background_image'] = "background-artwork.jpg";
|
|
||||||
$config['logo_image'] = "tibia-logo-artwork-top.gif";
|
|
||||||
$config['gallery_image_id_from_database'] = 1;
|
|
||||||
$config['menu_categories'] = array(
|
$config['menu_categories'] = array(
|
||||||
MENU_CATEGORY_NEWS => array('id' => 'news', 'name' => 'Latest News'),
|
MENU_CATEGORY_NEWS => array('id' => 'news', 'name' => 'Latest News'),
|
||||||
MENU_CATEGORY_ACCOUNT => array('id' => 'account', 'name' => 'Account'),
|
MENU_CATEGORY_ACCOUNT => array('id' => 'account', 'name' => 'Account'),
|
||||||
@ -21,4 +7,3 @@ $config['menu_categories'] = array(
|
|||||||
MENU_CATEGORY_LIBRARY => array('id' => 'library', 'name' => 'Library'),
|
MENU_CATEGORY_LIBRARY => array('id' => 'library', 'name' => 'Library'),
|
||||||
MENU_CATEGORY_SHOP => array('id' => 'shops', 'name' => 'Shop')
|
MENU_CATEGORY_SHOP => array('id' => 'shops', 'name' => 'Shop')
|
||||||
);
|
);
|
||||||
?>
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user