$context = $PAGE->get_context();
- if (empty($CFG->bloglevel)) {
- $this->content->text = get_string('blogdisable', 'blog');
- return $this->content;
- }
-
// don't display menu block if block is set at site level, and user is not logged in
- if ($CFG->bloglevel < BLOG_GLOBAL_LEVEL && !(isloggedin() && !isguestuser())) {
- $this->content->text = get_string('blogdisable', 'blog');
+ if (empty($CFG->bloglevel) || ($CFG->bloglevel < BLOG_GLOBAL_LEVEL && !(isloggedin() && !isguestuser()))) {
+ $this->content->text = '';
+ if ($this->page->user_is_editing()) {
+ $this->content->text = get_string('blogdisable', 'blog');
+ }
return $this->content;
}
}
function get_content() {
+ global $CFG;
+ if (!$CFG->usecomments) {
+ $this->content->text = '';
+ if ($this->page->user_is_editing()) {
+ $this->content->text = get_string('disabledcomments');
+ }
+ return $this->content;
+ }
if ($this->content !== NULL) {
return $this->content;
}
$cmt->itemid = $this->instance->id;
$cmt->course = $this->page->course;
// this is a hack to adjust commenting UI
- // in block_comments
+ // in block_comments
$cmt->env = 'block_comments';
$cmt->linktext = get_string('showcomments');
$comment = new comment($cmt);
global $USER, $CFG, $DB, $OUTPUT;
if (!$CFG->messaging) {
- return '';
+ $this->content->text = '';
+ if ($this->page->user_is_editing()) {
+ $this->content->text = get_string('disabled', 'message');
+ }
+ return $this->content;
}
if ($this->content !== NULL) {
return $this->content;
}
+ if (!$CFG->enablerssfeeds) {
+ $this->content->text = '';
+ if ($this->page->user_is_editing()) {
+ $this->content->text = get_string('disabledrssfeeds', 'block_rss_client');
+ }
+ return $this->content;
+ }
+
// initalise block content object
$this->content = new stdClass;
$this->content->text = '';
if (empty($CFG->usetags)) {
$this->content->text = '';
+ if ($this->page->user_is_editing()) {
+ $this->content->text = get_string('disabledtags', 'block_tags');
+ }
return $this->content;
}
$string['couldnotfindfeed'] = 'Could not find feed with id';
$string['customtitlelabel'] = 'Custom title (leave blank to use title supplied by feed):';
$string['deletefeedconfirm'] = 'Are you sure you want to delete this feed?';
+$string['disabledrssfeeds'] = 'RSS feeds are disabled';
$string['displaydescriptionlabel'] = 'Display each link\'s description?';
$string['editafeed'] = 'Edit a feed';
$string['editfeeds'] = 'Edit, subscribe or unsubsribe from RSS/Atom news feeds';
$string['coursetags'] = 'Course tags:';
$string['coursetags1'] = 'course tags';
$string['coursetags2'] = 'Show tags for this course';
+$string['disabledtags'] = 'Tags are disabled';
$string['edit'] = 'edit...';
$string['editdeletemytag'] = 'Delete tag from this course:';
$string['editmytags'] = 'My tags - shortcuts to all your tagged courses.';
$string['directory'] = 'Directory';
$string['directorypaths'] = 'Directory Paths';
$string['disable'] = 'Disable';
+$string['disabledcomments'] = 'Comments are disabled';
$string['displayingfirst'] = 'Only the first $a->count $a->things are displayed';
$string['displayingrecords'] = 'Displaying $a records';
$string['displayingusers'] = 'Displaying users $a->start to $a->end';