]> git.mjollnir.org Git - moodle.git/commitdiff
removed isset and merged from MOODLE_16_STABLE
authorskodak <skodak>
Sun, 21 May 2006 10:14:17 +0000 (10:14 +0000)
committerskodak <skodak>
Sun, 21 May 2006 10:14:17 +0000 (10:14 +0000)
lib/editor/htmlarea/htmlarea.php

index b2e4697229c42d4b0d6ac381f0aee5bafb934e9b..ab47a482b765e4903b3e4fcbebf82e54cd2b4f8d 100644 (file)
@@ -526,6 +526,7 @@ HTMLArea.prototype._createToolbar = function () {
 
     var first = true;
     for (var i in this.config.toolbar) {
+        if (this.config.toolbar.propertyIsEnumerable(i)) { // fix for prototype.js compatibility
         if (!first) {
             createButton("linebreak");
         } else {
@@ -533,6 +534,7 @@ HTMLArea.prototype._createToolbar = function () {
         }
         var group = this.config.toolbar[i];
         for (var j in group) {
+                if (group.propertyIsEnumerable(j)) { // fix for prototype.js compatibility
             var code = group[j];
             if (/^([IT])\[(.*?)\]/.test(code)) {
                 // special case, create text label
@@ -547,6 +549,8 @@ HTMLArea.prototype._createToolbar = function () {
                 tb_cell.innerHTML = label;
             } else {
                 createButton(code);
+                    }
+                }
             }
         }
     }
@@ -1452,7 +1456,7 @@ HTMLArea.prototype._createLink = function(link) {
         outparam = {
         f_anchors:anchors };
     }
-    this._popupDialog("link_std.php?id=<?php print(isset($id) && !empty($id)) ? $id : ''; ?>", function(param) {
+    this._popupDialog("link_std.php?id=<?php echo $id; ?>", function(param) {
         if (!param) {
             return false;
         }
@@ -1523,16 +1527,10 @@ HTMLArea.prototype._insertImage = function(image) {
         f_height : image.height
     };
     this._popupDialog("<?php
-    if(!empty($id)) {
-        if(isteacher($id)) {
-            echo "insert_image.php?id=";
-            print(isset($id) && !empty($id)) ? $id : "0";
-        } else {
-            echo "insert_image_std.php?id=";
-            print(isset($id) && !empty($id)) ? $id : "0";
-        }
+    if(!empty($id) and isteacher($id)) {
+        echo "insert_image.php?id=$id";
     } else {
-        echo "insert_image_std.php?id=0";
+        echo "insert_image_std.php?id=$id";
     }?>", function(param) {
         if (!param) {   // user must have pressed Cancel
             return false;
@@ -1869,12 +1867,12 @@ HTMLArea.prototype.execCommand = function(cmdID, UI, param) {
         HTMLArea._object = this;
         if (HTMLArea.is_ie) {
             {
-                window.open(this.popupURL("fullscreen.php?id=<?php print(isset($id) && !empty($id)) ? $id : '';?>"), "ha_fullscreen",
+                window.open(this.popupURL("fullscreen.php?id=<?php echo $id;?>"), "ha_fullscreen",
                     "toolbar=no,location=no,directories=no,status=no,menubar=no," +
                         "scrollbars=no,resizable=yes,width=800,height=600");
             }
         } else {
-            window.open(this.popupURL("fullscreen.php?id=<?php print(isset($id) && !empty($id)) ? $id : '';?>"), "ha_fullscreen",
+            window.open(this.popupURL("fullscreen.php?id=<?php echo $id;?>"), "ha_fullscreen",
                     "toolbar=no,menubar=no,personalbar=no,width=800,height=600," +
                     "scrollbars=no,resizable=yes");
         }