]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-17457 moved all STATEMENTS into install.php
authorskodak <skodak>
Thu, 15 Jan 2009 21:36:48 +0000 (21:36 +0000)
committerskodak <skodak>
Thu, 15 Jan 2009 21:36:48 +0000 (21:36 +0000)
lib/db/install.php
mod/quiz/report/statistics/db/install.php [new file with mode: 0644]
mod/quiz/report/statistics/db/install.xml

index 36da7860a3f6bde630d6904f4adbfc418934d107..b6e0d0f397c5d28c398e96b90f89491c899c1289 100644 (file)
@@ -6,9 +6,6 @@
 function xmldb_main_install() {
     global $CFG, $DB, $SITE;
 
-/// TODO: move all statements from install.xml here
-
-
 /// make sure system context exists
     $syscontext = get_context_instance(CONTEXT_SYSTEM);
     if ($syscontext->id != 1) {
diff --git a/mod/quiz/report/statistics/db/install.php b/mod/quiz/report/statistics/db/install.php
new file mode 100644 (file)
index 0000000..aa193d2
--- /dev/null
@@ -0,0 +1,16 @@
+<?php  //$Id$
+
+// This file is executed right after the install.xml
+//
+
+function xmldb_quizreport_statistics_install() {
+    global $DB;
+
+    $record = new object();
+    $record->name         = 'statistics';
+    $record->displayorder = 8000;
+    $record->cron         = 18000;
+    $record->capability   = 'quizreport/statistics:view';
+    $DB->insert_record('quiz_report', $record);
+
+}
\ No newline at end of file
index d6812e7eacd9dfcaaec52077d31bd0610e574b94..0a1a8d1853a90bacfdfb15543d4d240c2fe4f580 100644 (file)
       </KEYS>
     </TABLE>
   </TABLES>
-  <STATEMENTS>
-    <STATEMENT NAME="insert quiz_report" TYPE="insert" TABLE="quiz_report" COMMENT="Initial insert of records on table quiz_report">
-      <SENTENCES>
-        <SENTENCE TEXT="(name, displayorder, cron, capability) VALUES ('statistics', 8000, 18000, 'quizreport/statistics:view')" />
-      </SENTENCES>
-    </STATEMENT>
-  </STATEMENTS>
 </XMLDB>
\ No newline at end of file