contrib_todo_list-1.1.1/contrib_todo_list.module
contrib_todo_list.module
<?php
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function contrib_todo_list_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.contrib_todo_list':
return '<p>' . t('The Contrib Todo List module provides a block that allows users to manage todos associated with nodes. Users can create, share, and track the status of todos directly from the node page.') . '</p>'
. '<p>' . t('The block displays todos specific to the current node and user, including shared todos. Users with appropriate permissions can manage todos through an interactive interface.') . '</p>'
. '<h3>' . t('Features') . '</h3>'
. '<ul>'
. '<li>' . t('Create todos associated with specific nodes.') . '</li>'
. '<li>' . t('Share todos with other users.') . '</li>'
. '<li>' . t('Track todo status (Pending, In Progress, Completed).') . '</li>'
. '<li>' . t('Language-specific todos.') . '</li>'
. '<li>' . t('Real-time updates through AJAX.') . '</li>'
. '</ul>'
. '<h3>' . t('Permissions') . '</h3>'
. '<ul>'
. '<li>' . t('"Manage todo list": Users need this permission to create and manage todos.') . '</li>'
. '</ul>'
. '<h3>' . t('How to use') . '</h3>'
. '<p>' . t('Enable the module and place the "Contrib todo list" block in a region of your theme. The block will appear on node pages for users with appropriate permissions. Users can then:') . '</p>'
. '<ul>'
. '<li>' . t('Add new todos from the block interface.') . '</li>'
. '<li>' . t('Toggle todo sharing status.') . '</li>'
. '<li>' . t('Update todo states as they progress.') . '</li>'
. '<li>' . t('View todos specific to the current node and language.') . '</li>'
. '</ul>'
. '<h3>' . t('Configuration') . '</h3>'
. '<p>' . t('No additional configuration is required. Simply ensure users have the "Manage todo list" permission to use the functionality.') . '</p>';
}
}
/**
* Implements hook_theme().
*/
function contrib_todo_list_theme($existing, $type, $theme, $path) {
return [
'contrib_todo_list' => [
'variables' => [
'todos' => [],
'user_id' => NULL,
],
'template' => 'contrib-todo-list',
]
];
}