Update of /cvsroot/php-blog/serendipity/include/admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28245/include/admin
Modified Files:
plugins.inc.php
Log Message:
when a plugin fails to load, try to offer removing it
Index: plugins.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/admin/plugins.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- plugins.inc.php 27 Nov 2004 22:14:15 -0000 1.3
+++ plugins.inc.php 3 Dec 2004 14:38:45 -0000 1.4
@@ -37,6 +37,7 @@
</tr>
<?php
$sort_order = 0;
+ $errors = array();
/* Block display the plugins per placement location. */
if ($event_only) {
@@ -57,26 +58,33 @@
$plugin =& serendipity_plugin_api::load_plugin($plugin_data['name'], $plugin_data['authorid']);
$key = urlencode($plugin_data['name']);
- /* query for its name, description and configuration data */
- $bag = new serendipity_property_bag;
- $plugin->introspect($bag);
+ if (!is_object($plugin)) {
+ $name = ERROR . ': ' . $plugin_data['name'];
+ $desc = ERROR . '!';
+ } else {
+ /* query for its name, description and configuration data */
+
+ $bag = new serendipity_property_bag;
+ $plugin->introspect($bag);
+
+ $name = htmlspecialchars($bag->get('name'));
+ $desc = htmlspecialchars($bag->get('description'));
+
+ $title = serendipity_plugin_api::get_plugin_title($plugin, '[' . $name . ']');
+
+ if ($bag->is_set('configuration') && ($plugin->protected === FALSE || $plugin_data['authorid'] == '0' || $plugin_data['authorid'] == $serendipity['authorid'] || $serendipity['serendipityUserlevel'] >= USERLEVEL_ADMIN)) {
+ $url = '?serendipity[adminModule]=plugins&serendipity[plugin_to_conf]=' . $key;
+ $name = '<a href="' . $url . '">' . $name . '</a>';
+ $title = '<a href="' . $url . '">' . $title . '</a>';
+ }
+ }
- $name = htmlspecialchars($bag->get('name'));
- $desc = htmlspecialchars($bag->get('description'));
if ($event_only) {
$place = '<input type="hidden" name="serendipity[placement][' . $plugin_data['name'] . ']" value="event" />';
} else {
$place = placement_box('serendipity[placement][' . $plugin_data['name'] . ']', $plugin_data['placement']);
}
- $title = serendipity_plugin_api::get_plugin_title($plugin, '[' . $name . ']');
-
- if ($bag->is_set('configuration') && ($plugin->protected === FALSE || $plugin_data['authorid'] == '0' || $plugin_data['authorid'] == $serendipity['authorid'] || $serendipity['serendipityUserlevel'] >= USERLEVEL_ADMIN)) {
- $url = '?serendipity[adminModule]=plugins&serendipity[plugin_to_conf]=' . $key;
- $name = '<a href="' . $url . '">' . $name . '</a>';
- $title = '<a href="' . $url . '">' . $title . '</a>';
- }
-
/* Only display UP/DOWN links if there's somewhere for the plugin to go */
if ($sort_idx == 0) {
$moveup = ' ';
@@ -128,6 +136,8 @@
?>
</table>
<br />
+<?php
+ if (count($errors
<div>
<input type="submit" name="REMOVE" title="<?php echo REMOVE_TICKED_PLUGINS; ?>" value="<?php echo DELETE; ?>" />
<input type="submit" name="SAVE" title="<?php echo SAVE_CHANGES_TO_LAYOUT; ?>" value="<?php echo SAVE; ?>" />
|