]> git.mjollnir.org Git - moodle.git/commitdiff
Some fixes to avoid notices etc
authormoodler <moodler>
Sat, 29 Jan 2005 03:55:29 +0000 (03:55 +0000)
committermoodler <moodler>
Sat, 29 Jan 2005 03:55:29 +0000 (03:55 +0000)
blocks/html/block_html.php
blocks/html/config_instance.html

index 20b4c5680581360b0c288fac0e962f3f0028f064..f0af17a9f65888cdf69ff8539f254fb2ed30444a 100755 (executable)
@@ -9,10 +9,8 @@ class block_html extends block_base {
     }
 
     function specialization() {
-        // Does not check if $this->config or $this->config->title
-        // are empty because if they are then the user wishes the title
-        // of the block to be hidden anyway
-        $this->title = $this->config->title;
+        // We allow empty titles
+        $this->title = isset($this->config->title) ? $this->config->title : '';
     }
 
     function instance_allow_multiple() {
@@ -27,7 +25,7 @@ class block_html extends block_base {
         }
 
         $this->content = new stdClass;
-        $this->content->text = $this->config->text;
+        $this->content->text = isset($this->config->text) ? $this->config->text : '';
         $this->content->footer = '';
 
         return $this->content;
index 965b5a2fc9e5f3051b4c4f909ec0142ac607bfb7..876ad9728cf56a37467e46054bc34c0ba71f482b 100755 (executable)
@@ -1,3 +1,4 @@
+<?php $usehtmleditor = can_use_html_editor(); ?>
 <table cellpadding="9" cellspacing="0">
 <tr valign="top">
     <td align="right"><p><?php print_string('configtitle', 'block_html'); ?>:</td>
@@ -5,11 +6,14 @@
 </tr>
 <tr valign="top">
     <td align="right"><p><?php print_string('configcontent', 'block_html'); ?>:</td>
-    <td><?php print_textarea(true, 10, 50, 0, 0, 'text', $this->config->text); ?></td>
+    <td><?php print_textarea($usehtmleditor, 10, 50, 0, 0, 'text', isset($this->config->text)?$this->config->text:'') ?></td>
 </tr>
 <tr>
     <td colspan="3" align="center">
     <input type="submit" value="<?php print_string('savechanges') ?>" /></td>
 </tr>
 </table>
-<?php use_html_editor(); ?>
\ No newline at end of file
+<?php if ($usehtmleditor) {
+          use_html_editor(); 
+      }
+?>