]> git.mjollnir.org Git - moodle.git/commitdiff
Fixing drift between CVS and git
authorMoodle HQ git importer <gitimport@cvs.moodle.org>
Thu, 7 May 2009 00:35:40 +0000 (00:35 +0000)
committerMoodle HQ git importer <gitimport@cvs.moodle.org>
Thu, 7 May 2009 00:35:40 +0000 (00:35 +0000)
mod/lesson/action/addcluster.php
mod/lesson/action/addendofbranch.php
mod/lesson/action/addendofcluster.php
mod/lesson/action/insertpage.php
mod/lesson/action/updatepage.php
mod/lesson/restorelib.php

index 1735e11d42be9d4ab7548a0741faf56bf13bc50d..224acd3649ce881b066122fa4a0de42e5349eeae 100644 (file)
@@ -38,9 +38,7 @@
     $newpageid = $DB->insert_record("lesson_pages", $newpage);
     // update the linked list...
     if ($pageid != 0) {
-        if (!$DB->set_field("lesson_pages", "nextpageid", $newpageid, array("id" => $pageid))) {
-            print_error('cannotupdatelink', 'lesson');
-        }
+        $DB->set_field("lesson_pages", "nextpageid", $newpageid, array("id" => $pageid));
     }
     
     if ($pageid == 0) {
@@ -48,9 +46,7 @@
     }        
     if ($page->nextpageid) {
         // the new page is not the last page
-        if (!$DB->set_field("lesson_pages", "prevpageid", $newpageid, array("id" => $page->nextpageid))) {
-            print_error('cannotupdatelink', 'lesson');
-        }
+        $DB->set_field("lesson_pages", "prevpageid", $newpageid, array("id" => $page->nextpageid));
     }
     // ..and the single "answer"
     $newanswer = new stdClass;
index a052aa7fca47ca654f0a9ca98779490c1282dcc1..96799673c0c71c3fc019d2a15621f4a951fdbc00 100644 (file)
         $newpage->contents = get_string("endofbranch", "lesson");
         $newpageid = $DB->insert_record("lesson_pages", $newpage);
         // update the linked list...
-        if (!$DB->set_field("lesson_pages", "nextpageid", $newpageid, array("id" => $pageid))) {
-            print_error('cannotupdatelink', 'lesson');
-        }
+        $DB->set_field("lesson_pages", "nextpageid", $newpageid, array("id" => $pageid));
         if ($page->nextpageid) {
             // the new page is not the last page
-            if (!$DB->set_field("lesson_pages", "prevpageid", $newpageid, array("id" => $page->nextpageid))) {
-                print_error('cannotupdatelink', 'lesson');
-            }
+            $DB->set_field("lesson_pages", "prevpageid", $newpageid, array("id" => $page->nextpageid));
         }
         // ..and the single "answer"
         $newanswer = new stdClass;
index 15fff40ad6ac5674862387869230d00fdcc94eed..cbbc7a365e5c10ebd58be076e106cd90f78b59d4 100644 (file)
     $newpage->contents = get_string("endofclustertitle", "lesson");
     $newpageid = $DB->insert_record("lesson_pages", $newpage);
     // update the linked list...
-    if (!$DB->set_field("lesson_pages", "nextpageid", $newpageid, array("id" => $pageid))) {
-        print_error('cannotupdatelink', 'lesson');
-    }
+    $DB->set_field("lesson_pages", "nextpageid", $newpageid, array("id" => $pageid));
     if ($page->nextpageid) {
         // the new page is not the last page
-        if (!$DB->set_field("lesson_pages", "prevpageid", $newpageid, array("id" => $page->nextpageid))) {
-            print_error('cannotupdatelink', 'lesson');
-        }
+        $DB->set_field("lesson_pages", "prevpageid", $newpageid, array("id" => $page->nextpageid));
     }
     // ..and the single "answer"
     $newanswer = new stdClass;
index 4f9d37fbcb852feae52bfaf3409fd19f8dee9f82..231ee07b02ae2b0aaec72fdf598c78a5eaa23fa0 100644 (file)
             $newpage->contents = trim($form->contents);
             $newpage->title = $newpage->title;
             $newpageid = $DB->insert_record("lesson_pages", $newpage);
-            if (!$newpageid) {
-                print_error('cannotfindfirstpage', 'lesson');
-            }
             // update the linked list
-            if (!$DB->set_field("lesson_pages", "prevpageid", $newpageid, array("id" => $newpage->nextpageid))) {
-                print_error('cannotupdatelink', 'lesson');
-            }
+            $DB->set_field("lesson_pages", "prevpageid", $newpageid, array("id" => $newpage->nextpageid));
         }
     }
     // now add the answers
index 85eab4e7f66fb2c6d872f553c473ca2ba493002c..2f268d38846fd9df6540cfac4dbc0595c0417c3b 100644 (file)
@@ -47,9 +47,7 @@
     $page->contents = trim($form->contents);
     $page->title = $page->title;
     
-    if (!$DB->update_record("lesson_pages", $page)) {
-        print_error('cannotupdatepage', 'lesson');
-    }
+    $DB->update_record("lesson_pages", $page);
     if ($page->qtype == LESSON_ENDOFBRANCH || $page->qtype == LESSON_ESSAY || $page->qtype == LESSON_CLUSTER || $page->qtype == LESSON_ENDOFCLUSTER) {
         // there's just a single answer with a jump
         $oldanswer = new stdClass;
index c71e3902e31fe20950772feb7967e5bfc9b897a7..5e6a904b43ea27cc06762ef539b5ff2268021d66 100644 (file)
 
             //Fix the forwards link of the previous page
             if ($prevpageid) {
-                if (!$DB->set_field("lesson_pages", "nextpageid", $newid, array("id"=>$prevpageid))) {
-                    print_error('cannotupdatepage', 'lesson');
-                }
+                $DB->set_field("lesson_pages", "nextpageid", $newid, array("id"=>$prevpageid));
             }
             $prevpageid = $newid;
 
                     // change the absolute page id
                     $page = backup_getid($restore->backup_unique_code,"lesson_pages",$answer->jumpto);
                     if ($page) {
-                        if (!$DB->set_field("lesson_answers", "jumpto", $page->new_id, array("id"=>$answer->id))) {
-                            print_error('cannotresetjump', 'lesson');
-                        }
+                        $DB->set_field("lesson_answers", "jumpto", $page->new_id, array("id"=>$answer->id));
                     }
                 }
             }