[geeklog-cvs] geeklog: Updated blocks to deal with no topic assignments
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Mon Oct 10 14:26:26 EDT 2011
changeset 8442:8ca4f11166ba
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/8ca4f11166ba
user: Tom <websitemaster at cogeco.net>
date: Mon Oct 10 14:01:15 2011 -0400
description:
Updated blocks to deal with no topic assignments
Admin Block editor now uses topic list that displays parents
diffstat:
public_html/admin/block.php | 4 +++-
system/lib-admin.php | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diffs (35 lines):
diff -r 7ea02c9ca0d2 -r 8ca4f11166ba public_html/admin/block.php
--- a/public_html/admin/block.php Mon Oct 10 13:57:56 2011 -0400
+++ b/public_html/admin/block.php Mon Oct 10 14:01:15 2011 -0400
@@ -102,6 +102,8 @@
}
if ($tid == TOPIC_ALL_OPTION || $tid == TOPIC_HOMEONLY_OPTION) {
$access = 3;
+ } elseif ($tid == '') { // No topic assigned, Can happen if topic gets deleted
+ $access = 3;
} else {
$access = SEC_hasTopicAccess ($tid);
for ($i = 1; $i < $nrows; $i++) {
@@ -374,7 +376,7 @@
$block_templates->set_var('selectedtopics_checked', 'checked');
}
$block_templates->set_var('topic_options',
- COM_topicList ('tid,topic', $A['tid'], 1, true));
+ TOPIC_getListSelect($A['tid'], false));
$block_templates->set_var('lang_side', $LANG21[39]);
$block_templates->set_var('lang_left', $LANG21[40]);
$block_templates->set_var('lang_right', $LANG21[41]);
diff -r 7ea02c9ca0d2 -r 8ca4f11166ba system/lib-admin.php
--- a/system/lib-admin.php Mon Oct 10 13:57:56 2011 -0400
+++ b/system/lib-admin.php Mon Oct 10 14:01:15 2011 -0400
@@ -705,7 +705,9 @@
} elseif ($A['tid'] == TOPIC_HOMEONLY_OPTION) {
$retval = $LANG21[43];
} else {
- if ($nrows > 1) {
+ if ($nrows == 0) {
+ $retval = $LANG21[47]; // None
+ } elseif ($nrows > 1) {
$retval = $LANG21[44]; // Multiple
} else {
$retval = DB_getItem($_TABLES['topics'], 'topic', "tid = '{$A['tid']}'");
More information about the geeklog-cvs
mailing list