diff options
author | Jan Klemkow <j.klemkow@wemelug.de> | 2012-10-09 15:28:22 +0200 |
---|---|---|
committer | Jan Klemkow <j.klemkow@wemelug.de> | 2012-10-09 15:28:22 +0200 |
commit | 5c7511c7c64f62f44244ba1c9f1aac9952c564e1 (patch) | |
tree | 9f10a75a48b2d7df333ada2f6d750dddf430bafb /sqlbox/db | |
parent | 459313e56b0653e4709694a7e86afc11be514097 (diff) | |
download | sqltutor-plugin-5c7511c7c64f62f44244ba1c9f1aac9952c564e1.tar.gz sqltutor-plugin-5c7511c7c64f62f44244ba1c9f1aac9952c564e1.tar.bz2 sqltutor-plugin-5c7511c7c64f62f44244ba1c9f1aac9952c564e1.zip |
Rename 'newmodule' into sqlbox in all files.
Diffstat (limited to 'sqlbox/db')
-rw-r--r-- | sqlbox/db/access.php | 8 | ||||
-rw-r--r-- | sqlbox/db/install.php | 6 | ||||
-rw-r--r-- | sqlbox/db/install.xml | 8 | ||||
-rw-r--r-- | sqlbox/db/log.php | 10 | ||||
-rw-r--r-- | sqlbox/db/uninstall.php | 4 | ||||
-rw-r--r-- | sqlbox/db/upgrade.php | 42 |
6 files changed, 39 insertions, 39 deletions
diff --git a/sqlbox/db/access.php b/sqlbox/db/access.php index 71647d3..9722601 100644 --- a/sqlbox/db/access.php +++ b/sqlbox/db/access.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** - * Capability definitions for the newmodule module + * Capability definitions for the sqlbox module * * The capabilities are loaded into the database table when the module is * installed or updated. Whenever the capability definitions are updated, @@ -41,7 +41,7 @@ * The variable name for the capability definitions array is $capabilities * * @package mod - * @subpackage newmodule + * @subpackage sqlbox * @copyright 2011 Your Name * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -51,7 +51,7 @@ defined('MOODLE_INTERNAL') || die(); $capabilities = array( /***************************** remove these comment marks and modify the code as needed - 'mod/newmodule:view' => array( + 'mod/sqlbox:view' => array( 'captype' => 'read', 'contextlevel' => CONTEXT_MODULE, 'legacy' => array( @@ -63,7 +63,7 @@ $capabilities = array( ) ), - 'mod/newmodule:submit' => array( + 'mod/sqlbox:submit' => array( 'riskbitmask' => RISK_SPAM, 'captype' => 'write', 'contextlevel' => CONTEXT_MODULE, diff --git a/sqlbox/db/install.php b/sqlbox/db/install.php index d81ba97..4b3c1e7 100644 --- a/sqlbox/db/install.php +++ b/sqlbox/db/install.php @@ -20,7 +20,7 @@ * lib.php/modulename_install() post installation hook and partially defaults.php * * @package mod - * @subpackage newmodule + * @subpackage sqlbox * @copyright 2011 Your Name <your@email.adress> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -30,7 +30,7 @@ * * @see upgrade_plugins_modules() */ -function xmldb_newmodule_install() { +function xmldb_sqlbox_install() { } /** @@ -38,5 +38,5 @@ function xmldb_newmodule_install() { * * @see upgrade_plugins_modules() */ -function xmldb_newmodule_install_recovery() { +function xmldb_sqlbox_install_recovery() { } diff --git a/sqlbox/db/install.xml b/sqlbox/db/install.xml index d5d861b..f83ed09 100644 --- a/sqlbox/db/install.xml +++ b/sqlbox/db/install.xml @@ -1,15 +1,15 @@ <?xml version="1.0" encoding="UTF-8" ?> -<XMLDB PATH="mod/newmodule/db" VERSION="20101203" COMMENT="XMLDB file for Moodle mod/newmodule" +<XMLDB PATH="mod/sqlbox/db" VERSION="20101203" COMMENT="XMLDB file for Moodle mod/sqlbox" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd" > <TABLES> - <TABLE NAME="newmodule" COMMENT="Default comment for newmodule, please edit me"> + <TABLE NAME="sqlbox" COMMENT="Default comment for sqlbox, please edit me"> <FIELDS> <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="course"/> - <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="Course newmodule activity belongs to" PREVIOUS="id" NEXT="name"/> + <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="Course sqlbox activity belongs to" PREVIOUS="id" NEXT="name"/> <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="name field for moodle instances" PREVIOUS="course" NEXT="intro"/> - <FIELD NAME="intro" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" COMMENT="General introduction of the newmodule activity" PREVIOUS="name" NEXT="introformat"/> + <FIELD NAME="intro" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" COMMENT="General introduction of the sqlbox activity" PREVIOUS="name" NEXT="introformat"/> <FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Format of the intro field (MOODLE, HTML, MARKDOWN...)" PREVIOUS="intro" NEXT="timecreated"/> <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="introformat" NEXT="timemodified"/> <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timecreated"/> diff --git a/sqlbox/db/log.php b/sqlbox/db/log.php index 73561d7..6ddcc2a 100644 --- a/sqlbox/db/log.php +++ b/sqlbox/db/log.php @@ -23,7 +23,7 @@ * in the previous 1.9 NEWMODULE. * * @package mod - * @subpackage newmodule + * @subpackage sqlbox * @copyright 2011 Your Name <your@email.adress> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -33,8 +33,8 @@ defined('MOODLE_INTERNAL') || die(); global $DB; $logs = array( - array('module'=>'newmodule', 'action'=>'add', 'mtable'=>'newmodule', 'field'=>'name'), - array('module'=>'newmodule', 'action'=>'update', 'mtable'=>'newmodule', 'field'=>'name'), - array('module'=>'newmodule', 'action'=>'view', 'mtable'=>'newmodule', 'field'=>'name'), - array('module'=>'newmodule', 'action'=>'view all', 'mtable'=>'newmodule', 'field'=>'name') + array('module'=>'sqlbox', 'action'=>'add', 'mtable'=>'sqlbox', 'field'=>'name'), + array('module'=>'sqlbox', 'action'=>'update', 'mtable'=>'sqlbox', 'field'=>'name'), + array('module'=>'sqlbox', 'action'=>'view', 'mtable'=>'sqlbox', 'field'=>'name'), + array('module'=>'sqlbox', 'action'=>'view all', 'mtable'=>'sqlbox', 'field'=>'name') ); diff --git a/sqlbox/db/uninstall.php b/sqlbox/db/uninstall.php index 22ad141..cb5f7aa 100644 --- a/sqlbox/db/uninstall.php +++ b/sqlbox/db/uninstall.php @@ -19,7 +19,7 @@ * @see uninstall_plugin() * * @package mod - * @subpackage newmodule + * @subpackage sqlbox * @copyright 2011 Your Name <your@email.adress> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -27,6 +27,6 @@ /** * Custom uninstallation procedure */ -function xmldb_newmodule_uninstall() { +function xmldb_sqlbox_uninstall() { return true; } diff --git a/sqlbox/db/upgrade.php b/sqlbox/db/upgrade.php index 7f74831..1392912 100644 --- a/sqlbox/db/upgrade.php +++ b/sqlbox/db/upgrade.php @@ -16,7 +16,7 @@ // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** - * This file keeps track of upgrades to the newmodule module + * This file keeps track of upgrades to the sqlbox module * * Sometimes, changes between versions involve alterations to database * structures and other major things that may break installations. The upgrade @@ -26,7 +26,7 @@ * here will all be database-neutral, using the functions defined in DLL libraries. * * @package mod - * @subpackage newmodule + * @subpackage sqlbox * @copyright 2011 Your Name * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -34,12 +34,12 @@ defined('MOODLE_INTERNAL') || die(); /** - * Execute newmodule upgrade from the given old version + * Execute sqlbox upgrade from the given old version * * @param int $oldversion * @return bool */ -function xmldb_newmodule_upgrade($oldversion) { +function xmldb_sqlbox_upgrade($oldversion) { global $DB; $dbman = $DB->get_manager(); // loads ddl manager and xmldb classes @@ -55,10 +55,10 @@ function xmldb_newmodule_upgrade($oldversion) { // Lines below (this included) MUST BE DELETED once you get the first version // of your module ready to be installed. They are here only - // for demonstrative purposes and to show how the newmodule + // for demonstrative purposes and to show how the sqlbox // iself has been upgraded. - // For each upgrade block, the file newmodule/version.php + // For each upgrade block, the file sqlbox/version.php // needs to be updated . Such change allows Moodle to know // that this file has to be processed. @@ -71,8 +71,8 @@ function xmldb_newmodule_upgrade($oldversion) { // First example, some fields were added to install.xml on 2007/04/01 if ($oldversion < 2007040100) { - // Define field course to be added to newmodule - $table = new xmldb_table('newmodule'); + // Define field course to be added to sqlbox + $table = new xmldb_table('sqlbox'); $field = new xmldb_field('course', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'id'); // Add field course @@ -80,8 +80,8 @@ function xmldb_newmodule_upgrade($oldversion) { $dbman->add_field($table, $field); } - // Define field intro to be added to newmodule - $table = new xmldb_table('newmodule'); + // Define field intro to be added to sqlbox + $table = new xmldb_table('sqlbox'); $field = new xmldb_field('intro', XMLDB_TYPE_TEXT, 'medium', null, null, null, null,'name'); // Add field intro @@ -89,8 +89,8 @@ function xmldb_newmodule_upgrade($oldversion) { $dbman->add_field($table, $field); } - // Define field introformat to be added to newmodule - $table = new xmldb_table('newmodule'); + // Define field introformat to be added to sqlbox + $table = new xmldb_table('sqlbox'); $field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'intro'); @@ -101,7 +101,7 @@ function xmldb_newmodule_upgrade($oldversion) { // Once we reach this point, we can store the new version and consider the module // upgraded to the version 2007040100 so the next time this block is skipped - upgrade_mod_savepoint(true, 2007040100, 'newmodule'); + upgrade_mod_savepoint(true, 2007040100, 'sqlbox'); } // Second example, some hours later, the same day 2007/04/01 @@ -109,8 +109,8 @@ function xmldb_newmodule_upgrade($oldversion) { // "01" in the last two digits of the version if ($oldversion < 2007040101) { - // Define field timecreated to be added to newmodule - $table = new xmldb_table('newmodule'); + // Define field timecreated to be added to sqlbox + $table = new xmldb_table('sqlbox'); $field = new xmldb_field('timecreated', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'introformat'); @@ -119,8 +119,8 @@ function xmldb_newmodule_upgrade($oldversion) { $dbman->add_field($table, $field); } - // Define field timemodified to be added to newmodule - $table = new xmldb_table('newmodule'); + // Define field timemodified to be added to sqlbox + $table = new xmldb_table('sqlbox'); $field = new xmldb_field('timemodified', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'timecreated'); @@ -129,8 +129,8 @@ function xmldb_newmodule_upgrade($oldversion) { $dbman->add_field($table, $field); } - // Define index course (not unique) to be added to newmodule - $table = new xmldb_table('newmodule'); + // Define index course (not unique) to be added to sqlbox + $table = new xmldb_table('sqlbox'); $index = new xmldb_index('courseindex', XMLDB_INDEX_NOTUNIQUE, array('course')); // Add index to course field @@ -139,7 +139,7 @@ function xmldb_newmodule_upgrade($oldversion) { } // Another save point reached - upgrade_mod_savepoint(true, 2007040101, 'newmodule'); + upgrade_mod_savepoint(true, 2007040101, 'sqlbox'); } // Third example, the next day, 2007/04/02 (with the trailing 00), some actions were performed to install.php, @@ -148,7 +148,7 @@ function xmldb_newmodule_upgrade($oldversion) { // insert here code to perform some actions (same as in install.php) - upgrade_mod_savepoint(true, 2007040200, 'newmodule'); + upgrade_mod_savepoint(true, 2007040200, 'sqlbox'); } // And that's all. Please, examine and understand the 3 example blocks above. Also |