mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
themes lib MDL-24895 Multiple fixes to better handle overflow.
Major tasks undertaken in this patch: * New format_text argument, overflowdiv. * New page layout Report. * Review of all format_text calls. * Added support for the report layout to all themes. * Changed forum post display from tables to divs.
This commit is contained in:
parent
2412f8b882
commit
367a75fae4
125 changed files with 3366 additions and 2062 deletions
|
@ -23,7 +23,7 @@ require_once($CFG->libdir.'/adminlib.php');
|
|||
require_once('locallib.php');
|
||||
|
||||
require_login();
|
||||
admin_externalpage_setup('comments');
|
||||
admin_externalpage_setup('comments', '', null, '', array('pagelayout'=>'report'));
|
||||
|
||||
$context = get_context_instance(CONTEXT_SYSTEM);
|
||||
require_capability('moodle/comment:delete', $context);
|
||||
|
|
|
@ -413,6 +413,7 @@ EOD;
|
|||
|
||||
$comments = array();
|
||||
$candelete = has_capability('moodle/comment:delete', $this->context);
|
||||
$formatoptions = array('overflowdiv' => true);
|
||||
$rs = $DB->get_recordset_sql($sql, $params, $start, $CFG->commentsperpage);
|
||||
foreach ($rs as $u) {
|
||||
$c = new stdClass();
|
||||
|
@ -424,7 +425,7 @@ EOD;
|
|||
$c->profileurl = $url->out();
|
||||
$c->fullname = fullname($u);
|
||||
$c->time = userdate($c->timecreated, get_string('strftimerecent', 'langconfig'));
|
||||
$c->content = format_text($c->content, $c->format);
|
||||
$c->content = format_text($c->content, $c->format, $formatoptions);
|
||||
|
||||
$c->avatar = $OUTPUT->user_picture($u, array('size'=>18));
|
||||
if (($USER->id == $u->id) || !empty($candelete)) {
|
||||
|
@ -513,7 +514,7 @@ EOD;
|
|||
$newcmt->fullname = fullname($USER);
|
||||
$url = new moodle_url('/user/view.php', array('id'=>$USER->id, 'course'=>$this->courseid));
|
||||
$newcmt->profileurl = $url->out();
|
||||
$newcmt->content = format_text($newcmt->content, $format);
|
||||
$newcmt->content = format_text($newcmt->content, $format, array('overflowdiv'=>true));
|
||||
$newcmt->avatar = $OUTPUT->user_picture($USER, array('size'=>16));
|
||||
return $newcmt;
|
||||
} else {
|
||||
|
|
|
@ -47,11 +47,12 @@ class comment_manager {
|
|||
WHERE u.id=c.userid ORDER BY c.timecreated ASC";
|
||||
|
||||
$comments = array();
|
||||
$formatoptions = array('overflowdiv' => true);
|
||||
if ($records = $DB->get_records_sql($sql, array(), $start, $this->perpage)) {
|
||||
foreach ($records as $item) {
|
||||
$item->fullname = fullname($item);
|
||||
$item->time = userdate($item->timecreated);
|
||||
$item->content = format_text($item->content);
|
||||
$item->content = format_text($item->content, FORMAT_MOODLE, $formatoptions);
|
||||
$comments[] = $item;
|
||||
unset($item->firstname);
|
||||
unset($item->lastname);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue