/// Do the job, setting result as needed
/// Get the dir containing the file
- $dirpath = required_param('dir', PARAM_CLEAN);
- $dirpath = stripslashes_safe($dirpath);
- $tableparam = required_param('table', PARAM_CLEAN);
- $indexparam = required_param('index', PARAM_CLEAN);
+ $dirpath = required_param('dir', PARAM_PATH);
+ $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+ $tableparam = required_param('table', PARAM_PATH);
+ $indexparam = required_param('index', PARAM_PATH);
$confirmed = optional_param('confirmed', false, PARAM_BOOL);
$o.= ' <p align="center">' . $this->str['confirmdeleteindex'] . '<br /><br />' . $indexparam . '</p>';
$o.= ' <table align="center" cellpadding="20"><tr><td>';
$o.= ' <div class="singlebutton">';
- $o.= ' <form action="index.php?action=delete_index&confirmed=yes&postaction=edit_table&index=' . $indexparam . '&table=' . $tableparam . '&dir=' . urlencode($dirpath) . '" method="post">';
+ $o.= ' <form action="index.php?action=delete_index&confirmed=yes&postaction=edit_table&index=' . $indexparam . '&table=' . $tableparam . '&dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '" method="post">';
$o.= ' <input type="submit" value="'. $this->str['yes'] .'" /></form></div>';
$o.= ' </td><td>';
$o.= ' <div class="singlebutton">';
- $o.= ' <form action="index.php?action=edit_table&table=' . $tableparam . '&dir=' . urlencode($dirpath) . '" method="post">';
+ $o.= ' <form action="index.php?action=edit_table&table=' . $tableparam . '&dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '" method="post">';
$o.= ' <input type="submit" value="'. $this->str['no'] .'" /></form></div>';
$o.= ' </td></tr>';
$o.= ' </table>';
/// Do the job, setting result as needed
/// Get the dir containing the file
- $dirpath = required_param('dir', PARAM_CLEAN);
- $dirpath = stripslashes_safe($dirpath);
- $tableparam = required_param('table', PARAM_CLEAN);
- $keyparam = required_param('key', PARAM_CLEAN);
+ $dirpath = required_param('dir', PARAM_PATH);
+ $dirpath = $CFG->dirroot . stripslashes_safe($dirpath);
+ $tableparam = required_param('table', PARAM_PATH);
+ $keyparam = required_param('key', PARAM_PATH);
$confirmed = optional_param('confirmed', false, PARAM_BOOL);
$o.= ' <p align="center">' . $this->str['confirmdeletekey'] . '<br /><br />' . $keyparam . '</p>';
$o.= ' <table align="center" cellpadding="20"><tr><td>';
$o.= ' <div class="singlebutton">';
- $o.= ' <form action="index.php?action=delete_key&confirmed=yes&postaction=edit_table&key=' . $keyparam . '&table=' . $tableparam . '&dir=' . urlencode($dirpath) . '" method="post">';
+ $o.= ' <form action="index.php?action=delete_key&confirmed=yes&postaction=edit_table&key=' . $keyparam . '&table=' . $tableparam . '&dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '" method="post">';
$o.= ' <input type="submit" value="'. $this->str['yes'] .'" /></form></div>';
$o.= ' </td><td>';
$o.= ' <div class="singlebutton">';
- $o.= ' <form action="index.php?action=edit_table&table=' . $tableparam . '&dir=' . urlencode($dirpath) . '" method="post">';
+ $o.= ' <form action="index.php?action=edit_table&table=' . $tableparam . '&dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '" method="post">';
$o.= ' <input type="submit" value="'. $this->str['no'] .'" /></form></div>';
$o.= ' </td></tr>';
$o.= ' </table>';
/// 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)) {
/// Add the main form
$o = '<form name="form" id="form" action="index.php" method="post">';
- $o.= ' <input type="hidden" name ="dir" value="' . $dirpath . '" />';
+ $o.= ' <input type="hidden" name ="dir" value="' . str_replace($CFG->dirroot, '', $dirpath) . '" />';
$o.= ' <input type="hidden" name ="table" value="' . $tableparam .'" />';
$o.= ' <input type="hidden" name ="index" value="' . $indexparam .'" />';
$o.= ' <input type="hidden" name ="action" value="edit_index_save" />';
$b = ' <p align="center" class="buttons">';
/// The view original XML button
if ($table->getIndex($indexparam)) {
- $b .= ' <a href="index.php?action=view_index_xml&dir=' . urlencode($dirpath) . '&select=original&table=' . $tableparam . '&index=' . $indexparam . '" target="_blank">[' . $this->str['vieworiginal'] . ']</a>';
+ $b .= ' <a href="index.php?action=view_index_xml&dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '&select=original&table=' . $tableparam . '&index=' . $indexparam . '" target="_blank">[' . $this->str['vieworiginal'] . ']</a>';
} else {
$b .= ' [' . $this->str['vieworiginal'] . ']';
}
/// The view edited XML button
if ($index->hasChanged()) {
- $b .= ' <a href="index.php?action=view_index_xml&dir=' . urlencode($dirpath) . '&select=edited&table=' . $tableparam . '&index=' . $indexparam . '" target="_blank">[' . $this->str['viewedited'] . ']</a>';
+ $b .= ' <a href="index.php?action=view_index_xml&dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '&select=edited&table=' . $tableparam . '&index=' . $indexparam . '" target="_blank">[' . $this->str['viewedited'] . ']</a>';
} else {
$b .= ' [' . $this->str['viewedited'] . ']';
}
/// The back to edit table button
- $b .= ' <a href="index.php?action=edit_table&table=' . $tableparam . '&dir=' . urlencode($dirpath) . '">[' . $this->str['back'] . ']</a>';
+ $b .= ' <a href="index.php?action=edit_table&table=' . $tableparam . '&dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '">[' . $this->str['back'] . ']</a>';
$b .= '</p>';
$o .= $b;
/// 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)) {
/// Add the main form
$o = '<form name="form" id="form" action="index.php" method="post">';
- $o.= ' <input type="hidden" name ="dir" value="' . $dirpath . '" />';
+ $o.= ' <input type="hidden" name ="dir" value="' . str_replace($CFG->dirroot, '', $dirpath) . '" />';
$o.= ' <input type="hidden" name ="table" value="' . $tableparam .'" />';
$o.= ' <input type="hidden" name ="key" value="' . $keyparam .'" />';
$o.= ' <input type="hidden" name ="action" value="edit_key_save" />';
$b = ' <p align="center" class="buttons">';
/// The view original XML button
if ($table->getKey($keyparam)) {
- $b .= ' <a href="index.php?action=view_key_xml&dir=' . urlencode($dirpath) . '&select=original&table=' . $tableparam . '&key=' . $keyparam . '" target="_blank">[' . $this->str['vieworiginal'] . ']</a>';
+ $b .= ' <a href="index.php?action=view_key_xml&dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '&select=original&table=' . $tableparam . '&key=' . $keyparam . '" target="_blank">[' . $this->str['vieworiginal'] . ']</a>';
} else {
$b .= ' [' . $this->str['vieworiginal'] . ']';
}
/// The view edited XML button
if ($key->hasChanged()) {
- $b .= ' <a href="index.php?action=view_key_xml&dir=' . urlencode($dirpath) . '&select=edited&table=' . $tableparam . '&key=' . $keyparam . '" target="_blank">[' . $this->str['viewedited'] . ']</a>';
+ $b .= ' <a href="index.php?action=view_key_xml&dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '&select=edited&table=' . $tableparam . '&key=' . $keyparam . '" target="_blank">[' . $this->str['viewedited'] . ']</a>';
} else {
$b .= ' [' . $this->str['viewedited'] . ']';
}
/// The back to edit table button
- $b .= ' <a href="index.php?action=edit_table&table=' . $tableparam . '&dir=' . urlencode($dirpath) . '">[' . $this->str['back'] . ']</a>';
+ $b .= ' <a href="index.php?action=edit_table&table=' . $tableparam . '&dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)) . '">[' . $this->str['back'] . ']</a>';
$b .= '</p>';
$o .= $b;
/// 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)) {
/// 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)) {
/// 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)) {
/// 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)) {
/// Do the job, setting result as needed
/// Get the file parameter
- $index = required_param('index', PARAM_CLEAN);
- $table = required_param('table', PARAM_CLEAN);
+ $index = required_param('index', PARAM_PATH);
+ $table = required_param('table', PARAM_PATH);
$select = required_param('select', PARAM_ALPHA); //original/edited
/// 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 dir
if ($select == 'original') {
/// Do the job, setting result as needed
/// Get the file parameter
- $key = required_param('key', PARAM_CLEAN);
- $table = required_param('table', PARAM_CLEAN);
+ $key = required_param('key', PARAM_PATH);
+ $table = required_param('table', PARAM_PATH);
$select = required_param('select', PARAM_ALPHA); //original/edited
/// 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 dir
if ($select == 'original') {