relative+cleaned paths

This commit is contained in:
stronk7
2006-08-29 23:33:55 +00:00
parent 68905e201b
commit 2a05e82571
7 changed files with 28 additions and 24 deletions
@@ -62,8 +62,8 @@ class view_table_sql extends XMLDBAction {
/// Do the job, setting result as needed
/// Get the dir containing the file
$dirpath = required_param('dir', PARAM_CLEAN);
$dirpath = stripslashes_safe($dirpath);
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
/// Get the correct dirs
if (!empty($XMLDB->dbdirs)) {
@@ -78,12 +78,12 @@ class view_table_sql extends XMLDBAction {
/// ADD YOUR CODE HERE
/// Get parameters
$tableparam = required_param('table', PARAM_CLEAN);
$tableparam = required_param('table', PARAM_PATH);
if (!$table =& $structure->getTable($tableparam)) {
$this->errormsg = 'Wrong table specified: ' . $tableparm;
return false;
}
$generatorparam = optional_param('generator', null, PARAM_CLEAN);
$generatorparam = optional_param('generator', null, PARAM_ALPHANUM);
if (empty($generatorparam)) {
$generatorparam = $CFG->dbtype;
}
@@ -101,7 +101,7 @@ class view_table_sql extends XMLDBAction {
/// The back to edit table button
$b = ' <p align="center" class="buttons">';
$b .= '<a href="index.php?action=edit_table&amp;table=' . $tableparam . '&amp;dir=' . urlencode($dirpath) . '">[' . $this->str['back'] . ']</a>';
$b .= '<a href="index.php?action=edit_table&amp;table=' . $tableparam . '&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '">[' . $this->str['back'] . ']</a>';
$b .= '</p>';
$o = $b;
@@ -109,7 +109,7 @@ class view_table_sql extends XMLDBAction {
$o.= ' <tr><td align="center">' . $this->str['selectdb'];
/// Show the popup of generators
$url = 'index.php?action=view_table_sql&amp;table=' . $tableparam . '&amp;dir=' . urlencode($dirpath) . '&amp;generator=';
$url = 'index.php?action=view_table_sql&amp;table=' . $tableparam . '&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '&amp;generator=';
$o.= popup_form($url, $generators, 'selectgenerator', $generatorparam, '', '', '' , true);
$o.= ' </td></tr>';
$o.= ' <tr><td><textarea cols="80" rows="32">';