]> git.mjollnir.org Git - moodle.git/commitdiff
Small patches while I contemplate rewriting all those patches from scratch
authormoodler <moodler>
Tue, 21 Mar 2006 08:04:15 +0000 (08:04 +0000)
committermoodler <moodler>
Tue, 21 Mar 2006 08:04:15 +0000 (08:04 +0000)
blog/class.BlogEntry.php
blog/edit.html
blog/tags.php

index 0e2edb000b4c588aece8c4f36c5c7a9d234b7a62..0df5000dd0e12df0eeda7bbe366d95d9ae861a18 100755 (executable)
@@ -68,13 +68,9 @@ class BlogEntry {
      */
     function BlogEntry(&$entrydetails) {
         global $db, $CFG;
-//        print_object($entrydetails); //debug
 
         $this->entryId = $entrydetails->id;
 
-//        print "Debug: entryId: $this->entryId"; //debug
-//        print_object($this->entryCategoryIds); //debug
-        
         $this->entryBody = ereg_replace('<tick>', "'", stripslashes_safe($entrydetails->summary));
         
         $strftimedaydatetime = get_string('strftimedaydatetime');
@@ -96,9 +92,14 @@ class BlogEntry {
         } else {
             $this->entryPublishState = 'draft';
         }
-        $this->entryAuthorName = fullname($entrydetails);  // firstname and lastname defined
-        $this->entryAuthorEmail = $entrydetails->email;
-
+        if (isset($entrydetails->email)) {
+            $this->entryAuthorEmail = $entrydetails->email;
+            $this->entryAuthorName = fullname($entrydetails);  // firstname and lastname defined
+        } else {
+            $user = get_record('user', 'id', $entrydetails->userid);
+            $this->entryAuthorEmail = $user->email;
+            $this->entryAuthorName = fullname($user); 
+        }
     }
 
     /**
index 65b5153f1010bf5d5e913ace9585097ec7ec3a2a..d8c9a7b3e76104e588649f91780f7d9441c385d5 100755 (executable)
@@ -49,7 +49,7 @@
      ?>
     </td>
 </tr>
-<tr>
+<tr valign="top">
     <td align="right">
         <strong><?php print_string('tags'); echo ':';?></strong>
     </td>
                     }
                 ?>
                 </select>
+    <?php link_to_popup_window("/blog/tags.php",'popup',get_string('tagmanagement')); ?>
                 </td>
             </tr>
         </table>
-    <?php
-    link_to_popup_window("/blog/tags.php",'popup',get_string('tagmanagement'));
-    ?>
     </td>
 </tr>
 
     </small></small>              
     </td>
     <td align="left" colspan="2">
-    <?php
-        print_string('entrybodyonlydesc', 'blog');
-        print '<br />'."\n";
-        // usage: print_textarea($usehtmleditor, $rows, $cols, $width, $height, $name, $value="", $courseid)
-        print_textarea($usehtmleditor, 6, 60, 600, 500, 'body', $post->body, $post->courseid); ?>
+    <?php print_textarea($usehtmleditor, 25, 62, 500, 600, 'body', $post->body, $post->courseid); ?>
     </td>
 </tr>
 <tr valign="top">
index 38495ca7f77248ee222942db99af0821e4c6b57f..ce4157b94a26d46778bc3f549efb33a1da8fa6df 100755 (executable)
@@ -23,7 +23,7 @@ switch ($mode) {
             opener.document.entry[\'otags[]\'].insertBefore(o, null);
             </script>';
         } else {
-            error ('there is already a tag with this name!');
+            notify(get_string('tagalready'));
         }
 
     break;
@@ -45,7 +45,7 @@ switch ($mode) {
             opener.document.entry[\'ptags[]\'].insertBefore(o, null);
             </script>';
         } else {
-            error ('there is already a tag with this name!');
+            notify(get_string('tagalready'));
         }
         //write back to window.opener
     break;