Fixed a couple bugs with read-only mode and protected pages in the AJAX editor
authorDan
Tue, 25 Aug 2009 01:43:11 -0400
changeset 1102 faef5e62e1e0
parent 1080 6358f769ecb1
child 1103 90225c988124
Fixed a couple bugs with read-only mode and protected pages in the AJAX editor
ajax.php
includes/clientside/static/editor.js
--- a/ajax.php	Wed Aug 19 01:28:47 2009 -0400
+++ b/ajax.php	Tue Aug 25 01:43:11 2009 -0400
@@ -61,7 +61,7 @@
         $src = '';
       }
       
-      $auth_edit = ( $session->get_permissions('edit_page') && ( $session->get_permissions('even_when_protected') || !$paths->page_protected ) );
+      $auth_edit = ( $session->get_permissions('edit_page') && ( $session->get_permissions('even_when_protected') || !$page->ns->page_protected ) );
       $auth_wysiwyg = ( $session->get_permissions('edit_wysiwyg') );
       
       $return = array(
--- a/includes/clientside/static/editor.js	Wed Aug 19 01:28:47 2009 -0400
+++ b/includes/clientside/static/editor.js	Tue Aug 25 01:43:11 2009 -0400
@@ -441,7 +441,8 @@
   form.appendChild(preview_anchor);
   form.appendChild(preview_container);
   form.appendChild(ta_wrapper);
-  form.appendChild(tblholder);
+  if ( !readonly )
+    form.appendChild(tblholder);
   form.innerHTML += '<div style="margin: 10px 0 0 0;">' + toolbar + '</div>';
   edcon.appendChild(form);