diff --git a/core/modules/project_browser/config/project_browser.settings.yml b/core/modules/project_browser/config/project_browser.settings.yml index fd66849..de0b21c 100644 --- a/core/modules/project_browser/config/project_browser.settings.yml +++ b/core/modules/project_browser/config/project_browser.settings.yml @@ -1,5 +1,5 @@ cache_lifetime: 86400 -# @todo - Change the link once drupal.org is ready. +# @todo Change the link once drupal.org is ready. default_server: http://drupal:drupal@pbs-drupal_7.redesign.devdrupal.org/project_browser/server: name: Drupal.org diff --git a/core/modules/project_browser/project_browser.admin.inc b/core/modules/project_browser/project_browser.admin.inc index 32ffcce..6c3ce41 100644 --- a/core/modules/project_browser/project_browser.admin.inc +++ b/core/modules/project_browser/project_browser.admin.inc @@ -6,7 +6,7 @@ */ /** - * Form constructor for admin settings. + * Form constructor for the admin settings form. * * @see project_browser_menu() * @see project_browser_admin_form_submit() diff --git a/core/modules/project_browser/project_browser.inc b/core/modules/project_browser/project_browser.inc index 195c2ac..4fe50d1 100644 --- a/core/modules/project_browser/project_browser.inc +++ b/core/modules/project_browser/project_browser.inc @@ -993,13 +993,13 @@ function _project_browser_batch_install_release($release_name, array $project, a * dependencies, or the enable modules page if there were no errors. * * @param bool $success - * Whether or not the whole operation was successful. + * Whether or not the whole operation was successful, a Boolean. * @param array $results * An array of messages about any failures. * @param array $operations * An array of operations that need to be performed. */ -function _project_browser_batch_install_releases_finished($success, array $results, array $operations) { +function _project_browser_batch_install_releases_finished(bool $success, array $results, array $operations) { drupal_get_messages(); // Restore the maintenance mode to what it was at the start. diff --git a/core/modules/project_browser/project_browser.module b/core/modules/project_browser/project_browser.module index 1550158..3aa9227 100644 --- a/core/modules/project_browser/project_browser.module +++ b/core/modules/project_browser/project_browser.module @@ -12,13 +12,25 @@ * Implements hook_help(). */ function project_browser_help($path, $arg) { - $output = ''; switch ($path) { case "admin/help#project_browser": - $output .= '

' . t("Provides a UI for users to browse for and install new modules and themes from within their Drupal admin interface.") . '

'; - break; + $output = ''; + $output .= '

' . t('About') . '

'; + $output .= '

' . t("The Project Browser provides a UI for users to browse for and install new modules and themes from within their Drupal admin interface.") . '

'; + $output .= '

' . t('Uses') . '

'; + $output .= '
'; + $output .= '
' . t('Browsing') . '
'; + // @todo Fill in accurate information about Browsing. + $output .= '
' . t('Set browsing settings on the project browser settings page.', array('!url' => url('admin/config/development/project_browser'))) . '
'; + $output .= '
' . t('Downloading') . '
'; + // @todo Fill in accurate information about Downloading. + $output .= '
' . t('Project Browser downloads new modules and themes.') . '
'; + $output .= '
' . t('Installing') . '
'; + // @todo Fill in accurate information about Installing. + $output .= '
' . t('New projects can be installed from the Project Browser interface.') . '
'; + $output .= '
'; + return $output; } - return $output; } /** @@ -28,7 +40,7 @@ function project_browser_permission() { return array( 'use project browser' => array( 'title' => t('Use Project Browser'), - 'description' => t('This allows the user to browse for and install new modules and themes using Project Browser.'), + 'description' => t('Browse for and install new modules and themes from the UI.'), 'restrict access' => TRUE, ), ); @@ -92,6 +104,7 @@ function project_browser_menu() { 'access arguments' => array('use project browser'), 'type' => MENU_CALLBACK, ); + return $items; } @@ -101,11 +114,11 @@ function project_browser_menu() { * This is invoked via AJAX most of the time. * * @param string $method - * The method used for this callback. + * The method used for this callback, which is a string. * @param string $op - * The operation to perform. + * The operation to perform, which is a string. * @param string $project_name - * The short name of the project. + * The short name of the project, which is a string. * * @return array * An array of elements that should be changed. @@ -159,7 +172,7 @@ function project_browser_install_queue_callback($method, $op, $project_name) { */ function project_browser_menu_local_tasks_alter(&$data, $router_item, $root_path) { switch ($root_path) { - // This is used to put the 'Project Browser' action on the 'Modules' page. + // Put the 'Project Browser' action on the 'Modules' page. case 'admin/modules': // Unset the install theme page. foreach ($data['actions']['output'] as $num => $item) { @@ -177,7 +190,7 @@ function project_browser_menu_local_tasks_alter(&$data, $router_item, $root_path } break; - // This is used to include the old 'Install a module' link + // Include the old 'Install a module' link. case 'admin/modules/project-browser': case 'admin/modules/project-browser/modules': case 'admin/modules/project-browser/themes': @@ -191,8 +204,7 @@ function project_browser_menu_local_tasks_alter(&$data, $router_item, $root_path } break; - // This is used to put the 'Project Browser' action on the 'Appearance' - // page. + // Put the 'Project Browser' action on the 'Appearance' page. case 'admin/appearance': // Unset the install theme page. foreach ($data['actions']['output'] as $num => $item) { @@ -358,7 +370,6 @@ function project_browser_preprocess_project_browser_list(array &$variables) { default: $title = t('Projects'); break; - } // If any filters were selected, change the title to 'Search results'. diff --git a/core/modules/project_browser/project_browser.pages.inc b/core/modules/project_browser/project_browser.pages.inc index 0c71028..467d0ca 100644 --- a/core/modules/project_browser/project_browser.pages.inc +++ b/core/modules/project_browser/project_browser.pages.inc @@ -13,7 +13,7 @@ * can be installed and searched through, fetched from the server(s). * * @param string $type - * Type of project to view, ie 'module' or 'theme'. + * Type of project to view, as a string: 'module' or 'theme'. * * @return array * A render array for a page containing a list of projects and filters. @@ -138,7 +138,7 @@ function project_browser_page($type) { * Builds a page from the install process. * * @param string $op - * Operation to perform. + * Operation to perform, which is a string, for example, 'enable'. * * @return string * A themed page from the install process, depending on the $op. @@ -218,10 +218,8 @@ function project_browser_installation_select_versions_form($form, &$form_state, foreach ($projects as $project) { // Get the available releases for this project. if (!$release_data = project_browser_get_project_release_data($project)) { - drupal_set_message(t('Could not fetch releases for project %project.', - array('%project' => $project['title'])), 'warning'); - watchdog('project_browser', 'Could not fetch releases for project %project.', - array('%project' => $project['title']), WATCHDOG_ERROR); + drupal_set_message(t('Could not fetch releases for project %project.', array('%project' => $project['title'])), 'warning'); + watchdog('project_browser', 'Could not fetch releases for project %project.', array('%project' => $project['title']), WATCHDOG_ERROR); project_browser_install_queue_remove($project['name']); continue; } @@ -286,8 +284,7 @@ function project_browser_installation_select_versions_form($form, &$form_state, $form['releases'][$project['name']]['selected_text']['#markup'] = $releases_list[$project_data['recommended']]; } if (count($releases_list) > 1) { - $form['releases'][$project['name']]['selected_text']['#markup'] .= - " (" . t('change release') . ")"; + $form['releases'][$project['name']]['selected_text']['#markup'] .= " (" . t('change release') . ")"; } } @@ -299,8 +296,7 @@ function project_browser_installation_select_versions_form($form, &$form_state, $form['backup_warning'] = array( '#type' => 'markup', - '#markup' => t('Back up your database and site before you continue. !link.', - array('!link' => l(t('Learn how'), 'http://drupal.org/node/22281'))), + '#markup' => t('Back up your database and site before you continue. !link.', array('!link' => l(t('Learn how'), 'http://drupal.org/node/22281'))), ); $form['maintenance_mode'] = array( '#type' => 'checkbox', @@ -385,7 +381,7 @@ function project_browser_installation_install_dependencies_page() { foreach ($dependencies as $shortname) { $missing_projects[$shortname] = array( 'name' => $shortname, - // Missing dependencies only works for projects of type 'module' + // Missing dependencies only works for projects of type 'module'. 'type' => 'module', 'title' => $shortname, ); @@ -438,9 +434,7 @@ function project_browser_installation_enable_form($form, &$form_state, array $pr $modules = system_rebuild_module_data(); $form['instructions'] = array( '#type' => 'item', - '#markup' => t('The projects you selected have been successfully installed. - If you installed any new modules, you may enable them using the form below - or on the main !link page.', array('!link' => l(t('Modules'), 'admin/modules'))), + '#markup' => t('The projects you selected have been successfully installed. If you installed any new modules, you may enable them using the form below or on the main !link page.', array('!link' => l(t('Modules'), 'admin/modules'))), ); $options = array(); @@ -476,8 +470,7 @@ function project_browser_installation_enable_form($form, &$form_state, array $pr } } else { - drupal_set_message(t('There was an error getting information for @module', - array('@module' => $project['name'])), 'error'); + drupal_set_message(t('There was an error getting information for @module', array('@module' => $project['name'])), 'error'); } } } @@ -513,8 +506,7 @@ function project_browser_installation_enable_form($form, &$form_state, array $pr $form['missing'] = array( '#type' => 'item', '#title' => t('Missing Dependencies'), - '#description' => t('These modules are missing one or more dependencies, - and so cannot be enabled.'), + '#description' => t('These modules are missing one or more dependencies, and so cannot be enabled.'), '#markup' => theme('table', array('header' => $headers, 'rows' => $missing)), '#weight' => 2, ); @@ -546,7 +538,7 @@ function project_browser_installation_enable_form_submit($form, &$form_state) { * This will need to be called from every page of the install process. * * @param string $active - * (optional) Set the active task by key. Defaults to NULL. + * (optional) Set the active task by key, which is a string. Defaults to NULL. * * @return array * The themed task list for the install projects process. diff --git a/core/modules/project_browser/tests/project_browser_test.module b/core/modules/project_browser/tests/project_browser_test.module index 46b456f..766d415 100644 --- a/core/modules/project_browser/tests/project_browser_test.module +++ b/core/modules/project_browser/tests/project_browser_test.module @@ -114,7 +114,7 @@ function project_browser_test_get_categories($type) { * @return array * An array of projects. */ -function project_browser_test_get_results($filters) { +function project_browser_test_get_results(array $filters) { $projects = project_browser_test_projects(); $results = array( @@ -188,10 +188,7 @@ function project_browser_test_projects() { 'name' => 'views', 'drupal version' => 8, 'author' => 'merlinofchaos', - 'description' => "The Views module provides a flexible method for Drupal site - designers to control how lists and tables of content (nodes in Views 1, almost - anything in Views 2) are presented. Traditionally, Drupal has hard-coded most of - this, particularly in how taxonomy and tracker lists are formatted. ", + 'description' => "The Views module provides a flexible method for Drupal site designers to control how lists and tables of content (nodes in Views 1, almost anything in Views 2) are presented. Traditionally, Drupal has hard-coded most of this, particularly in how taxonomy and tracker lists are formatted. ", 'categories' => array('admin', 'search'), 'image' => 'http://learnbythedrop.com/system/files/images/View-Edit_0.png', 'usage' => '542312', @@ -212,10 +209,7 @@ function project_browser_test_projects() { 'name' => 'ctools_test', 'drupal version' => 8, 'author' => 'merlinofchaos', - 'description' => "This suite is primarily a set of APIs and tools to improve - the developer experience. It also contains a module called the Page Manager - whose job is to manage pages. In particular it manages panel pages, but as - it grows it will be able to manage far more than just Panels.", + 'description' => "This suite is primarily a set of APIs and tools to improve the developer experience. It also contains a module called the Page Manager whose job is to manage pages. In particular it manages panel pages, but as it grows it will be able to manage far more than just Panels.", 'categories' => array(), 'image' => '', 'usage' => '4312', @@ -234,10 +228,7 @@ function project_browser_test_projects() { 'name' => 'ctools', 'drupal version' => 8, 'author' => 'merlinofchaos', - 'description' => "This suite is primarily a set of APIs and tools to improve - the developer experience. It also contains a module called the Page Manager - whose job is to manage pages. In particular it manages panel pages, but as - it grows it will be able to manage far more than just Panels.", + 'description' => "This suite is primarily a set of APIs and tools to improve the developer experience. It also contains a module called the Page Manager whose job is to manage pages. In particular it manages panel pages, but as it grows it will be able to manage far more than just Panels.", 'categories' => array(), 'image' => '', 'usage' => '4312', @@ -256,9 +247,7 @@ function project_browser_test_projects() { 'name' => 'token', 'drupal version' => 8, 'author' => 'eaton', - 'description' => "Tokens are small bits of text that can be placed into larger - documents via simple placeholders, like %site-name or [user]. The Token module - provides a central API for modules to use these tokens, and expose their own token values.", + 'description' => "Tokens are small bits of text that can be placed into larger documents via simple placeholders, like %site-name or [user]. The Token module provides a central API for modules to use these tokens, and expose their own token values.", 'categories' => array('admin'), 'image' => 'http://drupal.org/files/images/token_08.thumbnail.png', 'usage' => '4563', @@ -277,11 +266,7 @@ function project_browser_test_projects() { 'name' => 'zen', 'drupal version' => 8, 'author' => 'johnAlbin', - 'description' => "Zen is the ultimate starting theme for Drupal. If you are - building your own standards-compliant theme, you will find it much easier to - start with Zen than to start with Garland or Bluemarine. This theme has fantastic - online documentation and tons of code comments for both the PHP (template.php) - and HTML (page.tpl.php, node.tpl.php).", + 'description' => "Zen is the ultimate starting theme for Drupal. If you are building your own standards-compliant theme, you will find it much easier to start with Zen than to start with Garland or Bluemarine. This theme has fantastic online documentation and tons of code comments for both the PHP (template.php) and HTML (page.tpl.php, node.tpl.php).", 'categories' => array('light', 'dark'), 'image' => 'http://drupal.org/files/images/zen-logo.thumbnail.png', 'usage' => '4563', @@ -300,9 +285,7 @@ function project_browser_test_projects() { 'name' => 'acquia_marina', 'drupal version' => 8, 'author' => 'stephthegeek', - 'description' => "The Fusion base theme and Skinr are required. Skinr for Drupal 7 - (dev release) is usable now but it is recommended that you proceed with caution - and do some of your own testing.", + 'description' => "The Fusion base theme and Skinr are required. Skinr for Drupal 7 (dev release) is usable now but it is recommended that you proceed with caution and do some of your own testing.", 'categories' => array('light'), 'image' => 'http://drupal.org/files/images/acquia_marina.thumbnail.png', 'usage' => '14563', @@ -323,10 +306,7 @@ function project_browser_test_projects() { 'name' => 'fusion', 'drupal version' => 8, 'author' => 'stephthegeek', - 'description' => "Fusion is a powerful base theme, with layout and style configuration - options built in that you can control through Drupal's UI. It's based on a simplified - 960px or fluid 12/16-column grid. It's designed to be used with the Skinr module, - with numerous useful block styles included.", + 'description' => "Fusion is a powerful base theme, with layout and style configuration options built in that you can control through Drupal's UI. It's based on a simplified 960px or fluid 12/16-column grid. It's designed to be used with the Skinr module, with numerous useful block styles included.", 'categories' => array('light'), 'image' => 'http://drupal.org/files/images/fusion-powering-small-banner.thumbnail.png', 'usage' => '14563',