Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/monara/public_html/test.athavaneng.com/themes.php on line 99
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
.
/**
* This file contains the news item block class, based upon block_base.
*
* @package block_news_items
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Class block_news_items
*
* @package block_news_items
* @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class block_news_items extends block_base {
function init() {
$this->title = get_string('pluginname', 'block_news_items');
}
function get_content() {
global $CFG, $USER;
if ($this->content !== NULL) {
return $this->content;
}
$this->content = new stdClass;
$this->content->text = '';
$this->content->footer = '';
if (empty($this->instance)) {
return $this->content;
}
if ($this->page->course->newsitems) { // Create a nice listing of recent postings
require_once($CFG->dirroot.'/mod/forum/lib.php'); // We'll need this
$text = '';
if (!$forum = forum_get_course_forum($this->page->course->id, 'news')) {
return '';
}
$modinfo = get_fast_modinfo($this->page->course);
if (empty($modinfo->instances['forum'][$forum->id])) {
return '';
}
$cm = $modinfo->instances['forum'][$forum->id];
if (!$cm->uservisible) {
return '';
}
$context = context_module::instance($cm->id);
/// User must have perms to view discussions in that forum
if (!has_capability('mod/forum:viewdiscussion', $context)) {
return '';
}
/// First work out whether we can post to this group and if so, include a link
$groupmode = groups_get_activity_groupmode($cm);
$currentgroup = groups_get_activity_group($cm, true);
if (forum_user_can_post_discussion($forum, $currentgroup, $groupmode, $cm, $context)) {
$text .= '
';
}
/// Get all the recent discussions we're allowed to see
// This block displays the most recent posts in a forum in
// descending order. The call to default sort order here will use
// that unless the discussion that post is in has a timestart set
// in the future.
// This sort will ignore pinned posts as we want the most recent.
$sort = forum_get_default_sort_order(true, 'p.modified', 'd', false);
if (! $discussions = forum_get_discussions($cm, $sort, false,
-1, $this->page->course->newsitems,
false, -1, 0, FORUM_POSTS_ALL_USER_GROUPS) ) {
$text .= '('.get_string('nonews', 'forum').')';
$this->content->text = $text;
return $this->content;
}
/// Actually create the listing now
$strftimerecent = get_string('strftimerecent');
$strmore = get_string('more', 'forum');
/// Accessibility: markup as a list.
$text .= "\n
\n";
foreach ($discussions as $discussion) {
$discussion->subject = $discussion->name;
$discussion->subject = format_string($discussion->subject, true, $forum->course);
$posttime = $discussion->modified;
if (!empty($CFG->forum_enabletimedposts) && ($discussion->timestart > $posttime)) {
$posttime = $discussion->timestart;
}
// If the user who created the discussion post has been deleted, indicate so.
if ($discussion->userdeleted) {
$userfullname = get_string('deleteduser', 'mod_forum');
} else {
$userfullname = fullname($discussion, has_capability('moodle/site:viewfullnames', $context));
}
$text .= '