From 61bca8ed8ab42ec8c8e8b651900d76ab6ae49eef Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 11 May 2014 12:09:16 +0200 Subject: [PATCH 01/39] [ticket/12527] Remove language file editor form ACP PHPBB3-12527 --- phpBB/includes/acp/acp_language.php | 1075 +-------------------------- 1 file changed, 4 insertions(+), 1071 deletions(-) diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index 013aab670f..d0920c3490 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -30,22 +30,13 @@ class acp_language function main($id, $mode) { - global $config, $db, $user, $auth, $template, $cache; - global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; - global $safe_mode, $file_uploads; - global $request; + global $config, $db, $user, $template; + global $phpbb_root_path, $phpEx, $request; include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); - $this->default_variables(); - // Check and set some common vars - $action = (isset($_POST['update_details'])) ? 'update_details' : ''; - $action = (isset($_POST['download_file'])) ? 'download_file' : $action; - $action = (isset($_POST['upload_file'])) ? 'upload_file' : $action; - $action = (isset($_POST['upload_data'])) ? 'upload_data' : $action; - $action = (isset($_POST['submit_file'])) ? 'submit_file' : $action; $action = (isset($_POST['remove_store'])) ? 'details' : $action; $submit = (empty($action) && !isset($_POST['update']) && !isset($_POST['test_connection'])) ? false : true; @@ -55,11 +46,6 @@ class acp_language add_form_key('acp_lang'); $lang_id = request_var('id', 0); - if (isset($_POST['missing_file'])) - { - $missing_file = request_var('missing_file', array('' => 0)); - $request->overwrite('language_file', array_shift(array_keys($missing_file))); - } $selected_lang_file = request_var('language_file', '|common.' . $phpEx); @@ -68,113 +54,12 @@ class acp_language $this->language_directory = basename($this->language_directory); $this->language_file = basename($this->language_file); - // detect language file type - if ($this->language_directory == 'email') - { - $language_file_type = 'email'; - $request_default = ''; - } - else if (strpos($this->language_file, 'help_') === 0) - { - $language_file_type = 'help'; - $request_default = array(0 => array(0 => '')); - } - else - { - $language_file_type = 'normal'; - $request_default = array('' => ''); - } - $user->add_lang('acp/language'); $this->tpl_name = 'acp_language'; $this->page_title = 'ACP_LANGUAGE_PACKS'; - if ($submit && $action == 'upload_data' && request_var('test_connection', '')) - { - $test_connection = false; - $action = 'upload_file'; - $method = request_var('method', ''); - - include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx); - - switch ($method) - { - case 'ftp': - $transfer = new ftp( - request_var('host', ''), - request_var('username', ''), - htmlspecialchars_decode($request->untrimmed_variable('password', '')), - request_var('root_path', ''), - request_var('port', ''), - request_var('timeout', '') - ); - break; - - case 'ftp_fsock': - $transfer = new ftp_fsock( - request_var('host', ''), - request_var('username', ''), - htmlspecialchars_decode($request->untrimmed_variable('password', '')), - request_var('root_path', ''), - request_var('port', ''), - request_var('timeout', '') - ); - break; - - default: - trigger_error($user->lang['INVALID_UPLOAD_METHOD'], E_USER_ERROR); - break; - } - - $test_connection = $transfer->open_session(); - $transfer->close_session(); - } - switch ($action) { - case 'upload_file': - - include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx); - - $method = request_var('method', ''); - - if (!class_exists($method)) - { - trigger_error('Method does not exist.', E_USER_ERROR); - } - - $requested_data = call_user_func(array($method, 'data')); - foreach ($requested_data as $data => $default) - { - $template->assign_block_vars('data', array( - 'DATA' => $data, - 'NAME' => $user->lang[strtoupper($method . '_' . $data)], - 'EXPLAIN' => $user->lang[strtoupper($method . '_' . $data) . '_EXPLAIN'], - 'DEFAULT' => $request->variable($data, (string) $default), - )); - } - - $hidden_data = build_hidden_fields(array( - 'file' => $this->language_file, - 'dir' => $this->language_directory, - 'language_file' => $selected_lang_file, - 'method' => $method) - ); - - $hidden_data .= build_hidden_fields(array('entry' => $request->variable('entry', $request_default, true, \phpbb\request\request_interface::POST))); - - $template->assign_vars(array( - 'S_UPLOAD' => true, - 'NAME' => $method, - 'U_ACTION' => $this->u_action . "&id=$lang_id&action=upload_data", - 'U_BACK' => $this->u_action . "&id=$lang_id&action=details&language_file=" . urlencode($selected_lang_file), - 'HIDDEN' => $hidden_data, - - 'S_CONNECTION_SUCCESS' => (request_var('test_connection', '') && $test_connection === true) ? true : false, - 'S_CONNECTION_FAILED' => (request_var('test_connection', '') && $test_connection !== true) ? true : false - )); - break; - case 'update_details': if (!$submit || !check_form_key($form_name)) @@ -209,259 +94,6 @@ class acp_language trigger_error($user->lang['LANGUAGE_DETAILS_UPDATED'] . adm_back_link($this->u_action)); break; - case 'submit_file': - case 'download_file': - case 'upload_data': - - if (!$submit || !check_form_key($form_name)) - { - trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING); - } - - $entry_value = $request->variable('entry', $request_default, true, \phpbb\request\request_interface::POST); - - if (!$lang_id || !$entry_value) - { - trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING); - } - - if (!$this->language_file || (!$this->language_directory && !in_array($this->language_file, $this->main_files))) - { - trigger_error($user->lang['NO_FILE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING); - } - - $sql = 'SELECT * - FROM ' . LANG_TABLE . " - WHERE lang_id = $lang_id"; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - if (!$row) - { - trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING); - } - - // Before we attempt to write anything let's check if the admin really chose a correct filename - switch ($this->language_directory) - { - case 'email': - // Get email templates - $email_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'email', 'txt'); - $email_files = $email_files['email/']; - - if (!in_array($this->language_file, $email_files)) - { - trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id), E_USER_WARNING); - } - break; - - case 'acp': - // Get acp files - $acp_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'acp', $phpEx); - $acp_files = $acp_files['acp/']; - - if (!in_array($this->language_file, $acp_files)) - { - trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id), E_USER_WARNING); - } - break; - - case 'mods': - // Get mod files - $mods_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'mods', $phpEx); - $mods_files = (isset($mods_files['mods/'])) ? $mods_files['mods/'] : array(); - - if (!in_array($this->language_file, $mods_files)) - { - trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id), E_USER_WARNING); - } - break; - - default: - if (!in_array($this->language_file, $this->main_files)) - { - trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id), E_USER_WARNING); - } - break; - } - - if (!$safe_mode) - { - $mkdir_ary = array('language', 'language/' . $row['lang_iso']); - - if ($this->language_directory) - { - $mkdir_ary[] = 'language/' . $row['lang_iso'] . '/' . $this->language_directory; - } - - foreach ($mkdir_ary as $dir) - { - $dir = $phpbb_root_path . 'store/' . $dir; - - if (!is_dir($dir)) - { - if (!@mkdir($dir, 0777)) - { - trigger_error("Could not create directory $dir", E_USER_ERROR); - } - @chmod($dir, 0777); - } - } - } - - // Get target filename for storage folder - $filename = $this->get_filename($row['lang_iso'], $this->language_directory, $this->language_file, true, true); - $fp = @fopen($phpbb_root_path . $filename, 'wb'); - - if (!$fp) - { - trigger_error(sprintf($user->lang['UNABLE_TO_WRITE_FILE'], $filename) . adm_back_link($this->u_action . '&id=' . $lang_id . '&action=details&language_file=' . urlencode($selected_lang_file)), E_USER_WARNING); - } - - if ($language_file_type == 'email') - { - // Email Template - $entry = $this->prepare_lang_entry(htmlspecialchars_decode($entry_value), false); - fwrite($fp, $entry); - } - else - { - $name = (($this->language_directory) ? $this->language_directory . '_' : '') . $this->language_file; - $header = str_replace(array('{FILENAME}', '{LANG_NAME}', '{CHANGED}', '{AUTHOR}'), array($name, $row['lang_english_name'], date('Y-m-d', time()), $row['lang_author']), $this->language_file_header); - - if ($language_file_type == 'help') - { - // Help File - $header .= '$help = array(' . "\n"; - fwrite($fp, $header); - - foreach ($entry_value as $key => $value) - { - if (!is_array($value)) - { - continue; - } - - $entry = "\tarray(\n"; - - foreach ($value as $_key => $_value) - { - $entry .= "\t\t" . (int) $_key . "\t=> '" . $this->prepare_lang_entry(htmlspecialchars_decode($_value)) . "',\n"; - } - - $entry .= "\t),\n"; - fwrite($fp, $entry); - } - - $footer = ");\n\n?>"; - fwrite($fp, $footer); - } - else if ($language_file_type == 'normal') - { - // Language File - $header .= $this->lang_header; - fwrite($fp, $header); - - foreach ($entry_value as $key => $value) - { - $entry = $this->format_lang_array(htmlspecialchars_decode($key), htmlspecialchars_decode($value)); - fwrite($fp, $entry); - } - - $footer = "));\n\n?>"; - fwrite($fp, $footer); - } - } - - fclose($fp); - - if ($action == 'download_file') - { - header('Pragma: no-cache'); - header('Content-Type: application/octetstream; name="' . $this->language_file . '"'); - header('Content-disposition: attachment; filename=' . $this->language_file); - - $fp = @fopen($phpbb_root_path . $filename, 'rb'); - while ($buffer = fread($fp, 1024)) - { - echo $buffer; - } - fclose($fp); - - add_log('admin', 'LOG_LANGUAGE_FILE_SUBMITTED', $this->language_file); - - exit; - } - else if ($action == 'upload_data') - { - $sql = 'SELECT lang_iso - FROM ' . LANG_TABLE . " - WHERE lang_id = $lang_id"; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - $file = request_var('file', ''); - $dir = request_var('dir', ''); - - $selected_lang_file = $dir . '|' . $file; - - $old_file = '/' . $this->get_filename($row['lang_iso'], $dir, $file, false, true); - $lang_path = 'language/' . $row['lang_iso'] . '/' . (($dir) ? $dir . '/' : ''); - - include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx); - $method = request_var('method', ''); - - if ($method != 'ftp' && $method != 'ftp_fsock') - { - trigger_error($user->lang['INVALID_UPLOAD_METHOD'], E_USER_ERROR); - } - - $transfer = new $method( - request_var('host', ''), - request_var('username', ''), - htmlspecialchars_decode($request->untrimmed_variable('password', '')), - request_var('root_path', ''), - request_var('port', ''), - request_var('timeout', '') - ); - - if (($result = $transfer->open_session()) !== true) - { - trigger_error($user->lang[$result] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id . '&language_file=' . urlencode($selected_lang_file)), E_USER_WARNING); - } - - $transfer->rename($lang_path . $file, $lang_path . $file . '.bak'); - $result = $transfer->copy_file('store/' . $lang_path . $file, $lang_path . $file); - - if ($result === false) - { - // If failed, try to rename again and print error out... - $transfer->delete_file($lang_path . $file); - $transfer->rename($lang_path . $file . '.bak', $lang_path . $file); - - trigger_error($user->lang['UPLOAD_FAILED'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id . '&language_file=' . urlencode($selected_lang_file)), E_USER_WARNING); - } - - $transfer->close_session(); - - // Remove from storage folder - if (file_exists($phpbb_root_path . 'store/' . $lang_path . $file)) - { - @unlink($phpbb_root_path . 'store/' . $lang_path . $file); - } - - add_log('admin', 'LOG_LANGUAGE_FILE_REPLACED', $file); - - trigger_error($user->lang['UPLOAD_COMPLETED'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id . '&language_file=' . urlencode($selected_lang_file))); - } - - add_log('admin', 'LOG_LANGUAGE_FILE_SUBMITTED', $this->language_file); - $action = 'details'; - - // no break; - case 'details': if (!$lang_id) @@ -478,308 +110,18 @@ class acp_language $lang_entries = $db->sql_fetchrow($result); $db->sql_freeresult($result); - $lang_iso = $lang_entries['lang_iso']; - $missing_vars = $missing_files = array(); - - // Get email templates - $email_files = filelist($phpbb_root_path . 'language/' . $config['default_lang'], 'email', 'txt'); - $email_files = $email_files['email/']; - - // Get acp files - $acp_files = filelist($phpbb_root_path . 'language/' . $config['default_lang'], 'acp', $phpEx); - $acp_files = $acp_files['acp/']; - - // Get mod files - $mods_files = filelist($phpbb_root_path . 'language/' . $config['default_lang'], 'mods', $phpEx); - $mods_files = (isset($mods_files['mods/'])) ? $mods_files['mods/'] : array(); - - // Check if our current filename matches the files - switch ($this->language_directory) - { - case 'email': - if (!in_array($this->language_file, $email_files)) - { - trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id), E_USER_WARNING); - } - break; - - case 'acp': - if (!in_array($this->language_file, $acp_files)) - { - trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id), E_USER_WARNING); - } - break; - - case 'mods': - if (!in_array($this->language_file, $mods_files)) - { - trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id), E_USER_WARNING); - } - break; - - default: - if (!in_array($this->language_file, $this->main_files)) - { - trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id), E_USER_WARNING); - } - } - - if (isset($_POST['remove_store'])) - { - $store_filename = $this->get_filename($lang_iso, $this->language_directory, $this->language_file, true, true); - - if (file_exists($phpbb_root_path . $store_filename)) - { - @unlink($phpbb_root_path . $store_filename); - } - } - - include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx); - - $methods = transfer::methods(); - - foreach ($methods as $method) - { - $template->assign_block_vars('buttons', array( - 'VALUE' => $method - )); - } - $template->assign_vars(array( 'S_DETAILS' => true, 'U_ACTION' => $this->u_action . "&action=details&id=$lang_id", 'U_BACK' => $this->u_action, + 'LANG_LOCAL_NAME' => $lang_entries['lang_local_name'], 'LANG_ENGLISH_NAME' => $lang_entries['lang_english_name'], 'LANG_ISO' => $lang_entries['lang_iso'], 'LANG_AUTHOR' => $lang_entries['lang_author'], - 'ALLOW_UPLOAD' => sizeof($methods) - ) - ); - - // If current lang is different from the default lang, then first try to grab missing/additional vars - if ($lang_iso != $config['default_lang']) - { - $is_missing_var = false; - - foreach ($this->main_files as $file) - { - if (file_exists($phpbb_root_path . $this->get_filename($lang_iso, '', $file))) - { - $missing_vars[$file] = $this->compare_language_files($config['default_lang'], $lang_iso, '', $file); - - if (sizeof($missing_vars[$file])) - { - $is_missing_var = true; - } - } - else - { - $missing_files[] = $this->get_filename($lang_iso, '', $file); - } - } - - // Now go through acp/mods directories - foreach ($acp_files as $file) - { - if (file_exists($phpbb_root_path . $this->get_filename($lang_iso, 'acp', $file))) - { - $missing_vars['acp/' . $file] = $this->compare_language_files($config['default_lang'], $lang_iso, 'acp', $file); - - if (sizeof($missing_vars['acp/' . $file])) - { - $is_missing_var = true; - } - } - else - { - $missing_files[] = $this->get_filename($lang_iso, 'acp', $file); - } - } - - if (sizeof($mods_files)) - { - foreach ($mods_files as $file) - { - if (file_exists($phpbb_root_path . $this->get_filename($lang_iso, 'mods', $file))) - { - $missing_vars['mods/' . $file] = $this->compare_language_files($config['default_lang'], $lang_iso, 'mods', $file); - - if (sizeof($missing_vars['mods/' . $file])) - { - $is_missing_var = true; - } - } - else - { - $missing_files[] = $this->get_filename($lang_iso, 'mods', $file); - } - } - } - - // More missing files... for example email templates? - foreach ($email_files as $file) - { - if (!file_exists($phpbb_root_path . $this->get_filename($lang_iso, 'email', $file))) - { - $missing_files[] = $this->get_filename($lang_iso, 'email', $file); - } - } - - if (sizeof($missing_files)) - { - $template->assign_vars(array( - 'S_MISSING_FILES' => true, - 'L_MISSING_FILES' => sprintf($user->lang['THOSE_MISSING_LANG_FILES'], $lang_entries['lang_local_name']), - 'MISSING_FILES' => implode('
', $missing_files)) - ); - } - - if ($is_missing_var) - { - $template->assign_vars(array( - 'S_MISSING_VARS' => true, - 'L_MISSING_VARS_EXPLAIN' => sprintf($user->lang['THOSE_MISSING_LANG_VARIABLES'], $lang_entries['lang_local_name']), - 'U_MISSING_ACTION' => $this->u_action . "&action=$action&id=$lang_id") - ); - - foreach ($missing_vars as $file => $vars) - { - if (!sizeof($vars)) - { - continue; - } - - $template->assign_block_vars('missing', array( - 'FILE' => $file, - 'TPL' => $this->print_language_entries($vars, '', false), - 'KEY' => (strpos($file, '/') === false) ? '|' . $file : str_replace('/', '|', $file)) - ); - } - } - } - - // Main language files - $s_lang_options = ''; - foreach ($this->main_files as $file) - { - if (strpos($file, 'help_') === 0) - { - continue; - } - - $prefix = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, '', $file, true, true))) ? '* ' : ''; - - $selected = (!$this->language_directory && $this->language_file == $file) ? ' selected="selected"' : ''; - $s_lang_options .= ''; - } - - // Help Files - $s_lang_options .= ''; - foreach ($this->main_files as $file) - { - if (strpos($file, 'help_') !== 0) - { - continue; - } - - $prefix = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, '', $file, true, true))) ? '* ' : ''; - - $selected = (!$this->language_directory && $this->language_file == $file) ? ' selected="selected"' : ''; - $s_lang_options .= ''; - } - - // Now every other language directory - $check_files = array('email', 'acp', 'mods'); - - foreach ($check_files as $check) - { - if (!sizeof(${$check . '_files'})) - { - continue; - } - - $s_lang_options .= ''; - - foreach (${$check . '_files'} as $file) - { - $prefix = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, $check, $file, true, true))) ? '* ' : ''; - - $selected = ($this->language_directory == $check && $this->language_file == $file) ? ' selected="selected"' : ''; - $s_lang_options .= ''; - } - } - - // Get Language Entries - if saved within store folder, we take this one (with the option to remove it) - $lang = array(); - - $is_email_file = ($this->language_directory == 'email') ? true : false; - $is_help_file = (strpos($this->language_file, 'help_') === 0) ? true : false; - - $file_from_store = (file_exists($phpbb_root_path . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, true, true))) ? true : false; - $no_store_filename = $this->get_filename($lang_iso, $this->language_directory, $this->language_file); - - if (!$file_from_store && !file_exists($phpbb_root_path . $no_store_filename)) - { - $print_message = sprintf($user->lang['MISSING_LANGUAGE_FILE'], $no_store_filename); - } - else - { - if ($is_email_file) - { - $lang = file_get_contents($phpbb_root_path . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, $file_from_store)); - } - else - { - $help = array(); - include($phpbb_root_path . $this->get_filename($lang_iso, $this->language_directory, $this->language_file, $file_from_store)); - - if ($is_help_file) - { - $lang = $help; - unset($help); - } - } - - $print_message = (($this->language_directory) ? $this->language_directory . '/' : '') . $this->language_file; - } - - // Normal language pack entries - $template->assign_vars(array( - 'U_ENTRY_ACTION' => $this->u_action . "&action=details&id=$lang_id#entries", - 'S_EMAIL_FILE' => $is_email_file, - 'S_FROM_STORE' => $file_from_store, - 'S_LANG_OPTIONS' => $s_lang_options, - 'PRINT_MESSAGE' => $print_message, - ) - ); - - if (!$is_email_file) - { - $tpl = ''; - $name = (($this->language_directory) ? $this->language_directory . '/' : '') . $this->language_file; - - if (isset($missing_vars[$name]) && sizeof($missing_vars[$name])) - { - $tpl .= $this->print_language_entries($missing_vars[$name], '* '); - } - - $tpl .= $this->print_language_entries($lang); - - $template->assign_var('TPL', $tpl); - unset($tpl); - } - else - { - $template->assign_vars(array( - 'LANG' => $lang) - ); - - unset($lang); - } + )); return; - break; case 'delete': @@ -929,127 +271,6 @@ class acp_language trigger_error($message . adm_back_link($this->u_action)); break; - - case 'download': - - if (!$lang_id) - { - trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action), E_USER_WARNING); - } - - $sql = 'SELECT * - FROM ' . LANG_TABLE . ' - WHERE lang_id = ' . $lang_id; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - $use_method = request_var('use_method', ''); - $methods = array('.tar'); - - $available_methods = array('.tar.gz' => 'zlib', '.tar.bz2' => 'bz2', '.zip' => 'zlib'); - foreach ($available_methods as $type => $module) - { - if (!@extension_loaded($module)) - { - continue; - } - - $methods[] = $type; - } - - // Let the user decide in which format he wants to have the pack - if (!$use_method) - { - $this->page_title = 'SELECT_DOWNLOAD_FORMAT'; - - $radio_buttons = ''; - foreach ($methods as $method) - { - $radio_buttons .= ''; - } - - $template->assign_vars(array( - 'S_SELECT_METHOD' => true, - 'U_BACK' => $this->u_action, - 'U_ACTION' => $this->u_action . "&action=$action&id=$lang_id", - 'RADIO_BUTTONS' => $radio_buttons) - ); - - return; - } - - if (!in_array($use_method, $methods)) - { - $use_method = '.tar'; - } - - include_once($phpbb_root_path . 'includes/functions_compress.' . $phpEx); - - if ($use_method == '.zip') - { - $compress = new compress_zip('w', $phpbb_root_path . 'store/lang_' . $row['lang_iso'] . $use_method); - } - else - { - $compress = new compress_tar('w', $phpbb_root_path . 'store/lang_' . $row['lang_iso'] . $use_method, $use_method); - } - - // Get email templates - $email_templates = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'email', 'txt'); - $email_templates = $email_templates['email/']; - - // Get acp files - $acp_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'acp', $phpEx); - $acp_files = $acp_files['acp/']; - - // Get mod files - $mod_files = filelist($phpbb_root_path . 'language/' . $row['lang_iso'], 'mods', $phpEx); - $mod_files = (isset($mod_files['mods/'])) ? $mod_files['mods/'] : array(); - - // Add main files - $this->add_to_archive($compress, $this->main_files, $row['lang_iso']); - - // Add search files if they exist... - if (file_exists($phpbb_root_path . 'language/' . $row['lang_iso'] . '/search_ignore_words.' . $phpEx)) - { - $this->add_to_archive($compress, array("search_ignore_words.$phpEx"), $row['lang_iso']); - } - - if (file_exists($phpbb_root_path . 'language/' . $row['lang_iso'] . '/search_synonyms.' . $phpEx)) - { - $this->add_to_archive($compress, array("search_synonyms.$phpEx"), $row['lang_iso']); - } - - // Write files in folders - $this->add_to_archive($compress, $email_templates, $row['lang_iso'], 'email'); - $this->add_to_archive($compress, $acp_files, $row['lang_iso'], 'acp'); - $this->add_to_archive($compress, $mod_files, $row['lang_iso'], 'mods'); - - // Write ISO File - $iso_src = htmlspecialchars_decode($row['lang_english_name']) . "\n"; - $iso_src .= htmlspecialchars_decode($row['lang_local_name']) . "\n"; - $iso_src .= htmlspecialchars_decode($row['lang_author']); - $compress->add_data($iso_src, 'language/' . $row['lang_iso'] . '/iso.txt'); - - // index.htm files - $compress->add_data('', 'language/' . $row['lang_iso'] . '/index.htm'); - $compress->add_data('', 'language/' . $row['lang_iso'] . '/email/index.htm'); - $compress->add_data('', 'language/' . $row['lang_iso'] . '/acp/index.htm'); - - if (sizeof($mod_files)) - { - $compress->add_data('', 'language/' . $row['lang_iso'] . '/mods/index.htm'); - } - - $compress->close(); - - $compress->download('lang_' . $row['lang_iso']); - @unlink($phpbb_root_path . 'store/lang_' . $row['lang_iso'] . $use_method); - - exit; - - break; } $sql = 'SELECT user_lang, COUNT(user_lang) AS lang_count @@ -1141,292 +362,4 @@ class acp_language unset($new_ary); } - - - /** - * Set default language variables/header - */ - function default_variables() - { - global $phpEx; - - $this->language_file_header = 'lang_header = ' -$lang = array_merge($lang, array( -'; - - // Language files in language root directory - $this->main_files = array("captcha_qa.$phpEx", "captcha_recaptcha.$phpEx", "common.$phpEx", "groups.$phpEx", "install.$phpEx", "mcp.$phpEx", "memberlist.$phpEx", "posting.$phpEx", "search.$phpEx", "ucp.$phpEx", "viewforum.$phpEx", "viewtopic.$phpEx", "help_bbcode.$phpEx", "help_faq.$phpEx"); - } - - /** - * Get filename/location of language file - */ - function get_filename($lang_iso, $directory, $filename, $check_store = false, $only_return_filename = false) - { - global $phpbb_root_path, $safe_mode; - - $check_filename = "language/$lang_iso/" . (($directory) ? $directory . '/' : '') . $filename; - - if ($check_store) - { - $check_store_filename = ($safe_mode) ? "store/langfile_{$lang_iso}" . (($directory) ? '_' . $directory : '') . "_{$filename}" : "store/language/$lang_iso/" . (($directory) ? $directory . '/' : '') . $filename; - - if (!$only_return_filename && file_exists($phpbb_root_path . $check_store_filename)) - { - return $check_store_filename; - } - else if ($only_return_filename) - { - return $check_store_filename; - } - } - - return $check_filename; - } - - /** - * Add files to archive - */ - function add_to_archive(&$compress, $filelist, $lang_iso, $directory = '') - { - global $phpbb_root_path; - - foreach ($filelist as $file) - { - // Get source filename - $source = $this->get_filename($lang_iso, $directory, $file, true); - $destination = 'language/' . $lang_iso . '/' . (($directory) ? $directory . '/' : '') . $file; - - // Add file to archive - $compress->add_custom_file($phpbb_root_path . $source, $destination); - } - } - - /** - * Little helper to add some hardcoded template bits - */ - function add_input_field() - { - $keys = func_get_args(); - - $non_static = array_shift($keys); - $value = utf8_normalize_nfc(array_shift($keys)); - - if (!$non_static) - { - return '' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . ''; - } - - // If more then 270 characters, then we present a textarea, else an input field - $textarea = (utf8_strlen($value) > 270) ? true : false; - $tpl = ''; - - $tpl .= ($textarea) ? '' : '" />'; - - return $tpl; - } - - /** - * Print language entries - */ - function print_language_entries(&$lang_ary, $key_prefix = '', $input_field = true) - { - $tpl = ''; - - foreach ($lang_ary as $key => $value) - { - if (is_array($value)) - { - // Write key - $tpl .= ' - - ' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . ' - '; - - foreach ($value as $_key => $_value) - { - if (is_array($_value)) - { - // Write key - $tpl .= ' - - ' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '   ' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . ' - '; - - foreach ($_value as $__key => $__value) - { - // Write key - $tpl .= ' - - ' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '' . htmlspecialchars($__key, ENT_COMPAT, 'UTF-8') . ' - '; - - $tpl .= $this->add_input_field($input_field, $__value, $key, $_key, $__key); - - $tpl .= ' - '; - } - } - else - { - // Write key - $tpl .= ' - - ' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . ' - '; - - $tpl .= $this->add_input_field($input_field, $_value, $key, $_key); - - $tpl .= ' - '; - } - } - - $tpl .= ' - -   - '; - } - else - { - // Write key - $tpl .= ' - - ' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . ' - '; - - $tpl .= $this->add_input_field($input_field, $value, $key); - - $tpl .= ' - '; - } - } - - return $tpl; - } - - /** - * Compare two language files - */ - function compare_language_files($source_lang, $dest_lang, $directory, $file) - { - global $phpbb_root_path, $phpEx; - - $return_ary = array(); - - $lang = array(); - include("{$phpbb_root_path}language/{$source_lang}/" . (($directory) ? $directory . '/' : '') . $file); - $lang_entry_src = $lang; - - $lang = array(); - - if (!file_exists($phpbb_root_path . $this->get_filename($dest_lang, $directory, $file, true))) - { - return array(); - } - - include($phpbb_root_path . $this->get_filename($dest_lang, $directory, $file, true)); - - $lang_entry_dst = $lang; - - unset($lang); - - $diff_array_keys = array_diff(array_keys($lang_entry_src), array_keys($lang_entry_dst)); - unset($lang_entry_dst); - - foreach ($diff_array_keys as $key) - { - $return_ary[$key] = $lang_entry_src[$key]; - } - - unset($lang_entry_src); - - return $return_ary; - } - - /** - * Return language string value for storage - */ - function prepare_lang_entry($text, $store = true) - { - $text = (STRIP) ? stripslashes($text) : $text; - - // Adjust for storage... - if ($store) - { - $text = str_replace("'", "\\'", str_replace('\\', '\\\\', $text)); - } - - return $text; - } - - /** - * Format language array for storage - */ - function format_lang_array($key, $value, $tabs = "\t") - { - $entry = ''; - - if (!is_array($value)) - { - $entry .= "{$tabs}'" . $this->prepare_lang_entry($key) . "'\t=> '" . $this->prepare_lang_entry($value) . "',\n"; - } - else - { - $_tabs = $tabs . "\t"; - $entry .= "\n{$tabs}'" . $this->prepare_lang_entry($key) . "'\t=> array(\n"; - - foreach ($value as $_key => $_value) - { - $entry .= $this->format_lang_array($_key, $_value, $_tabs); - } - - $entry .= "{$tabs}),\n\n"; - } - - return $entry; - } } From c334d8431d2945267a0ec7d0e883f4c85368b6f3 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 11 May 2014 12:45:05 +0200 Subject: [PATCH 02/39] [ticket/12527] Remove editor from template PHPBB3-12527 --- phpBB/adm/style/acp_language.html | 133 +----------------------------- 1 file changed, 2 insertions(+), 131 deletions(-) diff --git a/phpBB/adm/style/acp_language.html b/phpBB/adm/style/acp_language.html index d32f6b7eac..faf8159b49 100644 --- a/phpBB/adm/style/acp_language.html +++ b/phpBB/adm/style/acp_language.html @@ -2,29 +2,7 @@ - - - « {L_BACK} - -

{L_SELECT_DOWNLOAD_FORMAT}

- -
- -
- {L_DOWNLOAD_AS} -
-
-
{RADIO_BUTTONS}
-
- -

- -

-
- -
- - + « {L_BACK} @@ -98,113 +76,6 @@

- - -

{L_LANGUAGE_ENTRIES}

- -

{L_LANGUAGE_ENTRIES_EXPLAIN}

- -
- - -
- -
- - -
-   -
- -

 
 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {TPL} - - - - - -
{L_FILE_CONTENTS}
{L_LANGUAGE_KEY}{L_LANGUAGE_VARIABLE}
{PRINT_MESSAGE}
{L_FILE_FROM_STORAGE}
  
-   {L_UPLOAD_METHOD}{L_COLON}  id="method" checked="checked" value="{buttons.VALUE}" name="method" /> {buttons.VALUE} 
{S_FORM_TOKEN}  
-
- - - - « {L_BACK} - -

{L_UPLOAD_SETTINGS}

- -
- - -
-

{L_CONNECTION_SUCCESS}

-
- -
-

{L_CONNECTION_FAILED}

-
- - -
- {L_UPLOAD_SETTINGS} -
-
-
{NAME}
-
- -
-

{data.EXPLAIN}
-
-
- -
- -
- {HIDDEN} - {S_FORM_TOKEN} - - -
-
-

{L_ACP_LANGUAGE_PACKS}

@@ -231,7 +102,7 @@ {lang.LOCAL_NAME} {lang.ISO} {lang.USED_BY} -  {L_DOWNLOAD} | {L_DELETE} + {L_DELETE} From 63e195d7f0c286b0dcbc4ae30826ee88d811c372 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 11 May 2014 13:10:51 +0200 Subject: [PATCH 03/39] [ticket/12527] Restore missing files and variables check PHPBB3-12527 --- phpBB/adm/style/acp_language.html | 56 +++++++----------- phpBB/includes/acp/acp_language.php | 89 ++++++++++++++++++++++++++++- phpBB/language/en/acp/language.php | 1 + 3 files changed, 110 insertions(+), 36 deletions(-) diff --git a/phpBB/adm/style/acp_language.html b/phpBB/adm/style/acp_language.html index faf8159b49..4439f519e0 100644 --- a/phpBB/adm/style/acp_language.html +++ b/phpBB/adm/style/acp_language.html @@ -36,46 +36,32 @@ -

+ +

{L_MISSING_FILES}

- -
-

{L_MISSING_FILES}

-

{MISSING_FILES}

-
-

+
+ {L_MISSING_LANG_FILES} + + » {missing_files.FILE_NAME}
+ +
- -

{L_MISSING_LANG_VARIABLES}

+ +

{L_MISSING_VARS_EXPLAIN}

-

{L_MISSING_VARS_EXPLAIN}

- -
- - - - - - - - - - - - - - - {missing.TPL} - - -
{L_LANGUAGE_KEY}{L_LANGUAGE_VARIABLE}
{missing.FILE}
-
{S_FORM_TOKEN}
-
- -

+
+ {L_MISSING_LANG_VARIABLES} + +
+
+ +
{missing_varfile.variable.VAR_NAME}
+ +
+ +
-

{L_ACP_LANGUAGE_PACKS}

diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index d0920c3490..dfd3b06290 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -110,6 +110,8 @@ class acp_language $lang_entries = $db->sql_fetchrow($result); $db->sql_freeresult($result); + $lang_iso = $lang_entries['lang_iso']; + $template->assign_vars(array( 'S_DETAILS' => true, 'U_ACTION' => $this->u_action . "&action=details&id=$lang_id", @@ -117,10 +119,67 @@ class acp_language 'LANG_LOCAL_NAME' => $lang_entries['lang_local_name'], 'LANG_ENGLISH_NAME' => $lang_entries['lang_english_name'], - 'LANG_ISO' => $lang_entries['lang_iso'], + 'LANG_ISO' => $lang_iso, 'LANG_AUTHOR' => $lang_entries['lang_author'], + 'L_MISSING_FILES' => $user->lang('THOSE_MISSING_LANG_FILES', $lang_entries['lang_local_name']), + 'L_MISSING_VARS_EXPLAIN' => $user->lang('THOSE_MISSING_LANG_VARIABLES', $lang_entries['lang_local_name']), )); + // If current lang is different from the default lang, then highlight missing files and variables + if ($lang_iso != $config['default_lang']) + { + try + { + $iterator = new \RecursiveIteratorIterator( + new \phpbb\recursive_dot_prefix_filter_iterator( + new \RecursiveDirectoryIterator( + $phpbb_root_path . 'language/' . $config['default_lang'] . '/', + \FilesystemIterator::SKIP_DOTS + ) + ), + \RecursiveIteratorIterator::LEAVES_ONLY + ); + } + catch (\Exception $e) + { + return array(); + } + + foreach ($iterator as $file_info) + { + /** @var \RecursiveDirectoryIterator $file_info */ + $relative_path = $iterator->getInnerIterator()->getSubPathname(); + $relative_path = str_replace(DIRECTORY_SEPARATOR, '/', $relative_path); + + if (file_exists($phpbb_root_path . 'language/' . $lang_iso . '/' . $relative_path)) + { + if (substr($relative_path, 0 - strlen($phpEx)) === $phpEx) + { + $missing_vars = $this->compare_language_files($config['default_lang'], $lang_iso, $relative_path); + + if (!empty($missing_vars)) + { + $template->assign_block_vars('missing_varfile', array( + 'FILE_NAME' => $relative_path, + )); + + foreach ($missing_vars as $var) + { + $template->assign_block_vars('missing_varfile.variable', array( + 'VAR_NAME' => $var, + )); + } + } + } + } + else + { + $template->assign_block_vars('missing_files', array( + 'FILE_NAME' => $relative_path, + )); + } + } + } return; break; @@ -362,4 +421,32 @@ class acp_language unset($new_ary); } + + /** + * Compare two language files + */ + function compare_language_files($source_lang, $dest_lang, $file) + { + global $phpbb_root_path; + + $source_file = $phpbb_root_path . 'language/' . $source_lang . '/' . $file; + $dest_file = $phpbb_root_path . 'language/' . $dest_lang . '/' . $file; + + if (!file_exists($dest_file)) + { + return array(); + } + + $lang = array(); + include($source_file); + $lang_entry_src = $lang; + + $lang = array(); + include($dest_file); + $lang_entry_dst = $lang; + + unset($lang); + + return array_diff(array_keys($lang_entry_src), array_keys($lang_entry_dst)); + } } diff --git a/phpBB/language/en/acp/language.php b/phpBB/language/en/acp/language.php index 154551bd6e..5df99892ca 100644 --- a/phpBB/language/en/acp/language.php +++ b/phpBB/language/en/acp/language.php @@ -71,6 +71,7 @@ $lang = array_merge($lang, array( 'LANG_LOCAL_NAME' => 'Local name', 'MISSING_LANGUAGE_FILE' => 'Missing language file: %s', + 'MISSING_LANG_FILES' => 'Missing language files', 'MISSING_LANG_VARIABLES' => 'Missing language variables', 'MODS_FILES' => 'MODs language files', From ada9fc81a3bdb436377608f34a53cf647db28a67 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 11 May 2014 13:13:11 +0200 Subject: [PATCH 04/39] [ticket/12527] Check whether the language exists PHPBB3-12527 --- phpBB/includes/acp/acp_language.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index dfd3b06290..afff9d550b 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -110,6 +110,11 @@ class acp_language $lang_entries = $db->sql_fetchrow($result); $db->sql_freeresult($result); + if (!$lang_entries) + { + trigger_error($user->lang['LANGUAGE_PACK_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING); + } + $lang_iso = $lang_entries['lang_iso']; $template->assign_vars(array( From eaa45524129d434280ea5298fd08db8fd756297b Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 11 May 2014 13:19:00 +0200 Subject: [PATCH 05/39] [ticket/12527] Remove unnecessary language strings PHPBB3-12527 --- phpBB/language/en/acp/language.php | 33 ++---------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/phpBB/language/en/acp/language.php b/phpBB/language/en/acp/language.php index 5df99892ca..a52f47bd8d 100644 --- a/phpBB/language/en/acp/language.php +++ b/phpBB/language/en/acp/language.php @@ -38,22 +38,9 @@ $lang = array_merge($lang, array( 'ACP_FILES' => 'Admin language files', 'ACP_LANGUAGE_PACKS_EXPLAIN' => 'Here you are able to install/remove language packs. The default language pack is marked with an asterisk (*).', - 'EMAIL_FILES' => 'Email templates', - - 'FILE_CONTENTS' => 'File contents', - 'FILE_FROM_STORAGE' => 'File from storage folder', - - 'HELP_FILES' => 'Help files', - 'INSTALLED_LANGUAGE_PACKS' => 'Installed language packs', - 'INVALID_LANGUAGE_PACK' => 'The selected language pack seems to be not valid. Please verify the language pack and upload it again if necessary.', - 'INVALID_UPLOAD_METHOD' => 'The selected upload method is not valid, please choose a different method.', 'LANGUAGE_DETAILS_UPDATED' => 'Language details successfully updated.', - 'LANGUAGE_ENTRIES' => 'Language entries', - 'LANGUAGE_ENTRIES_EXPLAIN' => 'Here you are able to change existing language pack entries or not already translated ones.
Note: Once you changed a language file, the changes will be stored within a separate folder for you to download. The changes will not be seen by your users until you replace the original language files at your webspace (by uploading them).', - 'LANGUAGE_FILES' => 'Language files', - 'LANGUAGE_KEY' => 'Language key', 'LANGUAGE_PACK_ALREADY_INSTALLED' => 'This language pack is already installed.', 'LANGUAGE_PACK_DELETED' => 'The language pack %s has been removed successfully. All users using this language have been reset to the boards default language.', 'LANGUAGE_PACK_DETAILS' => 'Language pack details', @@ -70,32 +57,16 @@ $lang = array_merge($lang, array( 'LANG_ISO_CODE' => 'ISO code', 'LANG_LOCAL_NAME' => 'Local name', - 'MISSING_LANGUAGE_FILE' => 'Missing language file: %s', 'MISSING_LANG_FILES' => 'Missing language files', 'MISSING_LANG_VARIABLES' => 'Missing language variables', - 'MODS_FILES' => 'MODs language files', 'NO_FILE_SELECTED' => 'You haven’t specified a language file.', 'NO_LANG_ID' => 'You haven’t specified a language pack.', 'NO_REMOVE_DEFAULT_LANG' => 'You are not able to remove the default language pack.
If you want to remove this language pack, change your boards default language first.', 'NO_UNINSTALLED_LANGUAGE_PACKS' => 'No uninstalled language packs', - 'REMOVE_FROM_STORAGE_FOLDER' => 'Remove from storage folder', - - 'SELECT_DOWNLOAD_FORMAT' => 'Select download format', - 'SUBMIT_AND_DOWNLOAD' => 'Submit and download file', - 'SUBMIT_AND_UPLOAD' => 'Submit and upload file', - - 'THOSE_MISSING_LANG_FILES' => 'The following language files are missing from the %s language folder', - 'THOSE_MISSING_LANG_VARIABLES' => 'The following language variables are missing from the %s language pack', + 'THOSE_MISSING_LANG_FILES' => 'The following language files are missing from the “%s” language folder', + 'THOSE_MISSING_LANG_VARIABLES' => 'The following language variables are missing from the “%s” language pack', 'UNINSTALLED_LANGUAGE_PACKS' => 'Uninstalled language packs', - - 'UNABLE_TO_WRITE_FILE' => 'The file could not be written to %s.', - 'UPLOAD_COMPLETED' => 'The upload was completed successfully.', - 'UPLOAD_FAILED' => 'The upload failed for unknown reasons. You may need to replace the relevant file manually.', - 'UPLOAD_METHOD' => 'Upload method', - 'UPLOAD_SETTINGS' => 'Upload settings', - - 'WRONG_LANGUAGE_FILE' => 'Selected language file is invalid.', )); From 192bb74e3c5990535f592e69a8abb8dae1389be9 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 11 May 2014 13:23:41 +0200 Subject: [PATCH 06/39] [ticket/12527] Use a proper language string on confirm screen PHPBB3-12527 --- phpBB/includes/acp/acp_language.php | 2 +- phpBB/language/en/acp/language.php | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index afff9d550b..43b011424c 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -235,7 +235,7 @@ class acp_language 'action' => $action, 'id' => $lang_id, ); - confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields)); + confirm_box(false, $user->lang('DELETE_LANGUAGE_CONFIRM', $row['lang_english_name']), build_hidden_fields($s_hidden_fields)); } break; diff --git a/phpBB/language/en/acp/language.php b/phpBB/language/en/acp/language.php index a52f47bd8d..d69cdac08c 100644 --- a/phpBB/language/en/acp/language.php +++ b/phpBB/language/en/acp/language.php @@ -38,13 +38,15 @@ $lang = array_merge($lang, array( 'ACP_FILES' => 'Admin language files', 'ACP_LANGUAGE_PACKS_EXPLAIN' => 'Here you are able to install/remove language packs. The default language pack is marked with an asterisk (*).', - 'INSTALLED_LANGUAGE_PACKS' => 'Installed language packs', + 'DELETE_LANGUAGE_CONFIRM' => 'Are you sure you wish to delete “%s”?', + + 'INSTALLED_LANGUAGE_PACKS' => 'Installed language packs', 'LANGUAGE_DETAILS_UPDATED' => 'Language details successfully updated.', 'LANGUAGE_PACK_ALREADY_INSTALLED' => 'This language pack is already installed.', - 'LANGUAGE_PACK_DELETED' => 'The language pack %s has been removed successfully. All users using this language have been reset to the boards default language.', + 'LANGUAGE_PACK_DELETED' => 'The language pack “%s” has been removed successfully. All users using this language have been reset to the boards default language.', 'LANGUAGE_PACK_DETAILS' => 'Language pack details', - 'LANGUAGE_PACK_INSTALLED' => 'The language pack %s has been successfully installed.', + 'LANGUAGE_PACK_INSTALLED' => 'The language pack “%s” has been successfully installed.', 'LANGUAGE_PACK_CPF_UPDATE' => 'The custom profile fields’ language strings were copied from the default language. Please change them if necessary.', 'LANGUAGE_PACK_ISO' => 'ISO', 'LANGUAGE_PACK_LOCALNAME' => 'Local name', From b040c3f7c1e2d8c802bf06f8c4243702c4cc8cf3 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 18 May 2014 12:28:28 +0200 Subject: [PATCH 07/39] =?UTF-8?q?[ticket/12527]=20Fix=20"board=E2=80=99s?= =?UTF-8?q?=20language"=20vs=20"boards=20language"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PHPBB3-12527 --- phpBB/language/en/acp/language.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/language/en/acp/language.php b/phpBB/language/en/acp/language.php index d69cdac08c..911347b9b0 100644 --- a/phpBB/language/en/acp/language.php +++ b/phpBB/language/en/acp/language.php @@ -44,7 +44,7 @@ $lang = array_merge($lang, array( 'LANGUAGE_DETAILS_UPDATED' => 'Language details successfully updated.', 'LANGUAGE_PACK_ALREADY_INSTALLED' => 'This language pack is already installed.', - 'LANGUAGE_PACK_DELETED' => 'The language pack “%s” has been removed successfully. All users using this language have been reset to the boards default language.', + 'LANGUAGE_PACK_DELETED' => 'The language pack “%s” has been removed successfully. All users using this language have been reset to the board’s default language.', 'LANGUAGE_PACK_DETAILS' => 'Language pack details', 'LANGUAGE_PACK_INSTALLED' => 'The language pack “%s” has been successfully installed.', 'LANGUAGE_PACK_CPF_UPDATE' => 'The custom profile fields’ language strings were copied from the default language. Please change them if necessary.', @@ -64,7 +64,7 @@ $lang = array_merge($lang, array( 'NO_FILE_SELECTED' => 'You haven’t specified a language file.', 'NO_LANG_ID' => 'You haven’t specified a language pack.', - 'NO_REMOVE_DEFAULT_LANG' => 'You are not able to remove the default language pack.
If you want to remove this language pack, change your boards default language first.', + 'NO_REMOVE_DEFAULT_LANG' => 'You are not able to remove the default language pack.
If you want to remove this language pack, change your board’s default language first.', 'NO_UNINSTALLED_LANGUAGE_PACKS' => 'No uninstalled language packs', 'THOSE_MISSING_LANG_FILES' => 'The following language files are missing from the “%s” language folder', From 9a130e31a2f2f857ebfaac89003a2f24ca300adb Mon Sep 17 00:00:00 2001 From: hanakin Date: Fri, 23 May 2014 15:46:39 +0200 Subject: [PATCH 08/39] [ticket/12580] Remove :link pseudo from a tag removed the :link pseudo from a tag as due to specificity it prevents classes from altering any properties set to it. PHPBB3-12580 --- phpBB/styles/prosilver/theme/colours.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css index acb2df92a0..a7d7184642 100644 --- a/phpBB/styles/prosilver/theme/colours.css +++ b/phpBB/styles/prosilver/theme/colours.css @@ -250,7 +250,7 @@ p.post-notice.reported:before, p.post-notice.error:before { Colours and backgrounds for links.css -------------------------------------------------------------- */ -a:link { color: #105289; } +a { color: #105289; } a:visited { color: #105289; } a:hover { color: #D31141; } a:active { color: #368AD2; } From ce5258d801859fe38bdcd61531e3a4c14a7b3f03 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 23 May 2014 12:58:17 +0200 Subject: [PATCH 09/39] [ticket/12570] Add test for updating a config with the same value PHPBB3-12570 --- tests/config/db_text_test.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/config/db_text_test.php b/tests/config/db_text_test.php index 354c0efacf..ed5b6e7327 100644 --- a/tests/config/db_text_test.php +++ b/tests/config/db_text_test.php @@ -9,8 +9,8 @@ class phpbb_config_db_text_test extends phpbb_database_test_case { - private $db; - private $config_text; + /** @var \phpbb\config\db_text */ + protected $config_text; public function getDataSet() { @@ -48,6 +48,12 @@ class phpbb_config_db_text_test extends phpbb_database_test_case $this->assertSame('24', $this->config_text->get('foo')); } + public function test_set_same_value_get() + { + $this->config_text->set('foo', '23'); + $this->assertSame('23', $this->config_text->get('foo')); + } + public function test_set_get_long_string() { $expected = str_repeat('ABC', 10000); From 15516bd07853cbda585f1716ce1b614d43cf9d9a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 23 May 2014 16:10:07 +0200 Subject: [PATCH 10/39] [ticket/12570] Add a unit test to show broken sql_affectedrows() PHPBB3-12570 --- tests/dbal/sql_affected_rows_test.php | 73 +++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 tests/dbal/sql_affected_rows_test.php diff --git a/tests/dbal/sql_affected_rows_test.php b/tests/dbal/sql_affected_rows_test.php new file mode 100644 index 0000000000..df008bab9a --- /dev/null +++ b/tests/dbal/sql_affected_rows_test.php @@ -0,0 +1,73 @@ +db = $this->new_dbal(); + } + + public function getDataSet() + { + return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml'); + } + + public function test_select() + { + $sql = 'SELECT * + FROM ' . CONFIG_TABLE; + $this->db->sql_query($sql); + + $this->assertEquals(2, $this->db->sql_affectedrows()); + } + + public function test_update() + { + $sql = 'UPDATE ' . CONFIG_TABLE . " + SET config_value = 'bertie'"; + $this->db->sql_query($sql); + + $this->assertEquals(2, $this->db->sql_affectedrows()); + } + + public function test_update_all_matched_unequal_updated() + { + $sql = 'UPDATE ' . CONFIG_TABLE . " + SET config_value = 'foo'"; + $this->db->sql_query($sql); + + $this->assertEquals(2, $this->db->sql_affectedrows()); + } + + public function test_update_some_matched_unequal_updated() + { + $sql = 'UPDATE ' . CONFIG_TABLE . " + SET config_value = 'foo' + WHERE config_value = 'foo'"; + $this->db->sql_query($sql); + + $this->assertEquals(1, $this->db->sql_affectedrows()); + } + + public function test_insert() + { + $sql = 'INSERT INTO ' . CONFIG_TABLE . ' ' . $this->db->sql_build_array('INSERT', array( + 'config_name' => 'bertie', + 'config_value' => 'rules', + )); + $this->db->sql_query($sql); + + $this->assertEquals(1, $this->db->sql_affectedrows()); + } +} From b92eac71e49f184d1fe451a8b1b1d396768c6fb7 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 23 May 2014 16:12:22 +0200 Subject: [PATCH 11/39] [ticket/12570] Fix MySQLi affectedrows by specifying MYSQLI_CLIENT_FOUND_ROWS PHPBB3-12570 --- phpBB/phpbb/db/driver/mysqli.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpBB/phpbb/db/driver/mysqli.php b/phpBB/phpbb/db/driver/mysqli.php index 6814599b24..a0df7599f8 100644 --- a/phpBB/phpbb/db/driver/mysqli.php +++ b/phpBB/phpbb/db/driver/mysqli.php @@ -57,7 +57,8 @@ class mysqli extends \phpbb\db\driver\mysql_base } } - $this->db_connect_id = @mysqli_connect($this->server, $this->user, $sqlpassword, $this->dbname, $port, $socket); + $this->db_connect_id = @mysqli_init(); + $this->db_connect_id->real_connect($this->server, $this->user, $sqlpassword, $this->dbname, $port, $socket, MYSQLI_CLIENT_FOUND_ROWS); if ($this->db_connect_id && $this->dbname != '') { From d87dba3b0527ab1590be143c13c0c0d1010e3410 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 23 May 2014 16:13:19 +0200 Subject: [PATCH 12/39] [ticket/12570] Fix MySQL affectedrows We always want the number of matched rows instead of changed rows, when running an update. So when mysql_info() returns the number of matched rows we return that one instead of mysql_affected_rows() PHPBB3-12570 --- phpBB/phpbb/db/driver/mysql.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/phpBB/phpbb/db/driver/mysql.php b/phpBB/phpbb/db/driver/mysql.php index 1a4fd364df..de4d2de9c6 100644 --- a/phpBB/phpbb/db/driver/mysql.php +++ b/phpBB/phpbb/db/driver/mysql.php @@ -207,7 +207,26 @@ class mysql extends \phpbb\db\driver\mysql_base */ function sql_affectedrows() { - return ($this->db_connect_id) ? @mysql_affected_rows($this->db_connect_id) : false; + if ($this->db_connect_id) + { + // We always want the number of matched rows + // instead of changed rows, when running an update. + // So when mysql_info() returns the number of matched rows + // we return that one instead of mysql_affected_rows() + $mysql_info = @mysql_info($this->db_connect_id); + if ($mysql_info !== false) + { + $match = array(); + preg_match('#^Rows matched: (\d)+ Changed: (\d)+ Warnings: (\d)+$#', $mysql_info, $match); + if (isset($match[1])) + { + return $match[1]; + } + } + + return @mysql_affected_rows($this->db_connect_id); + } + return false; } /** From adc62684f0e5e3de44e492d03a0c042741b40ce1 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 23 May 2014 16:17:20 +0200 Subject: [PATCH 13/39] [ticket/12570] Add a test for set_array() and updating with the same value PHPBB3-12570 --- tests/config/db_text_test.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/config/db_text_test.php b/tests/config/db_text_test.php index ed5b6e7327..59730edf09 100644 --- a/tests/config/db_text_test.php +++ b/tests/config/db_text_test.php @@ -95,6 +95,8 @@ class phpbb_config_db_text_test extends phpbb_database_test_case 'baby' => 'phpBB', // Entry update 'bar' => '64', + // Entry update - same value + 'foo' => '23', ); $this->config_text->set_array($set_array_param); From 275e56ce70b194ed6712ba30707494607dbdc1cf Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 23 May 2014 18:04:40 +0200 Subject: [PATCH 14/39] [ticket/12570] Remove test for affected rows after SELECT It's not supposed to work PHPBB3-12570 --- tests/dbal/sql_affected_rows_test.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/tests/dbal/sql_affected_rows_test.php b/tests/dbal/sql_affected_rows_test.php index df008bab9a..860b8bf237 100644 --- a/tests/dbal/sql_affected_rows_test.php +++ b/tests/dbal/sql_affected_rows_test.php @@ -23,15 +23,6 @@ class phpbb_dbal_sql_affected_rows_test extends phpbb_database_test_case return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml'); } - public function test_select() - { - $sql = 'SELECT * - FROM ' . CONFIG_TABLE; - $this->db->sql_query($sql); - - $this->assertEquals(2, $this->db->sql_affectedrows()); - } - public function test_update() { $sql = 'UPDATE ' . CONFIG_TABLE . " @@ -50,7 +41,7 @@ class phpbb_dbal_sql_affected_rows_test extends phpbb_database_test_case $this->assertEquals(2, $this->db->sql_affectedrows()); } - public function test_update_some_matched_unequal_updated() + public function test_update_same_value_matched_unequal_updated() { $sql = 'UPDATE ' . CONFIG_TABLE . " SET config_value = 'foo' From fcdf1101cba7999081f12bca2f5f96ef7769539c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 24 May 2014 13:06:25 +0200 Subject: [PATCH 15/39] [ticket/12570] Keep MySQLi procedural PHPBB3-12570 --- phpBB/phpbb/db/driver/mysqli.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/phpbb/db/driver/mysqli.php b/phpBB/phpbb/db/driver/mysqli.php index a0df7599f8..39df175860 100644 --- a/phpBB/phpbb/db/driver/mysqli.php +++ b/phpBB/phpbb/db/driver/mysqli.php @@ -57,8 +57,8 @@ class mysqli extends \phpbb\db\driver\mysql_base } } - $this->db_connect_id = @mysqli_init(); - $this->db_connect_id->real_connect($this->server, $this->user, $sqlpassword, $this->dbname, $port, $socket, MYSQLI_CLIENT_FOUND_ROWS); + $this->db_connect_id = mysqli_init(); + @mysqli_real_connect($this->db_connect_id, $this->server, $this->user, $sqlpassword, $this->dbname, $port, $socket, MYSQLI_CLIENT_FOUND_ROWS); if ($this->db_connect_id && $this->dbname != '') { From ea17a7cc5b1ac8f14d825ac015b80a3366747348 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 26 May 2014 21:41:55 +0200 Subject: [PATCH 16/39] [ticket/12592] Make hhvm run MySQL again. PHPBB3-12592 --- .travis.yml | 47 +++++++++++++++++++++------------------ travis/setup-webserver.sh | 4 ---- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/.travis.yml b/.travis.yml index ae5afc33d7..0ac1464540 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,30 @@ language: php -php: - - 5.3.3 - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - hhvm -env: - - DB=mysqli +matrix: + include: + - php: 5.3.3 + env: DB=mysqli + - php: 5.3 + env: DB=mysqli # MyISAM + - php: 5.4 + env: DB=mysqli + - php: 5.4 + env: DB=mysql + - php: 5.4 + env: DB=mariadb + - php: 5.4 + env: DB=postgres + - php: 5.4 + env: DB=sqlite3 + - php: 5.5 + env: DB=mysqli + - php: 5.6 + env: DB=mysqli + - php: hhvm + env: DB=mysql + allow_failures: + - php: hhvm + fast_finish: true services: - redis-server @@ -24,16 +40,3 @@ script: - phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.5' -a '$DB' = 'mysqli' -a '$TRAVIS_PULL_REQUEST' != 'false' ]; then git-tools/commit-msg-hook-range.sh origin/$TRAVIS_BRANCH..FETCH_HEAD; fi" -matrix: - include: - - php: 5.4 - env: DB=mysql - - php: 5.4 - env: DB=mariadb - - php: 5.4 - env: DB=postgres - - php: 5.4 - env: DB=sqlite3 - allow_failures: - - php: hhvm - fast_finish: true diff --git a/travis/setup-webserver.sh b/travis/setup-webserver.sh index 6188d2c232..bffe2c0bf4 100755 --- a/travis/setup-webserver.sh +++ b/travis/setup-webserver.sh @@ -28,10 +28,6 @@ then # Upgrade to a recent stable version of HHVM sudo apt-get -o Dpkg::Options::="--force-confnew" install -y hhvm-nightly - # MySQLi is broken in HHVM 3.0.0~precise and still does not work for us in - # 2014.03.28~saucy, i.e. needs more work. Use MySQL extension for now. - sed -i "s/mysqli/mysql/" "$DIR/phpunit-mysql-travis.xml" - HHVM_LOG=$(realpath "$DIR")/hhvm.log sudo hhvm \ From 0a2e0ee964072ed7ee2989ae08f2f19820bebf03 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Tue, 27 May 2014 15:35:10 +0200 Subject: [PATCH 17/39] [ticket/12600] Add @log to the dependencies of extension:show PHPBB3-12600 --- phpBB/config/console.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/phpBB/config/console.yml b/phpBB/config/console.yml index 1305a12101..56bf99390a 100644 --- a/phpBB/config/console.yml +++ b/phpBB/config/console.yml @@ -86,6 +86,7 @@ services: class: phpbb\console\command\extension\show arguments: - @ext.manager + - @log tags: - { name: console.command } From aeb78030171d1076ef5e523f1021dffa0ecd368a Mon Sep 17 00:00:00 2001 From: neufke Date: Tue, 4 Feb 2014 20:29:28 +0100 Subject: [PATCH 18/39] [ticket/12155] CSS-ing of the mini post buttons Created a css version of the mini post buttons with the use of language vars and no fixed width of height. PHPBB3-12155 --- .../prosilver/template/overall_header.html | 6 +- .../prosilver/template/viewtopic_body.html | 6 +- phpBB/styles/prosilver/theme/buttons.css | 195 +++++++++++++++--- .../styles/prosilver/theme/en/stylesheet.css | 5 - .../prosilver/theme/images/mini-buttons.png | Bin 0 -> 2804 bytes 5 files changed, 173 insertions(+), 39 deletions(-) create mode 100644 phpBB/styles/prosilver/theme/images/mini-buttons.png diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html index 8c63ce9cea..2e4f6ce025 100644 --- a/phpBB/styles/prosilver/template/overall_header.html +++ b/phpBB/styles/prosilver/template/overall_header.html @@ -30,8 +30,10 @@ --> - - + + + + diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index 18fa7ce783..cdeb14170a 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -199,12 +199,12 @@ diff --git a/phpBB/styles/prosilver/theme/buttons.css b/phpBB/styles/prosilver/theme/buttons.css index 9ca04516cc..3df604394c 100644 --- a/phpBB/styles/prosilver/theme/buttons.css +++ b/phpBB/styles/prosilver/theme/buttons.css @@ -118,22 +118,22 @@ ul.linklist.bulletin li.small-icon:before { display: none; } -/* Poster profile icons +/* Poster contact icons ----------------------------------------*/ -ul.profile-icons { +ul.contact-icons { padding-top: 10px; list-style: none; } /* Rollover state */ -ul.profile-icons li { +ul.contact-icons li { float: left; margin: 0 6px 3px 0; background-position: 0 100%; } /* Rolloff state */ -ul.profile-icons li a { +ul.contact-icons li a { display: block; width: 100%; height: 100%; @@ -141,26 +141,26 @@ ul.profile-icons li a { } /* Hide text and hide off-state image when rolling over (prevents flicker in IE) */ -ul.profile-icons li span { display:none; } -ul.profile-icons li a:hover { background: none; } +ul.contact-icons li span { display:none; } +ul.contact-icons li a:hover { background: none; } /* Positioning of moderator icons */ -.postbody ul.profile-icons { +.postbody ul.contact-icons { float: right; width: auto; padding: 0; } -.postbody ul.profile-icons li { +.postbody ul.contact-icons li { margin: 0 3px; } /* Responsive icons in postbody */ -.postbody ul.profile-icons.responsive .responsive-menu { +.postbody ul.contact-icons.responsive .responsive-menu { position: relative; } -ul.profile-icons.responsive a.responsive-menu-link { +ul.contact-icons.responsive a.responsive-menu-link { display: inline-block; position: relative; margin: 0 5px; @@ -170,11 +170,11 @@ ul.profile-icons.responsive a.responsive-menu-link { background: none top left no-repeat; } -ul.profile-icons.responsive a.responsive-menu-link:hover { +ul.contact-icons.responsive a.responsive-menu-link:hover { background-position: 0 -20px; } -ul.profile-icons.responsive a.responsive-menu-link:before { +ul.contact-icons.responsive a.responsive-menu-link:before { content: ''; position: absolute; left: 0; @@ -185,13 +185,13 @@ ul.profile-icons.responsive a.responsive-menu-link:before { border-top: 0.375em double transparent; } -.postbody ul.profile-icons.responsive .popup-pointer { +.postbody ul.contact-icons.responsive .popup-pointer { left: auto; right: 7px; top: 20px; } -.postbody ul.profile-icons .dropdown li, .postbody ul.profile-icons .dropdown li a { +.postbody ul.contact-icons .dropdown li, .postbody ul.contact-icons .dropdown li a { display: block; background: transparent none; width: auto; @@ -202,7 +202,7 @@ ul.profile-icons.responsive a.responsive-menu-link:before { list-style-type: none; } -.postbody ul.profile-icons .dropdown li span { +.postbody ul.contact-icons .dropdown li span { display: block; text-align: right; font-size: 1.2em; @@ -210,7 +210,7 @@ ul.profile-icons.responsive a.responsive-menu-link:before { white-space: nowrap; } -.hasjs .postbody ul.profile-icons { +.hasjs .postbody ul.contact-icons { max-width: 40%; } @@ -271,19 +271,6 @@ ul.profile-icons.responsive a.responsive-menu-link:before { .info-icon, .info-icon a { background: none top left no-repeat; } /* Set profile icon dimensions */ -ul.profile-icons li.email-icon { width: 20px; height: 20px; } -ul.profile-icons li.phpbb_aol-icon { width: 20px; height: 20px; } -ul.profile-icons li.aim-icon { width: 20px; height: 20px; } -ul.profile-icons li.yahoo-icon { width: 20px; height: 20px; } -ul.profile-icons li.phpbb_yahoo-icon { width: 20px; height: 20px; } -ul.profile-icons li.web-icon { width: 20px; height: 20px; } -ul.profile-icons li.phpbb_website-icon { width: 20px; height: 20px; } -ul.profile-icons li.msnm-icon { width: 20px; height: 20px; } -ul.profile-icons li.phpbb_wlm-icon { width: 20px; height: 20px; } -ul.profile-icons li.icq-icon { width: 20px; height: 20px; } -ul.profile-icons li.phpbb_icq-icon { width: 20px; height: 20px; } -ul.profile-icons li.jabber-icon { width: 20px; height: 20px; } -ul.profile-icons li.pm-icon { width: 28px; height: 20px; } ul.profile-icons li.quote-icon { width: 54px; height: 20px; } ul.profile-icons li.report-icon { width: 20px; height: 20px; } ul.profile-icons li.edit-icon { width: 42px; height: 20px; } @@ -297,3 +284,153 @@ ul.profile-icons li.edit-icon { margin: 0 0 0 3px; } ul.profile-icons li.quote-icon { margin: 0 0 0 10px; } ul.profile-icons li.info-icon, ul.profile-icons li.report-icon { margin: 0 3px 0 0; } +/* mini profile buttons +--------------------------------------------- */ +ul.profile-icons { + float: right; + list-style: none; + width: auto; + height: auto; + margin-top: 2px; +} + +ul.profile-icons li { + float: left; + margin: 0 5px 0 0; +} + +ul.profile-icons li a { + font-weight: bold; + display: inline-block; + font-family: 'Noto Sans', sans-serif, Verdana, Arial, Helvetica; + font-size: 9px; + line-height: 10px; + height: 12px; + text-decoration: none !important; + outline-style: none !important; + vertical-align: bottom; + white-space: nowrap; + border: 1px solid transparent; + border-radius: 3px; + background: transparent none 0 0 repeat-x; + padding: 3px 5px 1px 8px; + position: relative; + border-color: #858585; + background: #e3e3e3; + /*background: url(data:image/svg+xml; base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNlM2UzZTMiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);*/ + background: -moz-linear-gradient(top, #ffffff 0%, #e3e3e3 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#e3e3e3)); + background: -webkit-linear-gradient(top, #ffffff 0%,#e3e3e3 100%); + background: -o-linear-gradient(top, #ffffff 0%,#e3e3e3 100%); + background: -ms-linear-gradient(top, #ffffff 0%,#e3e3e3 100%); + background: linear-gradient(to bottom, #ffffff 0%,#e3e3e3 100%); + -m-filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e3e3e3',GradientType=0 ); + box-shadow: 0 0 0 1px #FFFFFF inset; + -webkit-box-shadow: 0 0 0 1px #FFFFFF inset; + color: #BC2A4D !important; +} + +ul.profile-icons li a:hover { + border-color: #0a8ed0; + background: #ffffff; + /*background: url(data:image/svg+xml; base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIxJSIgc3RvcC1jb2xvcj0iI2UzZTNlMyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);*/ + background: -moz-linear-gradient(top, #e3e3e3 1%, #ffffff 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#e3e3e3), color-stop(100%,#ffffff)); + background: -webkit-linear-gradient(top, #e3e3e3 1%,#ffffff 100%); + background: -o-linear-gradient(top, #e3e3e3 1%,#ffffff 100%); + background: -ms-linear-gradient(top, #e3e3e3 1%,#ffffff 100%); + background: linear-gradient(to bottom, #e3e3e3 1%,#ffffff 100%); + -m-filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e3e3e3', endColorstr='#ffffff',GradientType=0 ); + text-shadow: 1px 1px 0 #FFFFFF, -1px -1px 0 #FFFFFF, -1px -1px 0 rgba(188, 42, 77, 0.2); + box-shadow: 0 0 0 1px #FFFFFF inset; + -webkit-box-shadow: 0 0 0 1px #FFFFFF inset; + color: #BC2A4D !important; +} + +ul.profile-icons li a:after { + content: ''; + display: block; + position: absolute; + top: 50%; + left: -4px; + width: 12px; + height: 16px; + margin-top: -10px; + background: transparent 0 0 no-repeat; + background-image: url("images/mini-buttons.png"); +} + + /* Mini profile button images */ +ul.profile-icons li.quote-icon a:after { + background-position: 0px 0px; +} + +ul.profile-icons li.quote-icon a:hover:after { + background-position: 0px -21px; +} + +ul.profile-icons li.edit-icon a:after { + background-position: -24px 0; +} + +ul.profile-icons li.edit-icon a:hover:after { + background-position: -24px -21px; +} + +ul.profile-icons li.warn-icon span { + display: none; +} + +ul.profile-icons li.warn-icon a:after { + background-position: -48px 0px; +} + +ul.profile-icons li.warn-icon a:hover:after { + background-position: -48px -21px; +} + +ul.profile-icons li.delete-icon span { + display: none; +} + +ul.profile-icons li.delete-icon a { + width: 12px; + padding: 3px 3px 1px 3px; +} + +ul.profile-icons li.delete-icon a:after { + background-position: -36px 0px; + left: 3px; + margin-top: -6px; +} + +ul.profile-icons li.delete-icon a:hover:after { + background-position: -36px -21px; +} + +ul.profile-icons li.report-icon span { + display: none; +} + +ul.profile-icons li.report-icon a { + width: 12px; + padding: 3px 3px 1px 3px; +} + +ul.profile-icons li.report-icon a:after { + background-position: -48px 0px; + left: 3px; + margin-top: -6px; +} + +ul.profile-icons li.report-icon a:hover:after { + background-position: -48px -21px; +} + +ul.profile-icons li.info-icon a { + padding: 3px 5px 1px 6px; +} + +ul.profile-icons li.info-icon a:after { + background: none; +} diff --git a/phpBB/styles/prosilver/theme/en/stylesheet.css b/phpBB/styles/prosilver/theme/en/stylesheet.css index d8ca2558e5..4ddf271cfd 100644 --- a/phpBB/styles/prosilver/theme/en/stylesheet.css +++ b/phpBB/styles/prosilver/theme/en/stylesheet.css @@ -1,8 +1,3 @@ -/* Set profile icon dimensions */ -ul.profile-icons li.pm-icon { width: 28px; height: 20px; } -ul.profile-icons li.quote-icon { width: 54px; height: 20px; } -ul.profile-icons li.edit-icon { width: 42px; height: 20px; } - /* Online image */ .online { background-image: url("./icon_user_online.gif"); } diff --git a/phpBB/styles/prosilver/theme/images/mini-buttons.png b/phpBB/styles/prosilver/theme/images/mini-buttons.png new file mode 100644 index 0000000000000000000000000000000000000000..1a885e0dccf99b85df6fcf7d3feaca226bb92999 GIT binary patch literal 2804 zcmaJ@dpuO>8z1)xgL0QLMzs~@%3v}yW5#6}hOtPC#>`=+%%z#ZFfL_jQ6aWgbP=^= zf5S>DQ7lQR&`KAf)CgNHxvpDwwAKFp`1N}~=bZO)zTfZjywCHz=W{Zs-fj?e6Lk;> z1o3bu`N?~C`3(iD%AZx=I`QS5v4|WbqVXa`v2+0dA~1R30Mvs+j|BVxIx}wnUBD3p zQi8GlgG50TFC2r%fzwwpa4~0<4FWkji}`fMK0pKw2O`;AJZ!wK0S09=@vuN!3X;Ni z0a$GJcmY6*_x5MR?_)SHVa`raM=?$=zyU;bsF)MQ72?Er*hgKQe7w4hfI&Y(MEmft zf1C=UP@yh70RXjyW2_lS6bg#P!cjK1SS-p4ibkT)2&DYNTBB@mwpbk64*IFVS4)Azms=(Q0(K0*bQSP8(2rZjvA^z%{a5uq zahYHD#o?=5gxnd#YGVH@(Vv&()w4SMQnvERm%<0Q@@f~z%epGoB?$ylV|kDW{^Fi@ zyC7b)Ks_gxZ>r)I^_1}aK8K3S?iVvq;N5M=X3EKnmtKa0p9cTTxu37M zmP1;GCyqfzOf%Yk@>Q8PKIWS|p{C|X0*c^J=i;?P&u>)DMRyEYrsPCDi_fi`o0+a( z99tf980wGxlhkFi)JjS#A|YW$u6^sbq&F%N4pUPnw!588r}_lz?9}2MH~mA+QOTml zY>mIZzW#L9h8?WlSK}q4G?G}I(5Yu&P+m}2Xl`u{dE2%YT~JUUlFW^z$z-zn#>PgW zd*qfmcd!i`<1#SA8Q<4r$75MoMy?IgD7-;Dci{Z_O_cAyKNTXW2|l{sIz`bu^YsQJ z-`d*RKE)2|8CPh!wZax#IUfiz~p4- zzZMpP_1CRoymYJ_q?Q?=70hgwJO^ubC}w>h9Jj!H)HnWgIzT8k0H@ibQET zu*l|4P8%^d%?6n9@i@nXzjXX)wBPUDv&?vnZ}W7cP%lxmJzq17$$_H|Wy`ZVz1X@cl~+|sZ^RDbqKoc(u-^REi^SXCq{QYBZCLNeWWvm zDzO1&n>j}iHFdE)rbqGV=1pB)y5;5N^6%hIeFKAt-*Htzn(giFdyqyuOS=ZXb84)3 z^={&VFL>c>xUFFPOsH$^&SfpJ8=`q2w`Kh)_WM^YzTo&r*`{-cf$s9}pg-SBd$;SM zz){V9AR>Dcjn7A7#vFui4uEQ1-ayZtVruw%DW5oWNOh<3-P-F{u3)bThq6qijx8Q# znP)K#IZqz1s2ASsQ5p?1ba_3Sh(rymoGy)8P&l~8a&mG~79Aa(bMoXG005{|Dkv!_ z2`9Tiob5GbzLG&z*xic4$yT$sPb!C!?6kiz)*d7*K9TM&-Le0batT;lyY;BTIH*fiAhgw?a` zbq%Tzy&r!Ik>viM=a}ug_C^kCa%$>aeZ6UMNs0O9%_@@R?2gw2?7F+VQt^eq4e9>p zMP?^a1b}%Or*vhqcd3g-_D^Qp_2q|Z+q9bY#`A%dp%gQx1f%TT&OJ`_BiegcY?k8G zd{-XMj!c^+bQ{r(hl&~rIX^(v2wEwo$_`+GjtqLoe8n)u|NN$6lf3>9Eo4cIW3M65 zjk#UCuuOs^#ypR-;kFjDIzm&SvOkYTUq(-XDeg@RM;6|A2Y;X|9Nj&MZSS`*=gBU! z`wORQ>djba^S1Wps9BvUhofg_G#5>Khfdz|zfzDRtRA*c44z+$f7<0XWpJzo@Y33- z&AppQOw`ECnflHA7vE&I-vwEqf~{wSWlv#c{~zQF8x{Fym@1{($jEp6B0weF{pZ7Cx3?ET~WN`EklLy^>FOU~{t3BA6F^r3E+GZ0wV@I~r@|zh3 z;B%@`Xoxc+R9pNpt=W`-A$F|2!q2N`sizYd<_zI>Z<%8_U8DZ|_}_zuXaTtQ_?W zWaVKLbiUFmMWwE03)=OjCeA13>ZJ1uxsJTp+1Ytae-zS+09~_~3~`JiOKi;5rSJoR zMV*Ns@|F^e1W4b2l=dI)&@`)aA2(VYEXEIFjQx3O2dlavd(>5avBcjGbM8q!-ie<` z=VkwzadzRG3Oab8%`#?5H@th}1$mv$w?M491V7zu?bY=~#L7>Gd z0d{PzfL&~4CiG~TUW(JQ+}iuJDiwUclz4qB_*CNN1G^<;NqqjK42!t*VUSVJ*R~T> zv?nZY3>xcg#bwe+4e7nfj_qsi4E~;&1j<`a)#_1fN*>rs&B`l$5LvVpr6WVzQImNJ z_oPmz58SX;tD>hFG{3pH^|F49pc4{t&PiO%TKUNyLJPuTCbAR@x3ixvX@oo$8|Ia= zMy`3%?z$PDhArlHX63w)RGsX*!PV{^-cyNr*In}7yUaNu?b)l{I0<{XDnK&(?UGWY zVcijDaa~Y)V`8aW_2Kt7e(Za5_9`p;>QdCD?+~P?wztWPJ~{;s9k(M3_JJdRv{$RS rqNj&Z9(e3~`D!wFLv`_Tn4%`AAtHRVK#Q*_%{B+>`P*X2+we literal 0 HcmV?d00001 From 03d3762d52a5c63168311fb103e517a7ed36c83c Mon Sep 17 00:00:00 2001 From: Cesar G Date: Fri, 9 May 2014 16:11:04 -0700 Subject: [PATCH 19/39] [ticket/12155] Remove obsolete language images. PHPBB3-12155 --- .../prosilver/theme/en/icon_contact_pm.gif | Bin 677 -> 0 bytes .../styles/prosilver/theme/en/icon_post_edit.gif | Bin 853 -> 0 bytes .../prosilver/theme/en/icon_post_quote.gif | Bin 1109 -> 0 bytes phpBB/styles/prosilver/theme/en/stylesheet.css | 15 --------------- phpBB/styles/prosilver/theme/imageset.css | 10 ---------- 5 files changed, 25 deletions(-) delete mode 100644 phpBB/styles/prosilver/theme/en/icon_contact_pm.gif delete mode 100644 phpBB/styles/prosilver/theme/en/icon_post_edit.gif delete mode 100644 phpBB/styles/prosilver/theme/en/icon_post_quote.gif diff --git a/phpBB/styles/prosilver/theme/en/icon_contact_pm.gif b/phpBB/styles/prosilver/theme/en/icon_contact_pm.gif deleted file mode 100644 index ec190118fe5be0251bd9a36552de1b5fa0c74cc8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 677 zcmV;W0$Tk?Nk%w1VH^M`0K@Ew70gh<>cVxiju-eC>9CEV@a(plgb6-a8M|s8LOBwdOS3S#=+qYn#W6X*=$g- z+Xk})fnZP&2}}qQavcy54^R(YUkr#I2oVSyd=Lf*9uG8zhY(Fq2??4Hkdh623w)WI zov8~DPYACNkbMsb2DzArBN4s`9b9dZvcg2js%GiuDZuYt#pAVZ4$SfPUm6ev^wn*89QrOTHvW5Q(V;eySZICJW}>C%GF zpFo2O4cgMD1fL9YF*s_0sZ*m+TS}NJA(VgtLM~9<%9X0rsZB5hAb@pg*Rv8@ZdhyJ zLID5*$Qqd1scwZ%8`64MyTO2fzXarNm;hkF009sN5P)zsz=REI*Cq`dSV+Xe0R|Kv zFjn*9mL4r8@M}212784$a5j8ZGlvE(FS-Ii;L?Hy5jGQ`V3@4y3N61)7*t>^Sp*ew z515kpDp>#!IJETjtT^1tjxraB@IbTo0Nh$~LlB_A-?(xiP?!=yOaxjUXc?f4{`mX4 zhcwk~`GArE!vJE103yc}Xkbf9G?3IHCAmbQo*3#Z(b5qVR%irh4rHj|h8%XNA#60s LB;tr4ga80L?XxS0 diff --git a/phpBB/styles/prosilver/theme/en/icon_post_edit.gif b/phpBB/styles/prosilver/theme/en/icon_post_edit.gif deleted file mode 100644 index 19006f95a7b5b7fa8e6427210f9a45f041963b9e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 853 zcmV-b1FHN-Nk%w1VJZM90M!5h`|bBDowvPSHL(~&2@^@ev{OO znbnY?*_EZ>oUGHCr`4OO-lVeRs<`RN(c#3)?b+V++VE+uF~Z7 z0AH~KQER?d|RA>gwg?<>TYy;Nalj-{0BU+1A$9&d$z{kB^0gg>-auYHDg$R#r+% zO55J!A^8LW002J#EC2ui04e||000L6z@KnPEE41ej4E|HLKZkZJUlms zjhUK=D3CNRlrcOzEGwoE1*ruAEUEe^ z5C#d!3@ieu2@n;+*ttR%Cn>@&;4j4C-~|le3I;Fc;q2t#+Cn-gF!lBet^zOx3-$Q> z{p#_vM=;)xc`*_y#5bW~LVgL;#en#5fx?Rh=gHW}5#NK45@fs@@W229kqbETI_wo2X;B5__39yoXqu>r=<&!9txt`i~>3C$izSb!;`#T{Xnq|<^ zG+IF3;NgRb7&2Z&a1{VWO%}!@7ujp3bhxov%-7}76BaK-wXc1a8V5L5fK7C1hKH4DiWB- zf`j`Na2^a25>!uuLoE1m&I;QRAfh7{ni8OSD-c-XI|R!2!-Cidqr!IGMeyA!;*n=w zFgwNwn~MuhD5MI*sZv}`Bu1bDa@;K`z?d!?mAo diff --git a/phpBB/styles/prosilver/theme/en/icon_post_quote.gif b/phpBB/styles/prosilver/theme/en/icon_post_quote.gif deleted file mode 100644 index c3708a1477407397362a5516d5fdb73d7f5cc34b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1109 zcmV-b1giT-Nk%w1VKx9L0M!5h`|+Yzjs$Pw^ zim=iEYQ+F$yZ~6F2T_tDW1KUH(JyhTQI*kVp3iWo*s{*%%-rhT>h<#T^VHPS$;rt7 z|Ns8}{{8*^`uh6#`1tkp_3-fU?d|RA>gwj^=Huhz;Nak!o12f1kA;PWW@ctmQc^`l zMcdxvA^8LW002J#EC2ui05$+9000L6z@KnPEE41ejEXyZF+4pQE-frR zJT)&coSmMZprN9jf;&GiZage88g4r-qp`BFEvBeEJUK9}xHT~`4F?4a6u$)!#>f;4 z1qTf=5CziGG1JYz*fF(U8n`PlHn=)3G64q<0t*N-G6ezb?lK4q1P=!R6A%o?0__YC z5c;tjxDCgQ7nNqjs02gCi~|g2%#ct(zzla1-9?iik--6p0SZXG7+|DHiQ9(kXhEZ; zOB(K6#*7IwKuDK2Y2<`CZNba`mMMj-tUgfG7h4L_-!W z(13sh3K@*n2>N5Cjk9QNG%x@`K>-A36C}__)dm6u0w5S@aJE4Kv;`PA2p}NsS+Xl{ zC|<1iYJmg>D&QcHpuk?m65JwP9CEQW12`DpK->a{>C>o9LrBfKwd>ZTTU3}$yS8K; zwsY&=ZMzhaEscT;ACBlzku7QLJGtcSRe`e!7#!HCbR&<2_STk z0u7>7XyJtzGA0NKr-0!9K?f&T&|e24z;J^ND!kA_3>3=Hf($pf2qO*Jyr6;&E+Uen zAT}~)Lkk?X5Mc)-c=tgE64oF?FvCnRLkk5w@MM%TOu&pYDm-9K0Z>kJzzc=}=>-QL zqF_M^BM=z_1`Zq`Km_Wj*pv!TI`G0g5eRUA0{}d*&jS%a$-o1E%3wnchmOTz1y8>4 zLJb(e0Lu(6Kor9a0~8QwQ!X~8?wjw5+57?nLM^xu!3!~5TnWb=tJuOOzo^Ku$cKQ8&BPAQ;_}O$Y)AwL bt{Q0bf&0yz-_AVuOkd9D1ub;YK>z?d4CnHx diff --git a/phpBB/styles/prosilver/theme/en/stylesheet.css b/phpBB/styles/prosilver/theme/en/stylesheet.css index 4ddf271cfd..bf4bd31ffc 100644 --- a/phpBB/styles/prosilver/theme/en/stylesheet.css +++ b/phpBB/styles/prosilver/theme/en/stylesheet.css @@ -1,21 +1,6 @@ /* Online image */ .online { background-image: url("./icon_user_online.gif"); } -/* Icon images */ -.quote-icon, .quote-icon a { background-image: url("./icon_post_quote.gif"); } -.edit-icon, .edit-icon a { background-image: url("./icon_post_edit.gif"); } - -/* EN Language Pack */ -.imageset.icon_post_edit { - background-image: url("./icon_post_edit.gif"); - padding-left: 42px; - padding-top: 20px; -} -.imageset.icon_post_quote { - background-image: url("./icon_post_quote.gif"); - padding-left: 54px; - padding-top: 20px; -} .imageset.icon_user_online { background-image: url("./icon_user_online.gif"); padding-left: 58px; diff --git a/phpBB/styles/prosilver/theme/imageset.css b/phpBB/styles/prosilver/theme/imageset.css index 8e3348a99d..5cd91348be 100644 --- a/phpBB/styles/prosilver/theme/imageset.css +++ b/phpBB/styles/prosilver/theme/imageset.css @@ -369,16 +369,6 @@ span.imageset { /* English images for fallback */ -.imageset.icon_post_edit { - background-image: url("./en/icon_post_edit.gif"); - padding-left: 42px; - padding-top: 20px; -} -.imageset.icon_post_quote { - background-image: url("./en/icon_post_quote.gif"); - padding-left: 54px; - padding-top: 20px; -} .imageset.icon_user_online { background-image: url("./en/icon_user_online.gif"); padding-left: 58px; From 00ff33c9b42479bee386cd45e863cb0bfe25a882 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Thu, 15 May 2014 13:22:43 -0700 Subject: [PATCH 20/39] [ticket/12155] Move existing button style to a more generic class. PHPBB3-12155 --- .../template/ucp_pm_message_header.html | 32 +++++- .../prosilver/template/viewforum_body.html | 12 ++- .../prosilver/template/viewtopic_body.html | 12 ++- .../template/viewtopic_topic_tools.html | 2 +- phpBB/styles/prosilver/theme/buttons.css | 98 ++++++++----------- phpBB/styles/prosilver/theme/colours.css | 20 +--- 6 files changed, 95 insertions(+), 81 deletions(-) diff --git a/phpBB/styles/prosilver/template/ucp_pm_message_header.html b/phpBB/styles/prosilver/template/ucp_pm_message_header.html index 840eba4c83..6ad71dcab6 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_message_header.html +++ b/phpBB/styles/prosilver/template/ucp_pm_message_header.html @@ -8,16 +8,38 @@

{FOLDER_STATUS}