diff --git a/admin/tool/xmldb/actions/XMLDBAction.class.php b/admin/tool/xmldb/actions/XMLDBAction.class.php
index 9d1aa343bb0..b853a7e631d 100644
--- a/admin/tool/xmldb/actions/XMLDBAction.class.php
+++ b/admin/tool/xmldb/actions/XMLDBAction.class.php
@@ -126,14 +126,14 @@ class XMLDBAction {
* array parameter
*/
function loadStrings($strings) {
- /// Load some commonly used strings
+ // Load some commonly used strings
if (get_string_manager()->string_exists($this->title, 'tool_xmldb')) {
$this->str['title'] = get_string($this->title, 'tool_xmldb');
} else {
$this->str['title'] = $this->title;
}
- /// Now process the $strings array loading it in the $str atribute
+ // Now process the $strings array loading it in the $str atribute
if ($strings) {
foreach ($strings as $key => $module) {
$this->str[$key] = get_string($key, $module);
@@ -149,19 +149,19 @@ class XMLDBAction {
global $SESSION;
- /// Sesskey protection
+ // Sesskey protection
if ($this->sesskey_protected) {
require_sesskey();
}
- /// If we are used any dir, save it in the lastused session object
- /// Some actions can use it to perform positioning
+ // If we are used any dir, save it in the lastused session object
+ // Some actions can use it to perform positioning
if ($lastused = optional_param ('dir', NULL, PARAM_PATH)) {
$SESSION->lastused = $lastused;
}
$this->postaction = optional_param ('postaction', NULL, PARAM_ALPHAEXT);
- /// Avoid being recursive
+ // Avoid being recursive
if ($this->title == $this->postaction) {
$this->postaction = NULL;
}
@@ -174,12 +174,12 @@ class XMLDBAction {
global $CFG;
- /// Get the action path and invoke it
+ // Get the action path and invoke it
$actionsroot = "$CFG->dirroot/$CFG->admin/tool/xmldb/actions";
$actionclass = $action . '.class.php';
$actionpath = "$actionsroot/$action/$actionclass";
- /// Load and invoke the proper action
+ // Load and invoke the proper action
$result = false;
if (file_exists($actionpath) && is_readable($actionpath)) {
require_once($actionpath);
@@ -218,16 +218,16 @@ class XMLDBAction {
$path = $structure->getPath();
- /// Trim "db" from path
+ // Trim "db" from path
$path = dirname($path);
- /// Get pluginname, plugindir and plugintype
+ // Get pluginname, plugindir and plugintype
$pluginname = basename($path);
- if ($path == 'lib') { /// exception for lib (not proper plugin)
+ if ($path == 'lib') { // exception for lib (not proper plugin)
$plugindir = 'lib';
$plugintype = 'lib';
- } else { /// rest of plugins
- //TODO: this is not nice and may fail, plugintype should be passed around somehow instead
+ } else { // rest of plugins
+ // TODO: this is not nice and may fail, plugintype should be passed around somehow instead
$plugintypes = get_plugin_types(false);
$plugindir = dirname($path);
$plugindir = str_replace('\\', '/', $plugindir);
@@ -237,22 +237,22 @@ class XMLDBAction {
$result = '';
switch ($plugintype ) {
- case 'lib': /// has own savepoint function
+ case 'lib': // has own savepoint function
$result = XMLDB_LINEFEED .
' // Main savepoint reached' . XMLDB_LINEFEED .
' upgrade_main_savepoint(true, XXXXXXXXXX);' . XMLDB_LINEFEED;
break;
- case 'mod': /// has own savepoint function
+ case 'mod': // has own savepoint function
$result = XMLDB_LINEFEED .
' // ' . $pluginname . ' savepoint reached' . XMLDB_LINEFEED .
' upgrade_mod_savepoint(true, XXXXXXXXXX, ' . "'$pluginname'" . ');' . XMLDB_LINEFEED;
break;
- case 'block': /// has own savepoint function
+ case 'block': // has own savepoint function
$result = XMLDB_LINEFEED .
' // ' . $pluginname . ' savepoint reached' . XMLDB_LINEFEED .
' upgrade_block_savepoint(true, XXXXXXXXXX, ' . "'$pluginname'" . ');' . XMLDB_LINEFEED;
break;
- default: /// rest of plugins
+ default: // rest of plugins
$result = XMLDB_LINEFEED .
' // ' . $pluginname . ' savepoint reached' . XMLDB_LINEFEED .
' upgrade_plugin_savepoint(true, XXXXXXXXXX, ' . "'$plugintype'" . ', ' . "'$pluginname'" . ');' . XMLDB_LINEFEED;
diff --git a/admin/tool/xmldb/actions/XMLDBCheckAction.class.php b/admin/tool/xmldb/actions/XMLDBCheckAction.class.php
index 0212c5d1253..547f00e9877 100644
--- a/admin/tool/xmldb/actions/XMLDBCheckAction.class.php
+++ b/admin/tool/xmldb/actions/XMLDBCheckAction.class.php
@@ -43,11 +43,11 @@ abstract class XMLDBCheckAction extends XMLDBAction {
function init() {
parent::init();
- /// Set own core attributes
+ // Set own core attributes
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
$this->introstr => 'tool_xmldb',
'ok' => '',
@@ -73,24 +73,24 @@ abstract class XMLDBCheckAction extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB, $DB, $OUTPUT;
- /// And we nedd some ddl suff
+ // And we nedd some ddl suff
$dbman = $DB->get_manager();
- /// Here we'll acummulate all the wrong fields found
+ // Here we'll acummulate all the wrong fields found
$problemsfound = array();
- /// Do the job, setting $result as needed
+ // Do the job, setting $result as needed
- /// Get the confirmed to decide what to do
+ // Get the confirmed to decide what to do
$confirmed = optional_param('confirmed', false, PARAM_BOOL);
- /// If not confirmed, show confirmation box
+ // If not confirmed, show confirmation box
if (!$confirmed) {
$o = '
';
$o.= '
';
@@ -110,59 +110,59 @@ abstract class XMLDBCheckAction extends XMLDBAction {
$this->output = $o;
} else {
- /// The back to edit table button
+ // The back to edit table button
$b = '
';
- /// Iterate over $XMLDB->dbdirs, loading their XML data to memory
+ // Iterate over $XMLDB->dbdirs, loading their XML data to memory
if ($XMLDB->dbdirs) {
$dbdirs =& $XMLDB->dbdirs;
$o='
';
foreach ($dbdirs as $dbdir) {
- /// Only if the directory exists
+ // Only if the directory exists
if (!$dbdir->path_exists) {
continue;
}
- /// Load the XML file
+ // Load the XML file
$xmldb_file = new xmldb_file($dbdir->path . '/install.xml');
- /// Only if the file exists
+ // Only if the file exists
if (!$xmldb_file->fileExists()) {
continue;
}
- /// Load the XML contents to structure
+ // Load the XML contents to structure
$loaded = $xmldb_file->loadXMLStructure();
if (!$loaded || !$xmldb_file->isLoaded()) {
echo $OUTPUT->notification('Errors found in XMLDB file: '. $dbdir->path . '/install.xml');
continue;
}
- /// Arriving here, everything is ok, get the XMLDB structure
+ // Arriving here, everything is ok, get the XMLDB structure
$structure = $xmldb_file->getStructure();
$o.='
';
- /// Foreach table, process its fields
+ // Foreach table, process its fields
foreach ($xmldb_tables as $xmldb_table) {
- /// Skip table if not exists
+ // Skip table if not exists
if (!$dbman->table_exists($xmldb_table)) {
continue;
}
- /// Fetch metadata from physical DB. All the columns info.
+ // Fetch metadata from physical DB. All the columns info.
if (!$metacolumns = $DB->get_columns($xmldb_table->getName())) {
- //// Skip table if no metacolumns is available for it
+ // / Skip table if no metacolumns is available for it
continue;
}
- /// Table processing starts here
+ // Table processing starts here
$o.='
' . $xmldb_table->getName();
- /// Do the specific check.
+ // Do the specific check.
list($output, $newproblems) = $this->check_table($xmldb_table, $metacolumns);
$o.=$output;
$problemsfound = array_merge($problemsfound, $newproblems);
$o.='
';
- /// Give the script some more time (resetting to current if exists)
+ // Give the script some more time (resetting to current if exists)
if ($currenttl = @ini_get('max_execution_time')) {
@ini_set('max_execution_time',$currenttl);
}
@@ -174,19 +174,19 @@ abstract class XMLDBCheckAction extends XMLDBAction {
$o.='
';
}
- /// Create a report of the problems found.
+ // Create a report of the problems found.
$r = $this->display_results($problemsfound);
- /// Combine the various bits of output.
+ // Combine the various bits of output.
$this->output = $b . $r . $o;
}
- /// Launch postaction if exists (leave this here!)
+ // Launch postaction if exists (leave this here!)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
- /// Return ok if arrived here
+ // Return ok if arrived here
return $result;
}
diff --git a/admin/tool/xmldb/actions/check_bigints/check_bigints.class.php b/admin/tool/xmldb/actions/check_bigints/check_bigints.class.php
index 94f5c77b6db..f2def4aad10 100644
--- a/admin/tool/xmldb/actions/check_bigints/check_bigints.class.php
+++ b/admin/tool/xmldb/actions/check_bigints/check_bigints.class.php
@@ -44,11 +44,11 @@ class check_bigints extends XMLDBCheckAction {
$this->introstr = 'confirmcheckbigints';
parent::init();
- /// Set own core attributes
+ // Set own core attributes
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
'wrongints' => 'tool_xmldb',
'nowrongintsfound' => 'tool_xmldb',
@@ -56,7 +56,7 @@ class check_bigints extends XMLDBCheckAction {
'mysqlextracheckbigints' => 'tool_xmldb',
));
- /// Correct fields must be type bigint for MySQL and int8 for PostgreSQL
+ // Correct fields must be type bigint for MySQL and int8 for PostgreSQL
$this->dbfamily = $DB->get_dbfamily();
switch ($this->dbfamily) {
case 'mysql':
@@ -74,26 +74,26 @@ class check_bigints extends XMLDBCheckAction {
$o = '';
$wrong_fields = array();
- /// Get and process XMLDB fields
+ // Get and process XMLDB fields
if ($xmldb_fields = $xmldb_table->getFields()) {
$o.='
';
foreach ($xmldb_fields as $xmldb_field) {
- /// If the field isn't integer(10), skip
+ // If the field isn't integer(10), skip
if ($xmldb_field->getType() != XMLDB_TYPE_INTEGER || $xmldb_field->getLength() != 10) {
continue;
}
- /// If the metadata for that column doesn't exist, skip
+ // If the metadata for that column doesn't exist, skip
if (!isset($metacolumns[$xmldb_field->getName()])) {
continue;
}
- /// To variable for better handling
+ // To variable for better handling
$metacolumn = $metacolumns[$xmldb_field->getName()];
- /// Going to check this field in DB
+ // Going to check this field in DB
$o.='
' . $this->str['field'] . ': ' . $xmldb_field->getName() . ' ';
- /// Detect if the physical field is wrong and, under mysql, check for incorrect signed fields too
+ // Detect if the physical field is wrong and, under mysql, check for incorrect signed fields too
if ($metacolumn->type != $this->correct_type || ($this->dbfamily == 'mysql' && $xmldb_field->getUnsigned() && !$metacolumn->unsigned)) {
$o.='' . $this->str['wrong'] . '';
- /// Add the wrong field to the list
+ // Add the wrong field to the list
$obj = new stdClass();
$obj->table = $xmldb_table;
$obj->field = $xmldb_field;
@@ -121,41 +121,41 @@ class check_bigints extends XMLDBCheckAction {
$r.= '
';
$r.= '
';
- /// If we have found wrong integers inform about them
+ // If we have found wrong integers inform about them
if (count($wrong_fields)) {
$r.= '
' . $this->str['yeswrongintsfound'] . '
';
$r.= '
';
foreach ($wrong_fields as $obj) {
$xmldb_table = $obj->table;
$xmldb_field = $obj->field;
- /// MySQL directly supports this
+ // MySQL directly supports this
// TODO: move this hack to generators!!
if ($this->dbfamily == 'mysql') {
$sqlarr = $dbman->generator->getAlterFieldSQL($xmldb_table, $xmldb_field);
- /// PostgreSQL (XMLDB implementation) is a bit, er... imperfect.
+ // PostgreSQL (XMLDB implementation) is a bit, er... imperfect.
} else if ($this->dbfamily == 'postgres') {
$sqlarr = array('ALTER TABLE ' . $DB->get_prefix() . $xmldb_table->getName() .
' ALTER COLUMN ' . $xmldb_field->getName() . ' TYPE BIGINT;');
}
$r.= '
';
- /// Add to output if we have sentences
+ // Add to output if we have sentences
if ($sqlarr) {
$sqlarr = $dbman->generator->getEndedStatements($sqlarr);
$s.= '' . str_replace("\n", ' ', implode(' ', $sqlarr)). ' ';
}
}
$r.= '
';
- /// Add the complete log message
+ // Add the complete log message
$r.= '
' . $this->str['completelogbelow'] . '
';
$r.= '
';
$r.= '
';
diff --git a/admin/tool/xmldb/actions/check_defaults/check_defaults.class.php b/admin/tool/xmldb/actions/check_defaults/check_defaults.class.php
index 9e01ce3b104..7365326a163 100644
--- a/admin/tool/xmldb/actions/check_defaults/check_defaults.class.php
+++ b/admin/tool/xmldb/actions/check_defaults/check_defaults.class.php
@@ -40,11 +40,11 @@ class check_defaults extends XMLDBCheckAction {
$this->introstr = 'confirmcheckdefaults';
parent::init();
- /// Set own core attributes
+ // Set own core attributes
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
'wrongdefaults' => 'tool_xmldb',
'nowrongdefaultsfound' => 'tool_xmldb',
@@ -58,7 +58,7 @@ class check_defaults extends XMLDBCheckAction {
$o = '';
$wrong_fields = array();
- /// Get and process XMLDB fields
+ // Get and process XMLDB fields
if ($xmldb_fields = $xmldb_table->getFields()) {
$o.='
';
foreach ($xmldb_fields as $xmldb_field) {
@@ -66,15 +66,15 @@ class check_defaults extends XMLDBCheckAction {
// Get the default value for the field
$xmldbdefault = $xmldb_field->getDefault();
- /// If the metadata for that column doesn't exist or 'id' field found, skip
+ // If the metadata for that column doesn't exist or 'id' field found, skip
if (!isset($metacolumns[$xmldb_field->getName()]) or $xmldb_field->getName() == 'id') {
continue;
}
- /// To variable for better handling
+ // To variable for better handling
$metacolumn = $metacolumns[$xmldb_field->getName()];
- /// Going to check this field in DB
+ // Going to check this field in DB
$o.='
' . $this->str['field'] . ': ' . $xmldb_field->getName() . ' ';
// get the value of the physical default (or blank if there isn't one)
@@ -90,7 +90,7 @@ class check_defaults extends XMLDBCheckAction {
$info = '('.$this->str['expected']." '$xmldbdefault', ".$this->str['actual'].
" '$physicaldefault')";
$o.='' . $this->str['wrong'] . " $info";
- /// Add the wrong field to the list
+ // Add the wrong field to the list
$obj = new stdClass();
$obj->table = $xmldb_table;
$obj->field = $xmldb_field;
@@ -120,7 +120,7 @@ class check_defaults extends XMLDBCheckAction {
$r.= ' ';
$r.= '
';
- /// If we have found wrong defaults inform about them
+ // If we have found wrong defaults inform about them
if (count($wrong_fields)) {
$r.= '
' . $this->str['yeswrongdefaultsfound'] . '
';
$r.= '
';
@@ -137,21 +137,21 @@ class check_defaults extends XMLDBCheckAction {
$this->str['field'] . ': ' . $xmldb_field->getName() . ', ' .
$this->str['expected'] . ' ' . "'$xmldbdefault'" . ' ' .
$this->str['actual'] . ' ' . "'$physicaldefault'" . '';
- /// Add to output if we have sentences
+ // Add to output if we have sentences
if ($sqlarr) {
$sqlarr = $dbman->generator->getEndedStatements($sqlarr);
$s.= '' . str_replace("\n", ' ', implode(' ', $sqlarr)) . ' ';
}
}
$r.= '
';
- /// Add the complete log message
+ // Add the complete log message
$r.= '
' . $this->str['completelogbelow'] . '
';
$r.= '
';
$r.= '';
diff --git a/admin/tool/xmldb/actions/check_foreign_keys/check_foreign_keys.class.php b/admin/tool/xmldb/actions/check_foreign_keys/check_foreign_keys.class.php
index 078d7708e40..272c2855966 100644
--- a/admin/tool/xmldb/actions/check_foreign_keys/check_foreign_keys.class.php
+++ b/admin/tool/xmldb/actions/check_foreign_keys/check_foreign_keys.class.php
@@ -44,11 +44,11 @@ class check_foreign_keys extends XMLDBCheckAction {
$this->introstr = 'confirmcheckforeignkeys';
parent::init();
- /// Set own core attributes
+ // Set own core attributes
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
'key' => 'tool_xmldb',
'violatedforeignkeys' => 'tool_xmldb',
@@ -67,17 +67,17 @@ class check_foreign_keys extends XMLDBCheckAction {
$o = '';
$violatedkeys = array();
- /// Keys
+ // Keys
if ($xmldb_keys = $xmldb_table->getKeys()) {
$o.='
';
foreach ($xmldb_keys as $xmldb_key) {
- /// We are only interested in foreign keys.
+ // We are only interested in foreign keys.
if (!in_array($xmldb_key->getType(), array(XMLDB_KEY_FOREIGN, XMLDB_KEY_FOREIGN_UNIQUE))) {
continue;
}
$o.='
' . $this->str['key'] . ': ' . $xmldb_key->readableInfo() . ' ';
- /// Work out the SQL to find key violations.
+ // Work out the SQL to find key violations.
$keyfields = $xmldb_key->getFields();
$reffields = $xmldb_key->getRefFields();
$joinconditions = array();
@@ -103,13 +103,13 @@ class check_foreign_keys extends XMLDBCheckAction {
implode(' AND ', $joinconditions) . ' WHERE ' .
implode(' AND ', $nullnessconditions);
- /// Check there are any problems in the database.
+ // Check there are any problems in the database.
$violations = $DB->count_records_sql($sql, $params);
if ($violations == 0) {
$o.='' . $this->str['ok'] . '';
} else {
$o.='' . $this->str['violations'] . '';
- /// Add the missing index to the list
+ // Add the missing index to the list
$violation = new stdClass;
$violation->table = $xmldb_table;
$violation->key = $xmldb_key;
@@ -139,7 +139,7 @@ class check_foreign_keys extends XMLDBCheckAction {
$r.= ' ';
$r.= '
';
- /// If we have found wrong integers inform about them
+ // If we have found wrong integers inform about them
if (count($violatedkeys)) {
$r.= '
';
continue;
}
- /// If we aren't creating the keys or the key is a XMLDB_KEY_FOREIGN (not underlying index generated
- /// automatically by the RDBMS) create the underlying (created by us) index (if doesn't exists)
+ // If we aren't creating the keys or the key is a XMLDB_KEY_FOREIGN (not underlying index generated
+ // automatically by the RDBMS) create the underlying (created by us) index (if doesn't exists)
if (!$dbman->generator->getKeySQL($xmldb_table, $xmldb_key) || $xmldb_key->getType() == XMLDB_KEY_FOREIGN) {
- /// Create the interim index
+ // Create the interim index
$xmldb_index = new xmldb_index('anyname');
$xmldb_index->setFields($xmldb_key->getFields());
switch ($xmldb_key->getType()) {
@@ -87,12 +87,12 @@ class check_indexes extends XMLDBCheckAction {
$xmldb_index->setUnique(false);
break;
}
- /// Check if the index exists in DB
+ // Check if the index exists in DB
if ($dbman->index_exists($xmldb_table, $xmldb_index)) {
$o.='' . $this->str['ok'] . '';
} else {
$o.='' . $this->str['missing'] . '';
- /// Add the missing index to the list
+ // Add the missing index to the list
$obj = new stdClass();
$obj->table = $xmldb_table;
$obj->index = $xmldb_index;
@@ -103,17 +103,17 @@ class check_indexes extends XMLDBCheckAction {
}
$o.='
';
foreach ($xmldb_indexes as $xmldb_index) {
$o.='
' . $this->str['index'] . ': ' . $xmldb_index->readableInfo() . ' ';
- /// Check if the index exists in DB
+ // Check if the index exists in DB
if ($dbman->index_exists($xmldb_table, $xmldb_index)) {
$o.='' . $this->str['ok'] . '';
} else {
$o.='' . $this->str['missing'] . '';
- /// Add the missing index to the list
+ // Add the missing index to the list
$obj = new stdClass();
$obj->table = $xmldb_table;
$obj->index = $xmldb_index;
@@ -139,7 +139,7 @@ class check_indexes extends XMLDBCheckAction {
$r.= ' ';
$r.= '
';
- /// If we have found missing indexes inform about them
+ // If we have found missing indexes inform about them
if (count($missing_indexes)) {
$r.= '
';
- /// Add the complete log message
+ // Add the complete log message
$r.= '
' . $this->str['completelogbelow'] . '
';
$r.= '
';
$r.= '';
diff --git a/admin/tool/xmldb/actions/create_xml_file/create_xml_file.class.php b/admin/tool/xmldb/actions/create_xml_file/create_xml_file.class.php
index d2fcf30cf0e..205700f2c80 100644
--- a/admin/tool/xmldb/actions/create_xml_file/create_xml_file.class.php
+++ b/admin/tool/xmldb/actions/create_xml_file/create_xml_file.class.php
@@ -35,15 +35,15 @@ class create_xml_file extends XMLDBAction {
*/
function init() {
parent::init();
- /// Set own core attributes
+ // Set own core attributes
$this->can_subaction = ACTION_NONE;
//$this->can_subaction = ACTION_HAVE_SUBACTIONS;
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
- /// 'key' => 'module',
+ // 'key' => 'module',
));
}
@@ -57,28 +57,28 @@ class create_xml_file extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_NONE;
//$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting result as needed
+ // Do the job, setting result as needed
- /// Get the dir containing the file
+ // Get the dir containing the file
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
$file = $dirpath . '/install.xml';
- /// Some variables
+ // Some variables
$xmlpath = dirname(str_replace($CFG->dirroot . '/', '', $file));
$xmlversion = userdate(time(), '%Y%m%d', 99, false);
$xmlcomment = 'XMLDB file for Moodle ' . dirname($xmlpath);
$xmltable = strtolower(basename(dirname($xmlpath)));
- /// Initial contents
+ // Initial contents
$c = '' . "\n";
$c.= ' ' . "\n";
$c.= ' ' . "\n";
@@ -98,12 +98,12 @@ class create_xml_file extends XMLDBAction {
$result = false;
}
- /// Launch postaction if exists
+ // Launch postaction if exists
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
- /// Return ok if arrived here
+ // Return ok if arrived here
return $result;
}
}
diff --git a/admin/tool/xmldb/actions/delete_field/delete_field.class.php b/admin/tool/xmldb/actions/delete_field/delete_field.class.php
index d8015e2835e..f2a201dc289 100644
--- a/admin/tool/xmldb/actions/delete_field/delete_field.class.php
+++ b/admin/tool/xmldb/actions/delete_field/delete_field.class.php
@@ -37,9 +37,9 @@ class delete_field extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
'confirmdeletefield' => 'tool_xmldb',
'yes' => '',
@@ -57,15 +57,15 @@ class delete_field extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting result as needed
+ // Do the job, setting result as needed
- /// Get the dir containing the file
+ // Get the dir containing the file
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
$tableparam = required_param('table', PARAM_CLEAN);
@@ -73,7 +73,7 @@ class delete_field extends XMLDBAction {
$confirmed = optional_param('confirmed', false, PARAM_BOOL);
- /// If not confirmed, show confirmation box
+ // If not confirmed, show confirmation box
if (!$confirmed) {
$o = '
';
$o.= '
';
@@ -93,14 +93,14 @@ class delete_field extends XMLDBAction {
$this->output = $o;
} else {
- /// Get the edited dir
+ // Get the edited dir
if (!empty($XMLDB->editeddirs)) {
if (isset($XMLDB->editeddirs[$dirpath])) {
$dbdir =& $XMLDB->dbdirs[$dirpath];
$editeddir =& $XMLDB->editeddirs[$dirpath];
if ($editeddir) {
$structure =& $editeddir->xml_file->getStructure();
- /// Move adjacent fields prev and next attributes
+ // Move adjacent fields prev and next attributes
$tables =& $structure->getTables();
$table =& $structure->getTable($tableparam);
$fields =& $table->getFields();
@@ -113,14 +113,14 @@ class delete_field extends XMLDBAction {
$next =& $table->getField($field->getNext());
$next->setPrevious($field->getPrevious());
}
- /// Remove the field
+ // Remove the field
$table->deleteField($fieldparam);
- /// Recalculate the hash
+ // Recalculate the hash
$structure->calculateHash(true);
- /// If the hash has changed from the original one, change the version
- /// and mark the structure as changed
+ // If the hash has changed from the original one, change the version
+ // and mark the structure as changed
$origstructure =& $dbdir->xml_file->getStructure();
if ($structure->getHash() != $origstructure->getHash()) {
$structure->setVersion(userdate(time(), '%Y%m%d', 99, false));
@@ -131,12 +131,12 @@ class delete_field extends XMLDBAction {
}
}
- /// Launch postaction if exists (leave this here!)
+ // Launch postaction if exists (leave this here!)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
- /// Return ok if arrived here
+ // Return ok if arrived here
return $result;
}
}
diff --git a/admin/tool/xmldb/actions/delete_index/delete_index.class.php b/admin/tool/xmldb/actions/delete_index/delete_index.class.php
index 465b5dbafc3..05327d0d472 100644
--- a/admin/tool/xmldb/actions/delete_index/delete_index.class.php
+++ b/admin/tool/xmldb/actions/delete_index/delete_index.class.php
@@ -37,9 +37,9 @@ class delete_index extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
'confirmdeleteindex' => 'tool_xmldb',
'yes' => '',
@@ -57,15 +57,15 @@ class delete_index extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting result as needed
+ // Do the job, setting result as needed
- /// Get the dir containing the file
+ // Get the dir containing the file
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
$tableparam = required_param('table', PARAM_PATH);
@@ -73,7 +73,7 @@ class delete_index extends XMLDBAction {
$confirmed = optional_param('confirmed', false, PARAM_BOOL);
- /// If not confirmed, show confirmation box
+ // If not confirmed, show confirmation box
if (!$confirmed) {
$o = '
';
$o.= '
';
@@ -93,14 +93,14 @@ class delete_index extends XMLDBAction {
$this->output = $o;
} else {
- /// Get the edited dir
+ // Get the edited dir
if (!empty($XMLDB->editeddirs)) {
if (isset($XMLDB->editeddirs[$dirpath])) {
$dbdir =& $XMLDB->dbdirs[$dirpath];
$editeddir =& $XMLDB->editeddirs[$dirpath];
if ($editeddir) {
$structure =& $editeddir->xml_file->getStructure();
- /// Move adjacent indexes prev and next attributes
+ // Move adjacent indexes prev and next attributes
$tables =& $structure->getTables();
$table =& $structure->getTable($tableparam);
$indexes =& $table->getIndexes();
@@ -113,14 +113,14 @@ class delete_index extends XMLDBAction {
$next =& $table->getIndex($index->getNext());
$next->setPrevious($index->getPrevious());
}
- /// Remove the index
+ // Remove the index
$table->deleteIndex($indexparam);
- /// Recalculate the hash
+ // Recalculate the hash
$structure->calculateHash(true);
- /// If the hash has changed from the original one, change the version
- /// and mark the structure as changed
+ // If the hash has changed from the original one, change the version
+ // and mark the structure as changed
$origstructure =& $dbdir->xml_file->getStructure();
if ($structure->getHash() != $origstructure->getHash()) {
$structure->setVersion(userdate(time(), '%Y%m%d', 99, false));
@@ -131,12 +131,12 @@ class delete_index extends XMLDBAction {
}
}
- /// Launch postaction if exists (leave this here!)
+ // Launch postaction if exists (leave this here!)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
- /// Return ok if arrived here
+ // Return ok if arrived here
return $result;
}
}
diff --git a/admin/tool/xmldb/actions/delete_key/delete_key.class.php b/admin/tool/xmldb/actions/delete_key/delete_key.class.php
index 409307a843f..1bf9dc0ba50 100644
--- a/admin/tool/xmldb/actions/delete_key/delete_key.class.php
+++ b/admin/tool/xmldb/actions/delete_key/delete_key.class.php
@@ -37,9 +37,9 @@ class delete_key extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
'confirmdeletekey' => 'tool_xmldb',
'yes' => '',
@@ -57,15 +57,15 @@ class delete_key extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting result as needed
+ // Do the job, setting result as needed
- /// Get the dir containing the file
+ // Get the dir containing the file
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
$tableparam = required_param('table', PARAM_PATH);
@@ -73,7 +73,7 @@ class delete_key extends XMLDBAction {
$confirmed = optional_param('confirmed', false, PARAM_BOOL);
- /// If not confirmed, show confirmation box
+ // If not confirmed, show confirmation box
if (!$confirmed) {
$o = '
';
$o.= '
';
@@ -93,14 +93,14 @@ class delete_key extends XMLDBAction {
$this->output = $o;
} else {
- /// Get the edited dir
+ // Get the edited dir
if (!empty($XMLDB->editeddirs)) {
if (isset($XMLDB->editeddirs[$dirpath])) {
$dbdir =& $XMLDB->dbdirs[$dirpath];
$editeddir =& $XMLDB->editeddirs[$dirpath];
if ($editeddir) {
$structure =& $editeddir->xml_file->getStructure();
- /// Move adjacent keys prev and next attributes
+ // Move adjacent keys prev and next attributes
$tables =& $structure->getTables();
$table =& $structure->getTable($tableparam);
$keys =& $table->getKeys();
@@ -113,14 +113,14 @@ class delete_key extends XMLDBAction {
$next =& $table->getKey($key->getNext());
$next->setPrevious($key->getPrevious());
}
- /// Remove the key
+ // Remove the key
$table->deleteKey($keyparam);
- /// Recalculate the hash
+ // Recalculate the hash
$structure->calculateHash(true);
- /// If the hash has changed from the original one, change the version
- /// and mark the structure as changed
+ // If the hash has changed from the original one, change the version
+ // and mark the structure as changed
$origstructure =& $dbdir->xml_file->getStructure();
if ($structure->getHash() != $origstructure->getHash()) {
$structure->setVersion(userdate(time(), '%Y%m%d', 99, false));
@@ -131,12 +131,12 @@ class delete_key extends XMLDBAction {
}
}
- /// Launch postaction if exists (leave this here!)
+ // Launch postaction if exists (leave this here!)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
- /// Return ok if arrived here
+ // Return ok if arrived here
return $result;
}
}
diff --git a/admin/tool/xmldb/actions/delete_table/delete_table.class.php b/admin/tool/xmldb/actions/delete_table/delete_table.class.php
index 9d49fc92002..27bcab63e15 100644
--- a/admin/tool/xmldb/actions/delete_table/delete_table.class.php
+++ b/admin/tool/xmldb/actions/delete_table/delete_table.class.php
@@ -37,9 +37,9 @@ class delete_table extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
'confirmdeletetable' => 'tool_xmldb',
'yes' => '',
@@ -57,22 +57,22 @@ class delete_table extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting result as needed
+ // Do the job, setting result as needed
- /// Get the dir containing the file
+ // Get the dir containing the file
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
$tableparam = required_param('table', PARAM_CLEAN);
$confirmed = optional_param('confirmed', false, PARAM_BOOL);
- /// If not confirmed, show confirmation box
+ // If not confirmed, show confirmation box
if (!$confirmed) {
$o = '
';
$o.= '
';
@@ -92,26 +92,26 @@ class delete_table extends XMLDBAction {
$this->output = $o;
} else {
- /// Get the edited dir
+ // Get the edited dir
if (!empty($XMLDB->editeddirs)) {
if (isset($XMLDB->editeddirs[$dirpath])) {
$dbdir =& $XMLDB->dbdirs[$dirpath];
$editeddir =& $XMLDB->editeddirs[$dirpath];
if ($editeddir) {
$structure =& $editeddir->xml_file->getStructure();
- /// Remove the table
+ // Remove the table
$structure->deleteTable($tableparam);
}
}
}
}
- /// Launch postaction if exists (leave this here!)
+ // Launch postaction if exists (leave this here!)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
- /// Return ok if arrived here
+ // Return ok if arrived here
return $result;
}
}
diff --git a/admin/tool/xmldb/actions/delete_xml_file/delete_xml_file.class.php b/admin/tool/xmldb/actions/delete_xml_file/delete_xml_file.class.php
index d4531b78f5a..c1431274981 100644
--- a/admin/tool/xmldb/actions/delete_xml_file/delete_xml_file.class.php
+++ b/admin/tool/xmldb/actions/delete_xml_file/delete_xml_file.class.php
@@ -37,9 +37,9 @@ class delete_xml_file extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
'confirmdeletexmlfile' => 'tool_xmldb',
'yes' => '',
@@ -57,21 +57,21 @@ class delete_xml_file extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting result as needed
+ // Do the job, setting result as needed
- /// Get the dir containing the file
+ // Get the dir containing the file
$dirpath = required_param('dir', PARAM_CLEAN);
$dirpath = $CFG->dirroot . $dirpath;
$confirmed = optional_param('confirmed', false, PARAM_BOOL);
- /// If not confirmed, show confirmation box
+ // If not confirmed, show confirmation box
if (!$confirmed) {
$o = '
';
$o.= '
';
@@ -91,7 +91,7 @@ class delete_xml_file extends XMLDBAction {
$this->output = $o;
} else {
- /// Get the original dir and delete the xml file
+ // Get the original dir and delete the xml file
if (!empty($XMLDB->dbdirs)) {
if (isset($XMLDB->dbdirs[$dirpath])) {
$dbdir =& $XMLDB->dbdirs[$dirpath];
@@ -102,12 +102,12 @@ class delete_xml_file extends XMLDBAction {
}
}
- /// Launch postaction if exists (leave this here!)
+ // Launch postaction if exists (leave this here!)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
- /// Return ok if arrived here
+ // Return ok if arrived here
return $result;
}
}
diff --git a/admin/tool/xmldb/actions/edit_field/edit_field.class.php b/admin/tool/xmldb/actions/edit_field/edit_field.class.php
index 197baf60fd6..2c38399c869 100644
--- a/admin/tool/xmldb/actions/edit_field/edit_field.class.php
+++ b/admin/tool/xmldb/actions/edit_field/edit_field.class.php
@@ -37,10 +37,10 @@ class edit_field extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
$this->sesskey_protected = false; // This action doesn't need sesskey protection
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
'change' => 'tool_xmldb',
'float2numbernote' => 'tool_xmldb',
@@ -62,18 +62,18 @@ class edit_field extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB, $OUTPUT;
- /// Do the job, setting result as needed
- /// Get the dir containing the file
+ // Do the job, setting result as needed
+ // Get the dir containing the file
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
- /// Get the correct dirs
+ // Get the correct dirs
if (!empty($XMLDB->dbdirs)) {
$dbdir =& $XMLDB->dbdirs[$dirpath];
} else {
@@ -84,9 +84,7 @@ class edit_field extends XMLDBAction {
$structure =& $editeddir->xml_file->getStructure();
}
- /// ADD YOUR CODE HERE
-
- /// Fetch request data
+ // Fetch request data
$tableparam = required_param('table', PARAM_CLEAN);
if (!$table =& $structure->getTable($tableparam)) {
$this->errormsg = 'Wrong table specified: ' . $tableparam;
@@ -94,7 +92,7 @@ class edit_field extends XMLDBAction {
}
$fieldparam = required_param('field', PARAM_CLEAN);
if (!$field =& $table->getField($fieldparam)) {
- /// Arriving here from a name change, looking for the new field name
+ // Arriving here from a name change, looking for the new field name
$fieldparam = required_param('name', PARAM_CLEAN);
$field =& $table->getField($fieldparam);
}
@@ -102,14 +100,14 @@ class edit_field extends XMLDBAction {
$dbdir =& $XMLDB->dbdirs[$dirpath];
$origstructure =& $dbdir->xml_file->getStructure();
- $o = ''; /// Output starts
+ $o = ''; // Output starts
- /// If field is XMLDB_TYPE_FLOAT, comment about to migrate it to XMLDB_TYPE_NUMBER
+ // If field is XMLDB_TYPE_FLOAT, comment about to migrate it to XMLDB_TYPE_NUMBER
if ($field->getType() == XMLDB_TYPE_FLOAT) {
$o .= '
' . $this->str['float2numbernote'] . '
';
}
- /// Add the main form
+ // Add the main form
$o.= '';
- /// Calculate the buttons
+ // Calculate the buttons
$b = '
';
- /// The view original XML button
+ // The view original XML button
if ($table->getField($fieldparam)) {
$b .= ' [' . $this->str['vieworiginal'] . ']';
} else {
$b .= ' [' . $this->str['vieworiginal'] . ']';
}
- /// The view edited XML button
+ // The view edited XML button
if ($field->hasChanged()) {
$b .= ' [' . $this->str['viewedited'] . ']';
} else {
$b .= ' [' . $this->str['viewedited'] . ']';
}
- /// The back to edit table button
+ // The back to edit table button
$b .= ' [' . $this->str['back'] . ']';
$b .= '
';
$o .= $b;
$this->output = $o;
- /// Launch postaction if exists (leave this here!)
+ // Launch postaction if exists (leave this here!)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
- /// Return ok if arrived here
+ // Return ok if arrived here
return $result;
}
}
diff --git a/admin/tool/xmldb/actions/edit_field/edit_field.js b/admin/tool/xmldb/actions/edit_field/edit_field.js
index 065828d883c..0ad913374a5 100644
--- a/admin/tool/xmldb/actions/edit_field/edit_field.js
+++ b/admin/tool/xmldb/actions/edit_field/edit_field.js
@@ -1,58 +1,52 @@
-/// $Id $
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see .
-///////////////////////////////////////////////////////////////////////////
-// //
-// NOTICE OF COPYRIGHT //
-// //
-// Moodle - Modular Object-Oriented Dynamic Learning Environment //
-// http://moodle.com //
-// //
-// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com //
-// (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com //
-// //
-// This program is free software; you can redistribute it and/or modify //
-// it under the terms of the GNU General Public License as published by //
-// the Free Software Foundation; either version 2 of the License, or //
-// (at your option) any later version. //
-// //
-// This program is distributed in the hope that it will be useful, //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
-// GNU General Public License for more details: //
-// //
-// http://www.gnu.org/copyleft/gpl.html //
-// //
-///////////////////////////////////////////////////////////////////////////
+/**
+ * @package tool
+ * @subpackage xmldb
+ * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+// Register the needed events
+onload=function() {
+ // Adjust the form on load
+ transformForm();
-/// Register the needed events
+ // Get the required fields
+ var typeField = document.getElementById('menutype');
+ var sequenceField = document.getElementById('menusequence');
- onload=function() {
- /// Adjust the form on load
- transformForm();
-
- /// Get the required fields
- var typeField = document.getElementById('menutype');
- var sequenceField = document.getElementById('menusequence');
-
- /// Register the rest of events
- if (typeField.addEventListener) {
- /// Standard
- typeField.addEventListener('change', transformForm, false);
- sequenceField.addEventListener('change', transformForm, false);
- } else {
- /// IE 5.5
- typeField.attachEvent('onchange', transformForm);
- sequenceField.attachEvent('onchange', transformForm);
- }
+ // Register the rest of events
+ if (typeField.addEventListener) {
+ // Standard
+ typeField.addEventListener('change', transformForm, false);
+ sequenceField.addEventListener('change', transformForm, false);
+ } else {
+ // IE 5.5
+ typeField.attachEvent('onchange', transformForm);
+ sequenceField.attachEvent('onchange', transformForm);
}
+}
/**
* This function controls all modifications to perform when any field changes
*/
function transformForm(event) {
-/// Initialize all the needed variables
+ // Initialize all the needed variables
var typeField = document.getElementById('menutype');
var lengthField = document.getElementById('length');
var decimalsField = document.getElementById('decimals');
@@ -64,14 +58,14 @@ function transformForm(event) {
var lengthTip = document.getElementById('lengthtip');
var decimalsTip = document.getElementById('decimalstip');
-/// Initially, enable everything
+ // Initially, enable everything
decimalsField.disabled = false;
unsignedField.disabled = false;
notnullField.disabled = false;
sequenceField.disabled = false;
defaultField.disabled = false;
-/// Based on sequence, disable some items
+ // Based on sequence, disable some items
if (sequenceField.value == '1') {
unsignedField.disabled = true;
unsignedField.value = '1';
@@ -81,8 +75,7 @@ function transformForm(event) {
defaultField.value = '';
}
-
-/// Based on type, disable some items
+ // Based on type, disable some items
switch (typeField.value) {
case '1': // XMLDB_TYPE_INTEGER
lengthTip.innerHTML = ' 1...20';
diff --git a/admin/tool/xmldb/actions/edit_field_save/edit_field_save.class.php b/admin/tool/xmldb/actions/edit_field_save/edit_field_save.class.php
index febcba819a8..0e1f7d86f47 100644
--- a/admin/tool/xmldb/actions/edit_field_save/edit_field_save.class.php
+++ b/admin/tool/xmldb/actions/edit_field_save/edit_field_save.class.php
@@ -38,9 +38,9 @@ class edit_field_save extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
'fieldnameempty' => 'tool_xmldb',
'incorrectfieldname' => 'tool_xmldb',
@@ -69,20 +69,20 @@ class edit_field_save extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
//$this->does_generate = ACTION_NONE;
$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting result as needed
+ // Do the job, setting result as needed
- if (!data_submitted()) { ///Basic prevention
+ if (!data_submitted()) { // Basic prevention
print_error('wrongcall', 'error');
}
- /// Get parameters
+ // Get parameters
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
@@ -108,9 +108,9 @@ class edit_field_save extends XMLDBAction {
$field =& $table->getField($fieldparam);
$oldhash = $field->getHash();
- $errors = array(); /// To store all the errors found
+ $errors = array(); // To store all the errors found
- /// Perform some automatic assumptions
+ // Perform some automatic assumptions
if ($sequence) {
$unsigned = true;
$notnull = true;
@@ -126,20 +126,20 @@ class edit_field_save extends XMLDBAction {
$default = NULL;
}
- /// Perform some checks
- /// Check empty name
+ // Perform some checks
+ // Check empty name
if (empty($name)) {
$errors[] = $this->str['fieldnameempty'];
}
- /// Check incorrect name
+ // Check incorrect name
if ($name == 'changeme') {
$errors[] = $this->str['incorrectfieldname'];
}
- /// Check duplicate name
+ // Check duplicate name
if ($fieldparam != $name && $table->getField($name)) {
$errors[] = $this->str['duplicatefieldname'];
}
- /// Integer checks
+ // Integer checks
if ($type == XMLDB_TYPE_INTEGER) {
if (!(is_numeric($length) && !empty($length) && intval($length)==floatval($length) &&
$length > 0 && $length <= 20)) {
@@ -151,7 +151,7 @@ class edit_field_save extends XMLDBAction {
$errors[] = $this->str['defaultincorrect'];
}
}
- /// Number checks
+ // Number checks
if ($type == XMLDB_TYPE_NUMBER) {
if (!(is_numeric($length) && !empty($length) && intval($length)==floatval($length) &&
$length > 0 && $length <= 20)) {
@@ -169,7 +169,7 @@ class edit_field_save extends XMLDBAction {
$errors[] = $this->str['defaultincorrect'];
}
}
- /// Float checks
+ // Float checks
if ($type == XMLDB_TYPE_FLOAT) {
if (!(empty($length) || (is_numeric($length) &&
!empty($length) &&
@@ -190,7 +190,7 @@ class edit_field_save extends XMLDBAction {
$errors[] = $this->str['defaultincorrect'];
}
}
- /// Char checks
+ // Char checks
if ($type == XMLDB_TYPE_CHAR) {
if (!(is_numeric($length) && !empty($length) && intval($length)==floatval($length) &&
$length > 0 && $length <= xmldb_field::CHAR_MAX_LENGTH)) {
@@ -203,7 +203,7 @@ class edit_field_save extends XMLDBAction {
}
}
}
- /// Text checks
+ // Text checks
if ($type == XMLDB_TYPE_TEXT) {
if ($length != 'small' &&
$length != 'medium' &&
@@ -217,7 +217,7 @@ class edit_field_save extends XMLDBAction {
}
}
}
- /// Binary checks
+ // Binary checks
if ($type == XMLDB_TYPE_BINARY) {
if ($length != 'small' &&
$length != 'medium' &&
@@ -235,7 +235,7 @@ class edit_field_save extends XMLDBAction {
$tempfield->setNotNull($notnull);
$tempfield->setSequence($sequence);
$tempfield->setDefault($default);
- /// Prepare the output
+ // Prepare the output
$o = '
';
$o .= $b;
$this->output = $o;
- /// Launch postaction if exists (leave this here!)
+ // Launch postaction if exists (leave this here!)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
- /// Return ok if arrived here
+ // Return ok if arrived here
return $result;
}
}
diff --git a/admin/tool/xmldb/actions/edit_index_save/edit_index_save.class.php b/admin/tool/xmldb/actions/edit_index_save/edit_index_save.class.php
index a39106c834f..f6a57fa0d19 100644
--- a/admin/tool/xmldb/actions/edit_index_save/edit_index_save.class.php
+++ b/admin/tool/xmldb/actions/edit_index_save/edit_index_save.class.php
@@ -38,9 +38,9 @@ class edit_index_save extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
'indexnameempty' => 'tool_xmldb',
'incorrectindexname' => 'tool_xmldb',
@@ -65,20 +65,20 @@ class edit_index_save extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
//$this->does_generate = ACTION_NONE;
$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting result as needed
+ // Do the job, setting result as needed
- if (!data_submitted()) { ///Basic prevention
+ if (!data_submitted()) { // Basic prevention
print_error('wrongcall', 'error');
}
- /// Get parameters
+ // Get parameters
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
@@ -99,44 +99,44 @@ class edit_index_save extends XMLDBAction {
$index =& $table->getIndex($indexparam);
$oldhash = $index->getHash();
- $errors = array(); /// To store all the errors found
+ $errors = array(); // To store all the errors found
- /// Perform some checks
- /// Check empty name
+ // Perform some checks
+ // Check empty name
if (empty($name)) {
$errors[] = $this->str['indexnameempty'];
}
- /// Check incorrect name
+ // Check incorrect name
if ($name == 'changeme') {
$errors[] = $this->str['incorrectindexname'];
}
- /// Check duplicate name
+ // Check duplicate name
if ($indexparam != $name && $table->getIndex($name)) {
$errors[] = $this->str['duplicateindexname'];
}
$fieldsarr = explode(',', $fields);
- /// Check the fields isn't empty
+ // Check the fields isn't empty
if (empty($fieldsarr[0])) {
$errors[] = $this->str['nofieldsspecified'];
} else {
- /// Check that there aren't duplicate column names
+ // Check that there aren't duplicate column names
$uniquearr = array_unique($fieldsarr);
if (count($fieldsarr) != count($uniquearr)) {
$errors[] = $this->str['duplicatefieldsused'];
}
- /// Check that all the fields in belong to the table
+ // Check that all the fields in belong to the table
foreach ($fieldsarr as $field) {
if (!$table->getField($field)) {
$errors[] = $this->str['fieldsnotintable'];
break;
}
}
- /// Check that there isn't any key using exactly the same fields
+ // Check that there isn't any key using exactly the same fields
$tablekeys = $table->getKeys();
if ($tablekeys) {
foreach ($tablekeys as $tablekey) {
$keyfieldsarr = $tablekey->getFields();
- /// Compare both arrays, looking for differences
+ // Compare both arrays, looking for differences
$diferences = array_merge(array_diff($fieldsarr, $keyfieldsarr), array_diff($keyfieldsarr, $fieldsarr));
if (empty($diferences)) {
$errors[] = $this->str['fieldsusedinkey'];
@@ -144,16 +144,16 @@ class edit_index_save extends XMLDBAction {
}
}
}
- /// Check that there isn't any index using exactly the same fields
+ // Check that there isn't any index using exactly the same fields
$tableindexes = $table->getIndexes();
if ($tableindexes) {
foreach ($tableindexes as $tableindex) {
- /// Skip checking against itself
+ // Skip checking against itself
if ($indexparam == $tableindex->getName()) {
continue;
}
$indexfieldsarr = $tableindex->getFields();
- /// Compare both arrays, looking for differences
+ // Compare both arrays, looking for differences
$diferences = array_merge(array_diff($fieldsarr, $indexfieldsarr), array_diff($indexfieldsarr, $fieldsarr));
if (empty($diferences)) {
$errors[] = $this->str['fieldsusedinindex'];
@@ -167,7 +167,7 @@ class edit_index_save extends XMLDBAction {
$tempindex = new xmldb_index($name);
$tempindex->setUnique($unique);
$tempindex->setFields($fieldsarr);
- /// Prepare the output
+ // Prepare the output
$o = '
';
$o .= $b;
$this->output = $o;
- /// Launch postaction if exists (leave this here!)
+ // Launch postaction if exists (leave this here!)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
- /// Return ok if arrived here
+ // Return ok if arrived here
return $result;
}
}
diff --git a/admin/tool/xmldb/actions/edit_key/edit_key.js b/admin/tool/xmldb/actions/edit_key/edit_key.js
index 06f4b332213..0744f08b863 100644
--- a/admin/tool/xmldb/actions/edit_key/edit_key.js
+++ b/admin/tool/xmldb/actions/edit_key/edit_key.js
@@ -1,67 +1,61 @@
-/// $Id $
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see .
-///////////////////////////////////////////////////////////////////////////
-// //
-// NOTICE OF COPYRIGHT //
-// //
-// Moodle - Modular Object-Oriented Dynamic Learning Environment //
-// http://moodle.com //
-// //
-// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com //
-// (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com //
-// //
-// This program is free software; you can redistribute it and/or modify //
-// it under the terms of the GNU General Public License as published by //
-// the Free Software Foundation; either version 2 of the License, or //
-// (at your option) any later version. //
-// //
-// This program is distributed in the hope that it will be useful, //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
-// GNU General Public License for more details: //
-// //
-// http://www.gnu.org/copyleft/gpl.html //
-// //
-///////////////////////////////////////////////////////////////////////////
+/**
+ * @package tool
+ * @subpackage xmldb
+ * @copyright 2003 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+// Register the needed events
+onload=function() {
+ // Adjust the form on load
+ transformForm();
-/// Register the needed events
+ // Get the required fields
+ var typeField = document.getElementById('menutype');
- onload=function() {
- /// Adjust the form on load
- transformForm();
-
- /// Get the required fields
- var typeField = document.getElementById('menutype');
-
- /// Register the rest of events
- if (typeField.addEventListener) {
- /// Standard
- typeField.addEventListener('change', transformForm, false);
- } else {
- /// IE 5.5
- typeField.attachEvent('onchange', transformForm);
- }
+ // Register the rest of events
+ if (typeField.addEventListener) {
+ // Standard
+ typeField.addEventListener('change', transformForm, false);
+ } else {
+ // IE 5.5
+ typeField.attachEvent('onchange', transformForm);
}
+}
/**
* This function controls all modifications to perform when any field changes
*/
function transformForm(event) {
-/// Initialize all the needed variables
+ // Initialize all the needed variables
var typeField = document.getElementById('menutype');
var fieldsField = document.getElementById('fields');
var reftableField = document.getElementById('reftable');
var reffieldsField = document.getElementById('reffields');
-/// Initially, enable everything
+ // Initially, enable everything
typeField.disabled = false;
fieldsField.disabled = false;
reftableField.disabled = false;
reffieldsField.disabled = false;
-/// Based on type, disable some items
+ // Based on type, disable some items
switch (typeField.value) {
case '1': // XMLDB_KEY_PRIMARY
case '2': // XMLDB_KEY_UNIQUE
diff --git a/admin/tool/xmldb/actions/edit_key_save/edit_key_save.class.php b/admin/tool/xmldb/actions/edit_key_save/edit_key_save.class.php
index 0372d515395..3822955834d 100644
--- a/admin/tool/xmldb/actions/edit_key_save/edit_key_save.class.php
+++ b/admin/tool/xmldb/actions/edit_key_save/edit_key_save.class.php
@@ -38,9 +38,9 @@ class edit_key_save extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
'keynameempty' => 'tool_xmldb',
'incorrectkeyname' => 'tool_xmldb',
@@ -71,20 +71,20 @@ class edit_key_save extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
//$this->does_generate = ACTION_NONE;
$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting result as needed
+ // Do the job, setting result as needed
- if (!data_submitted()) { ///Basic prevention
+ if (!data_submitted()) { // Basic prevention
print_error('wrongcall', 'error');
}
- /// Get parameters
+ // Get parameters
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
@@ -112,39 +112,39 @@ class edit_key_save extends XMLDBAction {
$key =& $table->getKey($keyparam);
$oldhash = $key->getHash();
- $errors = array(); /// To store all the errors found
+ $errors = array(); // To store all the errors found
- /// Perform some checks
- /// Check empty name
+ // Perform some checks
+ // Check empty name
if (empty($name)) {
$errors[] = $this->str['keynameempty'];
}
- /// Check incorrect name
+ // Check incorrect name
if ($name == 'changeme') {
$errors[] = $this->str['incorrectkeyname'];
}
- /// Check duplicate name
+ // Check duplicate name
if ($keyparam != $name && $table->getKey($name)) {
$errors[] = $this->str['duplicatekeyname'];
}
$fieldsarr = explode(',', $fields);
- /// Check the fields isn't empty
+ // Check the fields isn't empty
if (empty($fieldsarr[0])) {
$errors[] = $this->str['nofieldsspecified'];
} else {
- /// Check that there aren't duplicate column names
+ // Check that there aren't duplicate column names
$uniquearr = array_unique($fieldsarr);
if (count($fieldsarr) != count($uniquearr)) {
$errors[] = $this->str['duplicatefieldsused'];
}
- /// Check that all the fields in belong to the table
+ // Check that all the fields in belong to the table
foreach ($fieldsarr as $field) {
if (!$table->getField($field)) {
$errors[] = $this->str['fieldsnotintable'];
break;
}
}
- /// If primary, check that all the fields are not null
+ // If primary, check that all the fields are not null
if ($type == XMLDB_KEY_PRIMARY) {
foreach ($fieldsarr as $field) {
if ($fi = $table->getField($field)) {
@@ -155,16 +155,16 @@ class edit_key_save extends XMLDBAction {
}
}
}
- /// Check that there isn't any key using exactly the same fields
+ // Check that there isn't any key using exactly the same fields
$tablekeys = $table->getKeys();
if ($tablekeys) {
foreach ($tablekeys as $tablekey) {
- /// Skip checking against itself
+ // Skip checking against itself
if ($keyparam == $tablekey->getName()) {
continue;
}
$keyfieldsarr = $tablekey->getFields();
- /// Compare both arrays, looking for diferences
+ // Compare both arrays, looking for diferences
$diferences = array_merge(array_diff($fieldsarr, $keyfieldsarr), array_diff($keyfieldsarr, $fieldsarr));
if (empty($diferences)) {
$errors[] = $this->str['fieldsusedinkey'];
@@ -172,12 +172,12 @@ class edit_key_save extends XMLDBAction {
}
}
}
- /// Check that there isn't any index using exactlt the same fields
+ // Check that there isn't any index using exactlt the same fields
$tableindexes = $table->getIndexes();
if ($tableindexes) {
foreach ($tableindexes as $tableindex) {
$indexfieldsarr = $tableindex->getFields();
- /// Compare both arrays, looking for diferences
+ // Compare both arrays, looking for diferences
$diferences = array_merge(array_diff($fieldsarr, $indexfieldsarr), array_diff($indexfieldsarr, $fieldsarr));
if (empty($diferences)) {
$errors[] = $this->str['fieldsusedinindex'];
@@ -185,34 +185,34 @@ class edit_key_save extends XMLDBAction {
}
}
}
- /// If foreign key
+ // If foreign key
if ($type == XMLDB_KEY_FOREIGN ||
$type == XMLDB_KEY_FOREIGN_UNIQUE) {
$reffieldsarr = explode(',', $reffields);
- /// Check reftable is not empty
+ // Check reftable is not empty
if (empty($reftable)) {
$errors[] = $this->str['noreftablespecified'];
} else
- /// Check reffields are not empty
+ // Check reffields are not empty
if (empty($reffieldsarr[0])) {
$errors[] = $this->str['noreffieldsspecified'];
} else
- /// Check the number of fields is correct
+ // Check the number of fields is correct
if (count($fieldsarr) != count($reffieldsarr)) {
$errors[] = $this->str['wrongnumberofreffields'];
} else {
- /// Check, if pointing to one structure table, that there is one master key for this key
+ // Check, if pointing to one structure table, that there is one master key for this key
if ($rt = $structure->getTable($reftable)) {
$masterfound = false;
$reftablekeys = $rt->getKeys();
if ($reftablekeys) {
foreach ($reftablekeys as $reftablekey) {
- /// Only compare with primary and unique keys
+ // Only compare with primary and unique keys
if ($reftablekey->getType() != XMLDB_KEY_PRIMARY && $reftablekey->getType() != XMLDB_KEY_UNIQUE) {
continue;
}
$keyfieldsarr = $reftablekey->getFields();
- /// Compare both arrays, looking for diferences
+ // Compare both arrays, looking for diferences
$diferences = array_merge(array_diff($reffieldsarr, $keyfieldsarr), array_diff($keyfieldsarr, $reffieldsarr));
if (empty($diferences)) {
$masterfound = true;
@@ -222,7 +222,7 @@ class edit_key_save extends XMLDBAction {
if (!$masterfound) {
$errors[] = $this->str['nomasterprimaryuniquefound'];
} else {
- /// Quick test of the order
+ // Quick test of the order
if (implode(',', $reffieldsarr) != implode(',', $keyfieldsarr)) {
$errors[] = $this->str['masterprimaryuniqueordernomatch'];
}
@@ -243,7 +243,7 @@ class edit_key_save extends XMLDBAction {
$tempkey->setRefTable($reftable);
$tempkey->setRefFields($reffieldsarr);
}
- /// Prepare the output
+ // Prepare the output
$o = '
';
$o .= $e . $b;
@@ -188,48 +187,48 @@ class edit_table extends XMLDBAction {
require_once("$CFG->libdir/ddl/sql_generator.php");
$reserved_words = sql_generator::getAllReservedWords();
- /// Delete any 'changeme' field/key/index
+ // Delete any 'changeme' field/key/index
$table->deleteField('changeme');
$table->deleteKey('changeme');
$table->deleteIndex('changeme');
- /// Add the fields list
+ // Add the fields list
$fields =& $table->getFields();
if (!empty($fields)) {
$o .= '
' . $this->str['fields'] . '
';
$o .= '
';
$row = 0;
foreach ($fields as $field) {
- /// The field name (link to edit - if the field has no uses)
+ // The field name (link to edit - if the field has no uses)
if (!$structure->getFieldUses($table->getName(), $field->getName())) {
$f = '' . $field->getName() . '';
} else {
$f = $field->getName();
}
- /// Calculate buttons
+ // Calculate buttons
$b = '
';
- /// The edit button (if the field has no uses)
+ // The edit button (if the field has no uses)
if (!$structure->getFieldUses($table->getName(), $field->getName())) {
$b .= '[' . $this->str['edit'] . ']';
} else {
$b .= '[' . $this->str['edit'] . ']';
}
$b .= '
';
- /// The up button
+ // The up button
if ($field->getPrevious()) {
$b .= '[' . $this->str['up'] . ']';
} else {
$b .= '[' . $this->str['up'] . ']';
}
$b .= '
';
- /// The down button
+ // The down button
if ($field->getNext()) {
$b .= '[' . $this->str['down'] . ']';
} else {
$b .= '[' . $this->str['down'] . ']';
}
$b .= '
';
- /// The delete button (if we have more than one and it isn't used
+ // The delete button (if we have more than one and it isn't used
if (count($fields) > 1 &&
!$structure->getFieldUses($table->getName(), $field->getName())) {
$b .= '[' . $this->str['delete'] . ']';
@@ -237,109 +236,109 @@ class edit_table extends XMLDBAction {
$b .= '[' . $this->str['delete'] . ']';
}
$b .= '
';
- /// The view xml button
+ // The view xml button
$b .= '[' . $this->str['viewxml'] . ']';
- /// Detect if the table name is a reserved word
+ // Detect if the table name is a reserved word
if (array_key_exists($field->getName(), $reserved_words)) {
$b .= ' ' . $this->str['reserved'] . '';
}
- /// The readable info
+ // The readable info
$r = '
';
}
- /// Add the keys list
+ // Add the keys list
$keys =& $table->getKeys();
if (!empty($keys)) {
$o .= '
' . $this->str['keys'] . '
';
$o .= '
';
$row = 0;
foreach ($keys as $key) {
- /// The key name (link to edit - if the key has no uses)
+ // The key name (link to edit - if the key has no uses)
if (!$structure->getKeyUses($table->getName(), $key->getName())) {
$k = '' . $key->getName() . '';
} else {
$k = $key->getName();
}
- /// Calculate buttons
+ // Calculate buttons
$b = '
';
- /// The edit button (if the key hasn't uses)
+ // The edit button (if the key hasn't uses)
if (!$structure->getKeyUses($table->getName(), $key->getName())) {
$b .= '[' . $this->str['edit'] . ']';
} else {
$b .= '[' . $this->str['edit'] . ']';
}
$b .= '
';
- /// The up button
+ // The up button
if ($key->getPrevious()) {
$b .= '[' . $this->str['up'] . ']';
} else {
$b .= '[' . $this->str['up'] . ']';
}
$b .= '
';
- /// The down button
+ // The down button
if ($key->getNext()) {
$b .= '[' . $this->str['down'] . ']';
} else {
$b .= '[' . $this->str['down'] . ']';
}
$b .= '
';
- /// The delete button (if the key hasn't uses)
+ // The delete button (if the key hasn't uses)
if (!$structure->getKeyUses($table->getName(), $key->getName())) {
$b .= '[' . $this->str['delete'] . ']';
} else {
$b .= '[' . $this->str['delete'] . ']';
}
$b .= '
';
- /// The view xml button
+ // The view xml button
$b .= '[' . $this->str['viewxml'] . ']';
- /// The readable info
+ // The readable info
$r = '
';
}
- /// Add the indexes list
+ // Add the indexes list
$indexes =& $table->getIndexes();
if (!empty($indexes)) {
$o .= '
' . $this->str['indexes'] . '
';
$o .= '
';
$row = 0;
foreach ($indexes as $index) {
- /// The index name (link to edit)
+ // The index name (link to edit)
$i = '' . $index->getName() . '';
- /// Calculate buttons
+ // Calculate buttons
$b = '
';
$row = ($row + 1) % 2;
}
@@ -348,12 +347,12 @@ class edit_table extends XMLDBAction {
$this->output = $o;
- /// Launch postaction if exists (leave this here!)
+ // Launch postaction if exists (leave this here!)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
- /// Return ok if arrived here
+ // Return ok if arrived here
return $result;
}
}
diff --git a/admin/tool/xmldb/actions/edit_table_save/edit_table_save.class.php b/admin/tool/xmldb/actions/edit_table_save/edit_table_save.class.php
index 77c8669eb12..7658fd0b31a 100644
--- a/admin/tool/xmldb/actions/edit_table_save/edit_table_save.class.php
+++ b/admin/tool/xmldb/actions/edit_table_save/edit_table_save.class.php
@@ -37,9 +37,9 @@ class edit_table_save extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
'tablenameempty' => 'tool_xmldb',
'incorrecttablename' => 'tool_xmldb',
@@ -59,20 +59,20 @@ class edit_table_save extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
//$this->does_generate = ACTION_NONE;
$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting result as needed
+ // Do the job, setting result as needed
- if (!data_submitted()) { ///Basic prevention
+ if (!data_submitted()) { // Basic prevention
print_error('wrongcall', 'error');
}
- /// Get parameters
+ // Get parameters
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
@@ -87,25 +87,25 @@ class edit_table_save extends XMLDBAction {
$structure =& $editeddir->xml_file->getStructure();
$table =& $structure->getTable($tableparam);
- $errors = array(); /// To store all the errors found
+ $errors = array(); // To store all the errors found
- /// Perform some checks
- /// Check empty name
+ // Perform some checks
+ // Check empty name
if (empty($name)) {
$errors[] = $this->str['tablenameempty'];
}
- /// Check incorrect name
+ // Check incorrect name
if ($name == 'changeme') {
$errors[] = $this->str['incorrecttablename'];
}
- /// Check duplicatename
+ // Check duplicatename
if ($tableparam != $name && $structure->getTable($name)) {
$errors[] = $this->str['duplicatetablename'];
}
if (!empty($errors)) {
$temptable = new xmldb_table($name);
- /// Prepare the output
+ // Prepare the output
$o = '
';
$o .= $e . $b;
- /// Join all the reserved words into one big array
- /// Calculate list of available SQL generators
+ // Join all the reserved words into one big array
+ // Calculate list of available SQL generators
require_once("$CFG->libdir/ddl/sql_generator.php");
$reserved_words = sql_generator::getAllReservedWords();
- /// Add the tables list
+ // Add the tables list
$tables = $structure->getTables();
if ($tables) {
$o .= '
' . $this->str['tables'] . '
';
$o .= '
';
$row = 0;
foreach ($tables as $table) {
- /// The table name (link to edit table)
+ // The table name (link to edit table)
$t = '' . $table->getName() . '';
- /// Calculate buttons
+ // Calculate buttons
$b = '
';
- /// The up button
+ // The up button
if ($table->getPrevious()) {
$b .= '[' . $this->str['up'] . ']';
} else {
$b .= '[' . $this->str['up'] . ']';
}
$b .= '
';
- /// The down button
+ // The down button
if ($table->getNext()) {
$b .= '[' . $this->str['down'] . ']';
} else {
$b .= '[' . $this->str['down'] . ']';
}
$b .= '
';
- /// The delete button (if we have more than one and it isn't used)
+ // The delete button (if we have more than one and it isn't used)
if (count($tables) > 1 &&
!$structure->getTableUses($table->getName())) {
- ///!$structure->getTableUses($table->getName())) {
+ // !$structure->getTableUses($table->getName())) {
$b .= '[' . $this->str['delete'] . ']';
} else {
$b .= '[' . $this->str['delete'] . ']';
}
$b .= '
';
- /// The view xml button
+ // The view xml button
$b .= '[' . $this->str['viewxml'] . ']';
- /// Detect if the table name is a reserved word
+ // Detect if the table name is a reserved word
if (array_key_exists($table->getName(), $reserved_words)) {
$b .= ' ' . $this->str['reserved'] . '';
}
$b .= '
';
}
- ///Add the back to main
+ // Add the back to main
$this->output = $o;
}
}
- /// Launch postaction if exists (leave this unmodified)
+ // Launch postaction if exists (leave this unmodified)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
diff --git a/admin/tool/xmldb/actions/edit_xml_file_save/edit_xml_file_save.class.php b/admin/tool/xmldb/actions/edit_xml_file_save/edit_xml_file_save.class.php
index ace809e6933..1b3cd146e7e 100644
--- a/admin/tool/xmldb/actions/edit_xml_file_save/edit_xml_file_save.class.php
+++ b/admin/tool/xmldb/actions/edit_xml_file_save/edit_xml_file_save.class.php
@@ -37,11 +37,11 @@ class edit_xml_file_save extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
- /// 'key' => 'module',
+ // 'key' => 'module',
));
}
@@ -55,35 +55,35 @@ class edit_xml_file_save extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_NONE;
//$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting result as needed
+ // Do the job, setting result as needed
- if (!data_submitted()) { ///Basic prevention
+ if (!data_submitted()) { // Basic prevention
print_error('wrongcall', 'error');
}
- /// Get parameters
+ // Get parameters
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
$comment = required_param('comment', PARAM_CLEAN);
$comment = $comment;
- /// Set comment and recalculate hash
+ // Set comment and recalculate hash
$editeddir =& $XMLDB->editeddirs[$dirpath];
$structure =& $editeddir->xml_file->getStructure();
$structure->setComment($comment);
$structure->calculateHash(true);
- /// If the hash has changed from the original one, change the version
- /// and mark the structure as changed
+ // If the hash has changed from the original one, change the version
+ // and mark the structure as changed
$origdir =& $XMLDB->dbdirs[$dirpath];
$origstructure =& $origdir->xml_file->getStructure();
if ($structure->getHash() != $origstructure->getHash()) {
@@ -91,12 +91,12 @@ class edit_xml_file_save extends XMLDBAction {
$structure->setChanged(true);
}
- /// Launch postaction if exists (leave this here!)
+ // Launch postaction if exists (leave this here!)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
- /// Return ok if arrived here
+ // Return ok if arrived here
return $result;
}
}
diff --git a/admin/tool/xmldb/actions/generate_all_documentation/generate_all_documentation.class.php b/admin/tool/xmldb/actions/generate_all_documentation/generate_all_documentation.class.php
index 8865a57c6e0..14fd5d6effd 100644
--- a/admin/tool/xmldb/actions/generate_all_documentation/generate_all_documentation.class.php
+++ b/admin/tool/xmldb/actions/generate_all_documentation/generate_all_documentation.class.php
@@ -38,10 +38,10 @@ class generate_all_documentation extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
$this->sesskey_protected = false; // This action doesn't need sesskey protection
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
'backtomainview' => 'tool_xmldb',
'documentationintro' => 'tool_xmldb',
@@ -59,15 +59,15 @@ class generate_all_documentation extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting $result as needed
+ // Do the job, setting $result as needed
- /// Add link back to home
+ // Add link back to home
$b = '
';
@@ -115,7 +115,7 @@ class generate_all_documentation extends XMLDBAction {
$this->output.=get_string('extensionrequired','tool_xmldb','xsl');
}
- /// Launch postaction if exists (leave this unmodified)
+ // Launch postaction if exists (leave this unmodified)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
diff --git a/admin/tool/xmldb/actions/generate_documentation/generate_documentation.class.php b/admin/tool/xmldb/actions/generate_documentation/generate_documentation.class.php
index d4373b65b71..4436a88ebcf 100644
--- a/admin/tool/xmldb/actions/generate_documentation/generate_documentation.class.php
+++ b/admin/tool/xmldb/actions/generate_documentation/generate_documentation.class.php
@@ -37,10 +37,10 @@ class generate_documentation extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
$this->sesskey_protected = false; // This action doesn't need sesskey protection
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
'backtomainview' => 'tool_xmldb',
'documentationintro' => 'tool_xmldb'
@@ -57,15 +57,15 @@ class generate_documentation extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting $result as needed
+ // Do the job, setting $result as needed
- /// Get the dir containing the file
+ // Get the dir containing the file
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
$path = $dirpath.'/install.xml';
@@ -73,7 +73,7 @@ class generate_documentation extends XMLDBAction {
return false;
}
- /// Add link back to home
+ // Add link back to home
$b = '
';
@@ -85,7 +85,7 @@ class generate_documentation extends XMLDBAction {
$this->output.=$c;
if(class_exists('XSLTProcessor')) {
- /// Transform XML file and display it
+ // Transform XML file and display it
$doc = new DOMDocument();
$xsl = new XSLTProcessor();
@@ -99,7 +99,7 @@ class generate_documentation extends XMLDBAction {
$this->output.=get_string('extensionrequired','tool_xmldb','xsl');
}
- /// Launch postaction if exists (leave this unmodified)
+ // Launch postaction if exists (leave this unmodified)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
diff --git a/admin/tool/xmldb/actions/get_db_directories/get_db_directories.class.php b/admin/tool/xmldb/actions/get_db_directories/get_db_directories.class.php
index b820e148af8..db6ed82339c 100644
--- a/admin/tool/xmldb/actions/get_db_directories/get_db_directories.class.php
+++ b/admin/tool/xmldb/actions/get_db_directories/get_db_directories.class.php
@@ -37,16 +37,16 @@ class get_db_directories extends XMLDBAction {
*/
function init() {
parent::init();
- /// Set own core attributes
+ // Set own core attributes
$this->can_subaction = ACTION_NONE;
//$this->can_subaction = ACTION_HAVE_SUBACTIONS;
- /// Set own custom attributes
+ // Set own custom attributes
$this->sesskey_protected = false; // This action doesn't need sesskey protection
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
- /// 'key' => 'module',
+ // 'key' => 'module',
));
}
@@ -60,22 +60,22 @@ class get_db_directories extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_NONE;
//$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting $result as needed
+ // Do the job, setting $result as needed
- /// Lets go to add all the db directories available inside Moodle
- /// Create the array if it doesn't exists
+ // Lets go to add all the db directories available inside Moodle
+ // Create the array if it doesn't exists
if (!isset($XMLDB->dbdirs)) {
$XMLDB->dbdirs = array();
}
- /// get list of all dirs and create objects with status
+ // get list of all dirs and create objects with status
$db_directories = get_db_directories();
foreach ($db_directories as $path) {
$dbdir = new stdClass;
@@ -86,10 +86,10 @@ class get_db_directories extends XMLDBAction {
$XMLDB->dbdirs[$dbdir->path]->path_exists = file_exists($dbdir->path); //Update status
}
- /// Sort by key
+ // Sort by key
ksort($XMLDB->dbdirs);
- /// Return ok if arrived here
+ // Return ok if arrived here
return true;
}
}
diff --git a/admin/tool/xmldb/actions/load_xml_file/load_xml_file.class.php b/admin/tool/xmldb/actions/load_xml_file/load_xml_file.class.php
index a34cd03a443..cf03bf711a5 100644
--- a/admin/tool/xmldb/actions/load_xml_file/load_xml_file.class.php
+++ b/admin/tool/xmldb/actions/load_xml_file/load_xml_file.class.php
@@ -36,16 +36,16 @@ class load_xml_file extends XMLDBAction {
*/
function init() {
parent::init();
- /// Set own core attributes
+ // Set own core attributes
$this->can_subaction = ACTION_NONE;
//$this->can_subaction = ACTION_HAVE_SUBACTIONS;
- /// Set own custom attributes
+ // Set own custom attributes
$this->sesskey_protected = false; // This action doesn't need sesskey protection
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
- /// 'key' => 'module',
+ // 'key' => 'module',
));
}
@@ -59,43 +59,43 @@ class load_xml_file extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_NONE;
//$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting $result as needed
+ // Do the job, setting $result as needed
- /// Get the dir containing the file
+ // Get the dir containing the file
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
- /// Get the correct dir
+ // Get the correct dir
if (!empty($XMLDB->dbdirs)) {
$dbdir =& $XMLDB->dbdirs[$dirpath];
if ($dbdir) {
- /// Set some defaults
+ // Set some defaults
$dbdir->xml_exists = false;
$dbdir->xml_writeable = false;
$dbdir->xml_loaded = false;
- ///Only if the directory exists
+ // Only if the directory exists
if (!$dbdir->path_exists) {
return false;
}
$xmldb_file = new xmldb_file($dbdir->path . '/install.xml');
- ///Set the XML DTD and schema
+ // Set the XML DTD and schema
$xmldb_file->setDTD($CFG->dirroot . '/lib/xmldb/xmldb.dtd');
$xmldb_file->setSchema($CFG->dirroot . '/lib/xmldb/xmldb.xsd');
- /// Set dbdir as necessary
+ // Set dbdir as necessary
if ($xmldb_file->fileExists()) {
$dbdir->xml_exists = true;
}
if ($xmldb_file->fileWriteable()) {
$dbdir->xml_writeable = true;
}
- /// Load the XML contents to structure
+ // Load the XML contents to structure
$loaded = $xmldb_file->loadXMLStructure();
if ($loaded && $xmldb_file->isLoaded()) {
$dbdir->xml_loaded = true;
@@ -110,7 +110,7 @@ class load_xml_file extends XMLDBAction {
$this->errormsg = 'XMLDB structure not found';
$result = false;
}
- /// Launch postaction if exists
+ // Launch postaction if exists
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
diff --git a/admin/tool/xmldb/actions/load_xml_files/load_xml_files.class.php b/admin/tool/xmldb/actions/load_xml_files/load_xml_files.class.php
index 4c0b9baa034..967a5d45ef5 100644
--- a/admin/tool/xmldb/actions/load_xml_files/load_xml_files.class.php
+++ b/admin/tool/xmldb/actions/load_xml_files/load_xml_files.class.php
@@ -36,15 +36,15 @@ class load_xml_files extends XMLDBAction {
*/
function init() {
parent::init();
- /// Set own core attributes
+ // Set own core attributes
$this->can_subaction = ACTION_NONE;
//$this->can_subaction = ACTION_HAVE_SUBACTIONS;
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
- /// 'key' => 'module',
+ // 'key' => 'module',
));
}
@@ -58,36 +58,36 @@ class load_xml_files extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_NONE;
//$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting $result as needed
+ // Do the job, setting $result as needed
- /// Iterate over $XMLDB->dbdirs, loading their XML data to memory
+ // Iterate over $XMLDB->dbdirs, loading their XML data to memory
if ($XMLDB->dbdirs) {
$dbdirs =& $XMLDB->dbdirs;
foreach ($dbdirs as $dbdir) {
- /// Set some defaults
+ // Set some defaults
$dbdir->xml_exists = false;
$dbdir->xml_writeable = false;
$dbdir->xml_loaded = false;
- ///Only if the directory exists
+ // Only if the directory exists
if (!$dbdir->path_exists) {
continue;
}
$xmldb_file = new xmldb_file($dbdir->path . '/install.xml');
- /// Set dbdir as necessary
+ // Set dbdir as necessary
if ($xmldb_file->fileExists()) {
$dbdir->xml_exists = true;
}
if ($xmldb_file->fileWriteable()) {
$dbdir->xml_writeable = true;
}
- /// Load the XML contents to structure
+ // Load the XML contents to structure
$loaded = $xmldb_file->loadXMLStructure();
if ($loaded && $xmldb_file->isLoaded()) {
$dbdir->xml_loaded = true;
diff --git a/admin/tool/xmldb/actions/main_view/main_view.class.php b/admin/tool/xmldb/actions/main_view/main_view.class.php
index 73d6b9f7395..c8feb613396 100644
--- a/admin/tool/xmldb/actions/main_view/main_view.class.php
+++ b/admin/tool/xmldb/actions/main_view/main_view.class.php
@@ -40,10 +40,10 @@ class main_view extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
$this->sesskey_protected = false; // This action doesn't need sesskey protection
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
'load' => 'tool_xmldb',
'create' => 'tool_xmldb',
@@ -75,62 +75,62 @@ class main_view extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB, $SESSION, $DB;
- /// Get lastused
+ // Get lastused
$o = '';
if (isset($SESSION->lastused)) {
if ($lastused = $SESSION->lastused) {
- /// Print link
+ // Print link
$o .= '
';
- /// Send buttons to output
+ // Send buttons to output
$o .= $b;
- /// Do the job
+ // Do the job
- /// Get the list of DB directories
+ // Get the list of DB directories
$result = $this->launch('get_db_directories');
- /// Display list of DB directories if everything is ok
+ // Display list of DB directories if everything is ok
if ($result && !empty($XMLDB->dbdirs)) {
$o .= '
';
$row = 0;
foreach ($XMLDB->dbdirs as $key => $dbdir) {
- /// Detect if this is the lastused dir
+ // Detect if this is the lastused dir
$hithis = false;
if (str_replace($CFG->dirroot, '', $key) == $lastused) {
$hithis = true;
}
$elementtext = str_replace($CFG->dirroot . '/', '', $key);
- /// Calculate the dbdir has_changed field if needed
+ // Calculate the dbdir has_changed field if needed
if (!isset($dbdir->has_changed) && isset($dbdir->xml_loaded)) {
$dbdir->xml_changed = false;
if (isset($XMLDB->editeddirs[$key])) {
@@ -144,7 +144,7 @@ class main_view extends XMLDBAction {
}
}
}
- /// The file name (link to edit if the file is loaded)
+ // The file name (link to edit if the file is loaded)
if ($dbdir->path_exists &&
file_exists($key . '/install.xml') &&
is_readable($key . '/install.xml') &&
@@ -154,9 +154,9 @@ class main_view extends XMLDBAction {
} else {
$f = $elementtext;
}
- /// Calculate the buttons
+ // Calculate the buttons
$b = '
';
- /// The create button
+ // The create button
if ($dbdir->path_exists &&
!file_exists($key . '/install.xml') &&
is_writeable($key)) {
@@ -165,7 +165,7 @@ class main_view extends XMLDBAction {
$b .= '[' . $this->str['create'] . ']';
}
$b .= '
';
- /// The save button
+ // The save button
if ($dbdir->path_exists &&
file_exists($key . '/install.xml') &&
is_writeable($key . '/install.xml') &&
@@ -194,9 +194,9 @@ class main_view extends XMLDBAction {
!empty($dbdir->xml_loaded) &&
!empty($dbdir->xml_changed)) {
$b .= '[' . $this->str['save'] . ']';
- /// Check if the file has been manually edited while being modified in the editor
+ // Check if the file has been manually edited while being modified in the editor
if ($dbdir->filemtime != filemtime($key . '/install.xml')) {
- /// File manually modified. Add to errors.
+ // File manually modified. Add to errors.
if ($structure =& $dbdir->xml_file->getStructure()) {
$structure->errormsg = 'Warning: File locally modified while using the XMLDB Editor. Saving will overwrite local changes';
}
@@ -205,7 +205,7 @@ class main_view extends XMLDBAction {
$b .= '[' . $this->str['save'] . ']';
}
$b .= '
';
- /// include the higlight
+ // include the higlight
if ($hithis) {
$o .= '
' . $f . '
' . $b . '
';
} else {
$o .= '
' . $f . '
' . $b . '
';
}
$row = ($row + 1) % 2;
- /// show errors if they exist
+ // show errors if they exist
if (isset($dbdir->xml_file)) {
if ($structure =& $dbdir->xml_file->getStructure()) {
if ($errors = $structure->getAllErrors()) {
@@ -277,8 +277,8 @@ class main_view extends XMLDBAction {
}
}
}
- /// TODO: Drop this check in Moodle 2.1
- /// Intercept loaded structure here and look for ENUM fields
+ // TODO: Drop this check in Moodle 2.1
+ // Intercept loaded structure here and look for ENUM fields
if (isset($dbdir->xml_file)) {
if ($structure =& $dbdir->xml_file->getStructure()) {
if ($tables = $structure->getTables()) {
@@ -311,7 +311,7 @@ class main_view extends XMLDBAction {
}
}
}
- /// If there are changes pending to be saved, but the file cannot be written... inform here
+ // If there are changes pending to be saved, but the file cannot be written... inform here
if ($dbdir->path_exists &&
file_exists($key . '/install.xml') &&
!empty($dbdir->xml_loaded) &&
@@ -329,11 +329,11 @@ class main_view extends XMLDBAction {
}
$o .= '
';
- /// Set the output
+ // Set the output
$this->output = $o;
}
- /// Finally, return result
+ // Finally, return result
return $result;
}
}
diff --git a/admin/tool/xmldb/actions/move_updown_field/move_updown_field.class.php b/admin/tool/xmldb/actions/move_updown_field/move_updown_field.class.php
index b024e0933cf..042ed094e6b 100644
--- a/admin/tool/xmldb/actions/move_updown_field/move_updown_field.class.php
+++ b/admin/tool/xmldb/actions/move_updown_field/move_updown_field.class.php
@@ -37,11 +37,11 @@ class move_updown_field extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
- /// 'key' => 'module',
+ // 'key' => 'module',
));
}
@@ -55,19 +55,19 @@ class move_updown_field extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_NONE;
//$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting result as needed
- /// Get the dir containing the file
+ // Do the job, setting result as needed
+ // Get the dir containing the file
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
- /// Get the correct dirs
+ // Get the correct dirs
if (!empty($XMLDB->dbdirs)) {
$dbdir =& $XMLDB->dbdirs[$dirpath];
} else {
@@ -77,7 +77,7 @@ class move_updown_field extends XMLDBAction {
$editeddir =& $XMLDB->editeddirs[$dirpath];
$structure =& $editeddir->xml_file->getStructure();
}
- /// ADD YOUR CODE HERE
+
$prev = NULL;
$next = NULL;
$tableparam = required_param('table', PARAM_CLEAN);
@@ -94,7 +94,7 @@ class move_updown_field extends XMLDBAction {
$field =& $table->getField($swap->getPrevious());
}
- /// Change the field before the pair
+ // Change the field before the pair
if ($field->getPrevious()) {
$prev =& $table->getField($field->getPrevious());
$prev->setNext($swap->getName());
@@ -103,7 +103,7 @@ class move_updown_field extends XMLDBAction {
} else {
$swap->setPrevious(NULL);
}
- /// Change the field after the pair
+ // Change the field after the pair
if ($swap->getNext()) {
$next =& $table->getField($swap->getNext());
$next->setPrevious($field->getName());
@@ -112,37 +112,37 @@ class move_updown_field extends XMLDBAction {
} else {
$field->setNext(NULL);
}
- /// Swap the fields
+ // Swap the fields
$field->setPrevious($swap->getName());
$swap->setNext($field->getName());
- /// Mark fields as changed
+ // Mark fields as changed
$field->setChanged(true);
$swap->setChanged(true);
- /// Table has changed
+ // Table has changed
$table->setChanged(true);
- /// Reorder the fields
+ // Reorder the fields
$table->orderFields($fields);
- /// Recalculate the hash
+ // Recalculate the hash
$structure->calculateHash(true);
- /// If the hash has changed from the original one, change the version
- /// and mark the structure as changed
+ // If the hash has changed from the original one, change the version
+ // and mark the structure as changed
$origstructure =& $dbdir->xml_file->getStructure();
if ($structure->getHash() != $origstructure->getHash()) {
$structure->setVersion(userdate(time(), '%Y%m%d', 99, false));
$structure->setChanged(true);
}
- /// Launch postaction if exists (leave this here!)
+ // Launch postaction if exists (leave this here!)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
- /// Return ok if arrived here
+ // Return ok if arrived here
return $result;
}
}
diff --git a/admin/tool/xmldb/actions/move_updown_index/move_updown_index.class.php b/admin/tool/xmldb/actions/move_updown_index/move_updown_index.class.php
index a96cb6a8fc1..083d34c30f8 100644
--- a/admin/tool/xmldb/actions/move_updown_index/move_updown_index.class.php
+++ b/admin/tool/xmldb/actions/move_updown_index/move_updown_index.class.php
@@ -37,11 +37,11 @@ class move_updown_index extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
- /// 'key' => 'module',
+ // 'key' => 'module',
));
}
@@ -55,19 +55,19 @@ class move_updown_index extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_NONE;
//$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting result as needed
- /// Get the dir containing the file
+ // Do the job, setting result as needed
+ // Get the dir containing the file
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
- /// Get the correct dirs
+ // Get the correct dirs
if (!empty($XMLDB->dbdirs)) {
$dbdir =& $XMLDB->dbdirs[$dirpath];
} else {
@@ -77,7 +77,7 @@ class move_updown_index extends XMLDBAction {
$editeddir =& $XMLDB->editeddirs[$dirpath];
$structure =& $editeddir->xml_file->getStructure();
}
- /// ADD YOUR CODE HERE
+
$prev = NULL;
$next = NULL;
$tableparam = required_param('table', PARAM_CLEAN);
@@ -94,7 +94,7 @@ class move_updown_index extends XMLDBAction {
$index =& $table->getIndex($swap->getPrevious());
}
- /// Change the index before the pair
+ // Change the index before the pair
if ($index->getPrevious()) {
$prev =& $table->getIndex($index->getPrevious());
$prev->setNext($swap->getName());
@@ -103,7 +103,7 @@ class move_updown_index extends XMLDBAction {
} else {
$swap->setPrevious(NULL);
}
- /// Change the field after the pair
+ // Change the field after the pair
if ($swap->getNext()) {
$next =& $table->getIndex($swap->getNext());
$next->setPrevious($index->getName());
@@ -112,37 +112,37 @@ class move_updown_index extends XMLDBAction {
} else {
$index->setNext(NULL);
}
- /// Swap the indexes
+ // Swap the indexes
$index->setPrevious($swap->getName());
$swap->setNext($index->getName());
- /// Mark indexes as changed
+ // Mark indexes as changed
$index->setChanged(true);
$swap->setChanged(true);
- /// Table has changed
+ // Table has changed
$table->setChanged(true);
- /// Reorder the indexes
+ // Reorder the indexes
$table->orderIndexes($indexes);
- /// Recalculate the hash
+ // Recalculate the hash
$structure->calculateHash(true);
- /// If the hash has changed from the original one, change the version
- /// and mark the structure as changed
+ // If the hash has changed from the original one, change the version
+ // and mark the structure as changed
$origstructure =& $dbdir->xml_file->getStructure();
if ($structure->getHash() != $origstructure->getHash()) {
$structure->setVersion(userdate(time(), '%Y%m%d', 99, false));
$structure->setChanged(true);
}
- /// Launch postaction if exists (leave this here!)
+ // Launch postaction if exists (leave this here!)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
- /// Return ok if arrived here
+ // Return ok if arrived here
return $result;
}
}
diff --git a/admin/tool/xmldb/actions/move_updown_key/move_updown_key.class.php b/admin/tool/xmldb/actions/move_updown_key/move_updown_key.class.php
index 3b981ce2f9f..018b344437e 100644
--- a/admin/tool/xmldb/actions/move_updown_key/move_updown_key.class.php
+++ b/admin/tool/xmldb/actions/move_updown_key/move_updown_key.class.php
@@ -37,11 +37,11 @@ class move_updown_key extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
- /// 'key' => 'module',
+ // 'key' => 'module',
));
}
@@ -55,19 +55,19 @@ class move_updown_key extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_NONE;
//$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting result as needed
- /// Get the dir containing the file
+ // Do the job, setting result as needed
+ // Get the dir containing the file
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
- /// Get the correct dirs
+ // Get the correct dirs
if (!empty($XMLDB->dbdirs)) {
$dbdir =& $XMLDB->dbdirs[$dirpath];
} else {
@@ -77,7 +77,7 @@ class move_updown_key extends XMLDBAction {
$editeddir =& $XMLDB->editeddirs[$dirpath];
$structure =& $editeddir->xml_file->getStructure();
}
- /// ADD YOUR CODE HERE
+
$prev = NULL;
$next = NULL;
$tableparam = required_param('table', PARAM_CLEAN);
@@ -94,7 +94,7 @@ class move_updown_key extends XMLDBAction {
$key =& $table->getKey($swap->getPrevious());
}
- /// Change the key before the pair
+ // Change the key before the pair
if ($key->getPrevious()) {
$prev =& $table->getKey($key->getPrevious());
$prev->setNext($swap->getName());
@@ -103,7 +103,7 @@ class move_updown_key extends XMLDBAction {
} else {
$swap->setPrevious(NULL);
}
- /// Change the key after the pair
+ // Change the key after the pair
if ($swap->getNext()) {
$next =& $table->getKey($swap->getNext());
$next->setPrevious($key->getName());
@@ -112,37 +112,37 @@ class move_updown_key extends XMLDBAction {
} else {
$key->setNext(NULL);
}
- /// Swap the keys
+ // Swap the keys
$key->setPrevious($swap->getName());
$swap->setNext($key->getName());
- /// Mark keys as changed
+ // Mark keys as changed
$key->setChanged(true);
$swap->setChanged(true);
- /// Table has changed
+ // Table has changed
$table->setChanged(true);
- /// Reorder the keys
+ // Reorder the keys
$table->orderKeys($keys);
- /// Recalculate the hash
+ // Recalculate the hash
$structure->calculateHash(true);
- /// If the hash has changed from the original one, change the version
- /// and mark the structure as changed
+ // If the hash has changed from the original one, change the version
+ // and mark the structure as changed
$origstructure =& $dbdir->xml_file->getStructure();
if ($structure->getHash() != $origstructure->getHash()) {
$structure->setVersion(userdate(time(), '%Y%m%d', 99, false));
$structure->setChanged(true);
}
- /// Launch postaction if exists (leave this here!)
+ // Launch postaction if exists (leave this here!)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
- /// Return ok if arrived here
+ // Return ok if arrived here
return $result;
}
}
diff --git a/admin/tool/xmldb/actions/move_updown_table/move_updown_table.class.php b/admin/tool/xmldb/actions/move_updown_table/move_updown_table.class.php
index fb70771a4fb..6af0ae41536 100644
--- a/admin/tool/xmldb/actions/move_updown_table/move_updown_table.class.php
+++ b/admin/tool/xmldb/actions/move_updown_table/move_updown_table.class.php
@@ -37,11 +37,11 @@ class move_updown_table extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
- /// 'key' => 'module',
+ // 'key' => 'module',
));
}
@@ -55,19 +55,19 @@ class move_updown_table extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_NONE;
//$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting result as needed
- /// Get the dir containing the file
+ // Do the job, setting result as needed
+ // Get the dir containing the file
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
- /// Get the correct dirs
+ // Get the correct dirs
if (!empty($XMLDB->dbdirs)) {
$dbdir =& $XMLDB->dbdirs[$dirpath];
} else {
@@ -77,7 +77,7 @@ class move_updown_table extends XMLDBAction {
$editeddir =& $XMLDB->editeddirs[$dirpath];
$structure =& $editeddir->xml_file->getStructure();
}
- /// ADD YOUR CODE HERE
+
$prev = NULL;
$next = NULL;
$tableparam = required_param('table', PARAM_CLEAN);
@@ -91,7 +91,7 @@ class move_updown_table extends XMLDBAction {
$table =& $structure->getTable($swap->getPrevious());
}
- /// Change the table before the pair
+ // Change the table before the pair
if ($table->getPrevious()) {
$prev =& $structure->getTable($table->getPrevious());
$prev->setNext($swap->getName());
@@ -100,7 +100,7 @@ class move_updown_table extends XMLDBAction {
} else {
$swap->setPrevious(NULL);
}
- /// Change the table after the pair
+ // Change the table after the pair
if ($swap->getNext()) {
$next =& $structure->getTable($swap->getNext());
$next->setPrevious($table->getName());
@@ -109,34 +109,34 @@ class move_updown_table extends XMLDBAction {
} else {
$table->setNext(NULL);
}
- /// Swap the tables
+ // Swap the tables
$table->setPrevious($swap->getName());
$swap->setNext($table->getName());
- /// Table has changed
+ // Table has changed
$table->setChanged(true);
- /// Reorder the structure
+ // Reorder the structure
$structure->orderTables($tables);
- /// Send tables back to structure (the order above break refs)
+ // Send tables back to structure (the order above break refs)
$structure->setTables($tables);
- /// Recalculate the hash
+ // Recalculate the hash
$structure->calculateHash(true);
- /// If the hash has changed from the original one, change the version
- /// and mark the structure as changed
+ // If the hash has changed from the original one, change the version
+ // and mark the structure as changed
$origstructure =& $dbdir->xml_file->getStructure();
if ($structure->getHash() != $origstructure->getHash()) {
$structure->setVersion(userdate(time(), '%Y%m%d', 99, false));
$structure->setChanged(true);
}
- /// Launch postaction if exists (leave this here!)
+ // Launch postaction if exists (leave this here!)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
- /// Return ok if arrived here
+ // Return ok if arrived here
return $result;
}
}
diff --git a/admin/tool/xmldb/actions/new_field/new_field.class.php b/admin/tool/xmldb/actions/new_field/new_field.class.php
index 18fcb593099..6e8ff0f07ac 100644
--- a/admin/tool/xmldb/actions/new_field/new_field.class.php
+++ b/admin/tool/xmldb/actions/new_field/new_field.class.php
@@ -37,11 +37,11 @@ class new_field extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
- /// 'key' => 'module',
+ // 'key' => 'module',
));
}
@@ -55,19 +55,19 @@ class new_field extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_NONE;
//$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting result as needed
- /// Get the dir containing the file
+ // Do the job, setting result as needed
+ // Get the dir containing the file
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
- /// Get the correct dirs
+ // Get the correct dirs
if (!empty($XMLDB->dbdirs)) {
$dbdir =& $XMLDB->dbdirs[$dirpath];
} else {
@@ -77,34 +77,33 @@ class new_field extends XMLDBAction {
$editeddir =& $XMLDB->editeddirs[$dirpath];
$structure =& $editeddir->xml_file->getStructure();
}
- /// ADD YOUR CODE HERE
- $tableparam = required_param('table', PARAM_CLEAN);
+ $tableparam = required_param('table', PARAM_CLEAN);
- $table =& $structure->getTable($tableparam);
+ $table =& $structure->getTable($tableparam);
- /// If the changeme field exists, just get it and continue
+ // If the changeme field exists, just get it and continue
$changeme_exists = false;
if ($fields =& $table->getFields()) {
if ($field =& $table->getField('changeme')) {
$changeme_exists = true;
}
}
- if (!$changeme_exists) { /// Lets create the field
+ if (!$changeme_exists) { // Lets create the field
$field = new xmldb_field('changeme');
$table->addField($field);
- /// We have one new field, so the structure has changed
+ // We have one new field, so the structure has changed
$structure->setVersion(userdate(time(), '%Y%m%d', 99, false));
$structure->setChanged(true);
}
- /// Launch postaction if exists (leave this here!)
+ // Launch postaction if exists (leave this here!)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
- /// Return ok if arrived here
+ // Return ok if arrived here
return $result;
}
}
diff --git a/admin/tool/xmldb/actions/new_index/new_index.class.php b/admin/tool/xmldb/actions/new_index/new_index.class.php
index 839c5c3b541..500ff96d37c 100644
--- a/admin/tool/xmldb/actions/new_index/new_index.class.php
+++ b/admin/tool/xmldb/actions/new_index/new_index.class.php
@@ -37,11 +37,11 @@ class new_index extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
- /// 'key' => 'module',
+ // 'key' => 'module',
));
}
@@ -55,19 +55,19 @@ class new_index extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_NONE;
//$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting result as needed
- /// Get the dir containing the file
+ // Do the job, setting result as needed
+ // Get the dir containing the file
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
- /// Get the correct dirs
+ // Get the correct dirs
if (!empty($XMLDB->dbdirs)) {
$dbdir =& $XMLDB->dbdirs[$dirpath];
} else {
@@ -77,33 +77,32 @@ class new_index extends XMLDBAction {
$editeddir =& $XMLDB->editeddirs[$dirpath];
$structure =& $editeddir->xml_file->getStructure();
}
- /// ADD YOUR CODE HERE
- $tableparam = required_param('table', PARAM_CLEAN);
+ $tableparam = required_param('table', PARAM_CLEAN);
- $table =& $structure->getTable($tableparam);
+ $table =& $structure->getTable($tableparam);
- /// If the changeme index exists, just get it and continue
+ // If the changeme index exists, just get it and continue
$changeme_exists = false;
if ($indexes =& $table->getIndexes()) {
if ($index =& $table->getIndex('changeme')) {
$changeme_exists = true;
}
}
- if (!$changeme_exists) { /// Lets create the Index
+ if (!$changeme_exists) { // Lets create the Index
$index = new xmldb_index('changeme');
$table->addIndex($index);
- /// We have one new key, so the structure has changed
+ // We have one new key, so the structure has changed
$structure->setVersion(userdate(time(), '%Y%m%d', 99, false));
$structure->setChanged(true);
}
- /// Launch postaction if exists (leave this here!)
+ // Launch postaction if exists (leave this here!)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
- /// Return ok if arrived here
+ // Return ok if arrived here
return $result;
}
}
diff --git a/admin/tool/xmldb/actions/new_key/new_key.class.php b/admin/tool/xmldb/actions/new_key/new_key.class.php
index f2c165bfb0a..e19aa720323 100644
--- a/admin/tool/xmldb/actions/new_key/new_key.class.php
+++ b/admin/tool/xmldb/actions/new_key/new_key.class.php
@@ -37,11 +37,11 @@ class new_key extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
- /// 'key' => 'module',
+ // 'key' => 'module',
));
}
@@ -55,19 +55,19 @@ class new_key extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_NONE;
//$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting result as needed
- /// Get the dir containing the file
+ // Do the job, setting result as needed
+ // Get the dir containing the file
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
- /// Get the correct dirs
+ // Get the correct dirs
if (!empty($XMLDB->dbdirs)) {
$dbdir =& $XMLDB->dbdirs[$dirpath];
} else {
@@ -77,33 +77,32 @@ class new_key extends XMLDBAction {
$editeddir =& $XMLDB->editeddirs[$dirpath];
$structure =& $editeddir->xml_file->getStructure();
}
- /// ADD YOUR CODE HERE
- $tableparam = required_param('table', PARAM_CLEAN);
+ $tableparam = required_param('table', PARAM_CLEAN);
- $table =& $structure->getTable($tableparam);
+ $table =& $structure->getTable($tableparam);
- /// If the changeme key exists, just get it and continue
+ // If the changeme key exists, just get it and continue
$changeme_exists = false;
if ($keys =& $table->getKeys()) {
if ($key =& $table->getKey('changeme')) {
$changeme_exists = true;
}
}
- if (!$changeme_exists) { /// Lets create the Key
+ if (!$changeme_exists) { // Lets create the Key
$key = new xmldb_key('changeme');
$table->addKey($key);
- /// We have one new key, so the structure has changed
+ // We have one new key, so the structure has changed
$structure->setVersion(userdate(time(), '%Y%m%d', 99, false));
$structure->setChanged(true);
}
- /// Launch postaction if exists (leave this here!)
+ // Launch postaction if exists (leave this here!)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
- /// Return ok if arrived here
+ // Return ok if arrived here
return $result;
}
}
diff --git a/admin/tool/xmldb/actions/new_table/new_table.class.php b/admin/tool/xmldb/actions/new_table/new_table.class.php
index c2572bad41c..bb34696d5a7 100644
--- a/admin/tool/xmldb/actions/new_table/new_table.class.php
+++ b/admin/tool/xmldb/actions/new_table/new_table.class.php
@@ -37,11 +37,11 @@ class new_table extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
- /// 'key' => 'module',
+ // 'key' => 'module',
));
}
@@ -55,19 +55,19 @@ class new_table extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_NONE;
//$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB;
- /// Do the job, setting result as needed
- /// Get the dir containing the file
+ // Do the job, setting result as needed
+ // Get the dir containing the file
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
- /// Get the correct dirs
+ // Get the correct dirs
if (!empty($XMLDB->dbdirs)) {
$dbdir =& $XMLDB->dbdirs[$dirpath];
} else {
@@ -77,16 +77,15 @@ class new_table extends XMLDBAction {
$editeddir =& $XMLDB->editeddirs[$dirpath];
$structure =& $editeddir->xml_file->getStructure();
}
- /// ADD YOUR CODE HERE
- /// If the changeme table exists, just get it and continue
+ // If the changeme table exists, just get it and continue
$changeme_exists = false;
if ($tables =& $structure->getTables()) {
if ($table =& $structure->getTable('changeme')) {
$changeme_exists = true;
}
}
- if (!$changeme_exists) { /// Lets create the table
+ if (!$changeme_exists) { // Lets create the table
$field = new xmldb_field('id');
$field->setType(XMLDB_TYPE_INTEGER);
$field->setLength(10);
@@ -107,16 +106,16 @@ class new_table extends XMLDBAction {
$table->addField($field);
$table->addKey($key);
- /// Finally, add the whole retrofitted table to the structure
- /// in the place specified
+ // Finally, add the whole retrofitted table to the structure
+ // in the place specified
$structure->addTable($table);
}
- /// Launch postaction if exists (leave this here!)
+ // Launch postaction if exists (leave this here!)
if ($this->getPostAction() && $result) {
return $this->launch($this->getPostAction());
}
- /// Return ok if arrived here
+ // Return ok if arrived here
return $result;
}
}
diff --git a/admin/tool/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php b/admin/tool/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php
index 7b9103b25ca..1473cc45267 100644
--- a/admin/tool/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php
+++ b/admin/tool/xmldb/actions/new_table_from_mysql/new_table_from_mysql.class.php
@@ -38,9 +38,9 @@ class new_table_from_mysql extends XMLDBAction {
function init() {
parent::init();
- /// Set own custom attributes
+ // Set own custom attributes
- /// Get needed strings
+ // Get needed strings
$this->loadStrings(array(
'createtable' => 'tool_xmldb',
'aftertable' => 'tool_xmldb',
@@ -59,18 +59,18 @@ class new_table_from_mysql extends XMLDBAction {
$result = true;
- /// Set own core attributes
+ // Set own core attributes
$this->does_generate = ACTION_GENERATE_HTML;
- /// These are always here
+ // These are always here
global $CFG, $XMLDB, $DB, $OUTPUT;
- /// Do the job, setting result as needed
- /// Get the dir containing the file
+ // Do the job, setting result as needed
+ // Get the dir containing the file
$dirpath = required_param('dir', PARAM_PATH);
$dirpath = $CFG->dirroot . $dirpath;
- /// Get the correct dirs
+ // Get the correct dirs
if (!empty($XMLDB->dbdirs)) {
$dbdir =& $XMLDB->dbdirs[$dirpath];
} else {
@@ -80,14 +80,14 @@ class new_table_from_mysql extends XMLDBAction {
$editeddir =& $XMLDB->editeddirs[$dirpath];
$structure =& $editeddir->xml_file->getStructure();
}
- /// ADD YOUR CODE HERE
+
$tableparam = optional_param('table', NULL, PARAM_CLEAN);
- /// If no table, show form
+ // If no table, show form
if (!$tableparam) {
- /// No postaction here
+ // No postaction here
$this->postaction = NULL;
- /// Get list of tables
+ // Get list of tables
$dbtables = $DB->get_tables();
$selecttables = array();
foreach ($dbtables as $dbtable) {
@@ -96,7 +96,7 @@ class new_table_from_mysql extends XMLDBAction {
$selecttables[$dbtable] = $dbtable;
}
}
- /// Get list of after tables
+ // Get list of after tables
$aftertables = array();
if ($tables =& $structure->getTables()) {
foreach ($tables as $aftertable) {
@@ -107,7 +107,7 @@ class new_table_from_mysql extends XMLDBAction {
$this->errormsg = 'No tables available to be retrofitted';
return false;
}
- /// Now build the form
+ // Now build the form
$o = '