Skip to content
Snippets Groups Projects
Verified Commit 564afc4e authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #2861849 by ifrik, lomasr, prash_98, quietone, pguillard, shubhangi1995,...

Issue #2861849 by ifrik, lomasr, prash_98, quietone, pguillard, shubhangi1995, wengerk, yogeshmpawar, manish.upadhyay, amietpatial: Edit hook_help text for Workflows module

(cherry picked from commit ae308e40)
parent c75bd9de
No related branches found
No related tags found
3 merge requests!11769Issue #3517987: Add option to contextual filters to encode slashes in query parameter.,!11185Issue #3477324 by andypost, alexpott: Fix usage of str_getcsv() and fgetcsv() for PHP 8.4,!9944Issue #3483353: Consider making the createCopy config action optionally fail...
Pipeline #250651 passed
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Url;
/** /**
* Implements hook_help(). * Implements hook_help().
...@@ -13,15 +14,33 @@ ...@@ -13,15 +14,33 @@
function workflows_help($route_name, RouteMatchInterface $route_match) { function workflows_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) { switch ($route_name) {
case 'help.page.workflows': case 'help.page.workflows':
$output = ''; $content_moderation_url = NULL;
$output .= '<h2>' . t('About') . '</h2>'; if (\Drupal::moduleHandler()->moduleExists('content_moderation')) {
$output .= '<p>' . t('The Workflows module provides a UI and an API for creating workflows content. This lets site admins define workflows and their states, and then define transitions between those states. For more information, see the <a href=":workflow">online documentation for the Workflows module</a>.', [':workflow' => 'https://www.drupal.org/documentation/modules/workflows']) . '</p>'; $content_moderation_url = Url::fromRoute('help.page', ['name' => 'content_moderation'])->toString();
$output .= '<h4>' . t('Workflow') . '</h4>'; }
$output .= '<p>' . t('A collection of states and transitions between those states.') . '</p>'; $output = '<h2>' . t('About') . '</h2>';
$output .= '<h4>' . t('State') . '</h4>'; if ($content_moderation_url) {
$output .= '<p>' . t('A particular condition that something is in at a specific time. The usage of the state is determined by a module that harnesses the Workflows module. For example, Content Moderation allows a state to be used for moderation of content by assigning a given state to a content item.') . '</p>'; $output .= '<p>' . t('The Workflows module provides an API and an interface to create workflows with transitions between different states (for example publication or user status). These have to be provided by other modules such as the <a href=":moderation">Content Moderation module</a>. For more information, see the <a href=":workflow">online documentation for the Workflows module</a>.', [':moderation' => $content_moderation_url, ':workflow' => 'https://www.drupal.org/documentation/modules/workflows']) . '</p>';
$output .= '<h4>' . t('Transition') . '</h4>'; }
$output .= '<p>' . t('The process of changing from one state to another. A transition can occur from multiple states, but only to one state.') . '</p>'; else {
$output .= '<p>' . t('The Workflows module provides an API and an interface to create workflows with transitions between different states (for example publication or user status). These have to be provided by other modules such as the Content Moderation module. For more information, see the <a href=":workflow">online documentation for the Workflows module</a>.', [':workflow' => 'https://www.drupal.org/documentation/modules/workflows']) . '</p>';
}
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<dl>';
$output .= '<dt>' . t('Adding workflows') . '</dt>';
if ($content_moderation_url) {
$output .= '<dd>' . t('You can <em>only</em> add workflows on the <a href=":workflows">Workflows page</a>, after you have installed a module that leverages the API such as the <a href=":moderation">Content Moderation module</a>.', [':moderation' => $content_moderation_url, ':workflows' => Url::fromRoute('entity.workflow.collection')->toString()]) . '</dd>';
}
else {
$output .= '<dd>' . t('You can <em>only</em> add workflows on the <a href=":workflows">Workflows page</a>, after you have installed a module that leverages the API such as the Content Moderation module.', [':workflow' => 'https://www.drupal.org/documentation/modules/workflows']) . '</dd>';
}
$output .= '<dt>' . t('Adding states') . '<dt>';
$output .= '<dd>' . t('A workflow requires at least two states. States can be added when you add or edit a workflow on the <a href=":workflows">Workflows page</a>.', [':workflows' => Url::fromRoute('entity.workflow.collection')->toString()]) . '</dd>';
$output .= '<dt>' . t('Adding transitions') . '</dt>';
$output .= '<dd>' . t('A transition defines in which state an item can be save as next. It has one destination state, but can have several states <em>from</em> which the transition can be applied. Transitions can be added when you add or edit a workflow on the <a href=":workflows">Workflows page</a>.', [':workflows' => Url::fromRoute('entity.workflow.collection')->toString()]) . '</dd>';
$output .= '<dt>' . t('Configuring workflows further') . '</dt>';
$output .= '<dd>' . t('Depending on the installed workflow type, additional configuration can be available in the edit form of a workflow.') . '</dd>';
$output .= '<dl>';
return $output; return $output;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment