From 790f6e50eb504e142ae473dc767b41c90a50c1d9 Mon Sep 17 00:00:00 2001 From: saxmatt Date: Thu, 25 Mar 2004 07:05:52 +0000 Subject: [PATCH] Initial plugin funcitonality checkin. Not done yet. git-svn-id: http://svn.automattic.com/wordpress/trunk@1008 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/menu.txt | 1 + wp-admin/plugins.php | 88 ++++++++++++++++++++++++++++++++++ wp-admin/upgrade-functions.php | 6 +++ wp-content/plugins/hello.php | 13 +++++ 4 files changed, 108 insertions(+) create mode 100644 wp-admin/plugins.php create mode 100644 wp-content/plugins/hello.php diff --git a/wp-admin/menu.txt b/wp-admin/menu.txt index 08223ae028..00f4e46bae 100644 --- a/wp-admin/menu.txt +++ b/wp-admin/menu.txt @@ -4,6 +4,7 @@ 5 link-manager.php Links 3 users.php Users 4 options-general.php Options +8 plugins.php Plugins 4 templates.php Templates 5 upload.php Upload 0 profile.php My Profile diff --git a/wp-admin/plugins.php b/wp-admin/plugins.php new file mode 100644 index 0000000000..a85c7b85a4 --- /dev/null +++ b/wp-admin/plugins.php @@ -0,0 +1,88 @@ + +
+read()) !== false) { + if (!preg_match('|^\.+$|', $file)) $plugin_files[] = $file; + } +} + +if ('' != trim(get_settings('active_plugins'))) { + $current_plugins = unserialize(get_settings('active_plugins')); +} + +/* +Plugin Name: matt's cool plugin +Plugin URI: http://photomatt.net/plugins/cool-plugin +Description: blah blah blah anything until a newline +Author: photo matt +Author URI: http://photomatt.net +*/ + +if (!$plugins_dir || !$plugin_files) { + echo "

Couldn't open plugins directory or there are no plugins available.

"; // TODO: make more helpful +} else { +?> + + + + + + + +{$plugin_name[1]}"); + } + + if ('' == $author_uri) { + $author = $author_name[1]; + } else { + $author = wp_filter_kses("{$author_name[1]}"); + } + + + + $style = ('class="alternate"' == $style) ? '' : 'class="alternate"'; + echo " + + + + + + "; + } +?> + +
PluginAuthorDescriptionAction
$plugin$author$descriptionactivate
+ +
+ + diff --git a/wp-admin/upgrade-functions.php b/wp-admin/upgrade-functions.php index d95d694e2a..1cf2b49824 100644 --- a/wp-admin/upgrade-functions.php +++ b/wp-admin/upgrade-functions.php @@ -788,6 +788,12 @@ function upgrade_110() { if(!$wpdb->get_var("SELECT option_id FROM $tableoptions WHERE option_name = 'moderation_keys'")) { $wpdb->query("INSERT INTO $tableoptions (option_name, option_type, option_value, option_admin_level) VALUES ('moderation_keys', 3, '', 8)"); } + + // Option for plugins + if(!$wpdb->get_var("SELECT option_id FROM $tableoptions WHERE option_name = 'active_plugins'")) { + $wpdb->query("INSERT INTO $tableoptions (option_name, option_type, option_value, option_admin_level) VALUES ('active_plugins', 3, '', 8)"); + } + } ?> \ No newline at end of file diff --git a/wp-content/plugins/hello.php b/wp-content/plugins/hello.php new file mode 100644 index 0000000000..68332f7d6c --- /dev/null +++ b/wp-content/plugins/hello.php @@ -0,0 +1,13 @@ + \ No newline at end of file