? plugin_manager-D7.patch Index: plugin_manager.admin.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/plugin_manager/plugin_manager.admin.inc,v retrieving revision 1.52.2.58 diff -u -p -r1.52.2.58 plugin_manager.admin.inc --- plugin_manager.admin.inc 20 Nov 2008 23:44:22 -0000 1.52.2.58 +++ plugin_manager.admin.inc 22 Nov 2008 17:33:11 -0000 @@ -134,7 +134,7 @@ function plugin_manager_find($form_state LEFT JOIN {plugin_manager_taxonomy} pmt ON(pmt.short_name = pmr.short_name) WHERE $where - ORDER BY title", $terms[0], $terms[1] + ORDER BY title", $terms ); $files = module_rebuild_cache(); @@ -576,7 +576,7 @@ function plugin_manager_install_3($form, drupal_set_message(t("Successfully installed @name.", array('@name' => $name))); // rebuild caches - drupal_rebuild_theme_registry(); + drupal_theme_rebuild(); node_types_rebuild(); menu_rebuild(); cache_clear_all('schema', 'cache'); @@ -620,12 +620,16 @@ function plugin_manager_uninstall_form($ WHERE status = 0 ORDER BY type" ); + + $form = array(); + + $count = 0; while ($row = db_fetch_array($result)) { if (strpos($row['filename'],'sites/all/'.$row['type'].'s/'.$row['name'])!==0 || !file_exists($row['filename']))continue; $info_file = join('.',array_slice(explode('.',$row['filename']),0,-1)).'.info'; $info = drupal_parse_info_file($info_file); if (!$info['name'])$info['name'] = $row['name']; - if (!$form[$row['type']]){ + if (!isset($form[$row['type']])) { $form[$row['type']] = array( '#type' => 'fieldset', '#title' => htmlentities('Disabled '.ucwords($row['type']).'s'), @@ -638,32 +642,40 @@ function plugin_manager_uninstall_form($ '#name' => $row['name'], '#title' => htmlentities($info['name']), ); + $count ++; + } + + if ($count > 0) { + $form['backend'] = array( + '#title' => t('Removal method'), + '#type' => 'select', + '#options' => plugin_manager_backends(), + ); + $form['host'] = array( + '#title' => t('Hostname'), + '#type' => 'textfield', + '#default_value' => variable_get('plugin_manager_hostname', 'localhost'), + ); + $form['username'] = array( + '#type' => 'textfield', + '#title' => t('Username'), + '#default_value' => variable_get('plugin_manager_username', ''), + ); + $form['password'] = array( + '#type' => 'password', + '#title' => t('Password'), + '#default_value' => '', + ); + $form[] = array( + '#type' => 'submit', + '#value' => t('Uninstall'), + ); + return $form; + } + else { + drupal_set_message(t('No modules found to uninstall.')); + return array(); } - $form['backend'] = array( - '#title' => t('Removal method'), - '#type' => 'select', - '#options' => plugin_manager_backends(), - ); - $form['host'] = array( - '#title' => t('Hostname'), - '#type' => 'textfield', - '#default_value' => variable_get('plugin_manager_hostname', 'localhost'), - ); - $form['username'] = array( - '#type' => 'textfield', - '#title' => t('Username'), - '#default_value' => variable_get('plugin_manager_username', ''), - ); - $form['password'] = array( - '#type' => 'password', - '#title' => t('Password'), - '#default_value' => '', - ); - $form[] = array( - '#type' => 'submit', - '#value' => t('Uninstall'), - ); - return $form; } /** @@ -681,12 +693,6 @@ function plugin_manager_uninstall_form_s } // Get the files to remove. - /*$result = db_query( - "SELECT file_path - FROM {plugin_manager_files} - WHERE short_name = '%s' - ORDER BY file_path DESC", $plugin - );*/ $row = db_fetch_array(db_query( "SELECT filename, name, type FROM {system} @@ -699,6 +705,7 @@ function plugin_manager_uninstall_form_s $remove = call_user_func_array($backend .'_plugin_manager_remove', array('sites/all/'.$row['type'].'s/'.$row['name'], $form_state['values']['host'], $form_state['values']['username'], $form_state['values']['password'])); + db_query("DELETE FROM {plugin_manager_files} WHERE short_name = '%s'", $row['name']); if ($remove){ drupal_set_message("Successfully uninstalled $plugin."); }else @@ -878,7 +885,6 @@ function plugin_manager_settings_form() $form = array(); - $form['plugin_manager_username'] = array( '#title' => t('Stored Username'), '#type' => 'textfield', Index: plugin_manager.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/plugin_manager/plugin_manager.info,v retrieving revision 1.2.2.5 diff -u -p -r1.2.2.5 plugin_manager.info --- plugin_manager.info 23 Sep 2008 02:25:53 -0000 1.2.2.5 +++ plugin_manager.info 22 Nov 2008 17:33:11 -0000 @@ -1,6 +1,9 @@ ; $Id: plugin_manager.info,v 1.2.2.5 2008/09/23 02:25:53 jabapyth Exp $ name = Plugin Manager description = Enables the automated installation of modules and themes from drupal.org -core = 6.x +core = 7.x php = 5 package = Administration +files[] = plugin_manager.module +files[] = plugin_manager.install +files[] = plugin_manager.admin.inc \ No newline at end of file Index: plugin_manager.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/plugin_manager/plugin_manager.module,v retrieving revision 1.51.2.35 diff -u -p -r1.51.2.35 plugin_manager.module --- plugin_manager.module 20 Nov 2008 03:06:23 -0000 1.51.2.35 +++ plugin_manager.module 22 Nov 2008 17:33:11 -0000 @@ -19,7 +19,6 @@ function plugin_manager_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('plugin_manager_find'), 'access arguments' => array('access plugin manager'), - 'file' => 'plugin_manager.admin.inc', 'position' => 'right', 'weight' => -7, ); @@ -28,7 +27,6 @@ function plugin_manager_menu() { 'description' => 'Search for new themes and modules to queue for installation.', 'page callback' => 'plugin_manager_search', 'access arguments' => array('install plugins'), - 'file' => 'plugin_manager.admin.inc', 'block callback' => 'system_admin_theme_settings', ); $items['admin/plugin_manager/search/ajax'] = array( @@ -36,7 +34,6 @@ function plugin_manager_menu() { 'description' => 'AJAX callback.', 'page callback' => 'plugin_manager_search_ajax_callback', 'access arguments' => array('install plugins'), - 'file' => 'plugin_manager.admin.inc', 'type' => MENU_CALLBACK, ); $items['admin/plugin_manager/install'] = array( @@ -45,7 +42,6 @@ function plugin_manager_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('plugin_manager_install_form'), 'access arguments' => array('install plugins'), - 'file' => 'plugin_manager.admin.inc', 'block callback' => 'system_admin_theme_settings', ); $items['admin/plugin_manager/find'] = array( @@ -54,7 +50,6 @@ function plugin_manager_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('plugin_manager_find'), 'access arguments' => array('install plugins'), - 'file' => 'plugin_manager.admin.inc', 'block callback' => 'system_admin_theme_settings', ); $items['admin/plugin_manager/settings'] = array( @@ -63,7 +58,6 @@ function plugin_manager_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('plugin_manager_settings_form'), 'access arguments' => array('plugin manager settings'), - 'file' => 'plugin_manager.admin.inc', 'block callback' => 'system_admin_theme_settings', ); $items['admin/plugin_manager/uninstall'] = array( @@ -72,7 +66,6 @@ function plugin_manager_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('plugin_manager_uninstall_form'), 'access arguments' => array('uninstall plugins'), - 'file' => 'plugin_manager.admin.inc', 'block callback' => 'system_admin_theme_settings', ); $items['admin/plugin_manager/update'] = array( @@ -81,7 +74,6 @@ function plugin_manager_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('plugin_manager_update_form'), 'access arguments' => array('install modules'), - 'file' => 'plugin_manager.admin.inc', 'block callback' => 'system_admin_theme_settings', ); $items['admin/plugin_manager/manual'] = array( @@ -89,7 +81,6 @@ function plugin_manager_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('plugin_manager_manual'), 'access arguments' => array('manual install plugins'), - 'file' => 'plugin_manager.admin.inc', 'type' => MENU_CALLBACK, ); $items['admin/plugin_manager/reload'] = array( @@ -97,7 +88,6 @@ function plugin_manager_menu() { 'page callback' => 'drupal_get_form', 'page arguments' => array('plugin_manager_reload'), 'access arguments' => array('install plugins'), - 'file' => 'plugin_manager.admin.inc', 'type' => MENU_CALLBACK, ); $items['admin/build/modules/install'] = array( @@ -105,7 +95,6 @@ function plugin_manager_menu() { 'access arguments' => array('install plugins'), 'page callback' => 'drupal_get_form', 'page arguments' => array('plugin_manager_find'), - 'file' => 'plugin_manager.admin.inc', 'weight' => 9, 'type' => MENU_LOCAL_TASK, ); @@ -114,7 +103,6 @@ function plugin_manager_menu() { 'access arguments' => array('install plugins'), 'page callback' => 'drupal_get_form', 'page arguments' => array('plugin_manager_find'), - 'file' => 'plugin_manager.admin.inc', 'weight' => 9, 'type' => MENU_LOCAL_TASK, ); @@ -142,7 +130,28 @@ function plugin_manager_help($path, $arg * Implementation of hook_perm(). */ function plugin_manager_perm() { - return array('access plugin manager','manual install plugins', 'install plugins', 'plugin manager settings', 'uninstall plugins'); + return array( + 'access plugin manager' => array( + 'title' => t('Access plugin manager'), + 'description' => t('Description access plugin manager.'), + ), + 'manual install plugins' => array( + 'title' => t('Manual Install plugins'), + 'description' => t('Description manual install plugins.'), + ), + 'install plugins' => array( + 'title' => t('Install plugins'), + 'description' => t('Description install plugins.'), + ), + 'plugin manager settings' => array( + 'title' => t('Plugin manager settings'), + 'description' => t('Description plugin manager settings.'), + ), + 'uninstall plugins' => array( + 'title' => t('Uninstall plugins'), + 'description' => t('Description uninstall plugins.'), + ), + ); } /**