mirror of
https://github.com/e107inc/e107.git
synced 2025-07-12 02:26:21 +02:00
Fixes #541 - banner plugin to be installed by default on upgrade.
This commit is contained in:
@ -1359,6 +1359,13 @@ function update_706_to_800($type='')
|
|||||||
// e107::getSingleton('e107plugin')->save_addon_prefs(); //XXX Needed? Uncomment if SQL update does not occur.
|
// e107::getSingleton('e107plugin')->save_addon_prefs(); //XXX Needed? Uncomment if SQL update does not occur.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!e107::isInstalled('banner') && $sql->gen("SELECT * FROM #banner LIMIT 1"))
|
||||||
|
{
|
||||||
|
if ($just_check) return update_needed('Banner Table found, but plugin not installed. Needs to be refreshed.');
|
||||||
|
e107::getSingleton('e107plugin')->refresh('banner');
|
||||||
|
// e107::getSingleton('e107plugin')->save_addon_prefs(); //XXX Needed? Uncomment if SQL update does not occur.
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------
|
// ---------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
@ -1537,7 +1537,7 @@ class e107plugin
|
|||||||
|
|
||||||
$p_installed = e107::getPref('plug_installed', array()); // load preference;
|
$p_installed = e107::getPref('plug_installed', array()); // load preference;
|
||||||
|
|
||||||
if ($function == 'install' || $function == 'upgrade')
|
if ($function == 'install' || $function == 'upgrade' || $function == 'refresh')
|
||||||
{
|
{
|
||||||
$sql->update('plugin', "plugin_installflag = 1, plugin_addons = '{$eplug_addons}', plugin_version = '{$plug_vars['@attributes']['version']}', plugin_category ='".$this->manage_category($plug_vars['category'])."' WHERE plugin_id = ".$id);
|
$sql->update('plugin', "plugin_installflag = 1, plugin_addons = '{$eplug_addons}', plugin_version = '{$plug_vars['@attributes']['version']}', plugin_category ='".$this->manage_category($plug_vars['category'])."' WHERE plugin_id = ".$id);
|
||||||
$p_installed[$plug['plugin_path']] = $plug_vars['@attributes']['version'];
|
$p_installed[$plug['plugin_path']] = $plug_vars['@attributes']['version'];
|
||||||
@ -2429,6 +2429,46 @@ class e107plugin
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Refresh Plugin Info, Install flag, e_xxx, ignore existing tables. etc.
|
||||||
|
*
|
||||||
|
* @param int $dir - plugin folder.
|
||||||
|
*/
|
||||||
|
function refresh($dir)
|
||||||
|
{
|
||||||
|
if(empty($dir))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
global $sysprefs, $mySQLprefix;
|
||||||
|
|
||||||
|
$ns = e107::getRender();
|
||||||
|
$sql = e107::getDb();
|
||||||
|
$tp = e107::getParser();
|
||||||
|
|
||||||
|
$plug = $this->getinfo($dir);
|
||||||
|
|
||||||
|
$this->options = array('nolinks'=>true);
|
||||||
|
|
||||||
|
if(!is_array($plug))
|
||||||
|
{
|
||||||
|
return "'{$id}' is missing from the plugin db table";
|
||||||
|
}
|
||||||
|
|
||||||
|
$_path = e_PLUGIN.$plug['plugin_path'].'/';
|
||||||
|
|
||||||
|
if (file_exists($_path.'plugin.xml'))
|
||||||
|
{
|
||||||
|
$text = $this->install_plugin_xml($plug, 'refresh');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$text = EPL_ADLAN_21;
|
||||||
|
|
||||||
|
}
|
||||||
|
return $text;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user