' . _("Description") . '';
$parsedown = new Parsedown();
$page[] = $parsedown->parse($angeltype['description']);
// Team-Coordinators list missing
$page[] = '
' . _("Members") . '
';
$members_confirmed = array();
$members_unconfirmed = array();
foreach ($members as $member) {
$member['Nick'] = User_Nick_render($member);
if ($angeltype['restricted'] && $member['confirm_user_id'] == null) {
$member['actions'] = join(" ", array(
'' . ("confirm") . '',
'' . ("deny") . ''
));
$members_unconfirmed[] = $member;
} else {
if ($admin_user_angeltypes)
$member['actions'] = join(" ", array(
'' . ("remove") . ''
));
$members_confirmed[] = $member;
}
}
$page[] = table(array(
'Nick' => _("Nick"),
'DECT' => _("DECT"),
'actions' => ""
), $members_confirmed);
if ($admin_user_angeltypes && $angeltype['restricted'] && count($members_unconfirmed) > 0) {
$page[] = '' . _("Unconfirmed") . '
';
$page[] = buttons(array(
button(page_link_to('user_angeltypes') . '&action=confirm_all&angeltype_id=' . $angeltype['id'], _("confirm all"), 'ok'),
button(page_link_to('user_angeltypes') . '&action=delete_all&angeltype_id=' . $angeltype['id'], _("deny all"), 'cancel')
));
$page[] = table(array(
'Nick' => _("Nick"),
'DECT' => _("DECT"),
'actions' => ""
), $members_unconfirmed);
}
return page($page);
}
/**
* Display the list of angeltypes.
*
* @param array $angeltypes
*/
function AngelTypes_list_view($angeltypes, $admin_angeltypes) {
return page(array(
msg(),
buttons(array(
$admin_angeltypes ? button(page_link_to('angeltypes') . '&action=edit', _("New angeltype"), 'add') : '',
button(page_link_to('angeltypes') . '&action=about', _("Teams/Job description"))
)),
table(array(
'name' => _("Name"),
'restricted' => '',
'membership' => _("Membership"),
'actions' => ""
), $angeltypes)
));
}
function AngelTypes_about_view($angeltypes, $user_logged_in) {
global $faq_url;
$content = array(
buttons(array(
! $user_logged_in ? button(page_link_to('register'), register_title()) : '',
! $user_logged_in ? button(page_link_to('login'), login_title()) : '',
$user_logged_in ? button(page_link_to('angeltypes'), '« ' . angeltypes_title()) : 'back',
button($faq_url, _("FAQ"))
)),
'' . _("Here is the list of teams and their tasks. If you have questions, read the FAQ.") . '
'
);
$parsedown = new Parsedown();
foreach ($angeltypes as $angeltype) {
$content[] = '' . $angeltype['name'] . '
';
if (isset($angeltype['user_angeltype_id'])) {
$buttons = array();
if ($angeltype['user_angeltype_id'] != null)
$buttons[] = button(page_link_to('user_angeltypes') . '&action=delete&user_angeltype_id=' . $angeltype['user_angeltype_id'], _("leave"), 'cancel');
else
$buttons[] = button(page_link_to('user_angeltypes') . '&action=add&angeltype_id=' . $angeltype['id'], _("join"), 'add');
$content[] = buttons($buttons);
}
if ($angeltype['restricted'])
$content[] = info(_("This angeltype is restricted by double-opt-in by a team coordinator. Please show up at the according introduction meetings."), true);
$content[] = $parsedown->parse($angeltype['description']);
}
return page($content);
}
?>