static function get_all_labels($owner_uid) {
$rv = array();
- $result = db_query("SELECT fg_color, bg_color, caption FROM ttrss_labels2 WHERE owner_uid = " . $owner_uid);
+ $result = db_query("SELECT id, fg_color, bg_color, caption FROM ttrss_labels2 WHERE owner_uid = " . $owner_uid);
while ($line = db_fetch_assoc($result)) {
array_push($rv, $line);
$params["icon_cross"] = base64_img("images/cross.png");
$params["icon_indicator_white"] = base64_img("images/indicator_white.gif");
+ $params["labels"] = Labels::get_all_labels($_SESSION["uid"]);
+
return $params;
}
$data['dep_ts'] = calculate_dep_timestamp();
$data['reload_on_ts_change'] = !defined('_NO_RELOAD_ON_TS_CHANGE');
+ $data["labels"] = Labels::get_all_labels($_SESSION["uid"]);
if (CHECK_FOR_UPDATES && !$disable_update_check && $_SESSION["last_version_check"] + 86400 + rand(-1000, 1000) < time()) {
$update_result = @check_for_update();
}));
- var labels = dijit.byId("feedTree").model.getItemsInCategory(-2);
+ var labels = getInitParam("labels");
if (labels) {
var labelDelMenu = new dijit.Menu({ownerMenu: menu});
labels.each(function (label) {
- var id = label.id[0];
- var bare_id = id.substr(id.indexOf(":") + 1);
- var name = label.name[0];
-
- bare_id = feed_to_label_id(bare_id);
+ var bare_id = label.id;
+ var name = label.caption;
labelAddMenu.addChild(new dijit.MenuItem({
label: name,