prefs system: load phpinfo using inline method

This commit is contained in:
Andrew Dolgov 2021-02-14 12:29:08 +03:00
parent 6b5c9c781b
commit 1c7e4782aa
3 changed files with 10 additions and 11 deletions

View File

@ -1032,7 +1032,6 @@ class Pref_Prefs extends Handler_Protected {
if (this.domNode.querySelector('.loading'))
window.setTimeout(() => {
xhrPost("backend.php", {op: 'pref-prefs', method: 'index_auth'}, (transport) => {
console.log(this);
this.attr('content', transport.responseText);
});
}, 100);
@ -1047,7 +1046,6 @@ class Pref_Prefs extends Handler_Protected {
if (this.domNode.querySelector('.loading'))
window.setTimeout(() => {
xhrPost("backend.php", {op: 'pref-prefs', method: 'index_plugins'}, (transport) => {
console.log(this);
this.attr('content', transport.responseText);
});
}, 200);

View File

@ -173,10 +173,15 @@ class Pref_System extends Handler_Protected {
</div>
<div dojoType='dijit.layout.AccordionPane' title='<i class="material-icons">info</i> <?= __('PHP Information') ?>'>
<script type='dojo/method' event='onSelected' args='evt'>
Helpers.System.getPHPInfo(this);
</script>
<div class='phpinfo'><?= __("Loading, please wait...") ?></div>
<script type='dojo/method' event='onSelected' args='evt'>
if (this.domNode.querySelector('.loading'))
window.setTimeout(() => {
xhrPost("backend.php", {op: 'pref-system', method: 'getphpinfo'}, (transport) => {
this.attr('content', `<div class='phpinfo'>${transport.responseText}</div>`);
});
}, 200);
</script>
<span class='loading'><?= __("Loading, please wait...") ?></span>
</div>
<?php PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB, "prefSystem") ?>

View File

@ -54,11 +54,7 @@ const Helpers = {
},
},
System: {
getPHPInfo: function(widget) {
xhrPost("backend.php", {op: 'pref-system', method: 'getphpinfo'}, (transport) => {
widget.attr('content', transport.responseText);
});
}
//
},
EventLog: {
log_page: 0,