Bug #6136 - Hard coded admin paths

This commit is contained in:
skodak
2006-07-19 07:59:16 +00:00
parent 4985c39b50
commit 8c251d1a93
11 changed files with 49 additions and 48 deletions
+2 -2
View File
@@ -156,7 +156,7 @@
$table->define_columns(array('name', 'instances', 'version', 'hideshow', 'multiple', 'delete', 'settings'));
$table->define_headers(array($strname, $strcourses, $strversion, $strhide.'/'.$strshow, $strmultiple, $strdelete, $strsettings));
$table->define_baseurl($CFG->wwwroot.'/admin/blocks.php');
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php');
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'blocks');
@@ -218,7 +218,7 @@
$table->define_columns(array('block', 'delete'));
$table->define_headers(array($strname, $strdelete));
$table->define_baseurl($CFG->wwwroot.'/admin/blocks.php');
$table->define_baseurl($CFG->wwwroot.'/'.$CFG->admin.'/blocks.php');
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'incompatible');
+1 -1
View File
@@ -192,7 +192,7 @@
$table->column_style('order', 'text-align', 'center');
$table->column_style('settings', 'text-align', 'center');
$table->define_headers(array($txt->name, $txt->hideshow, $txt->updown, $txt->settings));
$table->define_baseurl("$CFG->wwwroot/admin/filters.php");
$table->define_baseurl("$CFG->wwwroot/$CFG->admin/filters.php");
$table->set_attribute('id', 'blocks');
$table->set_attribute('class', 'flexible generaltable generalbox');
$table->set_attribute('style', 'margin:auto;');
+3 -3
View File
@@ -23,7 +23,7 @@
$strreports = get_string('reports');
$strcourseoverview = get_string('courseoverview');
$strnav = '<a href="'.$CFG->wwwroot.'/admin/index.php">'.get_string('administration').'</a> -> <a href="'.$CFG->wwwroot.'/admin/report.php">'.$strreports.'</a> -> '.$strcourseoverview;
$strnav = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/index.php">'.get_string('administration').'</a> -> <a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/report.php">'.$strreports.'</a> -> '.$strcourseoverview;
$reportoptions = stats_get_report_options($course->id,STATS_MODE_RANKED);
@@ -75,10 +75,10 @@
$courses = get_records_sql($sql);
if (empty($courses)) {
error(get_string('statsnodata'),$CFG->wwwroot.'/admin/report/courseoverview/index.php');
error(get_string('statsnodata'),$CFG->wwwroot.'/'.$CFG->admin.'/report/courseoverview/index.php');
}
echo '<center><img src="'.$CFG->wwwroot.'/admin/report/courseoverview/reportsgraph.php?time='.$time.'&report='.$report.'&numcourses='.$numcourses.'" /></center>';
echo '<center><img src="'.$CFG->wwwroot.'/'.$CFG->admin.'/report/courseoverview/reportsgraph.php?time='.$time.'&report='.$report.'&numcourses='.$numcourses.'" /></center>';
$table = new object();
$table->align = array('left','center','center','center');
+1 -1
View File
@@ -28,7 +28,7 @@
$courses = get_records_sql($sql);
if (empty($courses)) {
error(get_string('statsnodata'),$CFG->wwwroot.'/admin/report/course/index.php');
error(get_string('statsnodata'),$CFG->wwwroot.'/'.$CFG->admin.'/report/course/index.php');
}
+1 -1
View File
@@ -6,7 +6,7 @@
if (!empty($CFG->enablestats)) {
echo '<p style="text-align:center;">';
echo '<a href="'.$CFG->wwwroot.'/admin/report/stats/index.php?course='.$course->id.'">'.get_string('stats').'</a>';
echo '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/report/stats/index.php?course='.$course->id.'">'.get_string('stats').'</a>';
echo '</p>';
$statsstatus = stats_check_uptodate($course->id);
if ($statsstatus !== NULL) {
+1 -1
View File
@@ -63,7 +63,7 @@
echo '<td valign="top" width="*" id="middle-column">';
print_simple_box_start('center');
print_heading($strheading);
echo '<form method="post" action="'.$CFG->wwwroot.'/admin/stickyblocks.php">'
echo '<form method="post" action="'.$CFG->wwwroot.'/'.$CFG->admin.'/stickyblocks.php">'
.'<p align="center">'.get_string('stickyblockspagetype','admin').': ';
choose_from_menu($options,'pt',$pt,'choose','this.form.submit();');
echo '</p></form>';
+2 -2
View File
@@ -89,7 +89,7 @@
print_heading('db unicode migration has been completed!');
unlink($filename); //no longer in maintenance mode
@require_logout();
print_continue($CFG->wwwroot.'/admin/langimport.php');
print_continue($CFG->wwwroot.'/'.$CFG->admin.'/langimport.php');
}
//else if $migrate
@@ -813,7 +813,7 @@ function db_migrate2utf8(){ //Eloy: Perhaps some type of limit parameter here
echo $lang.', ';
}
}
echo '</b><br/><a href="'.$CFG->wwwroot.'/admin/langimport.php">Language Import Utility</a></div>';
echo '</b><br/><a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/langimport.php">Language Import Utility</a></div>';
print_simple_box_end();
delete_records('config','name','langsused');
+1 -1
View File
@@ -56,7 +56,7 @@ class block_admin extends block_list {
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/log.gif" alt="" />';
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/admin/report.php">'.get_string('reports').'</a>';
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/report.php">'.get_string('reports').'</a>';
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/stats.gif" alt="" />';
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/files/index.php?id='.SITEID.'">'.get_string('sitefiles').'</a>';
+1 -1
View File
@@ -440,7 +440,7 @@ class page_course extends page_base {
function url_get_path() {
global $CFG;
if (defined('ADMIN_STICKYBLOCKS')) {
return $CFG->wwwroot.'/admin/stickyblocks.php';
return $CFG->wwwroot.'/'.$CFG->admin.'/stickyblocks.php';
}
if($this->id == SITEID) {
return $CFG->wwwroot .'/index.php';
+33 -33
View File
@@ -1,40 +1,40 @@
<?PHP
function hotpot_update_to_v2_1_21() {
global $CFG;
$ok = true;
function hotpot_update_to_v2_1_21() {
global $CFG;
$ok = true;
if (strtolower($CFG->dbtype)=='postgres7') {
// ensure setting of default values on certain fields
// this was originally done in postgres7.php, but was found to be incompatible with PG7 :-(
$table="hotpot";
$ok = $ok && hotpot_db_update_field_type($table, '', 'studentfeedbackurl', 'VARCHAR', 255, '', 'NOT NULL', '');
$ok = $ok && hotpot_db_update_field_type($table, '', 'studentfeedback', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$ok = $ok && hotpot_db_update_field_type($table, '', 'clickreporting', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$table="hotpot_attempts";
$ok = $ok && hotpot_db_update_field_type($table, '', 'score', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$ok = $ok && hotpot_db_update_field_type($table, '', 'penalties', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$ok = $ok && hotpot_db_update_field_type($table, '', 'status', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 1);
$table="hotpot_questions";
$ok = $ok && hotpot_db_update_field_type($table, '', 'type', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$table="hotpot_responses";
$ok = $ok && hotpot_db_update_field_type($table, '', 'score', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$ok = $ok && hotpot_db_update_field_type($table, '', 'weighting', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$ok = $ok && hotpot_db_update_field_type($table, '', 'correct', 'VARCHAR', 255, '', 'NOT NULL', '');
$ok = $ok && hotpot_db_update_field_type($table, '', 'wrong', 'VARCHAR', 255, '', 'NOT NULL', '');
$ok = $ok && hotpot_db_update_field_type($table, '', 'ignored', 'VARCHAR', 255, '', 'NOT NULL', '');
$ok = $ok && hotpot_db_update_field_type($table, '', 'hints', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$ok = $ok && hotpot_db_update_field_type($table, '', 'clues', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$ok = $ok && hotpot_db_update_field_type($table, '', 'checks', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$table="hotpot_strings";
$ok = $ok && hotpot_db_update_field_type($table, '', 'string', 'TEXT', '', '', 'NOT NULL', '');
}
// this was originally done in postgres7.php, but was found to be incompatible with PG7 :-(
$table="hotpot";
$ok = $ok && hotpot_db_update_field_type($table, '', 'studentfeedbackurl', 'VARCHAR', 255, '', 'NOT NULL', '');
$ok = $ok && hotpot_db_update_field_type($table, '', 'studentfeedback', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$ok = $ok && hotpot_db_update_field_type($table, '', 'clickreporting', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
return $ok;
}
$table="hotpot_attempts";
$ok = $ok && hotpot_db_update_field_type($table, '', 'score', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$ok = $ok && hotpot_db_update_field_type($table, '', 'penalties', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$ok = $ok && hotpot_db_update_field_type($table, '', 'status', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 1);
$table="hotpot_questions";
$ok = $ok && hotpot_db_update_field_type($table, '', 'type', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$table="hotpot_responses";
$ok = $ok && hotpot_db_update_field_type($table, '', 'score', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$ok = $ok && hotpot_db_update_field_type($table, '', 'weighting', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$ok = $ok && hotpot_db_update_field_type($table, '', 'correct', 'VARCHAR', 255, '', 'NOT NULL', '');
$ok = $ok && hotpot_db_update_field_type($table, '', 'wrong', 'VARCHAR', 255, '', 'NOT NULL', '');
$ok = $ok && hotpot_db_update_field_type($table, '', 'ignored', 'VARCHAR', 255, '', 'NOT NULL', '');
$ok = $ok && hotpot_db_update_field_type($table, '', 'hints', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$ok = $ok && hotpot_db_update_field_type($table, '', 'clues', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$ok = $ok && hotpot_db_update_field_type($table, '', 'checks', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$table="hotpot_strings";
$ok = $ok && hotpot_db_update_field_type($table, '', 'string', 'TEXT', '', '', 'NOT NULL', '');
}
return $ok;
}
function hotpot_update_to_v2_1_18() {
$ok = true;
@@ -485,7 +485,7 @@ function hotpot_update_to_v2_from_hotpotatoes() {
set_field("modules", "visible", "0", "id", $module->id);
print '<p>All HotPotatoes activities have been imported to the HotPot module.<br />'."\n";
print 'The HotPotatoes module has been hidden and can safely be deleted from this Moodle site.<br />'."\n";
print ' &nbsp; &nbsp; <a href="'.$CFG->wwwroot.'/admin/modules.php">Configuration -> Modules</A>, then click &quot;Delete&quot; for &quot;Hot Potatoes XML Quiz&quot;</p>'."\n";
print ' &nbsp; &nbsp; <a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/modules.php">Configuration -> Modules</A>, then click &quot;Delete&quot; for &quot;Hot Potatoes XML Quiz&quot;</p>'."\n";
}
}
if ($ok) {
+3 -2
View File
@@ -49,11 +49,12 @@ class page_my_moodle extends page_base {
}
function url_get_path() {
global $CFG;
page_id_and_class($id,$class);
if ($id == PAGE_MY_MOODLE) {
return $GLOBALS['CFG']->wwwroot.'/my/index.php';
return $CFG->wwwroot.'/my/index.php';
} elseif (defined('ADMIN_STICKYBLOCKS')){
return $GLOBALS['CFG']->wwwroot.'/admin/stickyblocks.php';
return $CFG->wwwroot.'/'.$CFG->admin.'/stickyblocks.php';
}
}