]> git.wh0rd.org - tt-rss.git/commitdiff
move customizeCSS to pref-prefs
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 1 Apr 2013 08:30:34 +0000 (12:30 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 1 Apr 2013 08:30:34 +0000 (12:30 +0400)
classes/dlg.php
classes/pref/prefs.php
js/prefs.js

index 75cbbd74d3326887e70a0581eb69d193f83c5bc6..36f3ee07590f451919ce2415b9c9e599a8f5d63b 100644 (file)
@@ -383,33 +383,6 @@ class Dlg extends Handler_Protected {
 
        }
 
-       function customizeCSS() {
-               $value = get_pref($this->link, "USER_STYLESHEET");
-
-               $value = str_replace("<br/>", "\n", $value);
-
-               print_notice(T_sprintf("You can override colors, fonts and layout of your currently selected theme with custom CSS declarations here. <a target=\"_blank\" class=\"visibleLink\" href=\"%s\">This file</a> can be used as a baseline.", "tt-rss.css"));
-
-               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
-               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"setpref\">";
-               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"key\" value=\"USER_STYLESHEET\">";
-
-               print "<table width='100%'><tr><td>";
-               print "<textarea dojoType=\"dijit.form.SimpleTextarea\"
-                       style='font-size : 12px; width : 100%; height: 200px;'
-                       placeHolder='body#ttrssMain { font-size : 14px; };'
-                       name='value'>$value</textarea>";
-               print "</td></tr></table>";
-
-               print "<div class='dlgButtons'>";
-               print "<button dojoType=\"dijit.form.Button\"
-                       onclick=\"dijit.byId('cssEditDlg').execute()\">".__('Save')."</button> ";
-               print "<button dojoType=\"dijit.form.Button\"
-                       onclick=\"dijit.byId('cssEditDlg').hide()\">".__('Cancel')."</button>";
-               print "</div>";
-
-       }
-
        function addInstance() {
                print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\"  name=\"op\" value=\"pref-instances\">";
                print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\"  name=\"method\" value=\"add\">";
index 2190dc0e7b50486f2dc2a10cb3bcfabb5f599a66..21b25c6319d44e3b3fc4d070d7b978612e002d7f 100644 (file)
@@ -2,7 +2,7 @@
 class Pref_Prefs extends Handler_Protected {
 
        function csrf_ignore($method) {
-               $csrf_ignored = array("index", "updateself");
+               $csrf_ignored = array("index", "updateself", "customizecss");
 
                return array_search($method, $csrf_ignored) !== false;
        }
@@ -870,5 +870,33 @@ class Pref_Prefs extends Handler_Protected {
                global $pluginhost;
                $pluginhost->clear_data($pluginhost->get_plugin($name));
        }
+
+       function customizeCSS() {
+               $value = get_pref($this->link, "USER_STYLESHEET");
+
+               $value = str_replace("<br/>", "\n", $value);
+
+               print_notice(T_sprintf("You can override colors, fonts and layout of your currently selected theme with custom CSS declarations here. <a target=\"_blank\" class=\"visibleLink\" href=\"%s\">This file</a> can be used as a baseline.", "tt-rss.css"));
+
+               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
+               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"setpref\">";
+               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"key\" value=\"USER_STYLESHEET\">";
+
+               print "<table width='100%'><tr><td>";
+               print "<textarea dojoType=\"dijit.form.SimpleTextarea\"
+                       style='font-size : 12px; width : 100%; height: 200px;'
+                       placeHolder='body#ttrssMain { font-size : 14px; };'
+                       name='value'>$value</textarea>";
+               print "</td></tr></table>";
+
+               print "<div class='dlgButtons'>";
+               print "<button dojoType=\"dijit.form.Button\"
+                       onclick=\"dijit.byId('cssEditDlg').execute()\">".__('Save')."</button> ";
+               print "<button dojoType=\"dijit.form.Button\"
+                       onclick=\"dijit.byId('cssEditDlg').hide()\">".__('Cancel')."</button>";
+               print "</div>";
+
+       }
+
 }
 ?>
index 26501bec90ae61ae590f91f116c4cdac1eabf62d..678332616344a336fde7418105ae7e19177dca2d 100644 (file)
@@ -1715,7 +1715,7 @@ function editLabel(id, event) {
 
 function customizeCSS() {
        try {
-               var query = "backend.php?op=dlg&method=customizeCSS";
+               var query = "backend.php?op=pref-prefs&method=customizeCSS";
 
                if (dijit.byId("cssEditDlg"))
                        dijit.byId("cssEditDlg").destroyRecursive();