includes/clientside/static/ajax.js
changeset 11 ccad6026a168
parent 1 fe660c52c48f
child 15 ad5986a53197
equal deleted inserted replaced
10:2f530ad04f1b 11:ccad6026a168
   567   }
   567   }
   568   var loc = makeUrlNS('Special', 'Administration', 'module=' + namespace_list['Admin'] + 'PageManager&source=ajax&page_id=' + ajaxEscape(title));
   568   var loc = makeUrlNS('Special', 'Administration', 'module=' + namespace_list['Admin'] + 'PageManager&source=ajax&page_id=' + ajaxEscape(title));
   569   window.location = loc;
   569   window.location = loc;
   570 }
   570 }
   571 
   571 
       
   572 function ajaxDisableEmbeddedPHP()
       
   573 {
       
   574   if ( !confirm('Are you really sure you want to do this? Some pages might not function if this emergency-only feature is activated.') )
       
   575     return false;
       
   576   var $killdiv = $dynano('php_killer');
       
   577   if ( !$killdiv.object )
       
   578   {
       
   579     alert('Can\'t get kill div object');
       
   580     return false;
       
   581   }
       
   582   $killdiv.object.innerHTML = '<img alt="Loading..." src="' + scriptPath + '/images/loading-big.gif" /><br />Making request...';
       
   583   var url = makeUrlNS('Admin', 'Home', 'src=ajax');
       
   584   ajaxPost(url, 'act=kill_php', function() {
       
   585       if ( ajax.readyState == 4 )
       
   586       {
       
   587         if ( ajax.responseText == '1' )
       
   588         {
       
   589           var $killdiv = $dynano('php_killer');
       
   590           //$killdiv.object.innerHTML = '<img alt="Success" src="' + scriptPath + '/images/error.png" /><br />Embedded PHP in pages has been disabled.';
       
   591           $killdiv.object.parentNode.removeChild($killdiv.object);
       
   592           var newdiv = document.createElement('div');
       
   593           // newdiv.style = $killdiv.object.style;
       
   594           newdiv.className = $killdiv.object.className;
       
   595           newdiv.innerHTML = '<img alt="Success" src="' + scriptPath + '/images/error.png" /><br />Embedded PHP in pages has been disabled.';
       
   596           $killdiv.object.parentNode.appendChild(newdiv);
       
   597           $killdiv.object.parentNode.removeChild($killdiv.object);
       
   598         }
       
   599         else
       
   600         {
       
   601           var $killdiv = $dynano('php_killer');
       
   602           $killdiv.object.innerHTML = ajax.responseText;
       
   603         }
       
   604       }
       
   605     });
       
   606 }
       
   607