mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 20:57:26 +02:00
Speed up admin Plugin-Manager page refresh. Add support for e_help() function.
This commit is contained in:
@@ -91,6 +91,7 @@ e107::coreLan('plugin', true);
|
|||||||
$e_sub_cat = 'plug_manage';
|
$e_sub_cat = 'plug_manage';
|
||||||
|
|
||||||
define('PLUGIN_SHOW_REFRESH', FALSE);
|
define('PLUGIN_SHOW_REFRESH', FALSE);
|
||||||
|
define('PLUGIN_SCAN_INTERVAL', 900);
|
||||||
|
|
||||||
global $user_pref;
|
global $user_pref;
|
||||||
|
|
||||||
@@ -205,6 +206,15 @@ $pman->pluginObserver();
|
|||||||
$mes = e107::getMessage();
|
$mes = e107::getMessage();
|
||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
|
|
||||||
|
function e_help()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
'caption' => "Scan for Changes",
|
||||||
|
'text' => "Plugin folders are scanned every ".(PLUGIN_SCAN_INTERVAL / 60) ." minutes for changes. Click the button below to scan now.
|
||||||
|
<p><a class='btn btn-mini btn-primary' href='".e_SELF."?refresh'>Refresh</a></p>"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
require_once("footer.php");
|
require_once("footer.php");
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@@ -319,8 +329,13 @@ class pluginManager{
|
|||||||
{
|
{
|
||||||
$this -> pluginUninstall();
|
$this -> pluginUninstall();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($this->action == "refresh")
|
||||||
|
{
|
||||||
|
$this -> pluginCheck(true); // forced
|
||||||
|
}
|
||||||
|
|
||||||
if($this->action == "install")
|
if($this->action == "install" || $this->action == "refresh")
|
||||||
{
|
{
|
||||||
$this -> pluginInstall();
|
$this -> pluginInstall();
|
||||||
$this -> action = "installed";
|
$this -> action = "installed";
|
||||||
@@ -894,10 +909,18 @@ class pluginManager{
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
// Check for new plugins, create entry in plugin table ...
|
// Check for new plugins, create entry in plugin table ...
|
||||||
function pluginCheck()
|
function pluginCheck($force=false)
|
||||||
{
|
{
|
||||||
global $plugin;
|
global $plugin;
|
||||||
$plugin->update_plugins_table('update');
|
|
||||||
|
if((time() > vartrue($_SESSION['nextPluginFolderScan'],0)) || $force == true)
|
||||||
|
{
|
||||||
|
$plugin->update_plugins_table('update');
|
||||||
|
}
|
||||||
|
|
||||||
|
$_SESSION['nextPluginFolderScan'] = time() + 360;
|
||||||
|
//echo "TIME = ".$_SESSION['nextPluginFolderScan'];
|
||||||
|
|
||||||
}
|
}
|
||||||
// ----------------------------------------------------------
|
// ----------------------------------------------------------
|
||||||
// render plugin information ...
|
// render plugin information ...
|
||||||
|
@@ -57,10 +57,18 @@ class admin_shortcodes
|
|||||||
function sc_admin_help()
|
function sc_admin_help()
|
||||||
{
|
{
|
||||||
if (!ADMIN) { return ''; }
|
if (!ADMIN) { return ''; }
|
||||||
|
|
||||||
|
$ns = e107::getRender();
|
||||||
|
$pref = e107::getPref();
|
||||||
|
|
||||||
|
if(function_exists('e_help')) // new in v2.x for non-admin-ui admin pages.
|
||||||
|
{
|
||||||
|
$tmp = e_help();
|
||||||
|
return $ns->tablerender($tmp['caption'],$tmp['text'],'',true);
|
||||||
|
}
|
||||||
|
|
||||||
$helpfile = '';
|
$helpfile = '';
|
||||||
global $ns, $pref; // Used by the help renderer
|
|
||||||
|
|
||||||
if(strpos(e_SELF, e_ADMIN_ABS) !== FALSE)
|
if(strpos(e_SELF, e_ADMIN_ABS) !== FALSE)
|
||||||
{
|
{
|
||||||
if (is_readable(e_LANGUAGEDIR.e_LANGUAGE.'/admin/help/'.e_PAGE))
|
if (is_readable(e_LANGUAGEDIR.e_LANGUAGE.'/admin/help/'.e_PAGE))
|
||||||
|
Reference in New Issue
Block a user