From 9d76e754513ec1119a010ab2e9abcf9fb9df52d1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 1 Apr 2013 12:34:49 +0400 Subject: [PATCH] move editPrefProfiles to pref-prefs --- classes/dlg.php | 116 --------------------------------------- classes/pref/prefs.php | 119 ++++++++++++++++++++++++++++++++++++++++- js/prefs.js | 2 +- 3 files changed, 119 insertions(+), 118 deletions(-) diff --git a/classes/dlg.php b/classes/dlg.php index 376f8d26..32a3b230 100644 --- a/classes/dlg.php +++ b/classes/dlg.php @@ -42,122 +42,6 @@ class Dlg extends Handler_Protected { //return; } - function editPrefProfiles() { - print "
"; - - print "
". - "" . __('Select').""; - print "
"; - print "
".__('All')."
"; - print "
".__('None')."
"; - print "
"; - - print "
"; - - print " -
"; - - print "
"; - - $result = db_query($this->link, "SELECT title,id FROM ttrss_settings_profiles - WHERE owner_uid = ".$_SESSION["uid"]." ORDER BY title"); - - print "
"; - - print "
"; - - print ""; - - print ""; #odd - - print ""; - - if (!$_SESSION["profile"]) { - $is_active = __("(active)"); - } else { - $is_active = ""; - } - - print ""; - - print ""; - - $lnum = 1; - - while ($line = db_fetch_assoc($result)) { - - $class = ($lnum % 2) ? "even" : "odd"; - - $profile_id = $line["id"]; - $this_row_id = "id=\"FCATR-$profile_id\""; - - print ""; - - $edit_title = htmlspecialchars($line["title"]); - - print ""; - - if ($_SESSION["profile"] == $line["id"]) { - $is_active = __("(active)"); - } else { - $is_active = ""; - } - - print ""; - - print ""; - - ++$lnum; - } - - print "
" . - __("Default profile") . " $is_active
" . $edit_title . - " - $is_active
"; - print "
"; - print "
"; - - print "
-
- - -
"; - - print ""; - print "
"; - - } - function pubOPMLUrl() { $url_path = Opml::opml_publish_url($this->link); diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php index 21b25c63..cc523092 100644 --- a/classes/pref/prefs.php +++ b/classes/pref/prefs.php @@ -2,7 +2,7 @@ class Pref_Prefs extends Handler_Protected { function csrf_ignore($method) { - $csrf_ignored = array("index", "updateself", "customizecss"); + $csrf_ignored = array("index", "updateself", "customizecss", "editprefprofiles"); return array_search($method, $csrf_ignored) !== false; } @@ -898,5 +898,122 @@ class Pref_Prefs extends Handler_Protected { } + function editPrefProfiles() { + print "
"; + + print "
". + "" . __('Select').""; + print "
"; + print "
".__('All')."
"; + print "
".__('None')."
"; + print "
"; + + print "
"; + + print " +
"; + + print "
"; + + $result = db_query($this->link, "SELECT title,id FROM ttrss_settings_profiles + WHERE owner_uid = ".$_SESSION["uid"]." ORDER BY title"); + + print "
"; + + print "
"; + + print ""; + + print ""; #odd + + print ""; + + if (!$_SESSION["profile"]) { + $is_active = __("(active)"); + } else { + $is_active = ""; + } + + print ""; + + print ""; + + $lnum = 1; + + while ($line = db_fetch_assoc($result)) { + + $class = ($lnum % 2) ? "even" : "odd"; + + $profile_id = $line["id"]; + $this_row_id = "id=\"FCATR-$profile_id\""; + + print ""; + + $edit_title = htmlspecialchars($line["title"]); + + print ""; + + if ($_SESSION["profile"] == $line["id"]) { + $is_active = __("(active)"); + } else { + $is_active = ""; + } + + print ""; + + print ""; + + ++$lnum; + } + + print "
" . + __("Default profile") . " $is_active
" . $edit_title . + " + $is_active
"; + print "
"; + print "
"; + + print "
+
+ + +
"; + + print ""; + print "
"; + + } + + } ?> diff --git a/js/prefs.js b/js/prefs.js index 67833261..30dad0d8 100644 --- a/js/prefs.js +++ b/js/prefs.js @@ -1400,7 +1400,7 @@ function editProfiles() { if (dijit.byId("profileEditDlg")) dijit.byId("profileEditDlg").destroyRecursive(); - var query = "backend.php?op=dlg&method=editPrefProfiles"; + var query = "backend.php?op=pref-prefs&method=editPrefProfiles"; dialog = new dijit.Dialog({ id: "profileEditDlg", -- 2.39.5