summaryrefslogtreecommitdiff
path: root/includes/controller
diff options
context:
space:
mode:
authorFelix Favre <gnomus@gnomus.de>2014-12-06 18:16:18 +0100
committerFelix Favre <gnomus@gnomus.de>2014-12-06 18:16:18 +0100
commit191ba6e1b14b94a3a46c16ca488f388c82120bad (patch)
tree09d64f0627d52eda2a72cf1a83ad411e4ac91e9f /includes/controller
parent524acb15ba70f49f44e85d4864ed035550703814 (diff)
replace all the remaining old icons with glyphicons
Diffstat (limited to 'includes/controller')
-rw-r--r--includes/controller/angeltypes_controller.php84
1 files changed, 42 insertions, 42 deletions
diff --git a/includes/controller/angeltypes_controller.php b/includes/controller/angeltypes_controller.php
index 79ffcfb4..6afa67dc 100644
--- a/includes/controller/angeltypes_controller.php
+++ b/includes/controller/angeltypes_controller.php
@@ -13,7 +13,7 @@ function angeltypes_title() {
function angeltypes_controller() {
if (! isset($_REQUEST['action']))
$_REQUEST['action'] = 'list';
-
+
switch ($_REQUEST['action']) {
default:
case 'list':
@@ -34,17 +34,17 @@ function angeltypes_controller() {
*/
function angeltypes_about_controller() {
global $privileges, $user;
-
+
if (isset($user))
$angeltypes = AngelTypes_with_user($user);
else
$angeltypes = AngelTypes();
if ($angeltypes === false)
engelsystem_error("Unable to load angeltypes.");
-
+
return array(
_("Teams/Job description"),
- AngelTypes_about_view($angeltypes, isset($user))
+ AngelTypes_about_view($angeltypes, isset($user))
);
}
@@ -53,29 +53,29 @@ function angeltypes_about_controller() {
*/
function angeltype_delete_controller() {
global $privileges, $user;
-
+
if (! in_array('admin_angel_types', $privileges))
redirect(page_link_to('angeltypes'));
-
+
$angeltype = AngelType($_REQUEST['angeltype_id']);
if ($angeltype === false)
engelsystem_error("Unable to load angeltype.");
if ($angeltype == null)
redirect(page_link_to('angeltypes'));
-
+
if (isset($_REQUEST['confirmed'])) {
$result = AngelType_delete($angeltype);
if ($result === false)
engelsystem_error("Unable to delete angeltype.");
-
+
engelsystem_log("Deleted angeltype: " . $name);
success(sprintf(_("Angeltype %s deleted."), $name));
redirect(page_link_to('angeltypes'));
}
-
+
return array(
sprintf(_("Delete angeltype %s"), $angeltype['name']),
- AngelType_delete_view($angeltype)
+ AngelType_delete_view($angeltype)
);
}
@@ -84,35 +84,35 @@ function angeltype_delete_controller() {
*/
function angeltype_edit_controller() {
global $privileges, $user;
-
+
$name = "";
$restricted = false;
$description = "";
-
+
if (isset($_REQUEST['angeltype_id'])) {
$angeltype = AngelType($_REQUEST['angeltype_id']);
if ($angeltype === false)
engelsystem_error("Unable to load angeltype.");
if ($angeltype == null)
redirect(page_link_to('angeltypes'));
-
+
$name = $angeltype['name'];
$restricted = $angeltype['restricted'];
$description = $angeltype['description'];
-
+
if (! User_is_AngelType_coordinator($user, $angeltype))
redirect(page_link_to('angeltypes'));
} else {
if (! in_array('admin_angel_types', $privileges))
redirect(page_link_to('angeltypes'));
}
-
+
// In coordinator mode only allow to modify description
$coordinator_mode = ! in_array('admin_angel_types', $privileges);
-
+
if (isset($_REQUEST['submit'])) {
$ok = true;
-
+
if (! $coordinator_mode) {
if (isset($_REQUEST['name'])) {
list($valid, $name) = AngelType_validate_name($_REQUEST['name'], $angeltype);
@@ -121,13 +121,13 @@ function angeltype_edit_controller() {
error(_("Please check the name. Maybe it already exists."));
}
}
-
+
$restricted = isset($_REQUEST['restricted']);
}
-
+
if (isset($_REQUEST['description']))
$description = strip_request_item_nl('description');
-
+
if ($ok) {
$restricted = $restricted ? 1 : 0;
if (isset($angeltype)) {
@@ -142,15 +142,15 @@ function angeltype_edit_controller() {
engelsystem_error("Unable to create angeltype.");
engelsystem_log("Created angeltype: " . $name . ", restricted: " . $restricted);
}
-
+
success("Angel type saved.");
redirect(page_link_to('angeltypes') . '&action=view&angeltype_id=' . $angeltype_id);
}
}
-
+
return array(
sprintf(_("Edit %s"), $name),
- AngelType_edit_view($name, $restricted, $description, $coordinator_mode)
+ AngelType_edit_view($name, $restricted, $description, $coordinator_mode)
);
}
@@ -159,30 +159,30 @@ function angeltype_edit_controller() {
*/
function angeltype_controller() {
global $privileges, $user;
-
+
if (! in_array('angeltypes', $privileges))
redirect('?');
-
+
if (! isset($_REQUEST['angeltype_id']))
redirect(page_link_to('angeltypes'));
-
+
$angeltype = AngelType($_REQUEST['angeltype_id']);
if ($angeltype === false)
engelsystem_error("Unable to load angeltype.");
if ($angeltype == null)
redirect(page_link_to('angeltypes'));
-
+
$user_angeltype = UserAngelType_by_User_and_AngelType($user, $angeltype);
if ($user_angeltype === false)
engelsystem_error("Unable to load user angeltype.");
-
+
$members = Users_by_angeltype($angeltype);
if ($members === false)
engelsystem_error("Unable to load members.");
-
+
return array(
sprintf(_("Team %s"), $angeltype['name']),
- AngelType_view($angeltype, $members, $user_angeltype, in_array('admin_user_angeltypes', $privileges) || $user_angeltype['coordinator'], in_array('admin_angel_types', $privileges), $user_angeltype['coordinator'])
+ AngelType_view($angeltype, $members, $user_angeltype, in_array('admin_user_angeltypes', $privileges) || $user_angeltype['coordinator'], in_array('admin_angel_types', $privileges), $user_angeltype['coordinator'])
);
}
@@ -191,20 +191,20 @@ function angeltype_controller() {
*/
function angeltypes_list_controller() {
global $privileges, $user;
-
+
if (! in_array('angeltypes', $privileges))
redirect('?');
-
+
$angeltypes = AngelTypes_with_user($user);
if ($angeltypes === false)
engelsystem_error("Unable to load angeltypes.");
-
+
foreach ($angeltypes as &$angeltype) {
$actions = array(
button(page_link_to('angeltypes') . '&action=view&angeltype_id=' . $angeltype['id'],_("view"),"btn-xs")
- //'<a class="view btn btn-default" href="' . page_link_to('angeltypes') . '&action=view&angeltype_id=' . $angeltype['id'] . '">' . _("view") . '</a>'
+ //'<a class="view btn btn-default" href="' . page_link_to('angeltypes') . '&action=view&angeltype_id=' . $angeltype['id'] . '">' . _("view") . '</a>'
);
-
+
if (in_array('admin_angel_types', $privileges)) {
$actions[] = button(page_link_to('angeltypes') . '&action=edit&angeltype_id=' . $angeltype['id'], _("edit"), "btn-xs");
$actions[] = button(page_link_to('angeltypes') . '&action=delete&angeltype_id=' . $angeltype['id'], _("delete"), "btn-xs");
@@ -212,7 +212,7 @@ function angeltypes_list_controller() {
//$actions[] = '<a class="edit" href="' . page_link_to('angeltypes') . '&action=edit&angeltype_id=' . $angeltype['id'] . '">' . _("edit") . '</a>';
//$actions[] = '<a class="delete" href="' . page_link_to('angeltypes') . '&action=delete&angeltype_id=' . $angeltype['id'] . '">' . _("delete") . '</a>';
}
-
+
$angeltype['membership'] = AngelType_render_membership($angeltype);
if ($angeltype['user_angeltype_id'] != null) {
//$actions[] = '<a class="cancel" href="' . page_link_to('user_angeltypes') . '&action=delete&user_angeltype_id=' . $angeltype['user_angeltype_id'] . '">' . _("leave") . '</a>';
@@ -221,16 +221,16 @@ function angeltypes_list_controller() {
$actions[] = button(page_link_to('user_angeltypes') . '&action=add&angeltype_id=' . $angeltype['id'], _("join"), "btn-xs");
//$actions[] = '<a class="add" href="' . page_link_to('user_angeltypes') . '&action=add&angeltype_id=' . $angeltype['id'] . '">' . _("join") . '</a>';
}
-
- $angeltype['restricted'] = $angeltype['restricted'] ? '<img src="pic/icons/lock.png" alt="' . _("Restricted") . '" title="' . _("Restricted") . '">' : '';
+
+ $angeltype['restricted'] = $angeltype['restricted'] ? glyph('lock') : '';
$angeltype['name'] = '<a href="' . page_link_to('angeltypes') . '&action=view&angeltype_id=' . $angeltype['id'] . '">' . $angeltype['name'] . '</a>';
-
+
$angeltype['actions'] = table_buttons($actions);
}
-
+
return array(
angeltypes_title(),
- AngelTypes_list_view($angeltypes, in_array('admin_angel_types', $privileges))
+ AngelTypes_list_view($angeltypes, in_array('admin_angel_types', $privileges))
);
}
-?> \ No newline at end of file
+?>