From 9ea48dbd45aaa7d239998910feddcc827aaaafe9 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 25 Feb 2013 20:24:11 +0100 Subject: [PATCH] [ticket/10411] Use template loops instead of defining the html in php files PHPBB3-10411 --- phpBB/adm/style/acp_groups_position.html | 22 ++++++++++++++++------ phpBB/includes/acp/acp_groups.php | 18 ++++++++++++------ phpBB/language/en/acp/groups.php | 4 ++-- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/phpBB/adm/style/acp_groups_position.html b/phpBB/adm/style/acp_groups_position.html index eb4c3d8819..55bc1b2323 100644 --- a/phpBB/adm/style/acp_groups_position.html +++ b/phpBB/adm/style/acp_groups_position.html @@ -39,7 +39,7 @@ - {legend.GROUP_NAME} + style="color: {legend.GROUP_COLOUR}">{legend.GROUP_NAME} {legend.GROUP_TYPE} @@ -68,7 +68,12 @@
- + {S_FORM_TOKEN} @@ -126,7 +131,7 @@ {teampage.GROUP_NAME} - {teampage.GROUP_NAME} + style="color: {teampage.GROUP_COLOUR}">{teampage.GROUP_NAME} {teampage.GROUP_TYPE}- @@ -159,8 +164,8 @@
- - + + {S_FORM_TOKEN}
@@ -169,7 +174,12 @@
- + {S_FORM_TOKEN} diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index fc31105685..46b5a0fa4a 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -916,7 +916,7 @@ class acp_groups { $template->assign_block_vars('legend', array( 'GROUP_NAME' => $group_name, - 'GROUP_COLOUR' => ($row['group_colour']) ? ' style="color: #' . $row['group_colour'] . '"' : '', + 'GROUP_COLOUR' => ($row['group_colour']) ? '#' . $row['group_colour'] : '', 'GROUP_TYPE' => $user->lang[phpbb_groupposition_legend::group_type_language($row['group_type'])], 'U_MOVE_DOWN' => "{$this->u_action}&field=legend&action=move_down&g=" . $row['group_id'], @@ -926,7 +926,11 @@ class acp_groups } else { - $s_group_select_legend .= '' . $group_name . ''; + $template->assign_block_vars('add_legend', array( + 'GROUP_ID' => (int) $row['group_id'], + 'GROUP_NAME' => $group_name, + 'GROUP_SPECIAL' => ($row['group_type'] == GROUP_SPECIAL), + )); } } $db->sql_freeresult($result); @@ -966,7 +970,7 @@ class acp_groups $template->assign_block_vars('teampage', array( 'GROUP_NAME' => $group_name, - 'GROUP_COLOUR' => ($row['group_colour']) ? ' style="color: #' . $row['group_colour'] . '"' : '', + 'GROUP_COLOUR' => ($row['group_colour']) ? '#' . $row['group_colour'] : '', 'GROUP_TYPE' => $group_type, 'U_CATEGORY' => (!$row['group_id']) ? "{$this->u_action}&c=" . $row['teampage_id'] : '', @@ -989,7 +993,11 @@ class acp_groups while ($row = $db->sql_fetchrow($result)) { $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']; - $s_group_select_teampage .= '' . $group_name . ''; + $template->assign_block_vars('add_teampage', array( + 'GROUP_ID' => (int) $row['group_id'], + 'GROUP_NAME' => $group_name, + 'GROUP_SPECIAL' => ($row['group_type'] == GROUP_SPECIAL), + )); } $db->sql_freeresult($result); @@ -999,8 +1007,6 @@ class acp_groups 'U_ACTION_TEAMPAGE' => $this->u_action . '&field=teampage' . $category_url_param, 'U_ACTION_TEAMPAGE_CAT' => $this->u_action . '&field=teampage_cat', - 'S_GROUP_SELECT_LEGEND' => $s_group_select_legend, - 'S_GROUP_SELECT_TEAMPAGE' => $s_group_select_teampage, 'S_TEAMPAGE_CATEGORY' => $category_id, 'DISPLAY_FORUMS' => ($config['teampage_forums']) ? true : false, 'DISPLAY_MEMBERSHIPS' => $config['teampage_memberships'], diff --git a/phpBB/language/en/acp/groups.php b/phpBB/language/en/acp/groups.php index 18e5cbaa1d..58101e5f60 100644 --- a/phpBB/language/en/acp/groups.php +++ b/phpBB/language/en/acp/groups.php @@ -36,14 +36,13 @@ if (empty($lang) || !is_array($lang)) $lang = array_merge($lang, array( 'ACP_GROUPS_MANAGE_EXPLAIN' => 'From this panel you can administer all your usergroups. You can delete, create and edit existing groups. Furthermore, you may choose group leaders, toggle open/hidden/closed group status and set the group name and description.', - 'ADD_CATEGORY' => 'Add category', + 'ADD_GROUP_CATEGORY' => 'Add category', 'ADD_USERS' => 'Add users', 'ADD_USERS_EXPLAIN' => 'Here you can add new users to the group. You may select whether this group becomes the new default for the selected users. Additionally you can define them as group leaders. Please enter each username on a separate line.', 'COPY_PERMISSIONS' => 'Copy permissions from', 'COPY_PERMISSIONS_EXPLAIN' => 'Once created, the group will have the same permissions as the one you select here.', 'CREATE_GROUP' => 'Create new group', - 'CATEGORY_NAME' => 'Category name', 'GROUPS_NO_MEMBERS' => 'This group has no members', 'GROUPS_NO_MODS' => 'No group leaders defined', @@ -52,6 +51,7 @@ $lang = array_merge($lang, array( 'GROUP_APPROVED' => 'Approved members', 'GROUP_AVATAR' => 'Group avatar', 'GROUP_AVATAR_EXPLAIN' => 'This image will be displayed in the Group Control Panel.', + 'GROUP_CATEGORY_NAME' => 'Category name', 'GROUP_CLOSED' => 'Closed', 'GROUP_COLOR' => 'Group colour', 'GROUP_COLOR_EXPLAIN' => 'Defines the colour members’ usernames will appear in, leave blank for user default.',