summaryrefslogtreecommitdiff
path: root/modules/comment/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/comment/helpers')
-rw-r--r--modules/comment/helpers/comment.php5
-rw-r--r--modules/comment/helpers/comment_event.php2
-rw-r--r--modules/comment/helpers/comment_installer.php8
3 files changed, 12 insertions, 3 deletions
diff --git a/modules/comment/helpers/comment.php b/modules/comment/helpers/comment.php
index 94b14d0d..92a286c7 100644
--- a/modules/comment/helpers/comment.php
+++ b/modules/comment/helpers/comment.php
@@ -60,5 +60,10 @@ class comment_Core {
}
return $form;
}
+
+ static function can_comment() {
+ return !identity::active_user()->guest ||
+ module::get_var("comment", "access_permissions") == "everybody";
+ }
}
diff --git a/modules/comment/helpers/comment_event.php b/modules/comment/helpers/comment_event.php
index 25fd4171..33d4cd05 100644
--- a/modules/comment/helpers/comment_event.php
+++ b/modules/comment/helpers/comment_event.php
@@ -51,13 +51,11 @@ class comment_event_Core {
}
static function admin_menu($menu, $theme) {
- /*
$menu->get("settings_menu")
->append(Menu::factory("link")
->id("comment")
->label(t("Comments"))
->url(url::site("admin/comments")));
- */
$menu->get("content_menu")
->append(Menu::factory("link")
diff --git a/modules/comment/helpers/comment_installer.php b/modules/comment/helpers/comment_installer.php
index 9ca47f1a..7a32bf67 100644
--- a/modules/comment/helpers/comment_installer.php
+++ b/modules/comment/helpers/comment_installer.php
@@ -47,7 +47,8 @@ class comment_installer {
DEFAULT CHARSET=utf8;");
module::set_var("comment", "spam_caught", 0);
- module::set_version("comment", 2);
+ module::set_var("comment", "access_permissions", "everybody");
+ module::set_version("comment", 3);
}
static function upgrade($version) {
@@ -56,6 +57,11 @@ class comment_installer {
$db->query("ALTER TABLE {comments} CHANGE `state` `state` varchar(15) default 'unpublished'");
module::set_version("comment", 2);
}
+
+ if ($version == 2) {
+ module::set_var("comment", "access_permissions", "everybody");
+ module::set_version("comment", 3);
+ }
}
static function uninstall() {