From 8d3cb8c0a95e21bda7d4b35b41d32ea5eb4084bc Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 17 Nov 2010 13:39:30 +0300 Subject: [PATCH] enable triple-pane theme; fix theme system not working --- functions.php | 22 ++++++++++++++++++---- prefs.php | 5 +---- themes/triple-pane/theme.css | 13 +++++++++++-- themes/triple-pane/theme.ini | 4 ++-- themes/triple-pane/theme.js | 14 ++++++++++++++ tt-rss.js | 9 +++++++++ tt-rss.php | 5 +---- 7 files changed, 56 insertions(+), 16 deletions(-) create mode 100644 themes/triple-pane/theme.js diff --git a/functions.php b/functions.php index 6d72c687..a6977b2a 100644 --- a/functions.php +++ b/functions.php @@ -2044,9 +2044,9 @@ } if ($theme_path) { - if (is_file("$t/theme.ini")) { - $ini = parse_ini_file("$t/theme.ini", true); - if ($ini['theme']['version'] > THEME_VERSION_REQUIRED) { + if (is_file("$theme_path/theme.ini")) { + $ini = parse_ini_file("$theme_path/theme.ini", true); + if ($ini['theme']['version'] >= THEME_VERSION_REQUIRED) { return $theme_path; } } @@ -2068,6 +2068,20 @@ return ''; } + function print_theme_includes($link) { + + $t = get_user_theme_path($link); + $time = time(); + + if ($t) { + print ""; + if (file_exists("$t/theme.js")) { + print ""; + } + } + } function get_all_themes() { $themes = glob("themes/*"); @@ -2079,7 +2093,7 @@ foreach ($themes as $t) { if (is_file("$t/theme.ini")) { $ini = parse_ini_file("$t/theme.ini", true); - if ($ini['theme']['version'] > THEME_VERSION_REQUIRED && + if ($ini['theme']['version'] >= THEME_VERSION_REQUIRED && !$ini['theme']['disabled']) { $entry = array(); $entry["path"] = $t; diff --git a/prefs.php b/prefs.php index 5bedfb8a..eda3cd0f 100644 --- a/prefs.php +++ b/prefs.php @@ -27,10 +27,7 @@ - - - + diff --git a/themes/triple-pane/theme.css b/themes/triple-pane/theme.css index 4a188a57..593ff955 100644 --- a/themes/triple-pane/theme.css +++ b/themes/triple-pane/theme.css @@ -1,4 +1,13 @@ -div.headlines_normal { +#content-insert { + border-left-width : 1px; + border-bottom-width : 0px; +} + +#headlines-frame { + border-right-width : 1px; +} + +/* div.headlines_normal { position : absolute; border-width : 1px 1px 0px 0px; right : 400px; @@ -66,7 +75,7 @@ span.headlineInnerTitle { bottom : 0px; top : 0px; -} +} */ /*#footer, #prefFooter { diff --git a/themes/triple-pane/theme.ini b/themes/triple-pane/theme.ini index 5e9feb9c..5aae7244 100644 --- a/themes/triple-pane/theme.ini +++ b/themes/triple-pane/theme.ini @@ -1,5 +1,5 @@ [theme] name=Triple-Pane author=seeker -version=1.0 -options=horiz_resize,hide_footer +version=1.1 +options= diff --git a/themes/triple-pane/theme.js b/themes/triple-pane/theme.js new file mode 100644 index 00000000..08805530 --- /dev/null +++ b/themes/triple-pane/theme.js @@ -0,0 +1,14 @@ +function themeBeforeLayout() { + $("headlines-wrap-inner").setAttribute("design", 'sidebar'); + $("content-insert").setAttribute("region", "trailing"); + $("content-insert").setStyle({ + width: '50%', + height: 'auto'}); +} + +function themeAfterLayout() { + $("headlines-toolbar").setStyle({ + 'border-right-width': '1px', + 'border-color': '#88b0f0', + }); +} diff --git a/tt-rss.js b/tt-rss.js index 8121e94b..f408197d 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -282,9 +282,18 @@ function init() { dojo.require("dijit.form.Select"); dojo.require("dojo.parser"); + if (typeof themeBeforeLayout == 'function') { + themeBeforeLayout(); + } + dojo.addOnLoad(function() { updateFeedList(); closeArticlePanel(); + + if (typeof themeAfterLayout == 'function') { + themeAfterLayout(); + } + }); if (!genericSanityCheck()) diff --git a/tt-rss.php b/tt-rss.php index 5791bd76..b1f43506 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -30,10 +30,7 @@ - - - + -- 2.39.5