mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 08:22:07 +02:00
MDL-7861xhtml strict and css fixes in blocks
This commit is contained in:
parent
f689ff1a9f
commit
440d164869
@ -50,7 +50,7 @@ class block_admin extends block_list {
|
||||
/// Course editing on/off
|
||||
|
||||
if (has_capability('moodle/course:update', $context) && ($course->id!==SITEID)) {
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/edit.gif" alt="" />';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/edit.gif" class="icon" alt="" />';
|
||||
if (isediting($this->instance->pageid)) {
|
||||
$this->content->items[]='<a href="view.php?id='.$this->instance->pageid.'&edit=off&sesskey='.sesskey().'">'.get_string('turneditingoff').'</a>';
|
||||
} else {
|
||||
@ -58,7 +58,7 @@ class block_admin extends block_list {
|
||||
}
|
||||
|
||||
$this->content->items[]='<a href="'.$CFG->wwwroot.'/course/edit.php?id='.$this->instance->pageid.'">'.get_string('settings').'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/settings.gif" alt="" />';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/settings.gif" class="icon" alt="" />';
|
||||
}
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ class block_admin extends block_list {
|
||||
|
||||
if (has_capability('moodle/role:assign', $context)) {
|
||||
$this->content->items[]='<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$context->id.'">'.get_string('assignroles', 'role').'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/roles.gif" alt="" />';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/roles.gif" class="icon" alt="" />';
|
||||
|
||||
}
|
||||
|
||||
@ -75,11 +75,11 @@ class block_admin extends block_list {
|
||||
if (has_capability('moodle/course:managemetacourse', $context)) {
|
||||
$strchildcourses = get_string('childcourses');
|
||||
$this->content->items[]='<a href="importstudents.php?id='.$this->instance->pageid.'">'.$strchildcourses.'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/course.gif" alt="" />';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/course.gif" class="icon" alt="" />';
|
||||
} else if (has_capability('moodle/role:assign', $context)) {
|
||||
$strchildcourses = get_string('childcourses');
|
||||
$this->content->items[]='<span class="dimmed_text">'.$strchildcourses.'</span>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/course.gif" alt="" />';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/course.gif" class="icon" alt="" />';
|
||||
}
|
||||
}
|
||||
|
||||
@ -89,57 +89,57 @@ class block_admin extends block_list {
|
||||
if (($course->groupmode || !$course->groupmodeforce) && has_capability('moodle/course:managegroups', $context) && ($course->id!==SITEID)) {
|
||||
$strgroups = get_string('groups');
|
||||
$this->content->items[]='<a title="'.$strgroups.'" href="'.groups_home_url($this->instance->pageid).'">'.$strgroups.'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/group.gif" alt="" />';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/group.gif" class="icon" alt="" />';
|
||||
}
|
||||
|
||||
/// Backup this course
|
||||
|
||||
if (has_capability('moodle/site:backup', $context)) {
|
||||
$this->content->items[]='<a href="'.$CFG->wwwroot.'/backup/backup.php?id='.$this->instance->pageid.'">'.get_string('backup').'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/backup.gif" alt="" />';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/backup.gif" class="icon" alt="" />';
|
||||
}
|
||||
|
||||
/// Restore to this course
|
||||
if (has_capability('moodle/site:restore', $context)) {
|
||||
$this->content->items[]='<a href="'.$CFG->wwwroot.'/files/index.php?id='.$this->instance->pageid.'&wdir=/backupdata">'.get_string('restore').'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/restore.gif" alt="" />';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/restore.gif" class="icon" alt="" />';
|
||||
}
|
||||
|
||||
/// Import data from other courses
|
||||
if (has_capability('moodle/site:import', $context) && ($course->id!==SITEID)) {
|
||||
$this->content->items[]='<a href="'.$CFG->wwwroot.'/course/import.php?id='.$this->instance->pageid.'">'.get_string('import').'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/restore.gif" alt="" />';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/restore.gif" class="icon" alt="" />';
|
||||
}
|
||||
|
||||
/// Reset this course
|
||||
if (has_capability('moodle/course:reset', $context) && ($course->id!==SITEID)) {
|
||||
$this->content->items[]='<a href="'.$CFG->wwwroot.'/course/reset.php?id='.$this->instance->pageid.'">'.get_string('reset').'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/return.gif" alt="" />';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/return.gif" class="icon" alt="" />';
|
||||
}
|
||||
|
||||
/// View course reports
|
||||
if (has_capability('moodle/site:viewreports', $context) && ($course->id!==SITEID)) {
|
||||
$this->content->items[]='<a href="'.$CFG->wwwroot.'/course/report.php?id='.$this->instance->pageid.'">'.get_string('reports').'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/stats.gif" alt="" />';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/stats.gif" class="icon" alt="" />';
|
||||
}
|
||||
|
||||
/// Manage questions
|
||||
if (has_capability('moodle/question:manage', $context) && ($course->id!==SITEID)) {
|
||||
$this->content->items[]='<a href="'.$CFG->wwwroot.'/question/edit.php?courseid='.$this->instance->pageid.'&clean=true">'.get_string('questions', 'quiz').'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/questions.gif" alt="" />';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/questions.gif" class="icon" alt="" />';
|
||||
}
|
||||
|
||||
/// Manage scales
|
||||
if (has_capability('moodle/course:managescales', $context) && ($course->id!==SITEID)) {
|
||||
$this->content->items[]='<a href="scales.php?id='.$this->instance->pageid.'">'.get_string('scales').'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/scales.gif" alt="" />';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/scales.gif" class="icon" alt="" />';
|
||||
}
|
||||
|
||||
|
||||
/// Manage files
|
||||
if (has_capability('moodle/course:managefiles', $context) && ($course->id!==SITEID)) {
|
||||
$this->content->items[]='<a href="'.$CFG->wwwroot.'/files/index.php?id='.$this->instance->pageid.'">'.get_string('files').'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/files.gif" alt="" />';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/files.gif" class="icon" alt="" />';
|
||||
}
|
||||
|
||||
/// Authorize hooks
|
||||
@ -152,23 +152,23 @@ class block_admin extends block_list {
|
||||
}
|
||||
}
|
||||
$this->content->items[] = $paymenturl;
|
||||
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/payment.gif" alt="" />';
|
||||
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/payment.gif" class="icon" alt="" />';
|
||||
}
|
||||
|
||||
/// View course grades (or just your own grades, same link)
|
||||
if ((has_capability('moodle/course:viewcoursegrades', $context) or
|
||||
(has_capability('moodle/user:viewusergrades', $context) && $course->showgrades)) && ($course->id!==SITEID)) {
|
||||
$this->content->items[]='<a href="'.$CFG->wwwroot.'/grade/index.php?id='.$this->instance->pageid.'">'.get_string('grades').'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/grades.gif" alt="" />';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/grades.gif" class="icon" alt="" />';
|
||||
}
|
||||
|
||||
if (empty($course->metacourse) && ($course->id!==SITEID)) {
|
||||
if (has_capability('moodle/legacy:guest', $context, NULL, false)) { // Are a guest now
|
||||
$this->content->items[]='<a href="enrol.php?id='.$this->instance->pageid.'">'.get_string('enrolme', '', $course->shortname).'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" alt="" />';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" class="icon" alt="" />';
|
||||
} else if (has_capability('moodle/role:unassignself', $context, NULL, false)) { // Have some role
|
||||
$this->content->items[]='<a href="unenrol.php?id='.$this->instance->pageid.'">'.get_string('unenrolme', '', $course->shortname).'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" alt="" />';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" class="icon" alt="" />';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +0,0 @@
|
||||
.block_adminblock .content {
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
}
|
@ -81,8 +81,6 @@ class block_admin_tree extends block_base {
|
||||
|
||||
$this->open_folder($content->visiblename);
|
||||
|
||||
unset($entries);
|
||||
|
||||
$entries = array_keys($content->children);
|
||||
|
||||
foreach ($entries as $entry) {
|
||||
@ -113,8 +111,6 @@ class block_admin_tree extends block_base {
|
||||
// we need to do this instead of $this->build_tree($adminroot) because the top-level folder
|
||||
// is redundant (and ideally ignored). (the top-level folder is "administration".)
|
||||
|
||||
unset($entries);
|
||||
|
||||
$entries = array_keys($adminroot->children);
|
||||
|
||||
asort($entries);
|
||||
|
@ -38,15 +38,15 @@ class block_messages extends block_base {
|
||||
$this->content->text .= '<ul class="list">';
|
||||
foreach ($users as $user) {
|
||||
$timeago = format_time(time() - $user->lastaccess);
|
||||
$this->content->text .= '<li>';
|
||||
$this->content->text .= print_user_picture($user->id, $this->instance->pageid, $user->picture, 16, true).' ';
|
||||
$this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$this->instance->pageid.'" title="'.$timeago.'">'.fullname($user).'</a>';
|
||||
$this->content->text .= ' <a target="message_'.$user->id.'" href="'.$CFG->wwwroot.'/message/discussion.php?id='.$user->id.'" onclick="return openpopup(\'/message/discussion.php?id='.$user->id.'\', \'message_'.$user->id.'\', \'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500\', 0);"><img class="iconsmall" src="'.$CFG->pixpath.'/t/message.gif" alt="" /> '.$user->count.'</a>';
|
||||
$this->content->text .= '</li>';
|
||||
$this->content->text .= '<li class="listentry"><div class="user"><a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$this->instance->pageid.'" title="'.$timeago.'">';
|
||||
$this->content->text .= print_user_picture($user->id, $this->instance->pageid, $user->picture, 0, true, false, '', false);
|
||||
$this->content->text .= fullname($user).'</a></div>';
|
||||
$this->content->text .= '<div class="message"><a href="'.$CFG->wwwroot.'/message/discussion.php?id='.$user->id.'" onclick="this.target=\'message_'.$user->id.'\'; return openpopup(\'/message/discussion.php?id='.$user->id.'\', \'message_'.$user->id.'\', \'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500\', 0);"><img class="iconsmall" src="'.$CFG->pixpath.'/t/message.gif" alt="" /> '.$user->count.'</a>';
|
||||
$this->content->text .= '</div></li>';
|
||||
}
|
||||
$this->content->text .= '</ul>';
|
||||
} else {
|
||||
$this->content->text .= '<div class="nomessage">';
|
||||
$this->content->text .= '<div class="info">';
|
||||
$this->content->text .= get_string('nomessages', 'message');
|
||||
$this->content->text .= '</div>';
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ class block_online_users extends block_base {
|
||||
//Calculate minutes
|
||||
$minutes = floor($timetoshowusers/60);
|
||||
|
||||
$this->content->text = "<div class=\"message\">(".get_string("periodnminutes","block_online_users",$minutes).")</div>";
|
||||
$this->content->text = "<div class=\"info\">(".get_string("periodnminutes","block_online_users",$minutes).")</div>";
|
||||
|
||||
//Now, we have in users, the list of users to show
|
||||
//Because they are online
|
||||
@ -96,23 +96,24 @@ class block_online_users extends block_base {
|
||||
$this->content->text .= '<li class="listentry">';
|
||||
$timeago = format_time(time() - max($user->timeaccess, $user->lastaccess)); //bruno to calculate correctly on frontpage
|
||||
if ($user->username == 'guest') {
|
||||
$this->content->text .= print_user_picture($user->id, $COURSE->id, $user->picture, 16, true, false).' ';
|
||||
$this->content->text .= get_string('guestuser');
|
||||
$this->content->text .= '<div class="user">'.print_user_picture($user->id, $COURSE->id, $user->picture, 16, true, false, '', false);
|
||||
$this->content->text .= get_string('guestuser').'</div>';
|
||||
|
||||
} else {
|
||||
$this->content->text .= print_user_picture($user->id, $COURSE->id, $user->picture, 16, true).' ';
|
||||
$this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$COURSE->id.'" title="'.$timeago.'">'.$user->fullname.'</a>';
|
||||
$this->content->text .= '<div class="user"><a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$COURSE->id.'" title="'.$timeago.'">';
|
||||
$this->content->text .= print_user_picture($user->id, $COURSE->id, $user->picture, 16, true, false, '', false);
|
||||
$this->content->text .= $user->fullname.'</a></div>';
|
||||
}
|
||||
if (!empty($USER->id) and ($USER->id != $user->id) and !empty($CFG->messaging) and
|
||||
!isguest() and $user->username != 'guest') { // Only when logged in and messaging active etc
|
||||
$this->content->text .= "\n".' <a title="'.get_string('messageselectadd').'" target="message_'.$user->id.'" href="'.$CFG->wwwroot.'/message/discussion.php?id='.$user->id.'" onclick="return openpopup(\'/message/discussion.php?id='.$user->id.'\', \'message_'.$user->id.'\', \'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500\', 0);">'
|
||||
.'<img class="messageicon" src="'.$CFG->pixpath.'/t/message.gif" alt="'. get_string('messageselectadd') .'" /></a>';
|
||||
$this->content->text .= '<div class="message"><a title="'.get_string('messageselectadd').'" href="'.$CFG->wwwroot.'/message/discussion.php?id='.$user->id.'" onclick="this.target=\'message_'.$user->id.'\';return openpopup(\'/message/discussion.php?id='.$user->id.'\', \'message_'.$user->id.'\', \'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500\', 0);">'
|
||||
.'<img class="iconsmall" src="'.$CFG->pixpath.'/t/message.gif" alt="'. get_string('messageselectadd') .'" /></a></div>';
|
||||
}
|
||||
$this->content->text .= "</li>\n";
|
||||
}
|
||||
$this->content->text .= "</ul>\n";
|
||||
$this->content->text .= '</ul><div class="clearer"><!-- --></div>';
|
||||
} else {
|
||||
$this->content->text .= "<div class=\"message\">".get_string("none")."</div>";
|
||||
$this->content->text .= "<div class=\"info\">".get_string("none")."</div>";
|
||||
}
|
||||
|
||||
return $this->content;
|
||||
|
@ -105,7 +105,7 @@
|
||||
'id' => $this->courseid,
|
||||
'section' => 'rss'
|
||||
));
|
||||
$output .= '<div align="center"><a title="'. get_string('feedsaddedit', 'block_rss_client') .'" href="'. $script .'">'. get_string('feedsaddedit', 'block_rss_client') .'</a></div>';
|
||||
$output .= '<div class="info"><a title="'. get_string('feedsaddedit', 'block_rss_client') .'" href="'. $script .'">'. get_string('feedsaddedit', 'block_rss_client') .'</a></div>';
|
||||
} else {
|
||||
// This instance has not been configured yet - show configure link?
|
||||
if (has_capability('block/rss_client:manageanyfeeds', $context)) {
|
||||
@ -117,7 +117,7 @@
|
||||
'id' => $this->courseid,
|
||||
'section' => 'rss'
|
||||
));
|
||||
$output .= '<div align="center"><a title="'. get_string('feedsconfigurenewinstance', 'block_rss_client') .'" href="'. $script.'">'. get_string('feedsconfigurenewinstance', 'block_rss_client') .'</a></div>';
|
||||
$output .= '<div class="info"><a title="'. get_string('feedsconfigurenewinstance', 'block_rss_client') .'" href="'. $script.'">'. get_string('feedsconfigurenewinstance', 'block_rss_client') .'</a></div>';
|
||||
}
|
||||
}
|
||||
//}
|
||||
@ -132,7 +132,7 @@
|
||||
foreach ($rssidarray as $rssid) {
|
||||
$output .= clean_text($this->get_rss_by_id($rssid, $display_description, $shownumentries, ($numids > 1) ? true : false), FORMAT_HTML);
|
||||
if ($numids > 1 && $count != $numids -1 && !empty($rssfeedstring)) {
|
||||
$output .= '<hr width="80%" />';
|
||||
$output .= '<hr style="width=:80%" />';
|
||||
}
|
||||
$count ++;
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ class block_section_links extends block_base {
|
||||
}
|
||||
$style = ($isvisible) ? '' : ' class="dimmed"';
|
||||
if ($i == $highlight) {
|
||||
$text .= "<li><a href=\"$link$i\"$style><b>$i</b></a></li>\n";
|
||||
$text .= "<li><a href=\"$link$i\"$style><strong>$i</strong></a></li>\n";
|
||||
} else {
|
||||
$text .= "<li><a href=\"$link$i\"$style>$i</a></li>\n";
|
||||
}
|
||||
|
@ -308,8 +308,8 @@ a.skip-block {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
.block_online_users .listentry {
|
||||
text-align:left;
|
||||
.block_messages .content .listentry,
|
||||
.block_online_users .content .listentry {
|
||||
font-size:0.75em
|
||||
}
|
||||
|
||||
|
@ -112,8 +112,7 @@ a img {
|
||||
}
|
||||
|
||||
img.userpicture,
|
||||
img.grouppicture,
|
||||
.block_online_users .listentry img {
|
||||
img.grouppicture {
|
||||
border: 0 solid
|
||||
}
|
||||
|
||||
@ -851,7 +850,7 @@ a.skip-block, .skip-block {
|
||||
.sideblock .content h2 {
|
||||
text-align: left;
|
||||
}
|
||||
/*.sideblock .content h3, ??*/
|
||||
|
||||
.sideblock .content h2 {
|
||||
margin:1.5em 0 0;
|
||||
padding:0;
|
||||
@ -880,26 +879,40 @@ a.skip-block, .skip-block {
|
||||
margin:0px;
|
||||
}
|
||||
|
||||
.sideblock .content .list {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.sideblock .content .list li {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.sideblock .content .list, .unlist, .inline-list {
|
||||
list-style:none;
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
.sideblock .content .list {
|
||||
width: 100%;
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
}
|
||||
|
||||
.sideblock .content .inline-list li {
|
||||
display:inline;
|
||||
}
|
||||
|
||||
.sideblock .content ul.list li.listentry {
|
||||
clear:both;
|
||||
}
|
||||
|
||||
.sideblock .content div.info {
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.sideblock .footer {
|
||||
margin-bottom: 4px;
|
||||
text-align:center;
|
||||
clear:both;
|
||||
}
|
||||
|
||||
.sideblock img.userpicture {
|
||||
width:16px;
|
||||
height:16px;
|
||||
margin-right:4px;
|
||||
}
|
||||
|
||||
.blockconfigtable {
|
||||
@ -910,26 +923,23 @@ a.skip-block, .skip-block {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.block_online_users .listentry {
|
||||
padding-top:5px;
|
||||
}
|
||||
|
||||
.block_messages .content {
|
||||
text-align:left;
|
||||
font-size:0.75em;
|
||||
padding-top:5px;
|
||||
}
|
||||
|
||||
.block_messages .content ul.list {
|
||||
list-style-type:none;
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
.block_online_users .listentry div.user,
|
||||
.block_messages .listentry div.user {
|
||||
float:left;
|
||||
}
|
||||
|
||||
.block_messages .content div.nomessage {
|
||||
text-align:center;
|
||||
.block_online_users .listentry div.message,
|
||||
.block_messages .listentry div.message {
|
||||
float:right;
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** Blogs
|
||||
***/
|
||||
|
Loading…
x
Reference in New Issue
Block a user