Nothing special at all. Unnamed sidebar blocks will show the text <Unnamed> instead of just showing nothing, thus making them renamable
authorDan
Sun, 21 Oct 2007 21:26:11 -0400
changeset 202 88d7a7c2743c
parent 201 2303ef648290
child 203 8e2fffc5c622
Nothing special at all. Unnamed sidebar blocks will show the text <Unnamed> instead of just showing nothing, thus making them renamable
includes/clientside/sbedit.js
plugins/SpecialAdmin.php
--- a/includes/clientside/sbedit.js	Sun Oct 21 02:33:25 2007 -0400
+++ b/includes/clientside/sbedit.js	Sun Oct 21 21:26:11 2007 -0400
@@ -164,7 +164,7 @@
   var id = input.sbedit_id;
   var parent = input.parentNode;
   parent.removeChild(input);
-  parent.appendChild(document.createTextNode(newname));
+  parent.appendChild(document.createTextNode(( newname == '' ? '<Unnamed>' : newname )));
   parent.ondblclick = function() { ajaxRenameSidebarStage1(this, this._idcache); return false; };
   var img = document.createElement('img');
   img.src = scriptPath + '/images/loading.gif';
--- a/plugins/SpecialAdmin.php	Sun Oct 21 02:33:25 2007 -0400
+++ b/plugins/SpecialAdmin.php	Sun Oct 21 21:26:11 2007 -0400
@@ -3194,7 +3194,10 @@
           $c = ($template->fetch_block($row['block_content'])) ? $template->fetch_block($row['block_content']) : 'Can\'t find plugin block';
           break;
       }
-      $t = '<span title="Double-click to rename this block" id="sbrename_' . $row['item_id'] . '" ondblclick="ajaxRenameSidebarStage1(this, \''.$row['item_id'].'\'); return false;">' . $template->tplWikiFormat($row['block_name']) . '</span>';
+      $block_name = $template->tplWikiFormat($row['block_name']);
+      if ( empty($block_name) )
+        $block_name = '&lt;Unnamed&gt;';
+      $t = '<span title="Double-click to rename this block" id="sbrename_' . $row['item_id'] . '" ondblclick="ajaxRenameSidebarStage1(this, \''.$row['item_id'].'\'); return false;">' . $block_name . '</span>';
       if($row['item_enabled'] == 0) $t .= ' <span id="disabled_'.$row['item_id'].'" style="color: red;">(disabled)</span>';
       else           $t .= ' <span id="disabled_'.$row['item_id'].'" style="color: red; display: none;">(disabled)</span>';
       $side = ( $row['sidebar_id'] == SIDEBAR_LEFT ) ? SIDEBAR_RIGHT : SIDEBAR_LEFT;