Skip to content

Commit

Permalink
admin blog comment course MDL-22856 Minor cleanups and improvements t…
Browse files Browse the repository at this point in the history
…o styles
  • Loading branch information
Sam Hemelryk committed Aug 19, 2010
1 parent c7e3e61 commit f36b47e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 43 deletions.
2 changes: 1 addition & 1 deletion admin/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
$table->define_headers(array($stractivitymodule, $stractivities, $strversion, "$strhide/$strshow", $strdelete, $strsettings));
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/modules.php');
$table->set_attribute('id', 'modules');
$table->set_attribute('class', 'generaltable generalbox boxaligncenter boxwidthwide');
$table->set_attribute('class', 'generaltable');
$table->setup();

foreach ($modules as $module) {
Expand Down
4 changes: 2 additions & 2 deletions admin/report/security/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
$table->head = array($strissue, $strstatus, $strdesc, $strconfig);
$table->size = array('30%', '10%', '50%', '10%' );
$table->align = array('left', 'left', 'left', 'left');
$table->width = '90%';
$table->attributes = array('class'=>'scurityreporttable generaltable');
$table->data = array();

// print detail of one issue only
Expand All @@ -105,7 +105,7 @@
$table->head = array($strissue, $strstatus, $strdesc);
$table->size = array('30%', '10%', '60%' );
$table->align = array('left', 'left', 'left');
$table->width = '90%';
$table->attributes = array('class'=>'scurityreporttable generaltable');
$table->data = array();

foreach ($issues as $issue) {
Expand Down
21 changes: 2 additions & 19 deletions blog/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -691,8 +691,6 @@ function blog_get_headers($courseid=null, $groupid=null, $userid=null, $tagid=nu
$mycourseid = $site->id;
}

$PAGE->navbar->add($strparticipants, "$CFG->wwwroot/user/index.php?id=$mycourseid");
$PAGE->navbar->add(fullname($user), "$CFG->wwwroot/user/view.php?id=$user->id");
$PAGE->navbar->add($strblogentries, $blogurl);

$blogurl->remove_params('userid');
Expand All @@ -712,9 +710,6 @@ function blog_get_headers($courseid=null, $groupid=null, $userid=null, $tagid=nu
// Case 3: A user's blog entries
if (!empty($userid) && empty($entryid) && ((empty($courseid) && empty($modid)) || !$CFG->useblogassociations)) {
$blogurl->param('userid', $userid);
$PAGE->navbar->add($strparticipants, "$CFG->wwwroot/user/index.php?id=$site->id");
$PAGE->navbar->add(fullname($user), "$CFG->wwwroot/user/view.php?id=$user->id");
$PAGE->navbar->add($strblogentries, $blogurl);
$PAGE->set_title("$site->shortname: " . fullname($user) . ": " . get_string('blog', 'blog'));
$PAGE->set_heading("$site->shortname: " . fullname($user) . ": " . get_string('blog', 'blog'));
$headers['heading'] = get_string('userblog', 'blog', fullname($user));
Expand All @@ -724,7 +719,6 @@ function blog_get_headers($courseid=null, $groupid=null, $userid=null, $tagid=nu

// Case 4: No blog associations, no userid
if (!$CFG->useblogassociations && empty($userid) && !in_array($action, array('edit', 'add'))) {
$PAGE->navbar->add($strblogentries, $blogurl);
$PAGE->set_title("$site->shortname: " . get_string('blog', 'blog'));
$PAGE->set_heading("$site->shortname: " . get_string('blog', 'blog'));
$headers['heading'] = get_string('siteblog', 'blog', $site->shortname);
Expand Down Expand Up @@ -755,9 +749,7 @@ function blog_get_headers($courseid=null, $groupid=null, $userid=null, $tagid=nu
if (!empty($userid) && !empty($courseid) && empty($modid) && empty($entryid)) {
$blogurl->param('userid', $userid);
$blogurl->param('courseid', $courseid);

$PAGE->navbar->add($strparticipants, "$CFG->wwwroot/user/index.php?id=$course->id");
$PAGE->navbar->add(fullname($user), "$CFG->wwwroot/user/view.php?id=$user->id");

$PAGE->navbar->add($strblogentries, $blogurl);

$PAGE->set_title("$site->shortname: $course->shortname: " . fullname($user) . ': ' . get_string('blogentries', 'blog'));
Expand Down Expand Up @@ -863,16 +855,7 @@ function blog_get_headers($courseid=null, $groupid=null, $userid=null, $tagid=nu

// Append edit mode info
if (!empty($action) && $action == 'add') {
if (empty($modid) && empty($courseid)) {
if (empty($user)) {
$user = $USER;
}
$PAGE->navbar->add($strparticipants, "$CFG->wwwroot/user/index.php?id=$site->id");
$PAGE->navbar->add(fullname($user), "$CFG->wwwroot/user/view.php?id=$user->id");
$blogurl->param('userid', $user->id);
$PAGE->navbar->add($strblogentries, $blogurl);
}
$PAGE->navbar->add(get_string('addnewentry', 'blog'));

} else if (!empty($action) && $action == 'edit') {
$PAGE->navbar->add(get_string('editentry', 'blog'));
}
Expand Down
2 changes: 1 addition & 1 deletion comment/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function print_comments($page=0) {
$table = new html_table();
$table->head = array (html_writer::checkbox('selectall', '', false, get_string('selectall'), array('id'=>'comment_select_all', 'class'=>'comment-report-selectall')), get_string('author', 'search'), get_string('content'), get_string('action'));
$table->align = array ('left', 'left', 'left', 'left');
$table->width = "95%";
$table->attributes = array('class'=>'generaltable commentstable');
$table->data = array();
$linkbase = $CFG->wwwroot.'/comment/index.php?action=delete&sesskey='.sesskey();
foreach ($comments as $c) {
Expand Down
26 changes: 6 additions & 20 deletions course/editcategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
require_capability('moodle/category:manage', $categorycontext);
$strtitle = get_string('editcategorysettings');
$editorcontext = $categorycontext;
$title = $strtitle;
$fullname = $category->name;
} else {
$parent = required_param('parent', PARAM_INT);
$PAGE->set_url('/course/editcategory.php', array('parent' => $parent));
Expand All @@ -41,8 +43,12 @@
require_capability('moodle/category:manage', $context);
$strtitle = get_string("addnewcategory");
$editorcontext = null;
$title = "$SITE->shortname: ".get_string('addnewcategory');
$fullname = $SITE->fullname;
}

$PAGE->set_pagelayout('admin');

$editoroptions = array('maxfiles' => EDITOR_UNLIMITED_FILES, 'maxbytes'=>$CFG->maxbytes, 'trusttext'=>true);
$category = file_prepare_standard_editor($category, 'description', $editoroptions, $editorcontext, 'coursecat', 'description', 0);

Expand Down Expand Up @@ -91,30 +97,10 @@
redirect('category.php?id='.$newcategory->id.'&categoryedit=on');
}

// Print the form
$straddnewcategory = get_string('addnewcategory');
$stradministration = get_string('administration');
$strcategories = get_string('categories');
$navlinks = array();

if ($id) {
$PAGE->navbar->add($strtitle);
$title = $strtitle;
$fullname = $category->name;
} else {
$PAGE->navbar->add($stradministration, new moodle_url('/admin/index.php'));
$PAGE->navbar->add($strcategories, new moodle_url('/course/index.php'));
$PAGE->navbar->add($straddnewcategory);
$title = "$SITE->shortname: $straddnewcategory";
$fullname = $SITE->fullname;
}

$PAGE->set_title($title);
$PAGE->set_heading($fullname);
echo $OUTPUT->header();
echo $OUTPUT->heading($strtitle);

$mform->display();

echo $OUTPUT->footer();

0 comments on commit f36b47e

Please sign in to comment.