测试论坛添加新话题按钮

1 post / 0 new
testusr3
testusr3's picture
Offline
Joined: 01/30/2012 - 10:18
测试论坛添加新话题按钮

The patch for af: 

 

diff --git a/advanced_forum.install b/advanced_forum.install
index 02ca660..7085e3f 100644
--- a/advanced_forum.install
+++ b/advanced_forum.install
@@ -35,3 +35,9 @@ function advanced_forum_update_5005() {
       ->condition('name', 'advanced_forum')
       ->execute();
 }
+
+function advanced_forum_update_7200() {
+  if  (variable_get('advanced_forum_forum_disabled') == NULL) {
+    variable_set('advanced_forum_forum_disabled', FALSE);
+  }
+}
diff --git a/includes/theme.inc b/includes/theme.inc
index e97602f..fcf5f18 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -363,7 +363,7 @@ function advanced_forum_preprocess_views_view__advanced_forum_topic_list(&$varia
 
   if ($menu_item['map'][0] == 'forum') {
     $forum = $menu_item['map'][1];
-    if ($forum->vid == variable_get('forum_nav_vocabulary') && $forum->tid > 0 && !variable_get('advanced_forum_forum_disabled', FALSE)) {
+    if ($forum->vid == variable_get('forum_nav_vocabulary') && $forum->tid > 0) {
       $variables['node_create_list'] = theme('advanced_forum_node_type_create_list', array('forum_id' => $forum->tid));
       $variables['forum_description'] = $forum->description;
       $variables['forum_tools'] = advanced_forum_forum_tools($forum->tid);
diff --git a/plugins/tasks/forum.inc b/plugins/tasks/forum.inc
index 427cd2b..b11c6e0 100644
--- a/plugins/tasks/forum.inc
+++ b/plugins/tasks/forum.inc
@@ -38,7 +38,7 @@ function advanced_forum_forum_page_manager_tasks() {
  * normal user view process.
  */
 function advanced_forum_forum_menu_alter(&$items, $task) {
-  if (variable_get('advanced_forum_forum_disabled', TRUE)) {
+  if (variable_get('advanced_forum_forum_disabled')) {
     return;
   }
 
@@ -114,6 +114,8 @@ function advanced_forum_forum_get_contexts($task, $subtask_id) {
  * Callback to enable/disable the page from the UI.
  */
 function advanced_forum_forum_enable($cache, $status) {
+  if ($status == NULL)
+    $status = FALSE;
   variable_set('advanced_forum_forum_disabled', $status);
 }