2004-09-12 12:21:27 +00:00
|
|
|
<?php // $Id$
|
2003-08-11 09:45:50 +00:00
|
|
|
|
|
|
|
/// Displays external information about a course
|
|
|
|
|
|
|
|
require_once("../config.php");
|
|
|
|
require_once("lib.php");
|
|
|
|
|
2007-02-21 11:42:48 +00:00
|
|
|
$search = optional_param('search', '', PARAM_RAW); // search words
|
|
|
|
$page = optional_param('page', 0, PARAM_INT); // which page to show
|
|
|
|
$perpage = optional_param('perpage', 10, PARAM_INT); // how many per page
|
|
|
|
$moveto = optional_param('moveto', 0, PARAM_INT); // move to category
|
|
|
|
$edit = optional_param('edit', -1, PARAM_BOOL);
|
|
|
|
$hide = optional_param('hide', 0, PARAM_INT);
|
|
|
|
$show = optional_param('show', 0, PARAM_INT);
|
|
|
|
$blocklist = optional_param('blocklist', 0, PARAM_INT);
|
|
|
|
$modulelist= optional_param('modulelist', '', PARAM_ALPHAEXT);
|
2003-08-11 09:45:50 +00:00
|
|
|
|
2005-11-02 15:36:57 +00:00
|
|
|
$search = trim(strip_tags($search)); // trim & clean raw searched string
|
2003-08-11 09:45:50 +00:00
|
|
|
|
2003-08-19 05:32:20 +00:00
|
|
|
if ($search) {
|
|
|
|
$searchterms = explode(" ", $search); // Search for words independently
|
|
|
|
foreach ($searchterms as $key => $searchterm) {
|
|
|
|
if (strlen($searchterm) < 2) {
|
|
|
|
unset($searchterms[$key]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$search = trim(implode(" ", $searchterms));
|
|
|
|
}
|
|
|
|
|
2003-08-11 09:45:50 +00:00
|
|
|
$site = get_site();
|
|
|
|
|
2004-05-16 10:26:04 +00:00
|
|
|
if ($CFG->forcelogin) {
|
|
|
|
require_login();
|
|
|
|
}
|
|
|
|
|
2008-12-11 10:47:48 +00:00
|
|
|
if (update_category_button()) {
|
2006-05-20 18:41:59 +00:00
|
|
|
if ($edit !== -1) {
|
2009-05-06 08:59:29 +00:00
|
|
|
$USER->editing = $edit;
|
2005-09-01 04:48:22 +00:00
|
|
|
}
|
2009-05-06 08:59:29 +00:00
|
|
|
$adminediting = $PAGE->user_is_editing();
|
2008-12-11 10:47:48 +00:00
|
|
|
} else {
|
|
|
|
$adminediting = false;
|
2007-08-17 19:09:11 +00:00
|
|
|
}
|
2005-09-01 04:48:22 +00:00
|
|
|
|
2005-10-12 03:11:49 +00:00
|
|
|
/// Editing functions
|
2008-04-24 08:39:47 +00:00
|
|
|
if (has_capability('moodle/course:visibility', get_context_instance(CONTEXT_SYSTEM))) {
|
2005-10-12 03:11:49 +00:00
|
|
|
/// Hide or show a course
|
2006-05-20 18:41:59 +00:00
|
|
|
if ($hide or $show and confirm_sesskey()) {
|
|
|
|
if ($hide) {
|
2008-06-02 08:13:24 +00:00
|
|
|
$course = $DB->get_record("course", array("id"=>$hide));
|
2005-10-12 03:11:49 +00:00
|
|
|
$visible = 0;
|
|
|
|
} else {
|
2008-06-02 08:13:24 +00:00
|
|
|
$course = $DB->get_record("course", array("id"=>$show));
|
2005-10-12 03:11:49 +00:00
|
|
|
$visible = 1;
|
|
|
|
}
|
|
|
|
if ($course) {
|
2008-06-02 08:13:24 +00:00
|
|
|
if (! $DB->set_field("course", "visible", $visible, array("id"=>$course->id))) {
|
2005-10-12 03:11:49 +00:00
|
|
|
notify("Could not update that course!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-04-24 08:39:47 +00:00
|
|
|
if (has_capability('moodle/course:create', get_context_instance(CONTEXT_SYSTEM)) && $perpage != 99999) {
|
2005-09-01 04:48:22 +00:00
|
|
|
$perpage = 30;
|
|
|
|
}
|
|
|
|
|
2003-08-11 09:45:50 +00:00
|
|
|
$displaylist = array();
|
|
|
|
$parentlist = array();
|
course categories: Fix many bugs with category editing and permissions. Clean up code.
Bugs: MDL-17479, MDL-16426, MDL-16063, MDL-16013, MDL-15658, MDL-15556, MDL-15161, MDL-14925, MDL-13742, MDL-11557.
* Simplify category editing permissions to just moodle/category:manage and moodle/category:seehiddencategories.
* Enforce those correctly. (Note MDL 17502 is still outstanding.)
* Don't screw up category sort order when you just edit name or description.
* Niceties like where redirects go when you cancel or submit forms.
* Make sure a global course creator can see the site admin block.
* Don't allow a category to be made the child of one of its children!
* General code cleanup to bring key files more in line with best pracitice.
Apologies for the fact it is one big patch, rather than a series of smaller patches. However, categoryedit.php, category.php and index.php where in pretty bad shape and needed significant cleaning up. categoryedit.php, in particular, was almost completely rewritten.
Merged from MOODLE_19_STABLE.
2008-12-04 08:53:10 +00:00
|
|
|
make_categories_list($displaylist, $parentlist);
|
2003-08-11 09:45:50 +00:00
|
|
|
|
|
|
|
$strcourses = get_string("courses");
|
2003-08-11 11:51:08 +00:00
|
|
|
$strsearch = get_string("search");
|
2003-08-11 09:45:50 +00:00
|
|
|
$strsearchresults = get_string("searchresults");
|
|
|
|
$strcategory = get_string("category");
|
2005-09-01 04:48:22 +00:00
|
|
|
$strselect = get_string("select");
|
|
|
|
$strselectall = get_string("selectall");
|
|
|
|
$strdeselectall = get_string("deselectall");
|
|
|
|
$stredit = get_string("edit");
|
2007-02-21 11:42:48 +00:00
|
|
|
$strfrontpage = get_string('frontpage', 'admin');
|
2007-02-21 13:03:24 +00:00
|
|
|
$strnovalidcourses = get_string('novalidcourses');
|
2003-08-11 09:45:50 +00:00
|
|
|
|
2007-02-21 11:42:48 +00:00
|
|
|
if (empty($search) and empty($blocklist) and empty($modulelist)) {
|
2007-08-17 19:09:11 +00:00
|
|
|
$navlinks = array();
|
|
|
|
$navlinks[] = array('name' => $strcourses, 'link' => "index.php", 'type' => 'misc');
|
|
|
|
$navlinks[] = array('name' => $strsearch, 'link' => null, 'type' => 'misc');
|
|
|
|
$navigation = build_navigation($navlinks);
|
|
|
|
|
|
|
|
print_header("$site->fullname : $strsearch", $site->fullname, $navigation, "", "");
|
2003-08-19 05:32:20 +00:00
|
|
|
print_simple_box_start("center");
|
|
|
|
echo "<center>";
|
|
|
|
echo "<br />";
|
|
|
|
print_course_search("", false, "plain");
|
|
|
|
echo "<br /><p>";
|
|
|
|
print_string("searchhelp");
|
|
|
|
echo "</p>";
|
|
|
|
echo "</center>";
|
|
|
|
print_simple_box_end();
|
2003-08-11 11:51:08 +00:00
|
|
|
print_footer();
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2008-06-09 16:53:30 +00:00
|
|
|
if (!empty($moveto) and $data = data_submitted() and confirm_sesskey()) { // Some courses are being moved
|
2008-06-02 08:13:24 +00:00
|
|
|
if (! $destcategory = $DB->get_record("course_categories", array("id"=>$data->moveto))) {
|
2008-05-01 05:44:41 +00:00
|
|
|
print_error('cannotfindcategory', '', '', $data->moveto);
|
2005-09-01 04:48:22 +00:00
|
|
|
}
|
2007-08-17 19:09:11 +00:00
|
|
|
|
|
|
|
$courses = array();
|
2005-09-01 04:48:22 +00:00
|
|
|
foreach ( $data as $key => $value ) {
|
|
|
|
if (preg_match('/^c\d+$/', $key)) {
|
|
|
|
array_push($courses, substr($key, 1));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
move_courses($courses, $data->moveto);
|
|
|
|
}
|
|
|
|
|
2007-02-21 11:42:48 +00:00
|
|
|
// get list of courses containing blocks if required
|
|
|
|
if (!empty($blocklist) and confirm_sesskey()) {
|
2009-05-07 08:55:10 +00:00
|
|
|
$blockname = $DB->get_field('block', 'name', array('id' => $blocklist));
|
|
|
|
$courses = $DB->get_recordset_sql("
|
|
|
|
SELECT * FROM {course} WHERE id IN (
|
|
|
|
SELECT DISTINCT ctx.instanceid
|
|
|
|
FROM {context} ctx
|
|
|
|
JOIN {block_instances} bi ON bi.contextid = ctx.id
|
|
|
|
WHERE ctx.contextlevel = " . CONTEXT_COURSE . " AND bi.blockname = ?)",
|
|
|
|
array($blockname));
|
2007-02-21 11:42:48 +00:00
|
|
|
$courses = array();
|
2009-05-07 08:55:10 +00:00
|
|
|
foreach ($courses as $course) {
|
|
|
|
$courses[$course->id] = $course;
|
2007-02-21 11:42:48 +00:00
|
|
|
}
|
2009-05-07 08:55:10 +00:00
|
|
|
$totalcount = count($courses);
|
2007-02-21 11:42:48 +00:00
|
|
|
}
|
|
|
|
// get list of courses containing modules if required
|
|
|
|
elseif (!empty($modulelist) and confirm_sesskey()) {
|
|
|
|
$modulename = $modulelist;
|
2008-12-09 22:17:18 +00:00
|
|
|
$sql = "SELECT DISTINCT c.id FROM {".$modulelist."} module, {course} c"
|
2008-11-07 05:34:42 +00:00
|
|
|
." WHERE module.course=c.id";
|
2007-02-21 11:42:48 +00:00
|
|
|
|
2008-11-07 05:34:42 +00:00
|
|
|
$courseids = $DB->get_records_sql($sql);
|
2008-11-07 05:40:20 +00:00
|
|
|
$courses = array();
|
|
|
|
if (!empty($courseids)) {
|
|
|
|
$firstcourse = $page*$perpage;
|
|
|
|
$lastcourse = $page*$perpage + $perpage -1;
|
|
|
|
$i = 0;
|
|
|
|
foreach ($courseids as $courseid) {
|
|
|
|
if ($i>= $firstcourse && $i<=$lastcourse) {
|
|
|
|
$courses[$courseid->id] = $DB->get_record('course', array('id'=> $courseid->id));
|
|
|
|
}
|
|
|
|
$i++;
|
2007-02-21 11:42:48 +00:00
|
|
|
}
|
2008-11-07 05:40:20 +00:00
|
|
|
$totalcount = count($courseids);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$totalcount = 0;
|
2007-02-21 11:42:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
2008-12-11 10:47:48 +00:00
|
|
|
$courses = get_courses_search($searchterms, "fullname ASC",
|
2007-09-19 07:08:50 +00:00
|
|
|
$page, $perpage, $totalcount);
|
2007-02-21 11:42:48 +00:00
|
|
|
}
|
2005-09-01 04:48:22 +00:00
|
|
|
|
2003-08-19 05:32:20 +00:00
|
|
|
$searchform = print_course_search($search, true, "navbar");
|
|
|
|
|
2008-04-24 08:39:47 +00:00
|
|
|
if (!empty($courses) && has_capability('moodle/course:create', get_context_instance(CONTEXT_SYSTEM))) {
|
2005-09-01 04:48:22 +00:00
|
|
|
$searchform .= update_categories_search_button($search,$page,$perpage);
|
|
|
|
}
|
|
|
|
|
2007-08-23 14:58:15 +00:00
|
|
|
$navlinks = array();
|
|
|
|
$navlinks[] = array('name' => $strcourses, 'link' => 'index.php', 'type' => 'misc');
|
|
|
|
$navlinks[] = array('name' => $strsearch, 'link' => 'search.php', 'type' => 'misc');
|
2008-06-02 08:13:24 +00:00
|
|
|
$navlinks[] = array('name' => "'".s($search)."'", 'link' => null, 'type' => 'misc');
|
2007-08-23 14:58:15 +00:00
|
|
|
$navigation = build_navigation($navlinks);
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2007-08-23 14:58:15 +00:00
|
|
|
print_header("$site->fullname : $strsearchresults", $site->fullname, $navigation, "", "", "", $searchform);
|
2003-08-11 09:45:50 +00:00
|
|
|
|
|
|
|
$lastcategory = -1;
|
2005-09-01 04:48:22 +00:00
|
|
|
if ($courses) {
|
2003-08-19 05:32:20 +00:00
|
|
|
print_heading("$strsearchresults: $totalcount");
|
2008-06-02 08:13:24 +00:00
|
|
|
$encodedsearch = urlencode($search);
|
2008-12-11 10:47:48 +00:00
|
|
|
|
2008-11-07 05:34:42 +00:00
|
|
|
///add the module parameter to the paging bar if they exists
|
|
|
|
$modulelink = "";
|
|
|
|
if (!empty($modulelist) and confirm_sesskey()) {
|
2009-01-02 10:51:26 +00:00
|
|
|
$modulelink = "&modulelist=".$modulelist."&sesskey=".sesskey();
|
2005-10-12 02:35:58 +00:00
|
|
|
}
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2008-12-11 10:47:48 +00:00
|
|
|
print_navigation_bar($totalcount, $page, $perpage, $encodedsearch, $modulelink);
|
|
|
|
|
|
|
|
if (!$adminediting) {
|
2005-09-01 04:48:22 +00:00
|
|
|
foreach ($courses as $course) {
|
2007-03-01 04:42:41 +00:00
|
|
|
$course->summary .= "<br /><p class=\"category\">";
|
2005-09-01 04:48:22 +00:00
|
|
|
$course->summary .= "$strcategory: <a href=\"category.php?id=$course->category\">";
|
|
|
|
$course->summary .= $displaylist[$course->category];
|
|
|
|
$course->summary .= "</a></p>";
|
2008-12-11 10:47:48 +00:00
|
|
|
print_course($course, $search);
|
2005-09-01 04:48:22 +00:00
|
|
|
print_spacer(5,5);
|
|
|
|
}
|
2008-12-11 10:47:48 +00:00
|
|
|
} else {
|
|
|
|
/// Show editing UI.
|
2007-03-02 01:26:19 +00:00
|
|
|
echo "<form id=\"movecourses\" action=\"search.php\" method=\"post\">\n";
|
2009-01-02 10:51:26 +00:00
|
|
|
echo "<div><input type=\"hidden\" name=\"sesskey\" value=\"".sesskey()."\" />\n";
|
2008-06-02 08:13:24 +00:00
|
|
|
echo "<input type=\"hidden\" name=\"search\" value=\"".s($search)."\" />\n";
|
2007-03-02 01:26:19 +00:00
|
|
|
echo "<input type=\"hidden\" name=\"page\" value=\"$page\" />\n";
|
|
|
|
echo "<input type=\"hidden\" name=\"perpage\" value=\"$perpage\" /></div>\n";
|
|
|
|
echo "<table border=\"0\" cellspacing=\"2\" cellpadding=\"4\" class=\"generalbox boxaligncenter\">\n<tr>\n";
|
|
|
|
echo "<th scope=\"col\">$strcourses</th>\n";
|
|
|
|
echo "<th scope=\"col\">$strcategory</th>\n";
|
|
|
|
echo "<th scope=\"col\">$strselect</th>\n";
|
|
|
|
echo "<th scope=\"col\">$stredit</th></tr>\n";
|
2007-05-08 15:07:25 +00:00
|
|
|
|
2008-12-11 10:47:48 +00:00
|
|
|
foreach ($courses as $course) {
|
|
|
|
|
2007-09-19 07:08:50 +00:00
|
|
|
if (isset($course->context)) {
|
|
|
|
$coursecontext = $course->context;
|
|
|
|
} else {
|
|
|
|
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
|
|
|
|
}
|
2007-02-21 11:42:48 +00:00
|
|
|
|
2005-09-01 04:48:22 +00:00
|
|
|
$linkcss = $course->visible ? "" : " class=\"dimmed\" ";
|
2007-02-21 11:42:48 +00:00
|
|
|
|
|
|
|
// are we displaying the front page (courseid=1)?
|
|
|
|
if ($course->id == 1) {
|
2007-03-02 01:26:19 +00:00
|
|
|
echo "<tr>\n";
|
|
|
|
echo "<td><a href=\"$CFG->wwwroot\">$strfrontpage</a></td>\n";
|
2007-02-21 11:42:48 +00:00
|
|
|
|
|
|
|
// can't do anything else with the front page
|
2007-03-02 01:26:19 +00:00
|
|
|
echo " <td> </td>\n"; // category place
|
|
|
|
echo " <td> </td>\n"; // select place
|
|
|
|
echo " <td> </td>\n"; // edit place
|
|
|
|
echo "</tr>\n";
|
2007-02-21 11:42:48 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2007-03-02 01:26:19 +00:00
|
|
|
echo "<tr>\n";
|
2007-08-17 19:09:11 +00:00
|
|
|
echo "<td><a $linkcss href=\"view.php?id=$course->id\">"
|
2008-12-11 10:47:48 +00:00
|
|
|
. highlight($search, format_string($course->fullname)) . "</a></td>\n";
|
2007-03-02 01:26:19 +00:00
|
|
|
echo "<td>".$displaylist[$course->category]."</td>\n";
|
|
|
|
echo "<td>\n";
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2006-11-21 05:31:46 +00:00
|
|
|
// this is ok since this will get inherited from course category context
|
|
|
|
// if it is set
|
course categories: Fix many bugs with category editing and permissions. Clean up code.
Bugs: MDL-17479, MDL-16426, MDL-16063, MDL-16013, MDL-15658, MDL-15556, MDL-15161, MDL-14925, MDL-13742, MDL-11557.
* Simplify category editing permissions to just moodle/category:manage and moodle/category:seehiddencategories.
* Enforce those correctly. (Note MDL 17502 is still outstanding.)
* Don't screw up category sort order when you just edit name or description.
* Niceties like where redirects go when you cancel or submit forms.
* Make sure a global course creator can see the site admin block.
* Don't allow a category to be made the child of one of its children!
* General code cleanup to bring key files more in line with best pracitice.
Apologies for the fact it is one big patch, rather than a series of smaller patches. However, categoryedit.php, category.php and index.php where in pretty bad shape and needed significant cleaning up. categoryedit.php, in particular, was almost completely rewritten.
Merged from MOODLE_19_STABLE.
2008-12-04 08:53:10 +00:00
|
|
|
if (has_capability('moodle/category:manage', $coursecontext)) {
|
2007-03-02 01:26:19 +00:00
|
|
|
echo "<input type=\"checkbox\" name=\"c$course->id\" />\n";
|
2006-11-21 05:31:46 +00:00
|
|
|
} else {
|
2007-03-02 01:26:19 +00:00
|
|
|
echo "<input type=\"checkbox\" name=\"c$course->id\" disabled=\"disabled\" />\n";
|
2006-11-21 05:31:46 +00:00
|
|
|
}
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2007-03-02 01:26:19 +00:00
|
|
|
echo "</td>\n";
|
|
|
|
echo "<td>\n";
|
2007-01-19 09:59:13 +00:00
|
|
|
$pixpath = $CFG->pixpath;
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2006-11-21 05:31:46 +00:00
|
|
|
// checks whether user can update course settings
|
|
|
|
if (has_capability('moodle/course:update', $coursecontext)) {
|
2007-03-02 01:26:19 +00:00
|
|
|
echo "<a title=\"".get_string("settings")."\" href=\"$CFG->wwwroot/course/edit.php?id=$course->id\">\n<img".
|
|
|
|
" src=\"$pixpath/t/edit.gif\" class=\"iconsmall\" alt=\"".get_string("settings")."\" /></a>\n ";
|
2006-11-21 05:31:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// checks whether user can do role assignment
|
2007-05-08 15:07:25 +00:00
|
|
|
if (has_capability('moodle/role:assign', $coursecontext)) {
|
2006-11-21 04:45:32 +00:00
|
|
|
echo'<a title="'.get_string('assignroles', 'role').'" href="'.$CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$coursecontext->id.'">';
|
2009-07-02 10:53:31 +00:00
|
|
|
echo '<img src="'.$OUTPUT->old_icon_url('i/roles') . '" class="iconsmall" alt="'.get_string('assignroles', 'role').'" /></a> ' . "\n";
|
2007-08-17 19:09:11 +00:00
|
|
|
}
|
2006-11-21 05:31:46 +00:00
|
|
|
|
|
|
|
// checks whether user can delete course
|
2007-08-17 19:09:11 +00:00
|
|
|
if (has_capability('moodle/course:delete', $coursecontext)) {
|
2007-03-02 01:26:19 +00:00
|
|
|
echo "<a title=\"".get_string("delete")."\" href=\"delete.php?id=$course->id\">\n<img".
|
|
|
|
" src=\"$pixpath/t/delete.gif\" class=\"iconsmall\" alt=\"".get_string("delete")."\" /></a>\n ";
|
2007-08-17 19:09:11 +00:00
|
|
|
}
|
2006-11-21 05:31:46 +00:00
|
|
|
|
|
|
|
// checks whether user can change visibility
|
|
|
|
if (has_capability('moodle/course:visibility', $coursecontext)) {
|
|
|
|
if (!empty($course->visible)) {
|
2009-01-02 10:51:26 +00:00
|
|
|
echo "<a title=\"".get_string("hide")."\" href=\"search.php?search=$encodedsearch&perpage=$perpage&page=$page&hide=$course->id&sesskey=".sesskey()."\">\n<img".
|
2007-03-02 01:26:19 +00:00
|
|
|
" src=\"$pixpath/t/hide.gif\" class=\"iconsmall\" alt=\"".get_string("hide")."\" /></a>\n ";
|
2006-11-21 05:31:46 +00:00
|
|
|
} else {
|
2009-01-02 10:51:26 +00:00
|
|
|
echo "<a title=\"".get_string("show")."\" href=\"search.php?search=$encodedsearch&perpage=$perpage&page=$page&show=$course->id&sesskey=".sesskey()."\">\n<img".
|
2007-03-02 01:26:19 +00:00
|
|
|
" src=\"$pixpath/t/show.gif\" class=\"iconsmall\" alt=\"".get_string("show")."\" /></a>\n ";
|
2006-11-21 05:31:46 +00:00
|
|
|
}
|
2007-08-17 19:09:11 +00:00
|
|
|
}
|
2006-11-21 05:31:46 +00:00
|
|
|
|
|
|
|
// checks whether user can do site backup
|
|
|
|
if (has_capability('moodle/site:backup', $coursecontext)) {
|
2007-03-02 01:26:19 +00:00
|
|
|
echo "<a title=\"".get_string("backup")."\" href=\"../backup/backup.php?id=$course->id\">\n<img".
|
|
|
|
" src=\"$pixpath/t/backup.gif\" class=\"iconsmall\" alt=\"".get_string("backup")."\" /></a>\n ";
|
2005-09-01 04:48:22 +00:00
|
|
|
}
|
2007-08-17 19:09:11 +00:00
|
|
|
|
2006-11-21 05:31:46 +00:00
|
|
|
// checks whether user can do restore
|
|
|
|
if (has_capability('moodle/site:restore', $coursecontext)) {
|
2007-03-02 01:26:19 +00:00
|
|
|
echo "<a title=\"".get_string("restore")."\" href=\"../files/index.php?id=$course->id&wdir=/backupdata\">\n<img".
|
|
|
|
" src=\"$pixpath/t/restore.gif\" class=\"iconsmall\" alt=\"".get_string("restore")."\" /></a>\n ";
|
2006-11-21 05:31:46 +00:00
|
|
|
}
|
|
|
|
|
2007-03-02 01:26:19 +00:00
|
|
|
echo "</td>\n</tr>\n";
|
2005-09-01 04:48:22 +00:00
|
|
|
}
|
2007-03-02 01:26:19 +00:00
|
|
|
echo "<tr>\n<td colspan=\"4\" style=\"text-align:center\">\n";
|
2005-09-01 04:48:22 +00:00
|
|
|
echo "<br />";
|
|
|
|
echo "<input type=\"button\" onclick=\"checkall()\" value=\"$strselectall\" />\n";
|
2009-03-16 02:11:15 +00:00
|
|
|
echo "<input type=\"button\" onclick=\"checknone()\" value=\"$strdeselectall\" />\n";
|
2007-01-04 21:32:36 +00:00
|
|
|
choose_from_menu ($displaylist, "moveto", "", get_string("moveselectedcoursesto"), "javascript: getElementById('movecourses').submit()");
|
2007-03-02 01:26:19 +00:00
|
|
|
echo "</td>\n</tr>\n";
|
|
|
|
echo "</table>\n</form>";
|
2005-09-01 04:48:22 +00:00
|
|
|
|
2003-08-11 09:45:50 +00:00
|
|
|
}
|
|
|
|
|
2008-11-07 05:34:42 +00:00
|
|
|
print_navigation_bar($totalcount,$page,$perpage,$encodedsearch,$modulelink);
|
2003-08-19 05:32:20 +00:00
|
|
|
|
2003-08-11 09:45:50 +00:00
|
|
|
} else {
|
2007-02-21 13:03:24 +00:00
|
|
|
if (!empty($search)) {
|
2008-06-02 08:13:24 +00:00
|
|
|
print_heading(get_string("nocoursesfound", "", s($search)));
|
2007-02-21 13:03:24 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
print_heading( $strnovalidcourses );
|
|
|
|
}
|
2003-08-11 09:45:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
echo "<br /><br />";
|
|
|
|
|
|
|
|
print_course_search($search);
|
|
|
|
|
|
|
|
print_footer();
|
|
|
|
|
2008-11-07 05:34:42 +00:00
|
|
|
/**
|
|
|
|
* Print a list navigation bar
|
|
|
|
* Display page numbers, and a link for displaying all entries
|
|
|
|
* @param integer $totalcount - number of entry to display
|
|
|
|
* @param integer $page - page number
|
|
|
|
* @param integer $perpage - number of entry per page
|
|
|
|
* @param string $encodedsearch
|
|
|
|
* @param string $modulelink - module name
|
|
|
|
*/
|
|
|
|
function print_navigation_bar($totalcount,$page,$perpage,$encodedsearch,$modulelink) {
|
|
|
|
print_paging_bar($totalcount, $page, $perpage, "search.php?search=$encodedsearch".$modulelink."&perpage=$perpage&",'page',($perpage == 99999));
|
|
|
|
|
|
|
|
//display
|
|
|
|
if ($perpage != 99999 && $totalcount > $perpage) {
|
|
|
|
echo "<center><p>";
|
|
|
|
echo "<a href=\"search.php?search=$encodedsearch".$modulelink."&perpage=99999\">".get_string("showall", "", $totalcount)."</a>";
|
|
|
|
echo "</p></center>";
|
|
|
|
}
|
|
|
|
}
|
2003-08-11 09:45:50 +00:00
|
|
|
|
|
|
|
?>
|