includes/clientside/static/ajax.js
changeset 11 ccad6026a168
parent 1 fe660c52c48f
child 15 ad5986a53197
--- a/includes/clientside/static/ajax.js	Tue Jun 19 18:41:10 2007 -0400
+++ b/includes/clientside/static/ajax.js	Thu Jun 21 12:00:16 2007 -0400
@@ -569,3 +569,39 @@
   window.location = loc;
 }
 
+function ajaxDisableEmbeddedPHP()
+{
+  if ( !confirm('Are you really sure you want to do this? Some pages might not function if this emergency-only feature is activated.') )
+    return false;
+  var $killdiv = $dynano('php_killer');
+  if ( !$killdiv.object )
+  {
+    alert('Can\'t get kill div object');
+    return false;
+  }
+  $killdiv.object.innerHTML = '<img alt="Loading..." src="' + scriptPath + '/images/loading-big.gif" /><br />Making request...';
+  var url = makeUrlNS('Admin', 'Home', 'src=ajax');
+  ajaxPost(url, 'act=kill_php', function() {
+      if ( ajax.readyState == 4 )
+      {
+        if ( ajax.responseText == '1' )
+        {
+          var $killdiv = $dynano('php_killer');
+          //$killdiv.object.innerHTML = '<img alt="Success" src="' + scriptPath + '/images/error.png" /><br />Embedded PHP in pages has been disabled.';
+          $killdiv.object.parentNode.removeChild($killdiv.object);
+          var newdiv = document.createElement('div');
+          // newdiv.style = $killdiv.object.style;
+          newdiv.className = $killdiv.object.className;
+          newdiv.innerHTML = '<img alt="Success" src="' + scriptPath + '/images/error.png" /><br />Embedded PHP in pages has been disabled.';
+          $killdiv.object.parentNode.appendChild(newdiv);
+          $killdiv.object.parentNode.removeChild($killdiv.object);
+        }
+        else
+        {
+          var $killdiv = $dynano('php_killer');
+          $killdiv.object.innerHTML = ajax.responseText;
+        }
+      }
+    });
+}
+