mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 15:05:56 +00:00
remove themes/
This commit is contained in:
@@ -42,8 +42,6 @@ class Pref_Prefs extends Handler_Protected {
|
|||||||
|
|
||||||
$_SESSION["prefs_cache"] = false;
|
$_SESSION["prefs_cache"] = false;
|
||||||
|
|
||||||
$orig_theme = get_pref($this->link, "_THEME_ID");
|
|
||||||
|
|
||||||
foreach (array_keys($_POST) as $pref_name) {
|
foreach (array_keys($_POST) as $pref_name) {
|
||||||
|
|
||||||
$pref_name = db_escape_string($pref_name);
|
$pref_name = db_escape_string($pref_name);
|
||||||
@@ -62,11 +60,7 @@ class Pref_Prefs extends Handler_Protected {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($orig_theme != get_pref($this->link, "_THEME_ID")) {
|
print __("The configuration was saved.");
|
||||||
print "PREFS_THEME_CHANGED";
|
|
||||||
} else {
|
|
||||||
print __("The configuration was saved.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getHelp() {
|
function getHelp() {
|
||||||
@@ -458,32 +452,6 @@ class Pref_Prefs extends Handler_Protected {
|
|||||||
|
|
||||||
print "<tr><td colspan=\"3\"><h3>".__($active_section)."</h3></td></tr>";
|
print "<tr><td colspan=\"3\"><h3>".__($active_section)."</h3></td></tr>";
|
||||||
|
|
||||||
if ($line["section_id"] == 2) {
|
|
||||||
print "<tr><td width=\"40%\">".__("Select theme")."</td>";
|
|
||||||
|
|
||||||
$user_theme = get_pref($this->link, "_THEME_ID");
|
|
||||||
$themes = get_all_themes();
|
|
||||||
|
|
||||||
print "<td><select name=\"_THEME_ID\" dojoType=\"dijit.form.Select\">";
|
|
||||||
print "<option value='Default'>".__('Default')."</option>";
|
|
||||||
print "<option value='----------------' disabled=\"1\">--------</option>";
|
|
||||||
|
|
||||||
foreach ($themes as $t) {
|
|
||||||
$base = $t['base'];
|
|
||||||
$name = $t['name'];
|
|
||||||
|
|
||||||
if ($base == $user_theme) {
|
|
||||||
$selected = "selected=\"1\"";
|
|
||||||
} else {
|
|
||||||
$selected = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
print "<option $selected value='$base'>$name</option>";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</select></td></tr>";
|
|
||||||
}
|
|
||||||
$lnum = 0;
|
$lnum = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -759,115 +759,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Deprecated, TODO: remove
|
||||||
function theme_image($link, $filename) {
|
function theme_image($link, $filename) {
|
||||||
if ($link) {
|
return $filename;
|
||||||
$theme_path = get_user_theme_path($link);
|
|
||||||
|
|
||||||
if ($theme_path && is_file($theme_path.$filename)) {
|
|
||||||
return $theme_path.$filename;
|
|
||||||
} else {
|
|
||||||
return $filename;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return $filename;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_user_theme($link) {
|
|
||||||
|
|
||||||
if (get_schema_version($link) >= 63 && $_SESSION["uid"]) {
|
|
||||||
$theme_name = get_pref($link, "_THEME_ID");
|
|
||||||
if (is_dir("themes/$theme_name")) {
|
|
||||||
return $theme_name;
|
|
||||||
} else {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_user_theme_path($link) {
|
|
||||||
$theme_path = '';
|
|
||||||
|
|
||||||
if (get_schema_version($link) >= 63 && $_SESSION["uid"]) {
|
|
||||||
$theme_name = get_pref($link, "_THEME_ID");
|
|
||||||
|
|
||||||
if ($theme_name && is_dir("themes/$theme_name")) {
|
|
||||||
$theme_path = "themes/$theme_name/";
|
|
||||||
} else {
|
|
||||||
$theme_name = '';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$theme_path = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($theme_path) {
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
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 '';
|
|
||||||
}
|
|
||||||
|
|
||||||
function print_theme_includes($link) {
|
|
||||||
|
|
||||||
$t = get_user_theme_path($link);
|
|
||||||
$time = time();
|
|
||||||
|
|
||||||
if ($t) {
|
|
||||||
print "<link rel=\"stylesheet\" type=\"text/css\"
|
|
||||||
href=\"$t/theme.css?$time \">";
|
|
||||||
if (file_exists("$t/theme.js")) {
|
|
||||||
print "<script type=\"text/javascript\" src=\"$t/theme.js?$time\">
|
|
||||||
</script>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function get_all_themes() {
|
|
||||||
$themes = glob("themes/*");
|
|
||||||
|
|
||||||
asort($themes);
|
|
||||||
|
|
||||||
$rv = array();
|
|
||||||
|
|
||||||
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 &&
|
|
||||||
!$ini['theme']['disabled']) {
|
|
||||||
$entry = array();
|
|
||||||
$entry["path"] = $t;
|
|
||||||
$entry["base"] = basename($t);
|
|
||||||
$entry["name"] = $ini['theme']['name'];
|
|
||||||
$entry["version"] = $ini['theme']['version'];
|
|
||||||
$entry["author"] = $ini['theme']['author'];
|
|
||||||
$entry["options"] = $ini['theme']['options'];
|
|
||||||
array_push($rv, $entry);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $rv;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function convert_timestamp($timestamp, $source_tz, $dest_tz) {
|
function convert_timestamp($timestamp, $source_tz, $dest_tz) {
|
||||||
@@ -1933,9 +1827,6 @@
|
|||||||
function make_init_params($link) {
|
function make_init_params($link) {
|
||||||
$params = array();
|
$params = array();
|
||||||
|
|
||||||
$params["theme"] = get_user_theme($link);
|
|
||||||
$params["theme_options"] = get_user_theme_options($link);
|
|
||||||
|
|
||||||
$params["sign_progress"] = theme_image($link, "images/indicator_white.gif");
|
$params["sign_progress"] = theme_image($link, "images/indicator_white.gif");
|
||||||
$params["sign_progress_tiny"] = theme_image($link, "images/indicator_tiny.gif");
|
$params["sign_progress_tiny"] = theme_image($link, "images/indicator_tiny.gif");
|
||||||
$params["sign_excl"] = theme_image($link, "images/sign_excl.svg");
|
$params["sign_excl"] = theme_image($link, "images/sign_excl.svg");
|
||||||
|
|||||||
@@ -53,7 +53,6 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="tt-rss.css?<?php echo $dt_add ?>"/>
|
<link rel="stylesheet" type="text/css" href="tt-rss.css?<?php echo $dt_add ?>"/>
|
||||||
<link rel="stylesheet" type="text/css" href="cdm.css?<?php echo $dt_add ?>"/>
|
<link rel="stylesheet" type="text/css" href="cdm.css?<?php echo $dt_add ?>"/>
|
||||||
|
|
||||||
<?php print_theme_includes($link) ?>
|
|
||||||
<?php print_user_stylesheet($link) ?>
|
<?php print_user_stylesheet($link) ?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|||||||
@@ -280,10 +280,6 @@ function init() {
|
|||||||
|
|
||||||
dojo.require("fox.FeedTree");
|
dojo.require("fox.FeedTree");
|
||||||
|
|
||||||
if (typeof themeBeforeLayout == 'function') {
|
|
||||||
themeBeforeLayout();
|
|
||||||
}
|
|
||||||
|
|
||||||
dojo.require("dijit.ColorPalette");
|
dojo.require("dijit.ColorPalette");
|
||||||
dojo.require("dijit.Dialog");
|
dojo.require("dijit.Dialog");
|
||||||
dojo.require("dijit.form.Button");
|
dojo.require("dijit.form.Button");
|
||||||
@@ -342,10 +338,6 @@ function init_second_stage() {
|
|||||||
switchPanelMode(_widescreen_mode);
|
switchPanelMode(_widescreen_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof themeAfterLayout == 'function') {
|
|
||||||
themeAfterLayout();
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
delCookie("ttrss_test");
|
delCookie("ttrss_test");
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="lib/dijit/themes/claro/claro.css"/>
|
<link rel="stylesheet" type="text/css" href="lib/dijit/themes/claro/claro.css"/>
|
||||||
<link rel="stylesheet" type="text/css" href="tt-rss.css?<?php echo $dt_add ?>"/>
|
<link rel="stylesheet" type="text/css" href="tt-rss.css?<?php echo $dt_add ?>"/>
|
||||||
|
|
||||||
<?php print_theme_includes($link) ?>
|
|
||||||
<?php print_user_stylesheet($link) ?>
|
<?php print_user_stylesheet($link) ?>
|
||||||
|
|
||||||
<link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
|
<link rel="shortcut icon" type="image/png" href="images/favicon.png"/>
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
#content-insert {
|
|
||||||
border-left-width : 1px;
|
|
||||||
border-bottom-width : 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#headlines-frame {
|
|
||||||
border-right-width : 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
[theme]
|
|
||||||
name=Widescreen
|
|
||||||
author=seeker
|
|
||||||
version=1.1
|
|
||||||
options=
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
function themeBeforeLayout() {
|
|
||||||
if ($("content-insert")) {
|
|
||||||
$("headlines-wrap-inner").setAttribute("design", 'sidebar');
|
|
||||||
$("content-insert").setAttribute("region", "trailing");
|
|
||||||
$("content-insert").setStyle({
|
|
||||||
width: '50%',
|
|
||||||
height: 'auto'});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function themeAfterLayout() {
|
|
||||||
$("headlines-toolbar").setStyle({
|
|
||||||
'border-width': '1px 1px 0px 0px',
|
|
||||||
'border-color': '#88b0f0',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user