From e7924c6dacef405a6e20b41d078f4a90a210cb51 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 13 Feb 2021 13:17:34 +0300 Subject: label editor: use client dialog --- classes/pref/labels.php | 68 ++++--------------------------------------------- 1 file changed, 5 insertions(+), 63 deletions(-) (limited to 'classes/pref/labels.php') diff --git a/classes/pref/labels.php b/classes/pref/labels.php index a787ce388..6102ab8dd 100644 --- a/classes/pref/labels.php +++ b/classes/pref/labels.php @@ -10,72 +10,14 @@ class Pref_Labels extends Handler_Protected { function edit() { $label_id = clean($_REQUEST['id']); - $sth = $this->pdo->prepare("SELECT * FROM ttrss_labels2 WHERE + $sth = $this->pdo->prepare("SELECT id, caption, fg_color, bg_color FROM ttrss_labels2 WHERE id = ? AND owner_uid = ?"); $sth->execute([$label_id, $_SESSION['uid']]); - if ($line = $sth->fetch()) { - - print_hidden("id", "$label_id"); - print_hidden("op", "pref-labels"); - print_hidden("method", "save"); - - print "
"; - - print "
".__("Caption")."
"; - - print "
"; - - $fg_color = $line['fg_color']; - $bg_color = $line['bg_color'] ? $line['bg_color'] : '#fff7d5'; - - print ""; - - print "
"; - - print "
" . __("Colors") . "
"; - print "
"; - - print ""; - print ""; - print "
".__("Foreground:")."".__("Background:")."
"; - - print ""; - print ""; - - print "
- -
"; - - print "
"; - - print "
- -
"; - - print "
"; - print "
"; - - print ""; - - print "
"; + if ($line = $sth->fetch(PDO::FETCH_ASSOC)) { + print json_encode($line); + } else { + print json_encode(["error" => "LABEL_NOT_FOUND"]); } } -- cgit v1.2.3