From ba27a025a4f2883997644d84fa74b80c4fae0792 Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Mon, 30 May 2005 08:51:51 +0000 Subject: [PATCH] Fix spartacus problems with dependant plugins in the same path --- docs/NEWS | 3 +++ .../serendipity_event_spartacus.php | 20 +++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/docs/NEWS b/docs/NEWS index 68acb18..2de06b0 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,9 @@ Version 0.9 () ------------------------------------------------------------------------ + * Spartacus plugin can now properly handle plugins which contain both + sidebar and event plugins in one directory (garvinhicking) + * TEMPLATES: Added div.serendipity_section_(comments|trackbacks|commentform) containers inside the Default Template's entries.tpl file to be able to customize certain containers via CSS. diff --git a/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php b/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php index ca58fef..b9bd09e 100644 --- a/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php +++ b/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php @@ -23,7 +23,7 @@ switch ($serendipity['lang']) { @define('PLUGIN_EVENT_SPARTACUS_FETCHING', 'Versuche URL %s zu öffnen...'); @define('PLUGIN_EVENT_SPARTACUS_FETCHED_BYTES_URL', '%s bytes von obiger URL geladen. Speichere Inhalt als %s...'); @define('PLUGIN_EVENT_SPARTACUS_FETCHED_BYTES_CACHE', '%s bytes von bereits bestehender Datei geladen. Speichere Inhalt als %s...'); - @define('PLUGIN_EVENT_SPARTACUS_FETCHED_DONE', 'Data successfully fetched.'); + @define('PLUGIN_EVENT_SPARTACUS_FETCHED_DONE', 'Daten erfolgreich geladen.'); break; case 'en': @@ -51,7 +51,7 @@ class serendipity_event_spartacus extends serendipity_event $propbag->add('description', PLUGIN_EVENT_SPARTACUS_DESC); $propbag->add('stackable', false); $propbag->add('author', 'Garvin Hicking'); - $propbag->add('version', '1.1'); + $propbag->add('version', '1.2'); $propbag->add('requirements', array( 'serendipity' => '0.8', 'smarty' => '2.6.7', @@ -335,6 +335,14 @@ class serendipity_event_spartacus extends serendipity_event $target = $pdir . $file; @mkdir($pdir . $plugin_to_install); $this->fetchfile($url, $target); + if (!isset($baseDir)) { + $baseDirs = explode('/', $file); + $baseDir = $baseDirs[0]; + } + } + + if (isset($baseDir)) { + return $baseDir; } } @@ -376,8 +384,12 @@ class serendipity_event_spartacus extends serendipity_event case 'backend_plugins_fetchplugin': if (!empty($eventData['GET']['spartacus_fetch'])) { - $this->download($this->fetchOnline($eventData['GET']['spartacus_fetch']), $eventData['GET']['install_plugin']); - $eventData['GET']['pluginPath'] = $eventData['GET']['install_plugin']; + $baseDir = $this->download($this->fetchOnline($eventData['GET']['spartacus_fetch']), $eventData['GET']['install_plugin']); + if (!empty($baseDir)) { + $eventData['GET']['pluginPath'] = $baseDir; + } else { + $eventData['GET']['pluginPath'] = $eventData['GET']['install_plugin']; + } if ($eventData['GET']['spartacus_upgrade']) { $eventData['install'] = false; -- 2.39.5