mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-26 11:19:55 +03:00
fixes #1591 specific processing for piwigo-openstreetmap and piwigo-videojs
This commit is contained in:
parent
61a4259b41
commit
4acfca116b
4 changed files with 20 additions and 0 deletions
|
@ -104,6 +104,12 @@ $change_theme_url.= 'change_theme=1';
|
|||
if (isset($_GET['page']) and preg_match('/^plugin-([^-]*)(?:-(.*))?$/', $_GET['page'], $matches))
|
||||
{
|
||||
$_GET['page'] = 'plugin';
|
||||
|
||||
if (preg_match('/^piwigo_(videojs|openstreetmap)$/', $matches[1]))
|
||||
{
|
||||
$matches[1] = str_replace('_', '-', $matches[1]);
|
||||
}
|
||||
|
||||
$_GET['section'] = $matches[1].'/admin.php';
|
||||
if (isset($matches[2]))
|
||||
{
|
||||
|
|
|
@ -74,6 +74,10 @@ class plugins
|
|||
$file_to_include = PHPWG_PLUGINS_PATH . $plugin_id . '/maintain';
|
||||
$classname = $plugin_id.'_maintain';
|
||||
|
||||
// piwigo-videojs and piwigo-openstreetmap unfortunately have a "-" in their folder
|
||||
// name (=plugin_id) and a class name can't have a "-". So we have to replace with a "_"
|
||||
$classname = str_replace('-', '_', $classname);
|
||||
|
||||
// 2.7 pattern (OO only)
|
||||
if (file_exists($file_to_include.'.class.php'))
|
||||
{
|
||||
|
|
|
@ -97,6 +97,11 @@ foreach($plugins->fs_plugins as $plugin_id => $fs_plugin)
|
|||
$setting_url = $settings_url_for_plugin_deprec[$plugin_id];
|
||||
} else if ($fs_plugin['hasSettings']) { // new version
|
||||
$setting_url = "admin.php?page=plugin-".$plugin_id;
|
||||
|
||||
if (preg_match('/^piwigo-(videojs|openstreetmap)$/', $plugin_id))
|
||||
{
|
||||
$setting_url = str_replace('piwigo-', 'piwigo_', $setting_url);
|
||||
}
|
||||
}
|
||||
|
||||
$tpl_plugin = array(
|
||||
|
|
|
@ -398,6 +398,11 @@ function autoupdate_plugin(&$plugin)
|
|||
include_once($maintain_file);
|
||||
|
||||
$classname = $plugin['id'].'_maintain';
|
||||
|
||||
// piwigo-videojs and piwigo-openstreetmap unfortunately have a "-" in their folder
|
||||
// name (=plugin_id) and a class name can't have a "-". So we have to replace with a "_"
|
||||
$classname = str_replace('-', '_', $classname);
|
||||
|
||||
$plugin_maintain = new $classname($plugin['id']);
|
||||
$plugin_maintain->update($plugin['version'], $fs_version, $page['errors']);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue