diff --git a/.gitignore b/.gitignore index 4093aeb56d..06b13923f5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,9 @@ *~ /phpunit.xml +/phpBB/cache/twig/* /phpBB/cache/*.html /phpBB/cache/*.php -/phpBB/cache/queue.php.lock +/phpBB/cache/*.lock /phpBB/composer.phar /phpBB/config.php /phpBB/config_dev.php diff --git a/.travis.yml b/.travis.yml index f296f10230..c89ad38661 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ php: - 5.3.3 - 5.3 - 5.4 + - 5.5 env: - DB=mysql @@ -12,16 +13,15 @@ before_script: - sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres; fi" - sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'create database phpbb_tests;' -U postgres; fi" - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS phpbb_tests;'; fi" - - pyrus set auto_discover 1 - - pyrus install --force phpunit/DbUnit - - phpenv rehash + - travis/install-php-extensions.sh - cd phpBB - - php ../composer.phar install --dev - - cd ../ + - php ../composer.phar install --dev --no-interaction --prefer-source + - cd .. + - sh -c "if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.3.19', '>=');"` = "1" ]; then travis/setup-webserver.sh; fi" script: - - phpunit --configuration travis/phpunit-$DB-travis.xml - + - phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml + notifications: email: recipients: diff --git a/build/build.xml b/build/build.xml index 28dd36bea8..f8181160c1 100644 --- a/build/build.xml +++ b/build/build.xml @@ -2,17 +2,16 @@ - - - + + + - - + @@ -43,15 +42,22 @@ - - + + @@ -59,7 +65,8 @@ - + @@ -162,9 +169,43 @@ command="git archive ${revision} | tar -xf - -C ../${dir}" checkreturn="true" /> + + command='php -r "\$j = json_decode(file_get_contents(\"composer.json\")); echo isset(\$j->require);"' + checkreturn="true" + outputProperty='composer-has-dependencies' /> + + + + + + + + + + + + + + + + + + + + + + + + @@ -187,6 +228,7 @@ + diff --git a/build/package.php b/build/package.php index 48f42b3572..eef6765af6 100755 --- a/build/package.php +++ b/build/package.php @@ -121,6 +121,7 @@ if (sizeof($package->old_packages)) $package->run_command('cp -Rp ' . $package->get('dest_dir') . '/docs ' . $dest_filename_dir); $package->run_command('cp -Rp ' . $package->get('dest_dir') . '/install ' . $dest_filename_dir); + $package->run_command('cp -Rp ' . $package->get('dest_dir') . '/vendor ' . $dest_filename_dir); $package->run_command('mkdir ' . $dest_filename_dir . '/install/update'); $package->run_command('mkdir ' . $dest_filename_dir . '/install/update/old'); @@ -256,6 +257,7 @@ $update_info = array( // Copy the install files to their respective locations $package->run_command('cp -Rp ' . $package->get('dest_dir') . '/docs ' . $package->get('patch_directory')); $package->run_command('cp -Rp ' . $package->get('dest_dir') . '/install ' . $package->get('patch_directory')); + $package->run_command('cp -Rp ' . $package->get('dest_dir') . '/vendor ' . $package->get('patch_directory')); // Remove some files chdir($package->get('patch_directory') . '/install'); diff --git a/composer.phar b/composer.phar index af7b8c1a67..a035fdc911 100755 Binary files a/composer.phar and b/composer.phar differ diff --git a/git-tools/hooks/pre-commit b/git-tools/hooks/pre-commit index 03babe47cd..06ba15c7fa 100755 --- a/git-tools/hooks/pre-commit +++ b/git-tools/hooks/pre-commit @@ -33,9 +33,7 @@ else against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 fi -error=0 errors="" - if ! which "$PHP_BIN" >/dev/null 2>&1 then echo "PHP Syntax check failed:" @@ -73,63 +71,18 @@ do # check the staged file content for syntax errors # using php -l (lint) - # note: if display_errors=stderr in php.ini, - # parse errors are printed on stderr; otherwise - # they are printed on stdout. - # we filter everything other than parse errors - # with a grep below, therefore it should be safe - # to combine stdout and stderr in all circumstances - result=$(git cat-file -p $sha | "$PHP_BIN" -l 2>&1) + result=$(git cat-file -p $sha | "$PHP_BIN" -n -l -ddisplay_errors\=1 -derror_reporting\=E_ALL -dlog_errrors\=0 2>&1) if [ $? -ne 0 ] then - error=1 # Swap back in correct filenames - errors=$(echo "$errors"; echo "$result" |sed -e "s@in - on@in $filename on@g") + errors=$(echo "$errors"; echo "$result" | grep ':' | sed -e "s@in - on@in $filename on@g") fi done unset IFS -if [ $error -eq 1 ] +if [ -n "$errors" ] then - echo "PHP Syntax check failed:" - # php "display errors" (display_errors php.ini value) - # and "log errors" (log_errors php.ini value). - # these are independent settings - see main/main.c in php source. - # the "log errors" setting produces output which - # starts with "PHP Parse error:"; the "display errors" - # setting produces output starting with "Parse error:". - # if both are turned on php dumps the parse error twice. - # therefore here we try to grep for one version and - # if that yields no results grep for the other version. - # - # other fun php facts: - # - # 1. in cli, display_errors and log_errors have different - # destinations by default. display_errors prints to - # standard output and log_errors prints to standard error. - # whether these destinations make sense is left - # as an exercise for the reader. - # 2. as mentioned above, with all output turned on - # php will print parse errors twice, one time on stdout - # and one time on stderr. - # 3. it is possible to set both display_errors and log_errors - # to off. if this is done php will print the text - # "Errors parsing " but will not say what - # the errors are. useful behavior, this. - # 4. on my system display_errors defaults to on and - # log_errors defaults to off, therefore providing - # by default one copy of messages. your mileage may vary. - # 5. by setting display_errors=stderr and log_errors=on, - # both sets of messages will be printed on stderr. - # 6. php-cgi binary, given display_errors=stderr and - # log_errors=on, still prints both sets of messages - # on stderr, but formats one set as an html fragment. - # 7. your entry here? ;) - $echo_e "$errors" | grep "^Parse error:" - if [ $? -ne 0 ] - then - # match failed - $echo_e "$errors" | grep "^PHP Parse error:" - fi + echo "PHP Syntax check failed: " + $echo_e "$errors" exit 1 fi diff --git a/git-tools/merge.php b/git-tools/merge.php index 034bd2032c..f6142095fb 100755 --- a/git-tools/merge.php +++ b/git-tools/merge.php @@ -78,12 +78,12 @@ function work($pull_id, $remote) add_remote($pull_user, 'phpbb3'); run("git fetch $pull_user"); run("git merge --no-ff $pull_user/$pull_branch"); - run("phpunit"); + run("phpBB/vendor/bin/phpunit"); run("git checkout develop"); run("git pull $remote develop"); run("git merge --no-ff develop-olympus"); - run("phpunit"); + run("phpBB/vendor/bin/phpunit"); break; case 'develop': @@ -93,7 +93,7 @@ function work($pull_id, $remote) add_remote($pull_user, 'phpbb3'); run("git fetch $pull_user"); run("git merge --no-ff $pull_user/$pull_branch"); - run("phpunit"); + run("phpBB/vendor/bin/phpunit"); break; default: @@ -124,19 +124,34 @@ function get_repository_url($username, $repository, $ssh = false) function api_request($query) { - $contents = file_get_contents("http://github.com/api/v2/json/$query"); + return api_url_request("https://api.github.com/$query?per_page=100"); +} + +function api_url_request($url) +{ + $contents = file_get_contents($url, false, stream_context_create(array( + 'http' => array( + 'header' => "User-Agent: phpBB/1.0\r\n", + ), + ))); if ($contents === false) { throw new RuntimeException("Error: failed to retrieve pull request data\n", 4); } + $contents = json_decode($contents); - return json_decode($contents); + if (isset($contents->message) && strpos($contents->message, 'API Rate Limit') === 0) + { + throw new RuntimeException('Reached github API Rate Limit. Please try again later' . "\n", 4); + } + + return $contents; } function get_pull($username, $repository, $pull_id) { - $request = api_request("pulls/$username/$repository/$pull_id"); + $request = api_request("repos/$username/$repository/pulls/$pull_id"); $pull = $request->pull; diff --git a/git-tools/setup_github_network.php b/git-tools/setup_github_network.php index 5f2e1609a7..4e144edae6 100755 --- a/git-tools/setup_github_network.php +++ b/git-tools/setup_github_network.php @@ -15,14 +15,14 @@ function show_usage() echo "$filename adds repositories of a github network as remotes to a local git repository.\n"; echo "\n"; - echo "Usage: [php] $filename -s collaborators|organisation|contributors|network [OPTIONS]\n"; + echo "Usage: [php] $filename -s collaborators|organisation|contributors|forks [OPTIONS]\n"; echo "\n"; echo "Scopes:\n"; echo " collaborators Repositories of people who have push access to the specified repository\n"; echo " contributors Repositories of people who have contributed to the specified repository\n"; echo " organisation Repositories of members of the organisation at github\n"; - echo " network All repositories of the whole github network\n"; + echo " forks All repositories of the whole github network\n"; echo "\n"; echo "Options:\n"; @@ -55,31 +55,31 @@ exit(work($scope, $username, $repository, $developer)); function work($scope, $username, $repository, $developer) { // Get some basic data - $network = get_network($username, $repository); + $forks = get_forks($username, $repository); $collaborators = get_collaborators($username, $repository); - if ($network === false || $collaborators === false) + if ($forks === false || $collaborators === false) { - echo "Error: failed to retrieve network or collaborators\n"; + echo "Error: failed to retrieve forks or collaborators\n"; return 1; } switch ($scope) { case 'collaborators': - $remotes = array_intersect_key($network, $collaborators); + $remotes = array_intersect_key($forks, $collaborators); break; case 'organisation': - $remotes = array_intersect_key($network, get_organisation_members($username)); + $remotes = array_intersect_key($forks, get_organisation_members($username)); break; case 'contributors': - $remotes = array_intersect_key($network, get_contributors($username, $repository)); + $remotes = array_intersect_key($forks, get_contributors($username, $repository)); break; - case 'network': - $remotes = $network; + case 'forks': + $remotes = $forks; break; default: @@ -145,26 +145,66 @@ function get_repository_url($username, $repository, $ssh = false) function api_request($query) { - $contents = file_get_contents("http://github.com/api/v2/json/$query"); + return api_url_request("https://api.github.com/$query?per_page=100"); +} + +function api_url_request($url) +{ + $contents = file_get_contents($url, false, stream_context_create(array( + 'http' => array( + 'header' => "User-Agent: phpBB/1.0\r\n", + ), + ))); + + $sub_request_result = array(); + // Check headers for pagination links + if (!empty($http_response_header)) + { + foreach ($http_response_header as $header_element) + { + // Find Link Header which gives us a link to the next page + if (strpos($header_element, 'Link: ') === 0) + { + list($head, $header_content) = explode(': ', $header_element); + foreach (explode(', ', $header_content) as $links) + { + list($url, $rel) = explode('; ', $links); + if ($rel == 'rel="next"') + { + // Found a next link, follow it and merge the results + $sub_request_result = api_url_request(substr($url, 1, -1)); + } + } + } + } + } + if ($contents === false) { return false; } - return json_decode($contents); + $contents = json_decode($contents); + + if (isset($contents->message) && strpos($contents->message, 'API Rate Limit') === 0) + { + throw new RuntimeException('Reached github API Rate Limit. Please try again later' . "\n", 4); + } + + return ($sub_request_result) ? array_merge($sub_request_result, $contents) : $contents; } function get_contributors($username, $repository) { - $request = api_request("repos/show/$username/$repository/contributors"); + $request = api_request("repos/$username/$repository/stats/contributors"); if ($request === false) { return false; } $usernames = array(); - foreach ($request->contributors as $contributor) + foreach ($request as $contribution) { - $usernames[$contributor->login] = $contributor->login; + $usernames[$contribution->author->login] = $contribution->author->login; } return $usernames; @@ -172,14 +212,14 @@ function get_contributors($username, $repository) function get_organisation_members($username) { - $request = api_request("organizations/$username/public_members"); + $request = api_request("orgs/$username/public_members"); if ($request === false) { return false; } $usernames = array(); - foreach ($request->users as $member) + foreach ($request as $member) { $usernames[$member->login] = $member->login; } @@ -189,35 +229,35 @@ function get_organisation_members($username) function get_collaborators($username, $repository) { - $request = api_request("repos/show/$username/$repository/collaborators"); + $request = api_request("repos/$username/$repository/collaborators"); if ($request === false) { return false; } $usernames = array(); - foreach ($request->collaborators as $collaborator) + foreach ($request as $collaborator) { - $usernames[$collaborator] = $collaborator; + $usernames[$collaborator->login] = $collaborator->login; } return $usernames; } -function get_network($username, $repository) +function get_forks($username, $repository) { - $request = api_request("repos/show/$username/$repository/network"); + $request = api_request("repos/$username/$repository/forks"); if ($request === false) { return false; } $usernames = array(); - foreach ($request->network as $network) + foreach ($request as $fork) { - $usernames[$network->owner] = array( - 'username' => $network->owner, - 'repository' => $network->name, + $usernames[$fork->owner->login] = array( + 'username' => $fork->owner->login, + 'repository' => $fork->name, ); } diff --git a/phpBB/.htaccess b/phpBB/.htaccess index 474f9774c2..6f33916775 100644 --- a/phpBB/.htaccess +++ b/phpBB/.htaccess @@ -1,12 +1,30 @@ + +RewriteEngine on + # # Uncomment the statement below if you want to make use of # HTTP authentication and it does not already work. # This could be required if you are for example using PHP via Apache CGI. # -# -#RewriteEngine on #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L] -# + +# +# The following 3 lines will rewrite URLs passed through the front controller +# to not require app.php in the actual URL. In other words, a controller is +# by default accessed at /app.php/my/controller, but can also be accessed at +# /my/controller +# +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule ^(.*)$ app.php [QSA,L] + +# +# If symbolic links are not already being followed, +# uncomment the line below. +# http://anothersysadmin.wordpress.com/2008/06/10/mod_rewrite-forbidden-403-with-apache-228/ +# +#Options +FollowSymLinks + Order Allow,Deny diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index e20bbe4bec..c1e8edbd03 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -42,7 +42,6 @@ if (!$auth->acl_get('a_')) // We define the admin variables now, because the user is now able to use the admin related features... define('IN_ADMIN', true); -$phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : './'; // Some oft used variables $safe_mode = (@ini_get('safe_mode') == '1' || strtolower(@ini_get('safe_mode')) === 'on') ? true : false; @@ -51,8 +50,7 @@ $module_id = request_var('i', ''); $mode = request_var('mode', ''); // Set custom style for admin area -$phpbb_style->set_ext_dir_prefix('adm/'); -$phpbb_style->set_custom_style('admin', $phpbb_admin_path . 'style', ''); +$template->set_custom_style('adm', $phpbb_admin_path . 'style'); $template->assign_var('T_ASSETS_PATH', $phpbb_root_path . 'assets'); $template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style'); diff --git a/phpBB/adm/style/acp_attachments.html b/phpBB/adm/style/acp_attachments.html index 266b7e48b4..c7b451e68b 100644 --- a/phpBB/adm/style/acp_attachments.html +++ b/phpBB/adm/style/acp_attachments.html @@ -196,7 +196,7 @@ {L_MAX_EXTGROUP_FILESIZE}{L_COLON} - {S_EXT_GROUP_SIZE_OPTIONS} + {S_EXT_GROUP_SIZE_OPTIONS} {L_ASSIGNED_EXTENSIONS}{L_COLON} @@ -348,7 +348,7 @@ {orphan.REAL_FILENAME} {orphan.FILETIME} {orphan.FILESIZE} - {L_ATTACH_ID}{L_COLON} + {L_ATTACH_ID}{L_COLON} diff --git a/phpBB/adm/style/acp_avatar_options_gravatar.html b/phpBB/adm/style/acp_avatar_options_gravatar.html new file mode 100644 index 0000000000..0c2e8cc984 --- /dev/null +++ b/phpBB/adm/style/acp_avatar_options_gravatar.html @@ -0,0 +1,11 @@ + + {L_GRAVATAR_AVATAR_EMAIL}{L_COLON}{L_GRAVATAR_AVATAR_EMAIL_EXPLAIN} + + + + {L_GRAVATAR_AVATAR_SIZE}{L_COLON}{L_GRAVATAR_AVATAR_SIZE_EXPLAIN} + + {L_PIXEL} × + {L_PIXEL} + + diff --git a/phpBB/adm/style/acp_avatar_options_local.html b/phpBB/adm/style/acp_avatar_options_local.html new file mode 100644 index 0000000000..148efd051b --- /dev/null +++ b/phpBB/adm/style/acp_avatar_options_local.html @@ -0,0 +1,25 @@ + + {L_AVATAR_CATEGORY}{L_COLON} + + {L_NO_AVATAR_CATEGORY} + + selected="selected">{avatar_local_cats.NAME} + + + + + + + + + + + + + + + + + + + diff --git a/phpBB/adm/style/acp_avatar_options_remote.html b/phpBB/adm/style/acp_avatar_options_remote.html new file mode 100644 index 0000000000..1c0e3db599 --- /dev/null +++ b/phpBB/adm/style/acp_avatar_options_remote.html @@ -0,0 +1,11 @@ + + {L_LINK_REMOTE_AVATAR}{L_COLON}{L_LINK_REMOTE_AVATAR_EXPLAIN} + + + + {L_LINK_REMOTE_SIZE}{L_COLON}{L_LINK_REMOTE_SIZE_EXPLAIN} + + {L_PIXEL} × + {L_PIXEL} + + diff --git a/phpBB/adm/style/acp_avatar_options_upload.html b/phpBB/adm/style/acp_avatar_options_upload.html new file mode 100644 index 0000000000..63a734ea7d --- /dev/null +++ b/phpBB/adm/style/acp_avatar_options_upload.html @@ -0,0 +1,11 @@ + + {L_UPLOAD_AVATAR_FILE}{L_COLON} + + + + + + {L_UPLOAD_AVATAR_URL}{L_COLON}{L_UPLOAD_AVATAR_URL_EXPLAIN} + + + diff --git a/phpBB/adm/style/acp_board.html b/phpBB/adm/style/acp_board.html index 6b8ceb3ef6..1a09c4eee6 100644 --- a/phpBB/adm/style/acp_board.html +++ b/phpBB/adm/style/acp_board.html @@ -34,7 +34,7 @@ - {auth_tpl.TPL} + diff --git a/phpBB/adm/style/acp_captcha.html b/phpBB/adm/style/acp_captcha.html index ab5e207e0d..df4c675209 100644 --- a/phpBB/adm/style/acp_captcha.html +++ b/phpBB/adm/style/acp_captcha.html @@ -19,11 +19,11 @@ {L_REG_LIMIT}{L_COLON}{L_REG_LIMIT_EXPLAIN} - + {L_MAX_LOGIN_ATTEMPTS}{L_COLON}{L_MAX_LOGIN_ATTEMPTS_EXPLAIN} - + {L_VISUAL_CONFIRM_POST}{L_COLON}{L_VISUAL_CONFIRM_POST_EXPLAIN} diff --git a/phpBB/adm/style/acp_ext_enable.html b/phpBB/adm/style/acp_ext_enable.html index 3f7be2c847..35585207eb 100644 --- a/phpBB/adm/style/acp_ext_enable.html +++ b/phpBB/adm/style/acp_ext_enable.html @@ -7,7 +7,13 @@ {L_EXTENSIONS_EXPLAIN} {L_ENABLE_EXPLAIN} - + + + {L_MIGRATION_EXCEPTION_ERROR} + {MIGRATOR_ERROR} + {L_RETURN} + + {L_ENABLE_CONFIRM} diff --git a/phpBB/adm/style/acp_ext_purge.html b/phpBB/adm/style/acp_ext_purge.html index 00a58721cb..94bef82ca5 100644 --- a/phpBB/adm/style/acp_ext_purge.html +++ b/phpBB/adm/style/acp_ext_purge.html @@ -7,7 +7,13 @@ {L_EXTENSIONS_EXPLAIN} {L_PURGE_EXPLAIN} - + + + {L_MIGRATION_EXCEPTION_ERROR} + {MIGRATOR_ERROR} + {L_RETURN} + + {L_PURGE_CONFIRM} diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index 9a3706c2f0..7b1466cfbd 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -152,7 +152,7 @@ {L_FORUM_DESC}{L_COLON}{L_FORUM_DESC_EXPLAIN} - {FORUM_DESC} + {FORUM_DESC} checked="checked" /> {L_PARSE_BBCODE} checked="checked" /> {L_PARSE_SMILIES} checked="checked" /> {L_PARSE_URLS} @@ -239,8 +239,9 @@ {L_FORUM_TOPICS_PAGE}{L_COLON}{L_FORUM_TOPICS_PAGE_EXPLAIN} - + + @@ -252,15 +253,15 @@ {L_AUTO_PRUNE_FREQ}{L_COLON}{L_AUTO_PRUNE_FREQ_EXPLAIN} - {L_DAYS} + {L_DAYS} {L_AUTO_PRUNE_DAYS}{L_COLON}{L_AUTO_PRUNE_DAYS_EXPLAIN} - {L_DAYS} + {L_DAYS} {L_AUTO_PRUNE_VIEWED}{L_COLON}{L_AUTO_PRUNE_VIEWED_EXPLAIN} - {L_DAYS} + {L_DAYS} {L_PRUNE_OLD_POLLS}{L_COLON}{L_PRUNE_OLD_POLLS_EXPLAIN} @@ -315,7 +316,7 @@ {L_FORUM_RULES}{L_COLON}{L_FORUM_RULES_EXPLAIN} - {FORUM_RULES_PLAIN} + {FORUM_RULES_PLAIN} checked="checked" /> {L_PARSE_BBCODE} checked="checked" /> {L_PARSE_SMILIES} checked="checked" /> {L_PARSE_URLS} @@ -436,7 +437,7 @@ - {NAVIGATION} [{L_EDIT} | {L_DELETE} | {L_RESYNC}] + {NAVIGATION} [{L_EDIT} | {L_DELETE} | {L_RESYNC}] diff --git a/phpBB/adm/style/acp_groups.html b/phpBB/adm/style/acp_groups.html index 4701bf702f..2953e85bd9 100644 --- a/phpBB/adm/style/acp_groups.html +++ b/phpBB/adm/style/acp_groups.html @@ -17,7 +17,7 @@ - enctype="multipart/form-data"> + {L_GROUP_DETAILS} @@ -84,11 +84,11 @@ {L_GROUP_SETTINGS_SAVE} {L_GROUP_MESSAGE_LIMIT}{L_COLON}{L_GROUP_MESSAGE_LIMIT_EXPLAIN} - + {L_GROUP_MAX_RECIPIENTS}{L_COLON}{L_GROUP_MAX_RECIPIENTS_EXPLAIN} - + {L_GROUP_COLOR}{L_COLON}{L_GROUP_COLOR_EXPLAIN} @@ -104,66 +104,26 @@ {L_GROUP_AVATAR} {L_CURRENT_IMAGE}{L_COLON}{L_AVATAR_EXPLAIN} - {AVATAR_IMAGE} - {L_DELETE_AVATAR} + {AVATAR} + {L_DELETE_AVATAR} - - - - {L_UPLOAD_AVATAR_FILE}{L_COLON} - - - - {L_UPLOAD_AVATAR_URL}{L_COLON}{L_UPLOAD_AVATAR_URL_EXPLAIN} - - - - - {L_LINK_REMOTE_AVATAR}{L_COLON}{L_LINK_REMOTE_AVATAR_EXPLAIN} - - - - {L_LINK_REMOTE_SIZE}{L_COLON}{L_LINK_REMOTE_SIZE_EXPLAIN} - {L_PIXEL} × {L_PIXEL} - - - - {L_AVATAR_GALLERY}{L_COLON} - - - - - - - - {L_AVATAR_GALLERY} - - {L_AVATAR_CATEGORY}{L_COLON} - {S_CAT_OPTIONS} - - - - - - - - - - - - - - - - - - - - - - - - + + {L_AVATAR_TYPE}{L_COLON} + + {L_NO_AVATAR_CATEGORY} + + selected="selected">{avatar_drivers.L_TITLE} + + + + + + + {avatar_drivers.L_EXPLAIN} + {avatar_drivers.OUTPUT} + + + @@ -174,6 +134,8 @@ + + « {L_BACK} diff --git a/phpBB/adm/style/acp_groups_position.html b/phpBB/adm/style/acp_groups_position.html index 1e309d4cbc..cf1a7be427 100644 --- a/phpBB/adm/style/acp_groups_position.html +++ b/phpBB/adm/style/acp_groups_position.html @@ -17,8 +17,8 @@ - - + + {S_FORM_TOKEN} @@ -38,22 +38,22 @@ - - {legend.GROUP_NAME} + + style="color: {legend.GROUP_COLOUR}">{legend.GROUP_NAME} {legend.GROUP_TYPE} - {ICON_MOVE_UP_DISABLED} - {ICON_MOVE_DOWN} + {ICON_MOVE_UP_DISABLED} + {ICON_MOVE_DOWN} - {ICON_MOVE_UP} - {ICON_MOVE_DOWN} + {ICON_MOVE_UP} + {ICON_MOVE_DOWN} - {ICON_MOVE_UP} - {ICON_MOVE_DOWN_DISABLED} + {ICON_MOVE_UP} + {ICON_MOVE_DOWN_DISABLED} - {ICON_MOVE_UP_DISABLED} - {ICON_MOVE_DOWN_DISABLED} + {ICON_MOVE_UP_DISABLED} + {ICON_MOVE_DOWN_DISABLED} {ICON_DELETE} @@ -66,9 +66,14 @@ - + - {L_SELECT_GROUP}{S_GROUP_SELECT_LEGEND} + + {L_SELECT_GROUP} + + class="sep" value="{add_legend.GROUP_ID}">{add_legend.GROUP_NAME} + + {S_FORM_TOKEN} @@ -82,7 +87,7 @@ {L_TEAMPAGE_SETTINGS} - {L_TEAMPAGE_MEMBERSHIPS}{L_COLON} + {L_TEAMPAGE_MEMBERSHIPS}{L_COLON} checked="checked" /> {L_TEAMPAGE_DISP_FIRST} checked="checked" /> {L_TEAMPAGE_DISP_DEFAULT} @@ -98,8 +103,8 @@ - - + + {S_FORM_TOKEN} @@ -108,6 +113,8 @@ {L_TEAMPAGE_EXPLAIN} + {L_TEAMPAGE} » {CURRENT_CATEGORY_NAME} + @@ -119,22 +126,29 @@ - - {teampage.GROUP_NAME} - {teampage.GROUP_TYPE} + + + + {teampage.GROUP_NAME} + + style="color: {teampage.GROUP_COLOUR}">{teampage.GROUP_NAME} + + + {teampage.GROUP_TYPE}- + - {ICON_MOVE_UP_DISABLED} - {ICON_MOVE_DOWN} + {ICON_MOVE_UP_DISABLED} + {ICON_MOVE_DOWN} - {ICON_MOVE_UP} - {ICON_MOVE_DOWN} + {ICON_MOVE_UP} + {ICON_MOVE_DOWN} - {ICON_MOVE_UP} - {ICON_MOVE_DOWN_DISABLED} + {ICON_MOVE_UP} + {ICON_MOVE_DOWN_DISABLED} - {ICON_MOVE_UP_DISABLED} - {ICON_MOVE_DOWN_DISABLED} + {ICON_MOVE_UP_DISABLED} + {ICON_MOVE_DOWN_DISABLED} {ICON_DELETE} @@ -147,13 +161,37 @@ - + + - {L_SELECT_GROUP}{S_GROUP_SELECT_TEAMPAGE} + + + + {S_FORM_TOKEN} + + + + + + + + {L_SELECT_GROUP} + + class="sep" value="{add_teampage.GROUP_ID}">{add_teampage.GROUP_NAME} + + {S_FORM_TOKEN} + + {ICON_MOVE_UP} + {ICON_MOVE_UP_DISABLED} + + {ICON_MOVE_DOWN} + {ICON_MOVE_DOWN_DISABLED} + + diff --git a/phpBB/adm/style/acp_icons.html b/phpBB/adm/style/acp_icons.html index b9af20d5a2..eca02d2798 100644 --- a/phpBB/adm/style/acp_icons.html +++ b/phpBB/adm/style/acp_icons.html @@ -108,8 +108,8 @@ - - + + @@ -136,8 +136,8 @@ - - + + {S_ADD_ORDER_LIST_DISPLAY} @@ -243,8 +243,8 @@ {items.EMOTION} - {ICON_MOVE_UP_DISABLED}{ICON_MOVE_UP} - {ICON_MOVE_DOWN_DISABLED}{ICON_MOVE_DOWN} + {ICON_MOVE_UP_DISABLED}{ICON_MOVE_UP} + {ICON_MOVE_DOWN_DISABLED}{ICON_MOVE_DOWN} {ICON_EDIT} {ICON_DELETE} diff --git a/phpBB/adm/style/acp_inactive.html b/phpBB/adm/style/acp_inactive.html index 726c8c8b32..68a168a5d6 100644 --- a/phpBB/adm/style/acp_inactive.html +++ b/phpBB/adm/style/acp_inactive.html @@ -53,7 +53,7 @@ - {L_DISPLAY_LOG}{L_COLON} {S_LIMIT_DAYS} {L_SORT_BY}{L_COLON} {S_SORT_KEY} {S_SORT_DIR} Users per page{L_COLON} + {L_DISPLAY_LOG}{L_COLON} {S_LIMIT_DAYS} {L_SORT_BY}{L_COLON} {S_SORT_KEY} {S_SORT_DIR} Users per page{L_COLON} diff --git a/phpBB/adm/style/acp_jabber.html b/phpBB/adm/style/acp_jabber.html index 639bcd221f..4d0b1b0d97 100644 --- a/phpBB/adm/style/acp_jabber.html +++ b/phpBB/adm/style/acp_jabber.html @@ -31,7 +31,7 @@ {L_JAB_PORT}{L_COLON}{L_JAB_PORT_EXPLAIN} - + {L_JAB_USERNAME}{L_COLON}{L_JAB_USERNAME_EXPLAIN} @@ -50,7 +50,7 @@ {L_JAB_PACKAGE_SIZE}{L_COLON}{L_JAB_PACKAGE_SIZE_EXPLAIN} - + diff --git a/phpBB/adm/style/acp_main.html b/phpBB/adm/style/acp_main.html index 8b591294d4..b644862ce1 100644 --- a/phpBB/adm/style/acp_main.html +++ b/phpBB/adm/style/acp_main.html @@ -76,6 +76,8 @@ + + {L_FORUM_STATS} @@ -202,6 +204,8 @@ + + diff --git a/phpBB/adm/style/acp_prune_forums.html b/phpBB/adm/style/acp_prune_forums.html index aede662bcb..67cdaa784a 100644 --- a/phpBB/adm/style/acp_prune_forums.html +++ b/phpBB/adm/style/acp_prune_forums.html @@ -73,11 +73,11 @@ {L_FORUM_PRUNE} {L_PRUNE_NOT_POSTED}{L_COLON} - + {L_PRUNE_NOT_VIEWED}{L_COLON} - + {L_PRUNE_OLD_POLLS}{L_COLON}{L_PRUNE_OLD_POLLS_EXPLAIN} diff --git a/phpBB/adm/style/acp_prune_users.html b/phpBB/adm/style/acp_prune_users.html index 75fa04a157..1257f3fb3d 100644 --- a/phpBB/adm/style/acp_prune_users.html +++ b/phpBB/adm/style/acp_prune_users.html @@ -35,11 +35,11 @@ {L_POSTS}{L_COLON} - {S_COUNT_OPTIONS} + {S_COUNT_OPTIONS} {L_POSTS_ON_QUEUE}{L_COLON} - {S_COUNT_OPTIONS} + {S_COUNT_OPTIONS} diff --git a/phpBB/adm/style/acp_ranks.html b/phpBB/adm/style/acp_ranks.html index a475370f73..4b2e52536f 100644 --- a/phpBB/adm/style/acp_ranks.html +++ b/phpBB/adm/style/acp_ranks.html @@ -41,7 +41,7 @@ {L_RANK_MINIMUM}{L_COLON} - + diff --git a/phpBB/adm/style/acp_search.html b/phpBB/adm/style/acp_search.html index 3da70bc0c8..bf353d62f2 100644 --- a/phpBB/adm/style/acp_search.html +++ b/phpBB/adm/style/acp_search.html @@ -18,11 +18,11 @@ {L_SEARCH_INTERVAL}{L_COLON}{L_SEARCH_INTERVAL_EXPLAIN} - {L_SECONDS} + {L_SECONDS} {L_SEARCH_GUEST_INTERVAL}{L_COLON}{L_SEARCH_GUEST_INTERVAL_EXPLAIN} - {L_SECONDS} + {L_SECONDS} {L_LIMIT_SEARCH_LOAD}{L_COLON}{L_LIMIT_SEARCH_LOAD_EXPLAIN} @@ -30,15 +30,15 @@ {L_MIN_SEARCH_AUTHOR_CHARS}{L_COLON}{L_MIN_SEARCH_AUTHOR_CHARS_EXPLAIN} - + {L_MAX_NUM_SEARCH_KEYWORDS}{L_COLON}{L_MAX_NUM_SEARCH_KEYWORDS_EXPLAIN} - + {L_SEARCH_STORE_RESULTS}{L_COLON}{L_SEARCH_STORE_RESULTS_EXPLAIN} - {L_SECONDS} + {L_SECONDS} diff --git a/phpBB/adm/style/acp_users_avatar.html b/phpBB/adm/style/acp_users_avatar.html index 2135b52fb9..0a72bb0b62 100644 --- a/phpBB/adm/style/acp_users_avatar.html +++ b/phpBB/adm/style/acp_users_avatar.html @@ -1,78 +1,39 @@ - enctype="multipart/form-data"> + {L_ACP_USER_AVATAR} - - {L_CURRENT_IMAGE}{L_COLON}{L_AVATAR_EXPLAIN} - {AVATAR_IMAGE} - {L_DELETE_AVATAR} - - - - - {L_UPLOAD_AVATAR_FILE}{L_COLON} - - - - - - {L_UPLOAD_AVATAR_URL}{L_COLON}{L_UPLOAD_AVATAR_URL_EXPLAIN} - - - - - - {L_LINK_REMOTE_AVATAR}{L_COLON}{L_LINK_REMOTE_AVATAR_EXPLAIN} - - - - {L_LINK_REMOTE_SIZE}{L_COLON}{L_LINK_REMOTE_SIZE_EXPLAIN} - {L_PIXEL} × {L_PIXEL} - - - - - {L_AVATAR_GALLERY}{L_COLON} - - - - - - - - {L_AVATAR_GALLERY} + {ERROR} - {L_AVATAR_CATEGORY}{L_COLON} - {S_CAT_OPTIONS} + {L_CURRENT_IMAGE}{L_COLON}{L_AVATAR_EXPLAIN} + {AVATAR} + {L_DELETE_AVATAR} + + + {L_AVATAR_SELECT} - - - - - - - - - - - - - - + {L_AVATAR_TYPE} + + {L_NO_AVATAR_CATEGORY} + + selected="selected">{avatar_drivers.L_TITLE} + + - - - - - - - + + + + {avatar_drivers.L_EXPLAIN} + {avatar_drivers.OUTPUT} + + + - - {S_FORM_TOKEN} + + {S_FORM_TOKEN} - + + diff --git a/phpBB/adm/style/acp_users_overview.html b/phpBB/adm/style/acp_users_overview.html index b7e3a9822e..1caa6e5e13 100644 --- a/phpBB/adm/style/acp_users_overview.html +++ b/phpBB/adm/style/acp_users_overview.html @@ -43,7 +43,7 @@ {L_EMAIL}{L_COLON} - + {L_NEW_PASSWORD}{L_COLON}{L_CHANGE_PASSWORD_EXPLAIN} @@ -53,6 +53,7 @@ {L_CONFIRM_PASSWORD}{L_COLON}{L_CONFIRM_PASSWORD_EXPLAIN} + diff --git a/phpBB/adm/style/acp_users_profile.html b/phpBB/adm/style/acp_users_profile.html index 3232e8d1f5..cad1dca9d8 100644 --- a/phpBB/adm/style/acp_users_profile.html +++ b/phpBB/adm/style/acp_users_profile.html @@ -12,7 +12,7 @@ {L_UCP_MSNM}{L_COLON} - + {L_UCP_YIM}{L_COLON} @@ -20,11 +20,11 @@ {L_UCP_JABBER}{L_COLON} - + {L_WEBSITE}{L_COLON} - + {L_LOCATION}{L_COLON} @@ -38,7 +38,7 @@ {L_INTERESTS}{L_COLON} {INTERESTS} - + {L_BIRTHDAY}{L_COLON}{L_BIRTHDAY_EXPLAIN} {L_DAY}{L_COLON} {S_BIRTHDAY_DAY_OPTIONS} {L_MONTH}{L_COLON} {S_BIRTHDAY_MONTH_OPTIONS} {L_YEAR}{L_COLON} {S_BIRTHDAY_YEAR_OPTIONS} @@ -48,7 +48,7 @@ {L_USER_CUSTOM_PROFILE_FIELDS} - + for="{profile_fields.FIELD_ID}">{profile_fields.LANG_NAME}{L_COLON}{profile_fields.LANG_EXPLAIN} {profile_fields.FIELD} diff --git a/phpBB/adm/style/acp_users_signature.html b/phpBB/adm/style/acp_users_signature.html index c9cc053eec..2b4964803e 100644 --- a/phpBB/adm/style/acp_users_signature.html +++ b/phpBB/adm/style/acp_users_signature.html @@ -92,7 +92,7 @@ // ]]> - {SIGNATURE} + {SIGNATURE} {L_DISABLE_BBCODE} diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index 8551c952c7..f7a7f9f9bf 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -1098,12 +1098,13 @@ input.disabled { border: 1px solid #999999; position: fixed; display: none; - top: 100px; - left: 35%; - width: 30%; + top: 150px; + left: 25%; + width: 50%; z-index: 50; padding: 25px; padding: 0 25px 20px 25px; + text-align: left; } .phpbb_alert .alert_close { @@ -1127,6 +1128,20 @@ input.disabled { padding-bottom: 8px; } +.phpbb_alert label { + display: block; + margin: 8px 0; + padding-bottom: 8px; +} + +.phpbb_alert div.alert_text > p, +.phpbb_alert div.alert_text > label, +.phpbb_alert div.alert_text > select, +.phpbb_alert div.alert_text > textarea, +.phpbb_alert div.alert_text > input { + font-size: 0.9em; +} + #darkenwrapper { display: none; } diff --git a/phpBB/adm/style/ajax.js b/phpBB/adm/style/ajax.js index 3ccb368665..efb0639f1b 100644 --- a/phpBB/adm/style/ajax.js +++ b/phpBB/adm/style/ajax.js @@ -2,11 +2,11 @@ "use strict"; -var img_templates = { +var imgTemplates = { up: $('.template-up-img'), - up_disabled: $('.template-up-img-disabled'), + upDisabled: $('.template-up-img-disabled'), down: $('.template-down-img'), - down_disabled: $('.template-down-img-disabled') + downDisabled: $('.template-down-img-disabled') }; /** @@ -15,20 +15,19 @@ var img_templates = { * an item is moved up. It moves the row up or down, and deactivates / * activates any up / down icons that require it (the ones at the top or bottom). */ -phpbb.add_ajax_callback('row_down', function() { +phpbb.addAjaxCallback('row_down', function() { var el = $(this), tr = el.parents('tr'), - tr_swap = tr.next(); + trSwap = tr.next(); /* * If the element was the first one, we have to: * - Add the up-link to the row we moved * - Remove the up-link on the next row */ - if (tr.is(':first-child')) - { - var up_img = img_templates.up.clone().attr('href', tr.attr('data-up')); - tr.find('.up').html(up_img); + if (tr.is(':first-child')) { + var upImg = imgTemplates.up.clone().attr('href', tr.attr('data-up')); + tr.find('.up').html(upImg); phpbb.ajaxify({ selector: tr.find('.up').children('a'), @@ -36,45 +35,43 @@ phpbb.add_ajax_callback('row_down', function() { overlay: false }); - tr_swap.find('.up').html(img_templates.up_disabled.clone()); + trSwap.find('.up').html(imgTemplates.upDisabled.clone()); } - tr.insertAfter(tr_swap); + tr.insertAfter(trSwap); /* * As well as: * - Remove the down-link on the moved row, if it is now the last row * - Add the down-link to the next row, if it was the last row */ - if (tr.is(':last-child')) - { - tr.find('.down').html(img_templates.down_disabled.clone()); + if (tr.is(':last-child')) { + tr.find('.down').html(imgTemplates.downDisabled.clone()); - var down_img = img_templates.down.clone().attr('href', tr_swap.attr('data-down')); - tr_swap.find('.down').html(down_img); + var downImg = imgTemplates.down.clone().attr('href', trSwap.attr('data-down')); + trSwap.find('.down').html(downImg); phpbb.ajaxify({ - selector: tr_swap.find('.down').children('a'), + selector: trSwap.find('.down').children('a'), callback: 'row_down', overlay: false }); } }); -phpbb.add_ajax_callback('row_up', function() { +phpbb.addAjaxCallback('row_up', function() { var el = $(this), tr = el.parents('tr'), - tr_swap = tr.prev(); + trSwap = tr.prev(); /* * If the element was the last one, we have to: * - Add the down-link to the row we moved * - Remove the down-link on the next row */ - if (tr.is(':last-child')) - { - var down_img = img_templates.down.clone().attr('href', tr.attr('data-down')); - tr.find('.down').html(down_img); + if (tr.is(':last-child')) { + var downImg = imgTemplates.down.clone().attr('href', tr.attr('data-down')); + tr.find('.down').html(downImg); phpbb.ajaxify({ selector: tr.find('.down').children('a'), @@ -82,25 +79,24 @@ phpbb.add_ajax_callback('row_up', function() { overlay: false }); - tr_swap.find('.down').html(img_templates.down_disabled.clone()); + trSwap.find('.down').html(imgTemplates.downDisabled.clone()); } - tr.insertBefore(tr_swap); + tr.insertBefore(trSwap); /* * As well as: * - Remove the up-link on the moved row, if it is now the first row * - Add the up-link to the previous row, if it was the first row */ - if (tr.is(':first-child')) - { - tr.find('.up').html(img_templates.up_disabled.clone()); + if (tr.is(':first-child')) { + tr.find('.up').html(imgTemplates.upDisabled.clone()); - var up_img = img_templates.up.clone().attr('href', tr_swap.attr('data-up')); - tr_swap.find('.up').html(up_img); + var upImg = imgTemplates.up.clone().attr('href', trSwap.attr('data-up')); + trSwap.find('.up').html(upImg); phpbb.ajaxify({ - selector: tr_swap.find('.up').children('a'), + selector: trSwap.find('.up').children('a'), callback: 'row_up', overlay: false }); @@ -112,30 +108,29 @@ phpbb.add_ajax_callback('row_up', function() { * It does this by replacing the text, and replacing all instances of "activate" * in the href with "deactivate", and vice versa. */ -phpbb.add_ajax_callback('activate_deactivate', function(res) { +phpbb.addAjaxCallback('activate_deactivate', function(res) { var el = $(this), - new_href = el.attr('href'); + newHref = el.attr('href'); el.text(res.text); - if (new_href.indexOf('deactivate') !== -1) - { - new_href = new_href.replace('deactivate', 'activate') - } - else - { - new_href = new_href.replace('activate', 'deactivate') + if (newHref.indexOf('deactivate') !== -1) { + newHref = newHref.replace('deactivate', 'activate'); + } else { + newHref = newHref.replace('activate', 'deactivate'); } - el.attr('href', new_href); + el.attr('href', newHref); }); /** * The removes the parent row of the link or form that triggered the callback, * and is good for stuff like the removal of forums. */ -phpbb.add_ajax_callback('row_delete', function() { - $(this).parents('tr').remove(); +phpbb.addAjaxCallback('row_delete', function(res) { + if (res.SUCCESS !== false) { + $(this).parents('tr').remove(); + } }); @@ -145,8 +140,7 @@ $('[data-ajax]').each(function() { ajax = $this.attr('data-ajax'), fn; - if (ajax !== 'false') - { + if (ajax !== 'false') { fn = (ajax !== 'true') ? ajax : null; phpbb.ajaxify({ selector: this, @@ -156,6 +150,12 @@ $('[data-ajax]').each(function() { } }); +/** +* Automatically resize textarea +*/ +$(document).ready(function() { + phpbb.resizeTextArea($('textarea:not(.no-auto-resize)'), {minHeight: 75}); +}); })(jQuery); // Avoid conflicts with other libraries diff --git a/phpBB/adm/style/auth_provider_ldap.html b/phpBB/adm/style/auth_provider_ldap.html new file mode 100644 index 0000000000..81afa44373 --- /dev/null +++ b/phpBB/adm/style/auth_provider_ldap.html @@ -0,0 +1,32 @@ + + {L_LDAP_SERVER}{L_COLON}{L_LDAP_SERVER_EXPLAIN} + + + + {L_LDAP_PORT}{L_COLON}{L_LDAP_PORT_EXPLAIN} + + + + {L_LDAP_DN}{L_COLON}{L_LDAP_DN_EXPLAIN} + + + + {L_LDAP_UID}{L_COLON}{L_LDAP_UID_EXPLAIN} + + + + {L_LDAP_USER_FILTER}{L_COLON}{L_LDAP_USER_FILTER_EXPLAIN} + + + + {L_LDAP_EMAIL}{L_COLON}{L_LDAP_EMAIL_EXPLAIN} + + + + {L_LDAP_USER}{L_COLON}{L_LDAP_USER_EXPLAIN} + + + + {L_LDAP_PASSWORD}{L_COLON}{L_LDAP_PASSWORD_EXPLAIN} + + diff --git a/phpBB/adm/style/avatars.js b/phpBB/adm/style/avatars.js new file mode 100644 index 0000000000..26ea24c0db --- /dev/null +++ b/phpBB/adm/style/avatars.js @@ -0,0 +1,15 @@ +(function($) { // Avoid conflicts with other libraries + +"use strict"; + +function avatarHide() { + $('#avatar_options > div').hide(); + + var selected = $('#avatar_driver').val(); + $('#avatar_option_' + selected).show(); +} + +avatarHide(); +$('#avatar_driver').bind('change', avatarHide); + +})(jQuery); // Avoid conflicts with other libraries diff --git a/phpBB/adm/style/captcha_gd_acp.html b/phpBB/adm/style/captcha_gd_acp.html index b333d9205c..43d54adc0b 100644 --- a/phpBB/adm/style/captcha_gd_acp.html +++ b/phpBB/adm/style/captcha_gd_acp.html @@ -20,11 +20,11 @@ {L_CAPTCHA_GD_X_GRID}{L_COLON}{L_CAPTCHA_GD_X_GRID_EXPLAIN} - + {L_CAPTCHA_GD_Y_GRID}{L_COLON}{L_CAPTCHA_GD_Y_GRID_EXPLAIN} - + {L_CAPTCHA_GD_WAVE}{L_COLON}{L_CAPTCHA_GD_WAVE_EXPLAIN} diff --git a/phpBB/adm/style/confirm_body.html b/phpBB/adm/style/confirm_body.html index 2fbb1a60d7..d0360d1b3a 100644 --- a/phpBB/adm/style/confirm_body.html +++ b/phpBB/adm/style/confirm_body.html @@ -1,3 +1,15 @@ + + + {MESSAGE_TITLE} + {MESSAGE_TEXT} + + + + + + + + @@ -14,7 +26,7 @@ - + diff --git a/phpBB/adm/style/editor.js b/phpBB/adm/style/editor.js index c9e8afe08e..9938ff5d0b 100644 --- a/phpBB/adm/style/editor.js +++ b/phpBB/adm/style/editor.js @@ -10,18 +10,16 @@ var theSelection = false; // Check for Browser & Platform for PC & IE specific bits // More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html var clientPC = navigator.userAgent.toLowerCase(); // Get client info -var clientVer = parseInt(navigator.appVersion); // Get browser version - -var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1)); -var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1)); +var clientVer = parseInt(navigator.appVersion, 10); // Get browser version +var is_ie = ((clientPC.indexOf('msie') !== -1) && (clientPC.indexOf('opera') === -1)); +var is_win = ((clientPC.indexOf('win') !== -1) || (clientPC.indexOf('16bit') !== -1)); var baseHeight; /** * Shows the help messages in the helpline window */ -function helpline(help) -{ +function helpline(help) { document.forms[form_name].helpbox.value = help_line[help]; } @@ -29,26 +27,22 @@ function helpline(help) * Fix a bug involving the TextRange object. From * http://www.frostjedi.com/terra/scripts/demo/caretBug.html */ -function initInsertions() -{ +function initInsertions() { var doc; - if(document.forms[form_name]) - { + + if (document.forms[form_name]) { doc = document; - } - else - { + } else { doc = opener.document; } var textarea = doc.forms[form_name].elements[text_name]; - if (is_ie && typeof(baseHeight) != 'number') - { + + if (is_ie && typeof(baseHeight) !== 'number') { textarea.focus(); baseHeight = doc.selection.createRange().duplicate().boundingHeight; - if (!document.forms[form_name]) - { + if (!document.forms[form_name]) { document.body.focus(); } } @@ -57,69 +51,59 @@ function initInsertions() /** * bbstyle */ -function bbstyle(bbnumber) -{ - if (bbnumber != -1) - { +function bbstyle(bbnumber) { + if (bbnumber !== -1) { bbfontstyle(bbtags[bbnumber], bbtags[bbnumber+1]); - } - else - { + } else { insert_text('[*]'); - document.forms[form_name].elements[text_name].focus(); + document.forms[form_name].elements[text_name].focus(); } } /** * Apply bbcodes */ -function bbfontstyle(bbopen, bbclose) -{ +function bbfontstyle(bbopen, bbclose) { theSelection = false; - + var textarea = document.forms[form_name].elements[text_name]; textarea.focus(); - if ((clientVer >= 4) && is_ie && is_win) - { + if ((clientVer >= 4) && is_ie && is_win) { // Get text selection theSelection = document.selection.createRange().text; - if (theSelection) - { + if (theSelection) { // Add tags around selection document.selection.createRange().text = bbopen + theSelection + bbclose; document.forms[form_name].elements[text_name].focus(); theSelection = ''; return; } - } - else if (document.forms[form_name].elements[text_name].selectionEnd && (document.forms[form_name].elements[text_name].selectionEnd - document.forms[form_name].elements[text_name].selectionStart > 0)) - { + } else if (document.forms[form_name].elements[text_name].selectionEnd + && (document.forms[form_name].elements[text_name].selectionEnd - document.forms[form_name].elements[text_name].selectionStart > 0)) { mozWrap(document.forms[form_name].elements[text_name], bbopen, bbclose); document.forms[form_name].elements[text_name].focus(); theSelection = ''; return; } - + //The new position for the cursor after adding the bbcode var caret_pos = getCaretPosition(textarea).start; - var new_pos = caret_pos + bbopen.length; + var new_pos = caret_pos + bbopen.length; // Open tag insert_text(bbopen + bbclose); // Center the cursor when we don't have a selection // Gecko and proper browsers - if (!isNaN(textarea.selectionStart)) - { + if (!isNaN(textarea.selectionStart)) { textarea.selectionStart = new_pos; textarea.selectionEnd = new_pos; - } + } // IE - else if (document.selection) - { + else if (document.selection) { var range = textarea.createTextRange(); range.move("character", new_pos); range.select(); @@ -133,62 +117,47 @@ function bbfontstyle(bbopen, bbclose) /** * Insert text at position */ -function insert_text(text, spaces, popup) -{ +function insert_text(text, spaces, popup) { var textarea; - - if (!popup) - { + + if (!popup) { textarea = document.forms[form_name].elements[text_name]; - } - else - { + } else { textarea = opener.document.forms[form_name].elements[text_name]; } - if (spaces) - { + if (spaces) { text = ' ' + text + ' '; } - if (!isNaN(textarea.selectionStart)) - { + if (!isNaN(textarea.selectionStart)) { var sel_start = textarea.selectionStart; var sel_end = textarea.selectionEnd; mozWrap(textarea, text, ''); textarea.selectionStart = sel_start + text.length; textarea.selectionEnd = sel_end + text.length; - } - - else if (textarea.createTextRange && textarea.caretPos) - { - if (baseHeight != textarea.caretPos.boundingHeight) - { + } else if (textarea.createTextRange && textarea.caretPos) { + if (baseHeight !== textarea.caretPos.boundingHeight) { textarea.focus(); storeCaret(textarea); } + var caret_pos = textarea.caretPos; - caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text; - - } - else - { + caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) === ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text; + } else { textarea.value = textarea.value + text; } - if (!popup) - { + if (!popup) { textarea.focus(); } - } /** * Add inline attachment at position */ -function attach_inline(index, filename) -{ +function attach_inline(index, filename) { insert_text('[attachment=' + index + ']' + filename + '[/attachment]'); document.forms[form_name].elements[text_name].focus(); } @@ -202,56 +171,39 @@ function addquote(post_id, username) var theSelection = ''; var divarea = false; - if (document.all) - { + if (document.all) { divarea = document.all[message_name]; - } - else - { + } else { divarea = document.getElementById(message_name); } // Get text selection - not only the post content :( - if (window.getSelection) - { + if (window.getSelection) { theSelection = window.getSelection().toString(); - } - else if (document.getSelection) - { + } else if (document.getSelection) { theSelection = document.getSelection(); - } - else if (document.selection) - { + } else if (document.selection) { theSelection = document.selection.createRange().text; } - if (theSelection == '' || typeof theSelection == 'undefined' || theSelection == null) - { - if (divarea.innerHTML) - { + if (theSelection === '' || typeof theSelection === 'undefined' || theSelection === null) { + if (divarea.innerHTML) { theSelection = divarea.innerHTML.replace(//ig, '\n'); theSelection = theSelection.replace(//ig, '\n'); theSelection = theSelection.replace(/<\;/ig, '<'); theSelection = theSelection.replace(/>\;/ig, '>'); - theSelection = theSelection.replace(/&\;/ig, '&'); + theSelection = theSelection.replace(/&\;/ig, '&'); theSelection = theSelection.replace(/ \;/ig, ' '); - } - else if (document.all) - { + } else if (document.all) { theSelection = divarea.innerText; - } - else if (divarea.textContent) - { + } else if (divarea.textContent) { theSelection = divarea.textContent; - } - else if (divarea.firstChild.nodeValue) - { + } else if (divarea.firstChild.nodeValue) { theSelection = divarea.firstChild.nodeValue; } } - if (theSelection) - { + if (theSelection) { insert_text('[quote="' + username + '"]' + theSelection + '[/quote]'); } @@ -261,15 +213,13 @@ function addquote(post_id, username) /** * From http://www.massless.org/mozedit/ */ -function mozWrap(txtarea, open, close) -{ - var selLength = (typeof(txtarea.textLength) == 'undefined') ? txtarea.value.length : txtarea.textLength; +function mozWrap(txtarea, open, close) { + var selLength = (typeof(txtarea.textLength) === 'undefined') ? txtarea.value.length : txtarea.textLength; var selStart = txtarea.selectionStart; var selEnd = txtarea.selectionEnd; var scrollTop = txtarea.scrollTop; - if (selEnd == 1 || selEnd == 2) - { + if (selEnd === 1 || selEnd === 2) { selEnd = selLength; } @@ -290,10 +240,8 @@ function mozWrap(txtarea, open, close) * Insert at Caret position. Code from * http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130 */ -function storeCaret(textEl) -{ - if (textEl.createTextRange) - { +function storeCaret(textEl) { + if (textEl.createTextRange) { textEl.caretPos = document.selection.createRange().duplicate(); } } @@ -301,8 +249,7 @@ function storeCaret(textEl) /** * Color pallette */ -function colorPalette(dir, width, height) -{ +function colorPalette(dir, width, height) { var r = 0, g = 0, b = 0; var numberList = new Array(6); var color = ''; @@ -315,88 +262,74 @@ function colorPalette(dir, width, height) document.writeln(''); - for (r = 0; r < 5; r++) - { - if (dir == 'h') - { + for (r = 0; r < 5; r++) { + if (dir === 'h') { document.writeln(''); } - for (g = 0; g < 5; g++) - { - if (dir == 'v') - { + for (g = 0; g < 5; g++) { + if (dir === 'v') { document.writeln(''); } - - for (b = 0; b < 5; b++) - { + + for (b = 0; b < 5; b++) { color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]); document.write(''); document.write(''); document.writeln(''); } - if (dir == 'v') - { + if (dir === 'v') { document.writeln(''); } } - if (dir == 'h') - { + if (dir === 'h') { document.writeln(''); } } document.writeln(''); } - /** * Caret Position object */ -function caretPosition() -{ +function caretPosition() { var start = null; var end = null; } - /** * Get the caret position in an textarea */ -function getCaretPosition(txtarea) -{ +function getCaretPosition(txtarea) { var caretPos = new caretPosition(); - + // simple Gecko/Opera way - if (txtarea.selectionStart || txtarea.selectionStart == 0) - { + if (txtarea.selectionStart || txtarea.selectionStart === 0) { caretPos.start = txtarea.selectionStart; caretPos.end = txtarea.selectionEnd; } // dirty and slow IE way - else if (document.selection) - { + else if (document.selection) { // get current selection var range = document.selection.createRange(); // a new selection of the whole textarea var range_all = document.body.createTextRange(); range_all.moveToElementText(txtarea); - + // calculate selection start point by moving beginning of range_all to beginning of range var sel_start; - for (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++) - { + for (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++) { range_all.moveStart('character', 1); } - + txtarea.sel_start = sel_start; - + // we ignore the end value for IE, this is already dirty enough and we don't need it caretPos.start = txtarea.sel_start; - caretPos.end = txtarea.sel_start; + caretPos.end = txtarea.sel_start; } return caretPos; diff --git a/phpBB/adm/style/install_header.html b/phpBB/adm/style/install_header.html index 6826654ded..5631b83e17 100644 --- a/phpBB/adm/style/install_header.html +++ b/phpBB/adm/style/install_header.html @@ -5,7 +5,7 @@ {META} {PAGE_TITLE} - + -{SCRIPTS} +{$SCRIPTS} + +
{L_EXTENSIONS_EXPLAIN}
{L_ENABLE_EXPLAIN}
{L_MIGRATION_EXCEPTION_ERROR}
{MIGRATOR_ERROR}
{L_RETURN}
{L_ENABLE_CONFIRM}
{L_PURGE_EXPLAIN}
{L_PURGE_CONFIRM}
{NAVIGATION} [{L_EDIT} | {L_DELETE} | {L_RESYNC}]
{avatar_drivers.L_EXPLAIN}
- - + + {S_FORM_TOKEN}
{L_TEAMPAGE_EXPLAIN}
{L_TEAMPAGE} » {CURRENT_CATEGORY_NAME}
{ERROR}
diff --git a/phpBB/adm/style/acp_users_profile.html b/phpBB/adm/style/acp_users_profile.html index 3232e8d1f5..cad1dca9d8 100644 --- a/phpBB/adm/style/acp_users_profile.html +++ b/phpBB/adm/style/acp_users_profile.html @@ -12,7 +12,7 @@
{MESSAGE_TEXT}