]> git.mjollnir.org Git - s9y.git/commitdiff
Make plugin manager fail more gracefully on errors
authorgarvinhicking <garvinhicking>
Fri, 29 Jul 2005 10:01:30 +0000 (10:01 +0000)
committergarvinhicking <garvinhicking>
Fri, 29 Jul 2005 10:01:30 +0000 (10:01 +0000)
include/admin/plugins.inc.php
include/plugin_api.inc.php
plugins/serendipity_event_spartacus/serendipity_event_spartacus.php

index f32c8a9300a642c2dee6005fe8499ef3c4008c91..1488a9c9db6e15640d0ddcfd5878f25404c487ba 100644 (file)
@@ -71,8 +71,9 @@ function show_plugins($event_only = false)
             $is_plugin_editable = ($is_plugin_owner || $plugin_data['authorid'] == '0');
 
             if (!is_object($plugin)) {
-                $name = ERROR . ': ' . $plugin_data['name'];
-                $desc = ERROR . '!';
+                $name = $title = ERROR . '!';
+                $desc          = ERROR . ': ' . $plugin_data['name'];
+                $can_configure = false;
             } else {
                 /* query for its name, description and configuration data */
 
index 707c39f398c441b99007488cce323c23fee39954..8573af297c22599865a244d03823f4a0c32fd747 100644 (file)
@@ -599,9 +599,10 @@ class serendipity_plugin_api {
                                           'title'   => $title,
                                           'content' => $content);
                 }
-            } elseif ($show_plugin !== FALSE) {
+            } else {
                     $pluginData[] = array('side'          => $side,
                                           'title'         => ERROR,
+                                          'class'         => $class,
                                           'content'       => sprintf(INCLUDE_ERROR, $plugin_data['name']));
             }
         }
index 097b405cc109b548c8c0211e5f32891ff9874f05..e536e7108c6cee6a4361361fa29029ee56024d51 100644 (file)
@@ -63,7 +63,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',       '2.01');
+        $propbag->add('version',       '2.02');
         $propbag->add('requirements',  array(
             'serendipity' => '0.9',
             'smarty'      => '2.6.7',
@@ -688,7 +688,10 @@ class serendipity_event_spartacus extends serendipity_event
                 case 'backend_plugins_fetchplugin':
                     if (!empty($eventData['GET']['spartacus_fetch'])) {
                         $baseDir = $this->download($this->fetchOnline($eventData['GET']['spartacus_fetch'], true), $eventData['GET']['install_plugin']);
-                        if (!empty($baseDir)) {
+                        
+                        if ($baseDir === false) {
+                            $eventData['install'] = false;
+                        } elseif (!empty($baseDir)) {
                             $eventData['GET']['pluginPath'] = $baseDir;
                         } else {
                             $eventData['GET']['pluginPath'] = $eventData['GET']['install_plugin'];