From 8ef341d5890d56d947bd2e01f3ef65adbceb8668 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Tue, 5 Apr 2011 10:29:10 -0700 Subject: [PATCH 1/3] QnA - best answers were not getting the 'best' class on their lis (fixed) --- plugins/QnA/QnAPlugin.php | 2 +- plugins/QnA/actions/qnanewquestion.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/QnA/QnAPlugin.php b/plugins/QnA/QnAPlugin.php index fe42975065..16fbc2f063 100644 --- a/plugins/QnA/QnAPlugin.php +++ b/plugins/QnA/QnAPlugin.php @@ -309,7 +309,7 @@ class QnAPlugin extends MicroAppPlugin $cls = array('hentry', 'notice', 'answer'); - $answer = QnA_Answer::staticGet('uri', $notice->uri); + $answer = QnA_Answer::staticGet('uri', $nli->notice->uri); if (!empty($answer) && !empty($answer->best)) { $cls[] = 'best'; diff --git a/plugins/QnA/actions/qnanewquestion.php b/plugins/QnA/actions/qnanewquestion.php index 3399c5eda8..6610188c47 100644 --- a/plugins/QnA/actions/qnanewquestion.php +++ b/plugins/QnA/actions/qnanewquestion.php @@ -88,7 +88,6 @@ class QnanewquestionAction extends Action } $this->title = $this->trimmed('title'); - common_debug("TITLE = " . $this->title); $this->description = $this->trimmed('description'); return true; From 4397686c912f386cc4c1bc802232ef640afecd40 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 5 Apr 2011 13:43:54 -0400 Subject: [PATCH 2/3] include limited-scope class on bookmarks in output --- plugins/Bookmark/BookmarkPlugin.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/Bookmark/BookmarkPlugin.php b/plugins/Bookmark/BookmarkPlugin.php index a24f207720..daefa12c39 100644 --- a/plugins/Bookmark/BookmarkPlugin.php +++ b/plugins/Bookmark/BookmarkPlugin.php @@ -294,7 +294,11 @@ class BookmarkPlugin extends MicroAppPlugin $nb = Bookmark::getByNotice($nli->notice); if (!empty($nb)) { $id = (empty($nli->repeat)) ? $nli->notice->id : $nli->repeat->id; - $nli->out->elementStart('li', array('class' => 'hentry notice bookmark', + $class = 'hentry notice bookmark'; + if ($nli->notice->scope != 0 && $nli->notice->scope != 1) { + $class .= ' limited-scope'; + } + $nli->out->elementStart('li', array('class' => $class, 'id' => 'notice-' . $id)); Event::handle('EndOpenNoticeListItemElement', array($nli)); return false; From d3b9aabac3af32be582a2922f062d1612ab1db60 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 5 Apr 2011 13:46:44 -0400 Subject: [PATCH 3/3] Questions show private lock correctly --- plugins/QnA/QnAPlugin.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/QnA/QnAPlugin.php b/plugins/QnA/QnAPlugin.php index fe42975065..0b9b81645c 100644 --- a/plugins/QnA/QnAPlugin.php +++ b/plugins/QnA/QnAPlugin.php @@ -295,9 +295,13 @@ class QnAPlugin extends MicroAppPlugin { case QnA_Question::OBJECT_TYPE: $id = (empty($nli->repeat)) ? $nli->notice->id : $nli->repeat->id; + $class = 'hentry notice question'; + if ($nli->notice->scope != 0 && $nli->notice->scope != 1) { + $class .= ' limited-scope'; + } $nli->out->elementStart( 'li', array( - 'class' => 'hentry notice question', + 'class' => $class, 'id' => 'notice-' . $id ) );