aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2010-05-14 02:44:19 +0200
committerNils Adermann <naderman@naderman.de>2010-05-14 02:44:19 +0200
commitfa5845e8c582c903ec1ef4a78844cb6d77cd96b7 (patch)
tree0bf0cb16cbe05a92a436bb0fe659a90cc64ceb7e /phpBB
parentbe1c5503443c305dd7f0064631dd73e37673fd7a (diff)
parent58dc5a191c0203ea6d98c37df26b0830b3bf8203 (diff)
downloadforums-fa5845e8c582c903ec1ef4a78844cb6d77cd96b7.tar
forums-fa5845e8c582c903ec1ef4a78844cb6d77cd96b7.tar.gz
forums-fa5845e8c582c903ec1ef4a78844cb6d77cd96b7.tar.bz2
forums-fa5845e8c582c903ec1ef4a78844cb6d77cd96b7.tar.xz
forums-fa5845e8c582c903ec1ef4a78844cb6d77cd96b7.zip
Merge branch 'ticket/nickvergessen/7717' into develop-olympus
* ticket/nickvergessen/7717: [ticket/7717] Localise default extension groups for attachments
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/acp/acp_attachments.php9
-rw-r--r--phpBB/install/database_update.php41
-rw-r--r--phpBB/language/en/acp/attachments.php12
-rw-r--r--phpBB/language/en/install.php10
4 files changed, 59 insertions, 13 deletions
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index 25e51814c4..980558c830 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -90,6 +90,7 @@ class acp_attachments
$s_assigned_groups = array();
while ($row = $db->sql_fetchrow($result))
{
+ $row['group_name'] = (isset($user->lang['EXT_GROUP_' . $row['group_name']])) ? $user->lang['EXT_GROUP_' . $row['group_name']] : $row['group_name'];
$s_assigned_groups[$row['cat_id']][] = $row['group_name'];
}
$db->sql_freeresult($result);
@@ -494,6 +495,10 @@ class acp_attachments
$sql = 'SELECT group_id
FROM ' . EXTENSION_GROUPS_TABLE . "
WHERE LOWER(group_name) = '" . $db->sql_escape(utf8_strtolower($new_group_name)) . "'";
+ if ($group_id)
+ {
+ $sql .= ' AND group_id <> ' . $group_id;
+ }
$result = $db->sql_query($sql);
if ($db->sql_fetchrow($result))
@@ -551,6 +556,7 @@ class acp_attachments
$group_id = $db->sql_nextid();
}
+ $group_name = (isset($user->lang['EXT_GROUP_' . $group_name])) ? $user->lang['EXT_GROUP_' . $group_name] : $group_name;
add_log('admin', 'LOG_ATTACH_EXTGROUP_' . strtoupper($action), $group_name);
}
@@ -858,7 +864,7 @@ class acp_attachments
'U_EDIT' => $this->u_action . "&amp;action=edit&amp;g={$row['group_id']}",
'U_DELETE' => $this->u_action . "&amp;action=delete&amp;g={$row['group_id']}",
- 'GROUP_NAME' => $row['group_name'],
+ 'GROUP_NAME' => (isset($user->lang['EXT_GROUP_' . $row['group_name']])) ? $user->lang['EXT_GROUP_' . $row['group_name']] : $row['group_name'],
'CATEGORY' => $cat_lang[$row['cat_id']],
)
);
@@ -1118,6 +1124,7 @@ class acp_attachments
$group_name = array();
while ($row = $db->sql_fetchrow($result))
{
+ $row['group_name'] = (isset($user->lang['EXT_GROUP_' . $row['group_name']])) ? $user->lang['EXT_GROUP_' . $row['group_name']] : $row['group_name'];
$group_name[] = $row;
}
$db->sql_freeresult($result);
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 7af0c86314..47d261dc46 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -913,6 +913,8 @@ function database_update_info()
'3.0.7-RC2' => array(),
// No changes from 3.0.7 to 3.0.7-PL1
'3.0.7' => array(),
+ // No changes from 3.0.7-PL1 to 3.0.8-RC1
+ '3.0.7-PL1' => array(),
);
}
@@ -923,7 +925,7 @@ function database_update_info()
*****************************************************************************/
function change_database_data(&$no_updates, $version)
{
- global $db, $errored, $error_ary, $config, $phpbb_root_path, $phpEx;
+ global $db, $errored, $error_ary, $config, $phpbb_root_path, $phpEx, $user;
switch ($version)
{
@@ -1648,6 +1650,43 @@ function change_database_data(&$no_updates, $version)
// No changes from 3.0.7 to 3.0.7-PL1
case '3.0.7':
break;
+
+ // Changes from 3.0.7-PL1 to 3.0.8-RC1
+ case '3.0.7-PL1':
+ $user->add_lang('acp/attachments');
+ $extension_groups = array(
+ $user->lang['EXT_GROUP_ARCHIVES'] => 'ARCHIVES',
+ $user->lang['EXT_GROUP_DOCUMENTS'] => 'DOCUMENTS',
+ $user->lang['EXT_GROUP_DOWNLOADABLE_FILES'] => 'DOWNLOADABLE_FILES',
+ $user->lang['EXT_GROUP_FLASH_FILES'] => 'FLASH_FILES',
+ $user->lang['EXT_GROUP_IMAGES'] => 'IMAGES',
+ $user->lang['EXT_GROUP_PLAIN_TEXT'] => 'PLAIN_TEXT',
+ $user->lang['EXT_GROUP_QUICKTIME_MEDIA'] => 'QUICKTIME_MEDIA',
+ $user->lang['EXT_GROUP_REAL_MEDIA'] => 'REAL_MEDIA',
+ $user->lang['EXT_GROUP_WINDOWS_MEDIA'] => 'WINDOWS_MEDIA',
+ );
+
+ $sql = 'SELECT group_id, group_name
+ FROM ' . EXTENSION_GROUPS_TABLE;
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if (isset($extension_groups[$row['group_name']]))
+ {
+ $sql_ary = array(
+ 'group_name' => $extension_groups[$row['group_name']],
+ );
+ $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
+ WHERE group_id = ' . (int) $row['group_id'];
+ _sql($sql, $errored, $error_ary);
+ }
+ }
+ $db->sql_freeresult($result);
+
+
+ $no_updates = false;
+ break;
}
}
diff --git a/phpBB/language/en/acp/attachments.php b/phpBB/language/en/acp/attachments.php
index f6369b6739..1821b8c867 100644
--- a/phpBB/language/en/acp/attachments.php
+++ b/phpBB/language/en/acp/attachments.php
@@ -85,7 +85,7 @@ $lang = array_merge($lang, array(
'DISPLAY_INLINED_EXPLAIN' => 'If set to No image attachments will show as a link.',
'DISPLAY_ORDER' => 'Attachment display order',
'DISPLAY_ORDER_EXPLAIN' => 'Display attachments ordered by time.',
-
+
'EDIT_EXTENSION_GROUP' => 'Edit extension group',
'EXCLUDE_ENTERED_IP' => 'Enable this to exclude the entered IP/hostname.',
'EXCLUDE_FROM_ALLOWED_IP' => 'Exclude IP from allowed IPs/hostnames',
@@ -97,6 +97,16 @@ $lang = array_merge($lang, array(
'EXTENSION_GROUP_DELETED' => 'Extension group successfully deleted.',
'EXTENSION_GROUP_EXIST' => 'The extension group %s already exists.',
+ 'EXT_GROUP_ARCHIVES' => 'Archives',
+ 'EXT_GROUP_DOCUMENTS' => 'Documents',
+ 'EXT_GROUP_DOWNLOADABLE_FILES' => 'Downloadable Files',
+ 'EXT_GROUP_FLASH_FILES' => 'Flash Files',
+ 'EXT_GROUP_IMAGES' => 'Images',
+ 'EXT_GROUP_PLAIN_TEXT' => 'Plain Text',
+ 'EXT_GROUP_QUICKTIME_MEDIA' => 'Quicktime Media',
+ 'EXT_GROUP_REAL_MEDIA' => 'Real Media',
+ 'EXT_GROUP_WINDOWS_MEDIA' => 'Windows Media',
+
'GO_TO_EXTENSIONS' => 'Go to extension management screen',
'GROUP_NAME' => 'Group name',
diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php
index 8515739dc9..4e58de8d90 100644
--- a/phpBB/language/en/install.php
+++ b/phpBB/language/en/install.php
@@ -586,16 +586,6 @@ $lang = array_merge($lang, array(
'DEFAULT_INSTALL_POST' => 'This is an example post in your phpBB3 installation. Everything seems to be working. You may delete this post if you like and continue to set up your board. During the installation process your first category and your first forum are assigned an appropriate set of permissions for the predefined usergroups administrators, bots, global moderators, guests, registered users and registered COPPA users. If you also choose to delete your first category and your first forum, do not forget to assign permissions for all these usergroups for all new categories and forums you create. It is recommended to rename your first category and your first forum and copy permissions from these while creating new categories and forums. Have fun!',
- 'EXT_GROUP_ARCHIVES' => 'Archives',
- 'EXT_GROUP_DOCUMENTS' => 'Documents',
- 'EXT_GROUP_DOWNLOADABLE_FILES' => 'Downloadable Files',
- 'EXT_GROUP_FLASH_FILES' => 'Flash Files',
- 'EXT_GROUP_IMAGES' => 'Images',
- 'EXT_GROUP_PLAIN_TEXT' => 'Plain Text',
- 'EXT_GROUP_QUICKTIME_MEDIA' => 'Quicktime Media',
- 'EXT_GROUP_REAL_MEDIA' => 'Real Media',
- 'EXT_GROUP_WINDOWS_MEDIA' => 'Windows Media',
-
'FORUMS_FIRST_CATEGORY' => 'Your first category',
'FORUMS_TEST_FORUM_DESC' => 'Description of your first forum.',
'FORUMS_TEST_FORUM_TITLE' => 'Your first forum',