Mailinglist front end pages.
More...
Go to the source code of this file.
Mailinglist front end pages.
Definition in file mailinglist.pagecallback.inc.
_mailinglist_list_pagecallback |
( |
|
$list = '' , |
|
|
|
$oper = '' , |
|
|
|
$p1 = '' , |
|
|
|
$p2 = '' , |
|
|
|
$p3 = '' , |
|
|
|
$p4 = '' |
|
) |
| |
_mailinglist_list_pagecallback()
callback for $base/mailinglist_list
Definition at line 58 of file mailinglist.pagecallback.inc.
References mailinglist_operation_load().
60 $base = variable_get(
'mailinglist_base',
'mailinglist');
62 l(t(
'Home'),
'<front>'),
63 l(t(
'Mailing Lists'), $base),
65 drupal_set_breadcrumb($breadcrumb);
69 drupal_set_title(t(
'Unknown Mailing List'));
70 $page = array(
"#markup" =>
"Unknown Mailing List.");
73 $listname = $list->admin_name;
74 drupal_set_title($list->admin_title);
75 $page[
'oper'] = array(
76 '#theme' =>
'item_list',
78 '#attributes' => array(
'class' =>
'mailinglist_list'),
80 foreach ($list->operations as $index => $enabled) {
83 if ($oper->hasPermission($list)) {
84 $page[
'oper'][
'#items'][$index] = array(
'data' => l($oper->plugin[
'name'],
"$base/$listname/$index"));
Interface to a mailing list.
mailinglist_operation_load($oper)
@ name CTools Operation/******** operation
_mailinglist_pagecallback |
( |
| ) |
|
Page call back function for mailinglist.
address is of form /mailinglist/listname/operation/ (mailinglist can be replaced with a different path) if no listname, give general information with a list of mailing lists available if no operation, give list introduction with a list of operations operations looked up in via plugin.
- Todo:
- get node id of our introduction.
Definition at line 18 of file mailinglist.pagecallback.inc.
References mailinglist_list_load_all().
19 $base = variable_get(
'mailinglist_base',
'mailinglist');
21 l(t(
'Home'),
'<front>'),
23 drupal_set_breadcrumb($breadcrumb);
31 $page[
'list'] = array(
'#markup' =>
'No Mailinglist defined');
34 $page[
'head'] = array(
'#markup' =>
'This is a listing of lists available');
35 $page[
'list'] = array(
36 '#theme' =>
'item_list',
38 '#attributes' => array(
'class' =>
'mailinglist_list'),
40 foreach ($lists as $index => $list) {
42 if (user_access(
'mailinglist ' . $index)) {
43 $admin_name = check_plain($list->admin_name);
44 $admin_title = check_plain($list->admin_title);
45 $markup =
"<a href=/$base/$admin_name>$admin_title</a>";
46 $page[
'list'][
'#items'][$index] = array(
'data' => $markup);
mailinglist_list_load_all($show_disabled=TRUE)
Load all mailinglists.
mailinglist_operation_form |
( |
|
$form, |
|
|
& |
$form_state |
|
) |
| |
mailinglit_operation_form().
Implements hook_form();
Definition at line 97 of file mailinglist.pagecallback.inc.
98 watchdog(
'Mailinglist',
"<pre>Form: @f \nState: @s</pre>",
99 array(
'@f' => print_r($form, TRUE),
'@s' => print_r($form_state, TRUE)), WATCHDOG_INFO);
100 $list = $form_state[
'build_info'][
'args'][0];
101 $operation = $form_state[
'build_info'][
'args'][1];
104 drupal_set_title(t(
'Unknown Mailing List'));
105 $form = array(
"#markup" =>
"Unknown Mailing List.");
110 drupal_set_title(t(
'Unknown Operation'));
111 $form = array(
"#markup" =>
"Unknown Operation.");
114 $base = variable_get(
'mailinglist_base',
'mailinglist');
116 l(t(
'Home'),
'<front>'),
117 l(t(
'Mailing Lists'), $base),
118 l($list->admin_title , $base .
'/' . $list->admin_name),
120 drupal_set_breadcrumb($breadcrumb);
121 drupal_set_title($list->admin_title .
' - ' . $operation->plugin[
'name']);
123 $operation->form($form, $form_state, $list);
Interface to a mailing list.
interface MailinglistOperationInterface
mailinglist_operation_form_submit |
( |
|
$form, |
|
|
& |
$form_state |
|
) |
| |
mailinglit_operationr_form_submit().
Implements hook_form_submit();
Definition at line 152 of file mailinglist.pagecallback.inc.
153 watchdog(
'Mailinglist',
"<pre>Submit: @f \nState: @s</pre>",
154 array(
'@f' => print_r($form, TRUE),
'@s' => print_r($form_state, TRUE)), WATCHDOG_INFO);
155 $list = $form_state[
'build_info'][
'args'][0];
156 $operation = $form_state[
'build_info'][
'args'][1];
158 $operation->submit($form, $form_state, $list);
161 dpm(func_get_args(),
'submit?');
interface MailinglistOperationInterface
mailinglist_operation_form_validate |
( |
|
$form, |
|
|
& |
$form_state |
|
) |
| |
mailinglit_operationr_form_validate().
Implements hook_form_validate();
Definition at line 133 of file mailinglist.pagecallback.inc.
134 watchdog(
'Mailinglist',
"<pre>Validate: @f \nState: @s</pre>",
135 array(
'@f' => print_r($form, TRUE),
'@s' => print_r($form_state, TRUE)), WATCHDOG_INFO);
137 $list = $form_state[
'build_info'][
'args'][0];
138 $operation = $form_state[
'build_info'][
'args'][1];
140 $operation->validate($form, $form_state, $list);
143 dpm(func_get_args(),
'validate?');
interface MailinglistOperationInterface