]> git.wh0rd.org - tt-rss.git/blobdiff - functions.php
replace some theme-specific frontend hooks with theme options
[tt-rss.git] / functions.php
index f32ff8c982f656581f203566f6a08ae8c848bd58..781074569a16b1c325c45f15b9b03b63a52f1308 100644 (file)
                return $theme_path;
        }
 
+       function get_user_theme_options($link) {
+               $t = get_user_theme_path($link);
+
+               if ($t) {
+                       if (is_file("$t/theme.ini")) {
+                               $ini = parse_ini_file("$t/theme.ini", true);
+                               if ($ini['theme']['version']) {
+                                       return $ini['theme']['options'];
+                               }
+                       }
+               }
+               return false;
+       }
+
+
        function get_all_themes() {
                $themes = glob("themes/*");
 
                                        $entry["name"] = $ini['theme']['name'];
                                        $entry["version"] = $ini['theme']['version'];
                                        $entry["author"] = $ini['theme']['author'];
+                                       $entry["options"] = $ini['theme']['options'];
                                        array_push($rv, $entry);
                                }
                        }
                }
 
                print "<param key=\"theme\" value=\"".get_user_theme($link)."\"/>";
+               print "<param key=\"theme_options\" value=\"".get_user_theme_options($link)."\"/>";
                print "<param key=\"daemon_enabled\" value=\"" . ENABLE_UPDATE_DAEMON . "\"/>";
                print "<param key=\"feeds_frame_refresh\" value=\"" . FEEDS_FRAME_REFRESH . "\"/>";
                print "<param key=\"daemon_refresh_only\" value=\"true\"/>";