| 1 |
<?php |
<?php |
| 2 |
/* $Id: subscription.module,v 1.12 2006/04/04 17:47:22 ee Exp $ */ |
/* $Id: subscription.module,v 1.13 2006/04/04 18:23:01 ee Exp $ */ |
| 3 |
|
|
| 4 |
function subscription_help($section) { |
function subscription_help($section) { |
| 5 |
switch ($section) { |
switch ($section) { |
| 563 |
global $user; |
global $user; |
| 564 |
$table = array(); |
$table = array(); |
| 565 |
if (!empty($_POST)) { |
if (!empty($_POST)) { |
| 566 |
|
|
| 567 |
$edit = $_POST['edit']; |
$edit = $_POST['edit']; |
| 568 |
$merge_ids = array(); |
$merge_ids = array(); |
| 569 |
foreach ($edit as $key => $value) { |
foreach ($edit as $key => $value) { |
| 571 |
$merge_ids[] = str_replace("merge", "", $key); |
$merge_ids[] = str_replace("merge", "", $key); |
| 572 |
} |
} |
| 573 |
} |
} |
| 574 |
|
|
| 575 |
$main_type = '*'; |
$main_type = '*'; |
| 576 |
$condition = array(); |
$condition = array(); |
| 577 |
$channel = ''; |
$channel = ''; |
| 608 |
$page = "<h1>Current subscriptions</h1>"; |
$page = "<h1>Current subscriptions</h1>"; |
| 609 |
if ($roles != array()) { |
if ($roles != array()) { |
| 610 |
foreach ($roles as $role) { |
foreach ($roles as $role) { |
| 611 |
$form = array( 'subscription_list_merge'.$role['sid'] => array( |
$table[] = array($role['object'], _subscription_condition_readable($role['condition']), $role['name'], l('delete', 'subscription/del/'.$role['sid']), |
| 612 |
'#type' => 'checkbox', |
'<input type="checkbox" name="edit[merge'.$role['sid'].']" value="1">' |
| 613 |
'#title' => '', |
); |
| 614 |
)); |
} |
| 615 |
$table[] = array($role['object'], |
// new form api sucks |
| 616 |
_subscription_condition_readable($role['condition']), |
$form = "<form method=\"post\" >"; |
| 617 |
$role['name'], |
$form .= theme("table", array(t("Object"), t("Condition"), t("Channel"), t("Function"), t("Merge")), $table); |
| 618 |
l('delete', 'subscription/del/'.$role['sid']), |
$form .= '<input type="submit" value="Merge">'; |
| 619 |
drupal_get_form('subscription_list_'.$role['sid'], $form) |
$form .= "</form>"; |
| 620 |
); |
$page .= $form; |
|
} |
|
|
$page .= theme("table", array(t("Object"), t("Condition"), t("Channel"), t("Function"), t("Merge")), $table); |
|
|
$form = array( 'subscription_list_submit' => array( |
|
|
'#type' => 'submit', |
|
|
'#value' => t("Merge"), |
|
|
)); |
|
|
$page .= drupal_get_form('subscription_list_submit', $form); |
|
| 621 |
} |
} |
| 622 |
else { |
else { |
| 623 |
$page .= t("Currently there are no subscriptions."); |
$page .= t("Currently there are no subscriptions."); |