From 5c7511c7c64f62f44244ba1c9f1aac9952c564e1 Mon Sep 17 00:00:00 2001 From: Jan Klemkow Date: Tue, 9 Oct 2012 15:28:22 +0200 Subject: Rename 'newmodule' into sqlbox in all files. --- sqlbox/db/access.php | 8 ++++---- sqlbox/db/install.php | 6 +++--- sqlbox/db/install.xml | 8 ++++---- sqlbox/db/log.php | 10 +++++----- sqlbox/db/uninstall.php | 4 ++-- sqlbox/db/upgrade.php | 42 +++++++++++++++++++++--------------------- 6 files changed, 39 insertions(+), 39 deletions(-) (limited to 'sqlbox/db') 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 . /** - * 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 * @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 @@ - - +
- + - + 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 * @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 * @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 . /** - * 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 -- cgit