]> git.mjollnir.org Git - moodle.git/commitdiff
Added JS template field for JavaScript if needed
authormoodler <moodler>
Thu, 17 Aug 2006 09:02:56 +0000 (09:02 +0000)
committermoodler <moodler>
Thu, 17 Aug 2006 09:02:56 +0000 (09:02 +0000)
mod/data/backuplib.php
mod/data/db/mysql.php
mod/data/db/mysql.sql
mod/data/db/postgres7.php
mod/data/db/postgres7.sql
mod/data/restorelib.php
mod/data/version.php

index 79a1e3750f6f824c41f8ad11a66f11aeca80d44f..952e90fdb41d065f0733191b0b993df01435a88e 100644 (file)
@@ -90,12 +90,13 @@ function data_backup_one_mod($bf,$preferences,$data) {
     fwrite ($bf,full_tag("RSSARTICLES",4,false,$data->rssarticles));
     fwrite ($bf,full_tag("SINGLETEMPLATE",4,false,$data->singletemplate));
     fwrite ($bf,full_tag("LISTTEMPLATE",4,false,$data->listtemplate));
+    fwrite ($bf,full_tag("LISTTEMPLATEHEADER",4,false,$data->listtemplateheader));
+    fwrite ($bf,full_tag("LISTTEMPLATEFOOTER",4,false,$data->listtemplatefooter));
     fwrite ($bf,full_tag("ADDTEMPLATE",4,false,$data->addtemplate));
     fwrite ($bf,full_tag("RSSTEMPLATE",4,false,$data->rsstemplate));
-    fwrite ($bf,full_tag("CSSTEMPLATE",4,false,$data->csstemplate));
     fwrite ($bf,full_tag("RSSTITLETEMPLATE",4,false,$data->rsstitletemplate));
-    fwrite ($bf,full_tag("LISTTEMPLATEHEADER",4,false,$data->listtemplateheader));
-    fwrite ($bf,full_tag("LISTTEMPLATEFOOTER",4,false,$data->listtemplatefooter));
+    fwrite ($bf,full_tag("CSSTEMPLATE",4,false,$data->csstemplate));
+    fwrite ($bf,full_tag("JSTEMPLATE",4,false,$data->jstemplate));
     fwrite ($bf,full_tag("APPROVAL",4,false,$data->approval));
     fwrite ($bf,full_tag("SCALE",4,false,$data->scale));
     fwrite ($bf,full_tag("ASSESSED",4,false,$data->assessed));
index c992c5d4584982ee8a6d4ba2130126f40b54e54b..b5079fca70ba3ece39d892b509f91e9810eee81f 100644 (file)
@@ -67,6 +67,11 @@ function data_upgrade($oldversion) {
     if ($oldversion < 2006052400) {
         table_column('data','','rsstitletemplate','text','','','','not null','rsstemplate');
     }
+
+    if ($oldversion < 2006081700) {
+        table_column('data', '', 'jstemplate', 'text', '', '', '', 'not null', 'csstemplate');
+    }
+
     return true;
 }
 
index d6e74f3bffe0fbfd7d7c9c52e00f2a919e680956..8b2397118b4aebc6eaf31eceac48aa4d22d55ef0 100755 (executable)
@@ -34,6 +34,7 @@ CREATE TABLE prefix_data (
   rsstemplate text NOT NULL default '',
   rsstitletemplate text NOT NULL default '',
   csstemplate text NOT NULL default '',
+  jstemplate text NOT NULL default '',
   approval tinyint(4) unsigned NOT NULL default '0',
   scale int(10) NOT NULL default '0',
   assessed int(10) unsigned NOT NULL default '0',
index 597b4d59dff2624f3b494af665d005b76fd30b17..c923c360aad93b658088e48fd883b58ad499c747 100644 (file)
@@ -151,6 +151,10 @@ function data_upgrade($oldversion) {
     if ($oldversion < 2006052400) {
         table_column('data','','rsstitletemplate','text','','','','not null','rsstemplate');
     }
+
+    if ($oldversion < 2006081700) {
+        table_column('data', '', 'jstemplate', 'text', '', '', '', 'not null', 'csstemplate');
+    }
     
     return true;
 }
index 1e1910ac5434483f6b2189817d7e4cb278641069..e3f735786ba44f163431345a28e38fbb7c9a39c4 100755 (executable)
@@ -23,6 +23,7 @@ CREATE TABLE prefix_data (
   rsstemplate text NOT NULL default '',
   rsstitletemplate text NOT NULL default '',
   csstemplate text NOT NULL default '',
+  jstemplate text NOT NULL default '',
   approval integer NOT NULL default '0',
   scale integer NOT NULL default '0',
   assessed integer NOT NULL default '0',
index 80b149cb6cf55d2ec7ed8e83ad419fc7d0d293d2..080e8dca6bc17c0de76f0bc9e6c8ad47147521c4 100644 (file)
@@ -68,12 +68,13 @@ function data_restore_mods($mod,$restore) {
         $database->rssarticles = backup_todb($info['MOD']['#']['RSSARTICLES']['0']['#']);
         $database->singletemplate = backup_todb($info['MOD']['#']['SINGLETEMPLATE']['0']['#']);
         $database->listtemplate = backup_todb($info['MOD']['#']['LISTTEMPLATE']['0']['#']);
+        $database->listtemplateheader = backup_todb($info['MOD']['#']['LISTTEMPLATEHEADER']['0']['#']);
+        $database->listtemplatefooter = backup_todb($info['MOD']['#']['LISTTEMPLATEFOOTER']['0']['#']);
         $database->addtemplate = backup_todb($info['MOD']['#']['ADDTEMPLATE']['0']['#']);
         $database->rsstemplate = backup_todb($info['MOD']['#']['RSSTEMPLATE']['0']['#']);
-        $database->csstemplate = backup_todb($info['MOD']['#']['CSSTEMPLATE']['0']['#']);
         $database->rsstitletemplate = backup_todb($info['MOD']['#']['RSSTITLETEMPLATE']['0']['#']);
-        $database->listtemplateheader = backup_todb($info['MOD']['#']['LISTTEMPLATEHEADER']['0']['#']);
-        $database->listtemplatefooter = backup_todb($info['MOD']['#']['LISTTEMPLATEFOOTER']['0']['#']);
+        $database->csstemplate = backup_todb($info['MOD']['#']['CSSTEMPLATE']['0']['#']);
+        $database->jstemplate = backup_todb($info['MOD']['#']['JSTEMPLATE']['0']['#']);
         $database->approval = backup_todb($info['MOD']['#']['APPROVAL']['0']['#']);
         $database->scale = backup_todb($info['MOD']['#']['SCALE']['0']['#']);
         $database->assessed = backup_todb($info['MOD']['#']['ASSESSED']['0']['#']);
index 1e54d56e09ae0d82770352ceaf1f42a1737581a4..ab7009d64d43c6de37b1ce3be38743cd3d9d2b80 100644 (file)
@@ -5,7 +5,7 @@
 //  This fragment is called by /admin/index.php
 ////////////////////////////////////////////////////////////////////////////////
 
-$module->version  = 2006080900;
+$module->version  = 2006081700;
 $module->requires = 2006080900;  // Requires this Moodle version
 $module->cron     = 60;