aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuriy Rusko <github@rusko.net>2014-05-27 21:55:40 +0200
committerYuriy Rusko <github@rusko.net>2014-05-27 21:55:40 +0200
commit1d61bcedfd1882f84d102c523a354a8c4ae69336 (patch)
treecbc3aead2546002d82fa0503eaab7f1520c515b8
parent27f787e5e4e118b77a3e16879d6c684bdaafc303 (diff)
parent0acaa7722956635b8f17e19cddc6f02a602b7352 (diff)
downloadforums-1d61bcedfd1882f84d102c523a354a8c4ae69336.tar
forums-1d61bcedfd1882f84d102c523a354a8c4ae69336.tar.gz
forums-1d61bcedfd1882f84d102c523a354a8c4ae69336.tar.bz2
forums-1d61bcedfd1882f84d102c523a354a8c4ae69336.tar.xz
forums-1d61bcedfd1882f84d102c523a354a8c4ae69336.zip
Merge remote-tracking branch 'upstream/develop-ascraeus' into ticket/12594
Conflicts: phpBB/docs/hook_system.html
-rw-r--r--.travis.yml47
-rw-r--r--phpBB/adm/style/acp_language.html189
-rw-r--r--phpBB/assets/javascript/core.js4
-rw-r--r--phpBB/config/console.yml1
-rw-r--r--phpBB/docs/hook_system.html883
-rw-r--r--phpBB/includes/acp/acp_language.php1087
-rw-r--r--phpBB/language/en/acp/language.php42
-rw-r--r--phpBB/phpbb/db/driver/mysql.php21
-rw-r--r--phpBB/phpbb/db/driver/mysqli.php3
-rw-r--r--phpBB/styles/prosilver/template/forum_fn.js9
-rw-r--r--phpBB/styles/prosilver/template/mcp_post.html19
-rw-r--r--phpBB/styles/prosilver/template/mcp_topic.html13
-rw-r--r--phpBB/styles/prosilver/template/overall_header.html2
-rw-r--r--phpBB/styles/prosilver/template/posting_topic_review.html19
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_history.html8
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_message_header.html25
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_viewmessage.html26
-rw-r--r--phpBB/styles/prosilver/template/viewforum_body.html12
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_body.html46
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_topic_tools.html2
-rw-r--r--phpBB/styles/prosilver/theme/bidi.css41
-rw-r--r--phpBB/styles/prosilver/theme/buttons.css300
-rw-r--r--phpBB/styles/prosilver/theme/colours.css51
-rw-r--r--phpBB/styles/prosilver/theme/en/icon_contact_pm.gifbin677 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/en/icon_post_edit.gifbin853 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/en/icon_post_quote.gifbin1109 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/en/stylesheet.css20
-rw-r--r--phpBB/styles/prosilver/theme/images/buttons.pngbin2923 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_post_delete.gifbin528 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_post_info.gifbin501 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_post_menu.pngbin1931 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_post_report.gifbin474 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_user_warn.gifbin481 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icons_button.pngbin0 -> 5690 bytes
-rw-r--r--phpBB/styles/prosilver/theme/imageset.css10
-rw-r--r--phpBB/styles/prosilver/theme/responsive.css4
-rw-r--r--tests/config/db_text_test.php12
-rw-r--r--tests/dbal/sql_affected_rows_test.php64
-rwxr-xr-xtravis/setup-webserver.sh4
39 files changed, 503 insertions, 2461 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/phpBB/adm/style/acp_language.html b/phpBB/adm/style/acp_language.html
index d32f6b7eac..4439f519e0 100644
--- a/phpBB/adm/style/acp_language.html
+++ b/phpBB/adm/style/acp_language.html
@@ -2,29 +2,7 @@
<a id="maincontent"></a>
-<!-- IF S_SELECT_METHOD -->
-
- <a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
-
- <h1>{L_SELECT_DOWNLOAD_FORMAT}</h1>
-
- <form id="selectmethod" method="post" action="{U_ACTION}">
-
- <fieldset>
- <legend>{L_DOWNLOAD_AS}</legend>
- <dl>
- <dt><label for="use_method">{L_DOWNLOAD_AS}{L_COLON}</label></dt>
- <dd>{RADIO_BUTTONS}</dd>
- </dl>
-
- <p class="quick">
- <input type="submit" class="button2" value="{L_DOWNLOAD}" name="download" />
- </p>
- </fieldset>
-
- </form>
-
-<!-- ELSEIF S_DETAILS -->
+<!-- IF S_DETAILS -->
<a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
@@ -58,153 +36,32 @@
</fieldset>
</form>
- <br /><br />
+ <!-- IF .missing_files -->
+ <h3 class="error">{L_MISSING_FILES}</h3>
- <!-- IF S_MISSING_FILES -->
- <div class="errorbox">
- <h3>{L_MISSING_FILES}</h3>
- <p>{MISSING_FILES}</p>
- </div>
- <br /><br />
- <!-- ENDIF -->
-
- <!-- IF S_MISSING_VARS -->
- <h1>{L_MISSING_LANG_VARIABLES}</h1>
-
- <p>{L_MISSING_VARS_EXPLAIN}</p>
-
- <form id="missing" method="post" action="{U_MISSING_ACTION}">
-
- <table class="table1">
- <thead>
- <tr>
- <th>{L_LANGUAGE_KEY}</th>
- <th>{L_LANGUAGE_VARIABLE}</th>
- </tr>
- </thead>
- <tbody>
- <!-- BEGIN missing -->
- <tr class="row4">
- <td><strong>{missing.FILE}</strong></td>
- <td style="text-align: right;"><input type="submit" name="missing_file[{missing.KEY}]" value="{L_SELECT}" class="button2" /></td>
- </tr>
- {missing.TPL}
- <!-- END missing -->
- </tbody>
- </table>
- <div>{S_FORM_TOKEN}</div>
- </form>
-
- <br /><br />
- <!-- ENDIF -->
-
- <a id="entries"></a>
-
- <h1>{L_LANGUAGE_ENTRIES}</h1>
-
- <p>{L_LANGUAGE_ENTRIES_EXPLAIN}</p>
-
- <form id="lang_entries" method="post" action="{U_ENTRY_ACTION}">
-
- <!-- IF S_FROM_STORE -->
- <fieldset class="quick" style="float: {S_CONTENT_FLOW_BEGIN};">
- <input type="submit" name="remove_store" value="{L_REMOVE_FROM_STORAGE_FOLDER}" class="button2" />
+ <fieldset>
+ <legend>{L_MISSING_LANG_FILES}</legend>
+ <!-- BEGIN missing_files -->
+ &raquo; {missing_files.FILE_NAME}<br />
+ <!-- END missing_files -->
</fieldset>
<!-- ENDIF -->
- <fieldset class="quick" style="float: {S_CONTENT_FLOW_END};">
- <select name="language_file">{S_LANG_OPTIONS}</select>&nbsp;<input type="submit" class="button2" name="change" value="{L_SELECT}" />
- </fieldset>
-
- <p>&nbsp;<br />&nbsp;</p>
-
-
- <!--[if lt IE 8]>
- <style type="text/css">
- /* <![CDATA[ */
- input.langvalue, textarea.langvalue {
- width: 450px;
- }
- /* ]]> */
- </style>
- <![endif]-->
-
- <table class="table1">
- <thead>
- <!-- IF S_EMAIL_FILE -->
- <tr>
- <th colspan="2">{L_FILE_CONTENTS}</th>
- </tr>
- <!-- ELSE -->
- <tr>
- <th>{L_LANGUAGE_KEY}</th>
- <th>{L_LANGUAGE_VARIABLE}</th>
- </tr>
- <!-- ENDIF -->
- <tr>
- <td rowspan="2" class="row3"><strong>{PRINT_MESSAGE}<!-- IF S_FROM_STORE --><br /><span style="color: red;">{L_FILE_FROM_STORAGE}</span><!-- ENDIF --></strong></td>
- <td class="row3" style="text-align: right;"><input type="submit" name="download_file" class="button2" value="{L_SUBMIT_AND_DOWNLOAD}" />&nbsp;&nbsp;<input type="submit" name="submit_file" class="button2" value="{L_SUBMIT}" /></td>
- </tr>
- <tr>
- <td class="row3" style="text-align: right;">
- <!-- IF ALLOW_UPLOAD -->&nbsp;&nbsp;{L_UPLOAD_METHOD}{L_COLON}&nbsp;<!-- BEGIN buttons --><input type="radio" class="radio"<!-- IF buttons.S_FIRST_ROW --> id="method" checked="checked"<!-- ENDIF --> value="{buttons.VALUE}" name="method" />&nbsp;{buttons.VALUE}&nbsp;<!-- END buttons --><input type="submit" name="upload_file" class="button2" value="{L_SUBMIT_AND_UPLOAD}" /><!-- ENDIF --></td>
- </tr>
- </thead>
- <tbody>
- <!-- IF S_EMAIL_FILE -->
- <tr>
- <td class="row2" colspan="2" style="text-align: center;"><textarea name="entry" id="entry" cols="80" rows="20">{LANG}</textarea></td>
- </tr>
- <!-- ELSE -->
- {TPL}
- <!-- ENDIF -->
- <tr>
- <td class="row3" colspan="3" style="text-align: right;">{S_FORM_TOKEN}<input type="submit" name="download_file" class="button2" value="{L_SUBMIT_AND_DOWNLOAD}" />&nbsp;&nbsp;<input type="submit" name="submit_file" class="button2" value="{L_SUBMIT}" /></td>
- </tr>
- </tbody>
- </table>
- </form>
-
-<!-- ELSEIF S_UPLOAD -->
-
- <a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a>
-
- <h1>{L_UPLOAD_SETTINGS}</h1>
-
- <form id="upload" method="post" action="{U_ACTION}">
-
- <!-- IF S_CONNECTION_SUCCESS -->
- <div class="successbox">
- <p>{L_CONNECTION_SUCCESS}</p>
- </div>
- <!-- ELSEIF S_CONNECTION_FAILED -->
- <div class="errorbox">
- <p>{L_CONNECTION_FAILED}</p>
- </div>
+ <!-- IF .missing_varfile -->
+ <h3 class="error">{L_MISSING_VARS_EXPLAIN}</h3>
+
+ <fieldset>
+ <legend>{L_MISSING_LANG_VARIABLES}</legend>
+ <!-- BEGIN missing_varfile -->
+ <dl>
+ <dt><label>{missing_varfile.FILE_NAME}</label></dt>
+ <!-- BEGIN variable -->
+ <dd>{missing_varfile.variable.VAR_NAME}</dd>
+ <!-- END variable -->
+ </dl>
+ <!-- END missing_varfile -->
+ </fieldset>
<!-- ENDIF -->
-
- <fieldset>
- <legend>{L_UPLOAD_SETTINGS}</legend>
- <dl>
- <dt><label>{L_UPLOAD_METHOD}{L_COLON}</label></dt>
- <dd><strong>{NAME}</strong></dd>
- </dl>
- <!-- BEGIN data -->
- <dl>
- <dt><label for="{data.DATA}">{data.NAME}{L_COLON}</label><br /><span>{data.EXPLAIN}</span></dt>
- <dd><input type="<!-- IF data.DATA == 'password' -->password<!-- ELSE -->text<!-- ENDIF -->" id="{data.DATA}" name="{data.DATA}" value="{data.DEFAULT}" /></dd>
- </dl>
- <!-- END data -->
- </fieldset>
-
- <fieldset class="quick">
- {HIDDEN}
- {S_FORM_TOKEN}
- <input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
- <input class="button1" type="submit" name="test_connection" value="{L_TEST_CONNECTION}" />
- </fieldset>
- </form>
-
<!-- ELSE -->
<h1>{L_ACP_LANGUAGE_PACKS}</h1>
@@ -231,7 +88,7 @@
<td>{lang.LOCAL_NAME}</td>
<td style="text-align: center;"><strong>{lang.ISO}</strong></td>
<td style="text-align: center;">{lang.USED_BY}</td>
- <td style="text-align: center;">&nbsp;<a href="{lang.U_DOWNLOAD}">{L_DOWNLOAD}</a>&nbsp;|&nbsp;<a href="{lang.U_DELETE}">{L_DELETE}</a></td>
+ <td style="text-align: center;"><a href="{lang.U_DELETE}">{L_DELETE}</a></td>
</tr>
<!-- END lang -->
<!-- IF .notinst -->
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index 9eba80542c..296c5b0ef9 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -15,7 +15,7 @@ var dark = $('#darkenwrapper');
var loadingIndicator = $('#loading_indicator');
var phpbbAlertTimer = null;
-var isTouch = (window && typeof window.ontouchstart !== 'undefined');
+phpbb.isTouch = (window && typeof window.ontouchstart !== 'undefined');
/**
* Display a loading screen
@@ -1011,7 +1011,7 @@ phpbb.resizeTextArea = function(items, options) {
resetCallback: function(item) { }
};
- if (isTouch) return;
+ if (phpbb.isTouch) return;
if (arguments.length > 1) {
configuration = $.extend(configuration, options);
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 }
diff --git a/phpBB/docs/hook_system.html b/phpBB/docs/hook_system.html
deleted file mode 100644
index 638b8ac290..0000000000
--- a/phpBB/docs/hook_system.html
+++ /dev/null
@@ -1,883 +0,0 @@
-<!DOCTYPE html>
-<html dir="ltr" lang="en">
-<head>
-<meta charset="utf-8">
-<meta name="keywords" content="" />
-<meta name="description" content="Hook System explanation" />
-<title>phpBB3 &bull; Hook System</title>
-
-<style type="text/css">
-/* <![CDATA[ */
-
-/*
- The original "prosilver" theme for phpBB3
- Created by subBlue design :: http://www.subBlue.com
-*/
-
-* { margin: 0; padding: 0; }
-
-html { font-size: 100%; height: 100%; margin-bottom: 1px; }
-
-body {
- font-family: Verdana, Helvetica, Arial, sans-serif;
- color: #828282;
- background-color: #FFFFFF;
- font-size: 12px;
- margin: 0;
- padding: 12px 0;
-}
-
-img { border-width: 0; }
-
-p {
- line-height: 1.3em;
- font-size: 1.1em;
- margin-bottom: 1.5em;
-}
-
-hr {
- border: 0 none #FFFFFF;
- border-top: 1px solid #CCCCCC;
- height: 1px;
- margin: 5px 0;
- display: block;
- clear: both;
-}
-
-html, body {
- color: #536482;
- background-color: #FFFFFF;
-}
-
-#doc-description h1 {
- font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
- margin-right: 200px;
- color: #FFFFFF;
- margin-top: 15px;
- font-weight: bold;
- font-size: 2em;
- color: #fff;
-}
-
-h1 {
- font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
- font-weight: normal;
- color: #000;
- font-size: 2em;
- margin: 0.8em 0 0.2em 0;
-}
-
-h2 {
- font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
- font-weight: normal;
- color: #28313F;
- font-size: 1.5em;
- margin: 0.8em 0 0.2em 0;
-}
-
-h3 {
- font-family: Arial, Helvetica, sans-serif;
- font-weight: bold;
- border-bottom: 1px solid #CCCCCC;
- margin-bottom: 3px;
- padding-bottom: 2px;
- font-size: 1.05em;
- color: #115098;
- margin-top: 20px;
-}
-
-.good { color: green; }
-.bad { color: red; }
-
-.version {
- margin-top: 20px;
- text-align: left;
- font-size: 70%;
- color: #006600;
- border-top: 1px solid #ccc;
-}
-
-code {
- color: #006600;
- font-weight: normal;
- font-family: 'Courier New', monospace;
- border-color: #D1D7DC;
- border-width: 1px;
- border-style: solid;
- background-color: #FAFAFA;
-}
-
-#wrap {
- padding: 0 20px;
- min-width: 650px;
-}
-
-#simple-wrap {
- padding: 6px 10px;
-}
-
-#page-body {
- margin: 4px 0;
- clear: both;
-}
-
-#page-footer {
- clear: both;
-}
-
-#logo {
- float: left;
- width: auto;
- padding: 10px 13px 0 10px;
-}
-
-a#logo:hover {
- text-decoration: none;
-}
-
-#doc-description {
- float: left;
- width: 70%;
-}
-
-#doc-description h1 {
- margin-right: 0;
-}
-
-.headerbar {
- background: #ebebeb none repeat-x 0 0;
- color: #FFFFFF;
- margin-bottom: 4px;
- padding: 0 5px;
-}
-
-span.corners-top, span.corners-bottom, span.corners-top span, span.corners-bottom span {
- font-size: 1px;
- line-height: 1px;
- display: block;
- height: 5px;
- background-repeat: no-repeat;
-}
-
-span.corners-top {
- background-image: none;
- background-position: 0 0;
- margin: 0 -5px;
-}
-
-span.corners-top span {
- background-image: none;
- background-position: 100% 0;
-}
-
-span.corners-bottom {
- background-image: none;
- background-position: 0 100%;
- margin: 0 -5px;
- clear: both;
-}
-
-span.corners-bottom span {
- background-image: none;
- background-position: 100% 100%;
-}
-
-.paragraph {
- padding: 0 10px;
- margin-bottom: 4px;
- background-repeat: no-repeat;
- background-position: 100% 0;
- background-color: #ECF3F7;
-}
-
-.paragraph:target .content {
- color: #000000;
-}
-
-.paragraph:target h3 a {
- color: #000000;
-}
-
-.content {
- color: #333333;
-}
-
-.content h2, .panel h2 {
- color: #115098;
- border-bottom-color: #CCCCCC;
-}
-
-a:link { color: #898989; text-decoration: none; }
-a:visited { color: #898989; text-decoration: none; }
-a:hover { color: #d3d3d3; text-decoration: underline; }
-a:active { color: #d2d2d2; text-decoration: none; }
-
-hr {
- border-color: #FFFFFF;
- border-top-color: #CCCCCC;
-}
-
-.menu {
- background-color: #cadceb;
-}
-
-.headerbar {
- background-color: #12A3EB;
- background-image: url("bg_header.gif");
- color: #FFFFFF;
-}
-
-.panel {
- background-color: #ECF1F3;
- color: #28313F;
-}
-
-
-span.corners-top {
- background-image: url("corners_left.png");
-}
-
-span.corners-top span {
- background-image: url("corners_right.png");
-}
-
-span.corners-bottom {
- background-image: url("corners_left.png");
-}
-
-span.corners-bottom span {
- background-image: url("corners_right.png");
-}
-
-.error {
- color: #BC2A4D;
-}
-
-a:link { color: #105289; }
-a:visited { color: #105289; }
-a:hover { color: #D31141; }
-a:active { color: #368AD2; }
-
-.paragraph span.corners-top, .paragraph span.corners-bottom {
- margin: 0 -10px;
-}
-
-.content {
- padding: 0;
- line-height: 1.48em;
- color: #333333;
-}
-
-.content h2, .panel h2 {
- color: #115098;
- border-bottom-color: #CCCCCC;
-}
-
-.notice {
- border-top-color: #CCCCCC;
-}
-
-.codebox {
- padding: 3px;
- background-color: #FFFFFF;
- border: 1px solid #C9D2D8;
- font-size: 1em;
- margin-bottom: 10px;
- display: block;
- font: 0.9em Monaco, "Andale Mono","Courier New", Courier, mono;
- line-height: 1.3em;
-}
-
-* html hr { margin: 0; }
-* html span.corners-top, * html span.corners-bottom { background-image: url("corners_left.gif"); }
-* html span.corners-top span, * html span.corners-bottom span { background-image: url("corners_right.gif"); }
-
-.back2top {
- clear: both;
- height: 11px;
- text-align: right;
-}
-
-.content ol {
- margin-left: 25px;
-}
-
-/* ]]> */
-</style>
-
-</head>
-
-<body id="phpbb" class="section-docs">
-
-<div id="wrap">
- <a id="top" name="top" accesskey="t"></a>
- <div id="page-header">
- <div class="headerbar">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div id="doc-description">
- <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a>
- <h1>Hook System</h1>
- <p>This is an explanation of how to use the phpBB3 hook system.</p>
- <p style="display: none;"><a href="#start_here">Skip</a></p>
- </div>
-
- <span class="corners-bottom"><span></span></span></div>
- </div>
- </div>
-
- <a name="start_here"></a>
-
- <div id="page-body">
-
- <h1>Hook System</h1>
-
- <div class="paragraph menu">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div class="content">
-
- <ol>
- <li><a href="#intro">Introduction</a></li>
- <li><a href="#use">Allow hooks in functions/methods</a></li>
- <li><a href="#register">Registering hooks</a></li>
- <li><a href="#return">Result returning</a></li>
- <li><a href="#embed">Embedding your hook files/classes/methods</a></li>
- <li><a href="#disclaimer">Copyright and disclaimer</a></li>
- </ol>
-
- </div>
-
- <span class="corners-bottom"><span></span></span></div>
- </div>
-
- <hr />
-
- <a name="intro"></a><h2>1. Introduction</h2>
-
- <div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div class="content">
-
-<h3>What is it?</h3>
-
-<p>The hook system allows applicaton and mod developers to hook into phpBB's or their own functions.</p>
-
-<h3>Pre-defined hookable phpBB3 functions</h3>
-
-<p>In phpBB3 there are four functions you are able to hook into with your custom functions:</p>
-
-<p><code>phpbb_user_session_handler();</code> which is called within phpbb_user::setup after the session and the user object is correctly initialized.<br />
-<code>append_sid($url, $params = false, $is_amp = true, $session_id = false);</code> which is called for building urls (appending the session id)<br />
-<code>$template-&gt;display($handle, $template);</code> which is called directly before outputting the (not-yet-compiled) template.<br />
-<code>exit_handler();</code> which is called at the very end of phpBB3's execution.</p>
-
-<p>Please note: The <code>$template-&gt;display</code> hook takes a <code>$template</code> argument, which is the template instance being used, which should be used instead of the global.</p>
-
-<p>There are also valid external constants you may want to use if you embed phpBB3 into your application:</p>
-
-<div class="codebox"><pre>
-PHPBB_MSG_HANDLER (overwrite message handler)
-PHPBB_DB_NEW_LINK (overwrite new_link parameter for sql_connect)
-PHPBB_ROOT_PATH (overwrite $phpbb_root_path)
-PHPBB_ADMIN_PATH (overwrite $phpbb_admin_path)
-PHPBB_USE_BOARD_URL_PATH (use generate_board_url() for image paths instead of $phpbb_root_path)
-</pre></div>
-
-<p>If the <code>PHPBB_USE_BOARD_URL_PATH</code> constant is set to true, phpBB uses generate_board_url() (this will return the boards url with the script path included) on all instances where web-accessible images are loaded. The exact locations are:</p>
-
-<ul>
- <li>/includes/user.php - phpbb_user::img()</li>
- <li>/includes/functions_content.php - smiley_text()</li>
-</ul>
-
-<p>Path locations for the following template variables are affected by this too:</p>
-
-<ul>
- <li>{T_ASSETS_PATH} - assets</li>
- <li>{T_THEME_PATH} - styles/xxx/theme</li>
- <li>{T_TEMPLATE_PATH} - styles/xxx/template</li>
- <li>{T_SUPER_TEMPLATE_PATH} - styles/xxx/template</li>
- <li>{T_IMAGESET_PATH} - styles/xxx/imageset</li>
- <li>{T_IMAGESET_LANG_PATH} - styles/xxx/imageset/yy</li>
- <li>{T_IMAGES_PATH} - images/</li>
- <li>{T_SMILIES_PATH} - $config['smilies_path']/</li>
- <li>{T_AVATAR_PATH} - $config['avatar_path']/</li>
- <li>{T_AVATAR_GALLERY_PATH} - $config['avatar_gallery_path']/</li>
- <li>{T_ICONS_PATH} - $config['icons_path']/</li>
- <li>{T_RANKS_PATH} - $config['ranks_path']/</li>
- <li>{T_UPLOAD_PATH} - $config['upload_path']/</li>
- <li>{T_STYLESHEET_LINK} - styles/xxx/theme/stylesheet.css (or link to style.php if css is parsed dynamically)</li>
- <li>New template variable {BOARD_URL} for the board url + script path.</li>
-</ul>
-
-
- </div>
-
- <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
-
- <span class="corners-bottom"><span></span></span></div>
- </div>
-
- <a name="use"></a><h2>2. Allow hooks in functions/methods</h2>
-
- <div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div class="content">
-
-<p>The following examples explain how phpBB3 utilize the in-build hook system. You will be more interested in registering your hooks, but showing you this may help you understand the system better along the way.</p>
-
-<p>First of all, this is how a function need to be layed out if you want to allow it to be hookable...</p>
-
-<div class="codebox"><pre>
-function my_own_function($my_first_parameter, $my_second_parameter)
-{
- global $phpbb_hook;
-
- if ($phpbb_hook-&gt;call_hook(__FUNCTION__, $my_first_parameter, $my_second_parameter))
- {
- if ($phpbb_hook-&gt;hook_return(__FUNCTION__))
- {
- return $phpbb_hook-&gt;hook_return_result(__FUNCTION__);
- }
- }
-
- [YOUR CODE HERE]
-}
-</pre></div>
-
-<p>Above, the call_hook function should always be mapping your function call... in regard to the number of parameters passed.</p>
-
-<p>This is how you could make a method being hookable...</p>
-
-<div class="codebox"><pre>
-class my_hookable_object
-{
- function hook_me($my_first_parameter, $my_second_parameter)
- {
- global $phpbb_hook;
-
- if ($phpbb_hook-&gt;call_hook(array(__CLASS__, __FUNCTION__), $my_first_parameter, $my_second_parameter))
- {
- if ($phpbb_hook-&gt;hook_return(array(__CLASS__, __FUNCTION__)))
- {
- return $phpbb_hook-&gt;hook_return_result(array(__CLASS__, __FUNCTION__));
- }
- }
-
- [YOUR CODE HERE]
- }
-}
-</pre></div>
-
-<p>The only difference about calling it is the way you define the first parameter. For a function it is only <code>__FUNCTION__</code>, for a method it is <code>array(__CLASS__, __FUNCTION__)</code>. In PHP4 __CLASS__ is always returning the class in lowercase.</p>
-
-<p>Now, in phpBB there are some pre-defined hooks available, but how do you make your own hookable function available (and therefore allowing others to hook into it)? For this, there is the add_hook() method:</p>
-
-<div class="codebox"><pre>
-// Adding your own hookable function:
-$phpbb_hook-&gt;add_hook('my_own_function');
-
-// Adding your own hookable method:
-$phpbb_hook-&gt;add_hook(array('my_hookable_object', 'hook_me'));
-</pre></div>
-
-<p>You are also able to remove the possibility of hooking a function/method by calling <code>$phpbb_hook-&gt;remove_hook()</code> with the same parameters as add_hook().<br />
-This comes in handy if you want to force some hooks not to be called - at all.</p>
-
- </div>
-
- <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
-
- <span class="corners-bottom"><span></span></span></div>
- </div>
-
- <a name="register"></a><h2>3. Registering hooks</h2>
-
- <div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div class="content">
-
- <h3>Registering hooks</h3>
-
-<p>Now to actually defining your functions which should be called. For this we take the append_sid() function as an example (this function is able to be hooked by default). We create two classes, one being static and a function:</p>
-
-<div class="codebox"><pre>
-class my_append_sid_class
-{
- // Our functions
- function my_append_sid(&amp;$hook, $url, $params = false, $is_amp = true, $session_id = false)
- {
- // Get possible previous results
- $result = $hook-&gt;previous_hook_result('append_sid');
-
- return $result['result'] . '&lt;br /&gt;And i was the second one.';
- }
-}
-
-// Yet another class :o
-class my_second_append_sid_class
-{
- function my_append_sid(&amp;$hook, $url, $params = false, $is_amp = true, $session_id = false)
- {
- // Get possible previous results
- $result = $hook-&gt;previous_hook_result('append_sid');
-
- echo $result['result'] . '&lt;br /&gt;I was called as the third one.';
- }
-}
-
-// And a normal function
-function my_append_sid(&amp;$hook, $url, $params = false, $is_amp = true, $session_id = false)
-{
- // Get possible previous results
- $result = $hook-&gt;previous_hook_result('append_sid');
-
- return 'I was called as the first one';
-}
-
-// Initializing the second class
-$my_second_append_sid_class = new my_second_append_sid_class();
-</pre></div>
-
-<p>Make sure you add the same parameters to your function as is defined for the hookable function with one exception: The first variable is always <code>&amp;$hook</code>... this is the hook object itself you are able to operate on.</p>
-
-<p>Now we register the hooks one by one with the <code>$phpbb_hook-&gt;register()</code> method:</p>
-
-<div class="codebox"><pre>
-// Now, we register our append_sid &quot;replacements&quot; in a stacked way...
-// Registering the function (this is called first)
-$phpbb_hook-&gt;register('append_sid', 'my_append_sid');
-
-// Registering the first class
-$phpbb_hook-&gt;register('append_sid', array('my_append_sid_class', 'my_append_sid'));
-$phpbb_hook-&gt;register('append_sid', array(&amp;$my_second_append_sid_class, 'my_append_sid'));
-</pre></div>
-
-<p>With this you are even able to make your own functions that are already hooked itself being hooked again...</p>
-
-<div class="codebox"><pre>
-// Registering hook, which will be called
-$phpbb_hook-&gt;register('append_sid', 'my_own_append_sid');
-
-// Add hook to our called hook function
-$phpbb_hook-&gt;add_hook('my_own_append_sid');
-
-// Register added hook
-$phpbb_hook-&gt;register('my_own_append_sid', 'also_my_own_append_sid');
-</pre></div>
-
- <h3>Special treatment/chains</h3>
-
- <p>The <code>register</code> method is able to take a third argument to specify a special 'chain' mode. The valid modes are <code>first</code>, <code>last</code> and <code>standalone</code></p>
-
- <p><code>$phpbb_hook-&gt;register('append_sid', 'my_own_append_sid', 'first')</code> would make sure that the function is called in the beginning of the chain. It is possible that more than one function is called within the first block - here the FIFO principle is used.</p>
-
- <p><code>$phpbb_hook-&gt;register('append_sid', 'my_own_append_sid', 'last')</code> would make sure that the function is called at the very end of the chain. It is possible that more than one function is called within the last block - here the FIFO principle is used.</p>
-
- <p><code>$phpbb_hook-&gt;register('append_sid', 'my_own_append_sid', 'standalone')</code> makes sure only the defined function is called. All other functions are removed from the chain and no other functions are added to it later on. If two applications try to trigger the standalone mode a PHP notice will be printed and the second function being discarded.</p>
-
- <h3>Only allowing hooks for some objects</h3>
-
- <p>Because the hook system is not able to differate between initialized objects and only operate on the class, you need to solve this on the code level.</p>
-
- <p>One possibility would be to use a property:</p>
-
- <div class="codebox"><pre>
-class my_hookable_object
-{
- function blabla()
- {
- }
-}
-
-class my_hookable_object2 extends my_hookable_object
-{
- var $call_hook = true;
-
- function hook_me($my_first_parameter, $my_second_parameter)
- {
- if ($this-&gt;call_hook)
- {
- global $phpbb_hook;
-
- if ($phpbb_hook-&gt;call_hook(array(__CLASS__, __FUNCTION__), $my_first_parameter, $my_second_parameter))
- {
- if ($phpbb_hook-&gt;hook_return(array(__CLASS__, __FUNCTION__)))
- {
- return $phpbb_hook-&gt;hook_return_result(array(__CLASS__, __FUNCTION__));
- }
- }
- }
-
- return 'not hooked';
- }
-}
-
-function hooking(&amp;$hook, $first, $second)
-{
- return 'hooked';
-}
-
-$first_object = new my_hookable_object2();
-$second_object = new my_hookable_object2();
-
-$phpbb_hook-&gt;add_hook(array('my_hookable_object2', 'hook_me'));
-
-$phpbb_hook-&gt;register(array('my_hookable_object2', 'hook_me'), 'hooking');
-
-// Do not call the hook for $first_object
-$first_object-&gt;call_hook = false;
-
-echo $first_object-&gt;hook_me('first', 'second') . '&lt;br /&gt;';
-echo $second_object-&gt;hook_me('first', 'second') . '&lt;br /&gt;';
-</pre></div>
-
-<p>OUTPUT:</p>
-
-<div class="codebox"><pre>
-not hooked
-hooked
-</pre></div>
-
- <p>A different possibility would be using a function variable (which could be left out on passing the function variables to the hook):</p>
-
- <div class="codebox"><pre>
-class my_hookable_object
-{
- function blabla()
- {
- }
-}
-
-class my_hookable_object2 extends my_hookable_object
-{
- function hook_me($my_first_parameter, $my_second_parameter, $hook_me = true)
- {
- if ($hook_me)
- {
- global $phpbb_hook;
-
- if ($phpbb_hook-&gt;call_hook(array(__CLASS__, __FUNCTION__), $my_first_parameter, $my_second_parameter))
- {
- if ($phpbb_hook-&gt;hook_return(array(__CLASS__, __FUNCTION__)))
- {
- return $phpbb_hook-&gt;hook_return_result(array(__CLASS__, __FUNCTION__));
- }
- }
- }
-
- return 'not hooked';
- }
-}
-
-function hooking(&amp;$hook, $first, $second)
-{
- return 'hooked';
-}
-
-$first_object = new my_hookable_object2();
-$second_object = new my_hookable_object2();
-
-$phpbb_hook-&gt;add_hook(array('my_hookable_object2', 'hook_me'));
-
-$phpbb_hook-&gt;register(array('my_hookable_object2', 'hook_me'), 'hooking');
-
-echo $first_object-&gt;hook_me('first', 'second', false) . '&lt;br /&gt;';
-echo $second_object-&gt;hook_me('first', 'second') . '&lt;br /&gt;';
- </pre></div>
-
- <p>OUTPUT:</p>
-
- <div class="codebox"><pre>
-not hooked
-hooked
- </pre></div>
-
- </div>
-
- <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
-
- <span class="corners-bottom"><span></span></span></div>
- </div>
-
- <a name="return"></a><h2>4. Result returning</h2>
-
- <div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div class="content">
-
-<p>Generally, the distinction has to be made if a function returns the result obtained from the called function or continue the execution. Based on the needs of the application this may differ. Therefore, the function returns the results only if the called hook function is returning a result.</p>
-
-<h3>Case 1 - Returning the result</h3>
-
-<p>Imagine the following function supporting hooks:</p>
-
-<div class="codebox"><pre>
-function append_sid($url, $params = false, $is_amp = true, $session_id = false)
-{
- global $_SID, $_EXTRA_URL, $phpbb_hook;
-
- // Developers using the hook function need to globalise the $_SID and $_EXTRA_URL on their own and also handle it appropiatly.
- // They could mimick most of what is within this function
- if ($phpbb_hook-&gt;call_hook(__FUNCTION__, $url, $params, $is_amp, $session_id))
- {
- if ($phpbb_hook-&gt;hook_return(__FUNCTION__))
- {
- return $phpbb_hook-&gt;hook_return_result(__FUNCTION__);
- }
- }
-
- [...]
-}
-</pre></div>
-
-<p>Now, the following function is yours. Since you return a value, the append_sid() function itself is returning it as is:</p>
-
-<div class="codebox"><pre>
-// The function called
-function my_append_sid(&amp;$hook, $url, $params = false, $is_amp = true, $session_id = false)
-{
- // Get possible previous results
- $result = $hook-&gt;previous_hook_result('append_sid');
-
- return 'Since i return something the append_sid() function will return my result.';
-}
-</pre></div>
-
-<p>To be able to get the results returned from functions higher in the change the <code>previous_hook_result()</code> method should always be used, it returns an <code>array('result' => [your result])</code> construct.</p>
-
-<h3>Case 2 - Not Returning any result</h3>
-
-<p>Sometimes applications want to return nothing and therefore force the underlying function to continue it's execution:</p>
-
-<div class="codebox"><pre>
-function append_sid($url, $params = false, $is_amp = true, $session_id = false)
-{
- global $_SID, $_EXTRA_URL, $phpbb_hook;
-
- // Developers using the hook function need to globalise the $_SID and $_EXTRA_URL on their own and also handle it appropiatly.
- // They could mimick most of what is within this function
- if ($phpbb_hook-&gt;call_hook(__FUNCTION__, $url, $params, $is_amp, $session_id))
- {
- if ($phpbb_hook-&gt;hook_return(__FUNCTION__))
- {
- return $phpbb_hook-&gt;hook_return_result(__FUNCTION__);
- }
- }
-
- [...]
-}
-
-// The function called
-function my_append_sid(&amp;$hook, $url, $params = false, $is_amp = true, $session_id = false)
-{
- // Get possible previous results
- $result = $hook-&gt;previous_hook_result('append_sid');
-
- [...]
-
- // I only rewrite some variables, but return nothing. Therefore, the append_sid() function will not return my (non)result.
-}
-</pre></div>
-
-<p>Please Note: The decision to return or not return is solely made of the very last function call within the hook chain. An example:</p>
-
-<div class="codebox"><pre>
-// The function called
-function my_append_sid(&amp;$hook, $url, $params = false, $is_amp = true, $session_id = false)
-{
- // Get possible previous results
- $result = $hook-&gt;previous_hook_result('append_sid');
-
- // $result is not filled
-
- return 'FILLED';
-}
-
-// This function is registered too and gets executed after my_append_sid()
-function my_own_append_sid(&amp;$hook, $url, $params = false, $is_amp = true, $session_id = false)
-{
- $result = $hook->previous_hook_result('append_sid');
-
- // $result is actually filled with $result['result'] = 'FILLED'
- // But i return nothing, therefore append_sid() continues it's execution.
-}
-
-// The way both functions are registered.
-$phpbb_hook->register('append_sid', 'my_append_sid');
-$phpbb_hook->register('append_sid', 'my_own_append_sid');
-</pre></div>
-
- </div>
-
- <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
-
- <span class="corners-bottom"><span></span></span></div>
- </div>
-
- <a name="embed"></a><h2>5. Embedding your hook files/classes/methods</h2>
-
- <div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div class="content">
-
-<p>There are basically two methods you are able to choose from:</p>
-
-<p>1) Add a file to includes/hooks/. The file need to be prefixed by <code>hook_</code>. This file is included within common.php, you are able to register your hooks, include other files or functions, etc. It is advised to only include other files if needed (within a function call for example).</p>
-
-<p>Please be aware that you need to purge your cache within the ACP to make your newly placed file available to phpBB3.</p>
-
-<p>2) The second method is meant for those wanting to wrap phpBB3 without placing a custom file to the hooks directory. This is mostly done by including phpBB's files within the application file. To be able to register your hooks you need to create a function within your application:</p>
-
-<div class="codebox"><pre>
-// My function which gets executed within the hooks constuctor
-function phpbb_hook_register(&amp;$hook)
-{
- $hook-&gt;register('append_sid', 'my_append_sid');
-}
-
-[...]
-</pre></div>
-
-<p>You should get the idea. ;)</p>
-
- </div>
-
- <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
-
- <span class="corners-bottom"><span></span></span></div>
- </div>
-
- <a name="disclaimer"></a><h2>6. Copyright and disclaimer</h2>
-
- <div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div class="content">
-
- <p>phpBB is free software, released under the terms of the <a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License, version 2 (GPL-2.0)</a>. Copyright © <a href="https://www.phpbb.com">phpBB Limited</a>. For full copyright and license information, please see the docs/CREDITS.txt file.</p>
-
- </div>
-
- <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
-
- <span class="corners-bottom"><span></span></span></div>
- </div>
-
- <div id="page-footer">
- <div class="version">&nbsp;</div>
- </div>
-</div></div>
-
-<div>
- <a id="bottom" name="bottom" accesskey="z"></a>
-</div>
-
-</body>
-</html>
diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php
index 2f8e781e3b..60e338ae7c 100644
--- a/phpBB/includes/acp/acp_language.php
+++ b/phpBB/includes/acp/acp_language.php
@@ -31,22 +31,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;
@@ -56,11 +47,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);
@@ -69,113 +55,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 . "&amp;id=$lang_id&amp;action=upload_data",
- 'U_BACK' => $this->u_action . "&amp;id=$lang_id&amp;action=details&amp;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))
@@ -210,259 +95,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 . '&amp;action=details&amp;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 . '&amp;action=details&amp;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 . '&amp;action=details&amp;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 . '&amp;action=details&amp;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 . '&amp;id=' . $lang_id . '&amp;action=details&amp;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 . '&amp;action=details&amp;id=' . $lang_id . '&amp;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 . '&amp;action=details&amp;id=' . $lang_id . '&amp;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 . '&amp;action=details&amp;id=' . $lang_id . '&amp;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)
@@ -479,308 +111,82 @@ 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 . '&amp;action=details&amp;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 . '&amp;action=details&amp;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 . '&amp;action=details&amp;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 . '&amp;action=details&amp;id=' . $lang_id), E_USER_WARNING);
- }
- }
-
- if (isset($_POST['remove_store']))
+ if (!$lang_entries)
{
- $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);
- }
+ trigger_error($user->lang['LANGUAGE_PACK_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx);
-
- $methods = transfer::methods();
-
- foreach ($methods as $method)
- {
- $template->assign_block_vars('buttons', array(
- 'VALUE' => $method
- ));
- }
+ $lang_iso = $lang_entries['lang_iso'];
$template->assign_vars(array(
'S_DETAILS' => true,
'U_ACTION' => $this->u_action . "&amp;action=details&amp;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_ISO' => $lang_iso,
'LANG_AUTHOR' => $lang_entries['lang_author'],
- 'ALLOW_UPLOAD' => sizeof($methods)
- )
- );
+ '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 first try to grab missing/additional vars
+ // If current lang is different from the default lang, then highlight missing files and variables
if ($lang_iso != $config['default_lang'])
{
- $is_missing_var = false;
-
- foreach ($this->main_files as $file)
+ try
{
- 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);
- }
+ $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
+ );
}
-
- // Now go through acp/mods directories
- foreach ($acp_files as $file)
+ catch (\Exception $e)
{
- 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);
- }
+ return array();
}
- if (sizeof($mods_files))
+ foreach ($iterator as $file_info)
{
- foreach ($mods_files as $file)
+ /** @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 (file_exists($phpbb_root_path . $this->get_filename($lang_iso, 'mods', $file)))
+ if (substr($relative_path, 0 - strlen($phpEx)) === $phpEx)
{
- $missing_vars['mods/' . $file] = $this->compare_language_files($config['default_lang'], $lang_iso, 'mods', $file);
+ $missing_vars = $this->compare_language_files($config['default_lang'], $lang_iso, $relative_path);
- if (sizeof($missing_vars['mods/' . $file]))
+ if (!empty($missing_vars))
{
- $is_missing_var = true;
+ $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
- {
- $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('<br />', $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 . "&amp;action=$action&amp;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 = '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang['LANGUAGE_FILES'] . '</option>';
- 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 .= '<option value="|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
- }
-
- // Help Files
- $s_lang_options .= '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang['HELP_FILES'] . '</option>';
- 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 .= '<option value="|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
- }
-
- // Now every other language directory
- $check_files = array('email', 'acp', 'mods');
-
- foreach ($check_files as $check)
- {
- if (!sizeof(${$check . '_files'}))
- {
- continue;
- }
-
- $s_lang_options .= '<option value="|common.' . $phpEx . '" class="sep">' . $user->lang[strtoupper($check) . '_FILES'] . '</option>';
-
- 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 .= '<option value="' . $check . '|' . $file . '"' . $selected . '>' . $prefix . $file . '</option>';
- }
- }
-
- // 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)
+ else
{
- $lang = $help;
- unset($help);
+ $template->assign_block_vars('missing_files', array(
+ 'FILE_NAME' => $relative_path,
+ ));
}
}
-
- $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 . "&amp;action=details&amp;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':
@@ -830,7 +236,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;
@@ -930,127 +336,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 .= '<label><input type="radio"' . ((!$radio_buttons) ? ' id="use_method"' : '') . ' class="radio" value="' . $method . '" name="use_method" /> ' . $method . '</label>';
- }
-
- $template->assign_vars(array(
- 'S_SELECT_METHOD' => true,
- 'U_BACK' => $this->u_action,
- 'U_ACTION' => $this->u_action . "&amp;action=$action&amp;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
@@ -1143,291 +428,31 @@ class acp_language
unset($new_ary);
}
-
/**
- * Set default language variables/header
- */
- function default_variables()
- {
- global $phpEx;
-
- $this->language_file_header = '<?php
-/**
-*
-* {FILENAME} [{LANG_NAME}]
-*
-* @package language
-* @copyright (c) ' . date('Y') . ' phpBB Group
-* @author {CHANGED} - {AUTHOR}
-* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
-*
-*/
-
-/**
-* DO NOT CHANGE
-*/
-if (!defined(\'IN_PHPBB\'))
-{
- exit;
-}
-
-if (empty($lang) || !is_array($lang))
-{
- $lang = array();
-}
-
-// DEVELOPERS PLEASE NOTE
-//
-// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
-//
-// Placeholders can now contain order information, e.g. instead of
-// \'Page %s of %s\' you can (and should) write \'Page %1$s of %2$s\', this allows
-// translators to re-order the output of data while ensuring it remains correct
-//
-// You do not need this where single placeholders are used, e.g. \'Message %d\' is fine
-// equally where a string contains only two placeholders which are used to wrap text
-// in a url you again do not need to specify an order e.g., \'Click %sHERE%s\' is fine
-';
-
- $this->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
+ * Compare two language files
*/
- function add_to_archive(&$compress, $filelist, $lang_iso, $directory = '')
+ function compare_language_files($source_lang, $dest_lang, $file)
{
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);
- }
- }
+ $source_file = $phpbb_root_path . 'language/' . $source_lang . '/' . $file;
+ $dest_file = $phpbb_root_path . 'language/' . $dest_lang . '/' . $file;
- /**
- * 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)
+ if (!file_exists($dest_file))
{
- return '<strong>' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '</strong>';
- }
-
- // If more then 270 characters, then we present a textarea, else an input field
- $textarea = (utf8_strlen($value) > 270) ? true : false;
- $tpl = '';
-
- $tpl .= ($textarea) ? '<textarea name="' : '<input type="text" name="';
- $tpl .= 'entry[' . implode('][', array_map('utf8_htmlspecialchars', $keys)) . ']"';
-
- $tpl .= ($textarea) ? ' cols="80" rows="5" class="langvalue">' : ' class="langvalue" value="';
- $tpl .= htmlspecialchars($value, ENT_COMPAT, 'UTF-8');
- $tpl .= ($textarea) ? '</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 .= '
- <tr>
- <td class="row3" colspan="2">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<strong>' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '</strong></td>
- </tr>';
-
- foreach ($value as $_key => $_value)
- {
- if (is_array($_value))
- {
- // Write key
- $tpl .= '
- <tr>
- <td class="row3" colspan="2">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '&nbsp; &nbsp;<strong>' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '</strong></td>
- </tr>';
-
- foreach ($_value as $__key => $__value)
- {
- // Write key
- $tpl .= '
- <tr>
- <td class="row1" style="white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<strong>' . htmlspecialchars($__key, ENT_COMPAT, 'UTF-8') . '</strong></td>
- <td class="row2">';
-
- $tpl .= $this->add_input_field($input_field, $__value, $key, $_key, $__key);
-
- $tpl .= '</td>
- </tr>';
- }
- }
- else
- {
- // Write key
- $tpl .= '
- <tr>
- <td class="row1" style="white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<strong>' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '</strong></td>
- <td class="row2">';
-
- $tpl .= $this->add_input_field($input_field, $_value, $key, $_key);
-
- $tpl .= '</td>
- </tr>';
- }
- }
-
- $tpl .= '
- <tr>
- <td class="spacer" colspan="2">&nbsp;</td>
- </tr>';
- }
- else
- {
- // Write key
- $tpl .= '
- <tr>
- <td class="row1" style="white-space: nowrap;">' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '<strong>' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '</strong></td>
- <td class="row2">';
-
- $tpl .= $this->add_input_field($input_field, $value, $key);
-
- $tpl .= '</td>
- </tr>';
- }
+ return array();
}
- 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);
+ include($source_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));
-
+ include($dest_file);
$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;
+ 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 20ad8c3ac0..f46e78efd4 100644
--- a/phpBB/language/en/acp/language.php
+++ b/phpBB/language/en/acp/language.php
@@ -40,26 +40,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 (*).',
- 'EMAIL_FILES' => 'Email templates',
+ 'DELETE_LANGUAGE_CONFIRM' => 'Are you sure you wish to delete “%s”?',
- '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.',
+ 'INSTALLED_LANGUAGE_PACKS' => 'Installed language packs',
'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.<br /><strong>Note:</strong> 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 <strong>%s</strong> 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 <strong>%s</strong> 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',
@@ -72,31 +61,16 @@ $lang = array_merge($lang, array(
'LANG_ISO_CODE' => 'ISO code',
'LANG_LOCAL_NAME' => 'Local name',
- 'MISSING_LANGUAGE_FILE' => 'Missing language file: <strong style="color:red">%s</strong>',
+ '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.<br />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.<br />If you want to remove this language pack, change your board’s 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 <strong>%s</strong> 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.',
));
diff --git a/phpBB/phpbb/db/driver/mysql.php b/phpBB/phpbb/db/driver/mysql.php
index 9b6d9962c9..569bd4f10a 100644
--- a/phpBB/phpbb/db/driver/mysql.php
+++ b/phpBB/phpbb/db/driver/mysql.php
@@ -210,7 +210,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;
}
/**
diff --git a/phpBB/phpbb/db/driver/mysqli.php b/phpBB/phpbb/db/driver/mysqli.php
index da6dcbc776..58361ff0f8 100644
--- a/phpBB/phpbb/db/driver/mysqli.php
+++ b/phpBB/phpbb/db/driver/mysqli.php
@@ -60,7 +60,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();
+ @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 != '')
{
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js
index 1594d73517..a4ede51f4b 100644
--- a/phpBB/styles/prosilver/template/forum_fn.js
+++ b/phpBB/styles/prosilver/template/forum_fn.js
@@ -681,7 +681,7 @@ function parse_document(container)
/**
* Responsive link lists
*/
- container.find('.linklist:not(.navlinks, [data-skip-responsive]), .postbody ul.profile-icons:not([data-skip-responsive])').each(function() {
+ container.find('.linklist:not(.navlinks, [data-skip-responsive]), .postbody .post-buttons:not([data-skip-responsive])').each(function() {
var $this = $(this),
$body = $('body'),
filterSkip = '.breadcrumbs, [data-skip-responsive]',
@@ -769,6 +769,11 @@ function parse_document(container)
menu.prepend(clone.not('.rightside'));
menu.find('li.leftside, li.rightside').removeClass('leftside rightside');
menu.find('.inputbox').parents('li:first').css('white-space', 'normal');
+
+ if ($this.hasClass('post-buttons')) {
+ $('.button', menu).removeClass('button icon-button');
+ $('.responsive-menu-link', item).addClass('button icon-button').prepend('<span></span>');
+ }
copied = true;
}
else {
@@ -914,6 +919,8 @@ function parse_document(container)
$(document).ready(function() {
// Swap .nojs and .hasjs
$('#phpbb.nojs').toggleClass('nojs hasjs');
+ $('#phpbb').toggleClass('hastouch', phpbb.isTouch);
+ $('#phpbb.hastouch').removeClass('notouch');
// Focus forms
$('form[data-focus]:first').each(function() {
diff --git a/phpBB/styles/prosilver/template/mcp_post.html b/phpBB/styles/prosilver/template/mcp_post.html
index 2b4ebec5c8..10ec6f3ea9 100644
--- a/phpBB/styles/prosilver/template/mcp_post.html
+++ b/phpBB/styles/prosilver/template/mcp_post.html
@@ -50,13 +50,20 @@
<div class="postbody">
<h3><a href="{U_VIEW_POST}">{POST_SUBJECT}</a></h3>
- <!-- IF U_EDIT -->
- <ul class="profile-icons">
- <li class="edit-icon"><a href="{U_EDIT}" title="{L_EDIT_POST}"><span>{L_EDIT_POST}</span></a></li>
+ <ul class="post-buttons">
+ <li id="expand">
+ <a href="#post_details" onclick="viewableArea(getElementById('post_details'), true); var rev_text = getElementById('expand').getElementsByTagName('a').item(0).firstChild; if (rev_text.data.trim() == '{LA_EXPAND_VIEW}'){rev_text.data = '{LA_COLLAPSE_VIEW}'; } else if (rev_text.data.trim() == '{LA_COLLAPSE_VIEW}'){rev_text.data = '{LA_EXPAND_VIEW}';} return false;">
+ {L_EXPAND_VIEW}
+ </a>
+ </li>
+ <!-- IF U_EDIT -->
+ <li>
+ <a href="{U_EDIT}" title="{L_EDIT_POST}" class="button icon-button edit-icon">
+ <span>{L_EDIT_POST}</span>
+ </a>
+ </li>
+ <!-- ENDIF -->
</ul>
- <!-- ENDIF -->
-
- <span class="right-box" id="expand"><a href="#post_details" onclick="viewableArea(getElementById('post_details'), true); var rev_text = getElementById('expand').getElementsByTagName('a').item(0).firstChild; if (rev_text.data == '{LA_EXPAND_VIEW}'){rev_text.data = '{LA_COLLAPSE_VIEW}'; } else if (rev_text.data == '{LA_COLLAPSE_VIEW}'){rev_text.data = '{LA_EXPAND_VIEW}'}; return false;">{L_EXPAND_VIEW}</a></span>
<!-- IF S_PM -->
<p class="author">
diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html
index bfe18579a6..19ee123eba 100644
--- a/phpBB/styles/prosilver/template/mcp_topic.html
+++ b/phpBB/styles/prosilver/template/mcp_topic.html
@@ -96,7 +96,18 @@
<div class="inner">
<div class="postbody" id="pr{postrow.POST_ID}">
- <ul class="profile-icons"><li class="info-icon"><a href="{postrow.U_POST_DETAILS}" title="{L_POST_DETAILS}"><span>{L_POST_DETAILS}</span></a></li><li><label for="post_id_list_select_{postrow.POST_ID}">{L_SELECT}{L_COLON} <input type="checkbox" id="post_id_list_select_{postrow.POST_ID}" name="post_id_list[]" value="{postrow.POST_ID}"<!-- IF postrow.S_CHECKED --> checked="checked"<!-- ENDIF --> /></label></li></ul>
+ <ul class="post-buttons">
+ <li>
+ <a href="{postrow.U_POST_DETAILS}" title="{L_POST_DETAILS}" class="button icon-button info-icon">
+ <span>{L_POST_DETAILS}</span>
+ </a>
+ </li>
+ <li>
+ <label for="post_id_list_select_{postrow.POST_ID}">{L_SELECT}{L_COLON}
+ <input type="checkbox" id="post_id_list_select_{postrow.POST_ID}" name="post_id_list[]" value="{postrow.POST_ID}"<!-- IF postrow.S_CHECKED --> checked="checked"<!-- ENDIF --> />
+ </label>
+ </li>
+ </ul>
<h3><a href="{postrow.U_POST_DETAILS}">{postrow.POST_SUBJECT}</a></h3>
<p class="author"><a href="#pr{postrow.POST_ID}">{postrow.MINI_POST_IMG}</a> {L_POSTED} {postrow.POST_DATE} {L_POST_BY_AUTHOR} <strong>{postrow.POST_AUTHOR_FULL}</strong><!-- IF postrow.U_MCP_DETAILS --> [ <a href="{postrow.U_MCP_DETAILS}">{L_POST_DETAILS}</a> ]<!-- ENDIF --></p>
diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html
index 8c63ce9cea..d18fff6bb0 100644
--- a/phpBB/styles/prosilver/template/overall_header.html
+++ b/phpBB/styles/prosilver/template/overall_header.html
@@ -52,7 +52,7 @@
{$STYLESHEETS}
</head>
-<body id="phpbb" class="nojs section-{SCRIPT_NAME} {S_CONTENT_DIRECTION} {BODY_CLASS}">
+<body id="phpbb" class="nojs notouch section-{SCRIPT_NAME} {S_CONTENT_DIRECTION} {BODY_CLASS}">
<!-- EVENT overall_header_body_before -->
diff --git a/phpBB/styles/prosilver/template/posting_topic_review.html b/phpBB/styles/prosilver/template/posting_topic_review.html
index d2faed5f8f..6909877196 100644
--- a/phpBB/styles/prosilver/template/posting_topic_review.html
+++ b/phpBB/styles/prosilver/template/posting_topic_review.html
@@ -24,14 +24,25 @@
<div class="postbody" id="pr{topic_review_row.POST_ID}">
<h3><a href="#pr{topic_review_row.POST_ID}">{topic_review_row.POST_SUBJECT}</a></h3>
+ <!-- IF (topic_review_row.POSTER_QUOTE and topic_review_row.DECODED_MESSAGE) or topic_review_row.U_MCP_DETAILS -->
+ <ul class="post-buttons">
+ <!-- IF topic_review_row.U_MCP_DETAILS -->
+ <li>
+ <a href="{topic_review_row.U_MCP_DETAILS}" title="{L_POST_DETAILS}" class="button icon-button info-icon">
+ <span>{L_POST_DETAILS}</span>
+ </a>
+ <li>
+ <!-- ENDIF -->
<!-- IF topic_review_row.POSTER_QUOTE and topic_review_row.DECODED_MESSAGE -->
- <ul class="profile-icons">
- <li class="quote-icon"><a href="#postingbox" onclick="addquote({topic_review_row.POST_ID}, '{topic_review_row.POSTER_QUOTE}', '{LA_WROTE}');" title="{L_QUOTE} {topic_review_row.POST_AUTHOR}"><span>{L_QUOTE} {topic_review_row.POST_AUTHOR}</span></a></li>
+ <li>
+ <a href="#postingbox" onclick="addquote({topic_review_row.POST_ID}, '{topic_review_row.POSTER_QUOTE}', '{LA_WROTE}');" title="{L_QUOTE} {topic_review_row.POST_AUTHOR}" class="button icon-button quote-icon">
+ <span>{L_QUOTE} {topic_review_row.POST_AUTHOR}</span>
+ </a>
+ </li>
+ <!-- ENDIF -->
</ul>
<!-- ENDIF -->
- <!-- IF topic_review_row.U_MCP_DETAILS --><div class="right-box"><a href="{topic_review_row.U_MCP_DETAILS}">{L_POST_DETAILS}</a></div><!-- ENDIF -->
-
<p class="author"><!-- IF S_IS_BOT -->{topic_review_row.MINI_POST_IMG}<!-- ELSE --><a href="{topic_review_row.U_MINI_POST}">{topic_review_row.MINI_POST_IMG}</a><!-- ENDIF --> {L_POST_BY_AUTHOR} <strong>{topic_review_row.POST_AUTHOR_FULL}</strong> &raquo; {topic_review_row.POST_DATE} </p>
<div class="content">{topic_review_row.MESSAGE}</div>
diff --git a/phpBB/styles/prosilver/template/ucp_pm_history.html b/phpBB/styles/prosilver/template/ucp_pm_history.html
index d08f622d1f..0e9c3844cc 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_history.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_history.html
@@ -18,8 +18,12 @@
<h3><a href="{history_row.U_VIEW_MESSAGE}" <!-- IF history_row.S_CURRENT_MSG -->class="current"<!-- ENDIF -->>{history_row.SUBJECT}</a></h3>
<!-- IF history_row.U_QUOTE or history_row.MESSAGE_AUTHOR_QUOTE -->
- <ul class="profile-icons">
- <li class="quote-icon"><a <!-- IF history_row.U_QUOTE -->href="{history_row.U_QUOTE}"<!-- ELSE -->href="#postingbox" onclick="addquote({history_row.MSG_ID}, '{history_row.MESSAGE_AUTHOR_QUOTE}', '{LA_WROTE}');"<!-- ENDIF --> title="{L_QUOTE} {history_row.MESSAGE_AUTHOR}"><span>{L_QUOTE} {history_row.MESSAGE_AUTHOR}</span></a></li>
+ <ul class="post-buttons">
+ <li>
+ <a <!-- IF history_row.U_QUOTE -->href="{history_row.U_QUOTE}"<!-- ELSE -->href="#postingbox" onclick="addquote({history_row.MSG_ID}, '{history_row.MESSAGE_AUTHOR_QUOTE}', '{LA_WROTE}');"<!-- ENDIF --> title="{L_QUOTE} {history_row.MESSAGE_AUTHOR}" class="button icon-button quote-icon">
+ <span>{L_QUOTE} {history_row.MESSAGE_AUTHOR}</span>
+ </a>
+ </li>
</ul>
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/ucp_pm_message_header.html b/phpBB/styles/prosilver/template/ucp_pm_message_header.html
index 840eba4c83..56e27811c6 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_message_header.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_message_header.html
@@ -8,16 +8,31 @@
<!-- IF FOLDER_STATUS and FOLDER_MAX_MESSAGES neq 0 --><p>{FOLDER_STATUS}</p><!-- ENDIF -->
<!-- IF U_POST_REPLY_PM or U_POST_NEW_TOPIC or U_FORWARD_PM -->
<div class="buttons">
- <!-- IF U_POST_REPLY_PM --><div class="pmreply-icon"><a title="{L_POST_REPLY_PM}" href="{U_POST_REPLY_PM}"><span></span>{L_BUTTON_PM_REPLY}</a></div>
- <!-- ELSEIF U_POST_NEW_TOPIC --><div class="newpm-icon"><a href="{U_POST_NEW_TOPIC}" accesskey="n" title="{L_UCP_PM_COMPOSE}"><span></span>{L_BUTTON_PM_NEW}</a></div><!-- ENDIF -->
- <!-- IF U_FORWARD_PM --><div class="forwardpm-icon"><a title="{L_POST_FORWARD_PM}" href="{U_FORWARD_PM}"><span></span>{L_BUTTON_PM_FORWARD}</a></div><!-- ENDIF -->
- <!-- IF U_POST_REPLY_PM and S_PM_RECIPIENTS gt 1 --><div class="reply-all"><a title="{L_REPLY_TO_ALL}" href="{U_POST_REPLY_ALL}">{L_BUTTON_PM_REPLY_ALL}</a></div><!-- ENDIF -->
+ <!-- IF U_POST_REPLY_PM -->
+ <a title="{L_POST_REPLY_PM}" href="{U_POST_REPLY_PM}" class="button icon-button pmreply-icon">
+ {L_BUTTON_PM_REPLY}
+ </a>
+ <!-- ELSEIF U_POST_NEW_TOPIC -->
+ <a href="{U_POST_NEW_TOPIC}" accesskey="n" title="{L_UCP_PM_COMPOSE}" class="button icon-button newpm-icon">
+ {L_BUTTON_PM_NEW}
+ </a>
+ <!-- ENDIF -->
+ <!-- IF U_FORWARD_PM -->
+ <a title="{L_POST_FORWARD_PM}" href="{U_FORWARD_PM}" class="button icon-button forwardpm-icon">
+ {L_BUTTON_PM_FORWARD}
+ </a>
+ <!-- ENDIF -->
+ <!-- IF U_POST_REPLY_PM and S_PM_RECIPIENTS gt 1 -->
+ <a title="{L_REPLY_TO_ALL}" href="{U_POST_REPLY_ALL}" class="button icon-button reply-all">
+ {L_BUTTON_PM_REPLY_ALL}
+ </a>
+ <!-- ENDIF -->
</div>
<!-- ENDIF -->
<!-- IF not S_IS_BOT and U_PRINT_PM -->
<div class="dropdown-container dropdown-button-control topic-tools">
- <span title="{L_PM_TOOLS}" class="dropdown-trigger dropdown-select dropdown-select-icon tools-icon"><span></span></span>
+ <span title="{L_PM_TOOLS}" class="dropdown-trigger dropdown-select button icon-button tools-icon"></span>
<div class="dropdown hidden">
<div class="pointer"><div class="pointer-inner"></div></div>
<ul class="dropdown-contents">
diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
index f58b334a60..84ab6ecb44 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
@@ -66,11 +66,27 @@
<h3 class="first">{SUBJECT}</h3>
<!-- IF U_DELETE or U_EDIT or U_QUOTE or U_REPORT -->
- <ul class="profile-icons">
- <!-- IF U_EDIT --><li class="edit-icon"><a href="{U_EDIT}" title="{L_POST_EDIT_PM}"><span>{L_POST_EDIT_PM}</span></a></li><!-- ENDIF -->
- <!-- IF U_DELETE --><li class="delete-icon"><a href="{U_DELETE}" title="{L_DELETE_MESSAGE}"><span>{L_DELETE_MESSAGE}</span></a></li><!-- ENDIF -->
- <!-- IF U_REPORT --><li class="report-icon"><a href="{U_REPORT}" title="{L_REPORT_PM}"><span>{L_REPORT_PM}</span></a></li><!-- ENDIF -->
- <!-- IF U_QUOTE --><li class="quote-icon"><a href="{U_QUOTE}" title="{L_POST_QUOTE_PM}"><span>{L_POST_QUOTE_PM}</span></a></li><!-- ENDIF -->
+ <ul class="post-buttons">
+ <!-- IF U_EDIT -->
+ <li>
+ <a href="{U_EDIT}" title="{L_POST_EDIT_PM}" class="button icon-button edit-icon"><span>{L_POST_EDIT_PM}</span></a>
+ </li>
+ <!-- ENDIF -->
+ <!-- IF U_DELETE -->
+ <li>
+ <a href="{U_DELETE}" title="{L_DELETE_MESSAGE}" class="button icon-button delete-icon"><span>{L_DELETE_MESSAGE}</span></a>
+ </li>
+ <!-- ENDIF -->
+ <!-- IF U_REPORT -->
+ <li>
+ <a href="{U_REPORT}" title="{L_REPORT_PM}" class="button icon-button report-icon"><span>{L_REPORT_PM}</span></a>
+ </li>
+ <!-- ENDIF -->
+ <!-- IF U_QUOTE -->
+ <li>
+ <a href="{U_QUOTE}" title="{L_POST_QUOTE_PM}" class="button icon-button quote-icon"><span>{L_POST_QUOTE_PM}</span></a>
+ </li>
+ <!-- ENDIF -->
</ul>
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html
index 7a0ebaafcf..c747dd01f5 100644
--- a/phpBB/styles/prosilver/template/viewforum_body.html
+++ b/phpBB/styles/prosilver/template/viewforum_body.html
@@ -39,7 +39,9 @@
<!-- IF not S_IS_BOT and S_DISPLAY_POST_INFO -->
<div class="buttons">
- <div class="<!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->post-icon<!-- ENDIF -->" title="<!-- IF S_IS_LOCKED -->{L_FORUM_LOCKED}<!-- ELSE -->{L_POST_TOPIC}<!-- ENDIF -->"><a href="{U_POST_NEW_TOPIC}"><span></span><!-- IF S_IS_LOCKED -->{L_BUTTON_FORUM_LOCKED}<!-- ELSE -->{L_BUTTON_NEW_TOPIC}<!-- ENDIF --></a></div>
+ <a href="{U_POST_NEW_TOPIC}" class="button icon-button <!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->post-icon<!-- ENDIF -->" title="<!-- IF S_IS_LOCKED -->{L_FORUM_LOCKED}<!-- ELSE -->{L_POST_TOPIC}<!-- ENDIF -->">
+ <!-- IF S_IS_LOCKED -->{L_BUTTON_FORUM_LOCKED}<!-- ELSE -->{L_BUTTON_NEW_TOPIC}<!-- ENDIF -->
+ </a>
</div>
<!-- ENDIF -->
@@ -222,9 +224,11 @@
<!-- IF .topicrow and not S_DISPLAY_ACTIVE -->
<div class="topic-actions">
<!-- IF not S_IS_BOT and S_DISPLAY_POST_INFO -->
- <div class="buttons">
- <div class="<!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->post-icon<!-- ENDIF -->" title="<!-- IF S_IS_LOCKED -->{L_FORUM_LOCKED}<!-- ELSE -->{L_POST_TOPIC}<!-- ENDIF -->"><a href="{U_POST_NEW_TOPIC}"><span></span><!-- IF S_IS_LOCKED -->{L_BUTTON_FORUM_LOCKED}<!-- ELSE -->{L_BUTTON_NEW_TOPIC}<!-- ENDIF --></a></div>
- </div>
+ <div class="buttons">
+ <a href="{U_POST_NEW_TOPIC}" class="button icon-button <!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->post-icon<!-- ENDIF -->" title="<!-- IF S_IS_LOCKED -->{L_FORUM_LOCKED}<!-- ELSE -->{L_POST_TOPIC}<!-- ENDIF -->">
+ <!-- IF S_IS_LOCKED -->{L_BUTTON_FORUM_LOCKED}<!-- ELSE -->{L_BUTTON_NEW_TOPIC}<!-- ENDIF -->
+ </a>
+ </div>
<!-- ENDIF -->
<div class="pagination">
diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html
index 18fa7ce783..eb61bd3e72 100644
--- a/phpBB/styles/prosilver/template/viewtopic_body.html
+++ b/phpBB/styles/prosilver/template/viewtopic_body.html
@@ -29,7 +29,9 @@
<div class="buttons">
<!-- IF not S_IS_BOT and S_DISPLAY_REPLY_INFO -->
- <div class="<!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->reply-icon<!-- ENDIF -->"><a href="{U_POST_REPLY_TOPIC}" title="<!-- IF S_IS_LOCKED -->{L_TOPIC_LOCKED}<!-- ELSE -->{L_POST_REPLY}<!-- ENDIF -->"><span></span><!-- IF S_IS_LOCKED -->{L_BUTTON_TOPIC_LOCKED}<!-- ELSE -->{L_BUTTON_POST_REPLY}<!-- ENDIF --></a></div>
+ <a href="{U_POST_REPLY_TOPIC}" class="button icon-button <!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->reply-icon<!-- ENDIF -->" title="<!-- IF S_IS_LOCKED -->{L_TOPIC_LOCKED}<!-- ELSE -->{L_POST_REPLY}<!-- ENDIF -->">
+ <!-- IF S_IS_LOCKED -->{L_BUTTON_TOPIC_LOCKED}<!-- ELSE -->{L_BUTTON_POST_REPLY}<!-- ENDIF -->
+ </a>
<!-- ENDIF -->
</div>
@@ -197,14 +199,38 @@
<!-- IF not S_IS_BOT -->
<!-- IF postrow.U_EDIT or postrow.U_DELETE or postrow.U_REPORT or postrow.U_WARN or postrow.U_INFO or postrow.U_QUOTE -->
- <ul class="profile-icons">
+ <ul class="post-buttons">
<!-- EVENT viewtopic_body_post_buttons_before -->
- <!-- IF postrow.U_EDIT --><li class="edit-icon"><a href="{postrow.U_EDIT}" title="{L_EDIT_POST}"><span>{L_EDIT_POST}</span></a></li><!-- ENDIF -->
- <!-- IF postrow.U_DELETE --><li class="delete-icon"><a href="{postrow.U_DELETE}" title="{L_DELETE_POST}"><span>{L_DELETE_POST}</span></a></li><!-- ENDIF -->
- <!-- IF postrow.U_REPORT --><li class="report-icon"><a href="{postrow.U_REPORT}" title="{L_REPORT_POST}"><span>{L_REPORT_POST}</span></a></li><!-- ENDIF -->
- <!-- IF postrow.U_WARN --><li class="warn-icon"><a href="{postrow.U_WARN}" title="{L_WARN_USER}"><span>{L_WARN_USER}</span></a></li><!-- ENDIF -->
- <!-- IF postrow.U_INFO --><li class="info-icon"><a href="{postrow.U_INFO}" title="{L_INFORMATION}"><span>{L_INFORMATION}</span></a></li><!-- ENDIF -->
- <!-- IF postrow.U_QUOTE --><li class="quote-icon"><a href="{postrow.U_QUOTE}" title="{L_REPLY_WITH_QUOTE}"><span>{L_REPLY_WITH_QUOTE}</span></a></li><!-- ENDIF -->
+ <!-- IF postrow.U_EDIT -->
+ <li>
+ <a href="{postrow.U_EDIT}" title="{L_EDIT_POST}" class="button icon-button edit-icon"><span>{L_BUTTON_EDIT}</span></a>
+ </li>
+ <!-- ENDIF -->
+ <!-- IF postrow.U_DELETE -->
+ <li>
+ <a href="{postrow.U_DELETE}" title="{L_DELETE_POST}" class="button icon-button delete-icon"><span>{L_DELETE_POST}</span></a>
+ </li>
+ <!-- ENDIF -->
+ <!-- IF postrow.U_REPORT -->
+ <li>
+ <a href="{postrow.U_REPORT}" title="{L_REPORT_POST}" class="button icon-button report-icon"><span>{L_REPORT_POST}</span></a>
+ </li>
+ <!-- ENDIF -->
+ <!-- IF postrow.U_WARN -->
+ <li>
+ <a href="{postrow.U_WARN}" title="{L_WARN_USER}" class="button icon-button warn-icon"><span>{L_WARN_USER}</span></a>
+ </li>
+ <!-- ENDIF -->
+ <!-- IF postrow.U_INFO -->
+ <li>
+ <a href="{postrow.U_INFO}" title="{L_INFORMATION}" class="button icon-button info-icon"><span>{L_INFORMATION}</span></a>
+ </li>
+ <!-- ENDIF -->
+ <!-- IF postrow.U_QUOTE -->
+ <li>
+ <a href="{postrow.U_QUOTE}" title="{L_REPLY_WITH_QUOTE}" class="button icon-button quote-icon"><span>{L_QUOTE}</span></a>
+ </li>
+ <!-- ENDIF -->
<!-- EVENT viewtopic_body_post_buttons_after -->
</ul>
<!-- ENDIF -->
@@ -316,7 +342,9 @@
<div class="topic-actions">
<div class="buttons">
<!-- IF not S_IS_BOT and S_DISPLAY_REPLY_INFO -->
- <div class="<!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->reply-icon<!-- ENDIF -->"><a href="{U_POST_REPLY_TOPIC}" title="<!-- IF S_IS_LOCKED -->{L_TOPIC_LOCKED}<!-- ELSE -->{L_POST_REPLY}<!-- ENDIF -->"><span></span><!-- IF S_IS_LOCKED -->{L_BUTTON_TOPIC_LOCKED}<!-- ELSE -->{L_BUTTON_POST_REPLY}<!-- ENDIF --></a></div>
+ <a href="{U_POST_REPLY_TOPIC}" class="button icon-button <!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->reply-icon<!-- ENDIF -->" title="<!-- IF S_IS_LOCKED -->{L_TOPIC_LOCKED}<!-- ELSE -->{L_POST_REPLY}<!-- ENDIF -->">
+ <!-- IF S_IS_LOCKED -->{L_BUTTON_TOPIC_LOCKED}<!-- ELSE -->{L_BUTTON_POST_REPLY}<!-- ENDIF -->
+ </a>
<!-- ENDIF -->
</div>
diff --git a/phpBB/styles/prosilver/template/viewtopic_topic_tools.html b/phpBB/styles/prosilver/template/viewtopic_topic_tools.html
index 89f34d1b3a..5394c00f6a 100644
--- a/phpBB/styles/prosilver/template/viewtopic_topic_tools.html
+++ b/phpBB/styles/prosilver/template/viewtopic_topic_tools.html
@@ -1,6 +1,6 @@
<!-- IF not S_IS_BOT and (U_WATCH_TOPIC or U_BOOKMARK_TOPIC or U_BUMP_TOPIC or S_HAS_ATTACHMENTS or U_EMAIL_TOPIC or U_PRINT_TOPIC or S_DISPLAY_TOPIC_TOOLS) -->
<div class="dropdown-container dropdown-button-control topic-tools">
- <span title="{L_TOPIC_TOOLS}" class="dropdown-trigger dropdown-select dropdown-select-icon tools-icon"><span></span></span>
+ <span title="{L_TOPIC_TOOLS}" class="button icon-button tools-icon dropdown-trigger dropdown-select"></span>
<div class="dropdown hidden">
<div class="pointer"><div class="pointer-inner"></div></div>
<ul class="dropdown-contents">
diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css
index c2d15b9ef2..78b95d902e 100644
--- a/phpBB/styles/prosilver/theme/bidi.css
+++ b/phpBB/styles/prosilver/theme/bidi.css
@@ -554,13 +554,27 @@ ul.linklist li.small-icon > a, ul.linklist li.breadcrumbs span:first-child > a {
/* Rollover buttons
Based on: http://wellstyled.com/css-nopreload-rollovers.html
----------------------------------------*/
-.rtl .buttons {
- float: right;
+.rtl .icon-button.dropdown-select {
+ padding-left: 26px;
+ padding-right: 8px;
+}
+
+.rtl .icon-button:before {
+ float: left;
+ margin-left: 0;
+ margin-right: 2px;
}
-/* Rollover state */
-.rtl .buttons div {
- margin: 0 1px 0 5px;
+.dropdown-select:after {
+ border-left: 0;
+ border-right-style: solid;
+ border-right-width: 1px;
+ left: 0;
+ right: auto;
+}
+
+.rtl .buttons, .rtl .buttons .button {
+ float: right;
}
/* Icon images
@@ -574,17 +588,18 @@ ul.linklist li.small-icon > a, ul.linklist li.breadcrumbs span:first-child > a {
padding-right: 0;
}
-/* Poster profile icons
-----------------------------------------*/
-/* Rollover state */
-.rtl .postprofile ul.profile-icons li {
+/* Post control buttons
+--------------------------------------------- */
+.rtl .post-buttons {
+ float: left;
+}
+
+.rtl .post-buttons li {
float: right;
- margin: 0 0 3px 6px;
}
-/* Positioning of moderator icons */
-.rtl .postbody ul.profile-icons {
- float: left;
+.post-buttons .icon-button:before {
+ margin-right: 0;
}
/**
diff --git a/phpBB/styles/prosilver/theme/buttons.css b/phpBB/styles/prosilver/theme/buttons.css
index 9ca04516cc..7d9aae86d7 100644
--- a/phpBB/styles/prosilver/theme/buttons.css
+++ b/phpBB/styles/prosilver/theme/buttons.css
@@ -4,102 +4,84 @@
/* Rollover buttons
Based on: http://wellstyled.com/css-nopreload-rollovers.html
----------------------------------------*/
-.buttons {
- float: left;
- width: auto;
- height: auto;
-}
-
-/* Rollover state */
-.buttons div, .dropdown-select {
- float: left;
- margin: 0 5px 0 0;
-}
-
-/* Rolloff state */
-.buttons div a, .dropdown-select {
+.button {
+ cursor: pointer;
display: inline-block;
- line-height: 17.5px;
height: 18px;
font-size: 13px;
white-space: nowrap;
border: 1px solid transparent;
border-radius: 4px;
background: transparent none 0 0 repeat-x;
- padding: 2px 22px 2px 8px;
+ padding: 2px 8px;
font-family: "Open Sans", "Droid Sans", Verdana, Arial, Helvetica;
- font-weight: 600;
position: relative;
text-decoration: none !important;
outline-style: none !important;
vertical-align: bottom;
- *padding-right: 8px;
}
-.buttons div span { display: none; }
+.icon-button.dropdown-select {
+ padding-right: 28px;
+}
-.buttons div a:after, .dropdown-select:after {
+.icon-button:before {
+ background: transparent 0 0 no-repeat;
content: '';
- display: block;
- position: absolute;
- top: 50%;
- right: 6px;
- width: 12px;
+ display: inline-block;
+ float: right;
height: 12px;
- margin-top: -6px;
- background: transparent 0 0 no-repeat;
-}
-
-.buttons div a:hover:after {
- background-position: 0 -20px;
-}
-
-.dropdown-select {
- cursor: pointer;
- font-family: inherit;
- font-size: 1em;
- font-weight: normal;
+ margin: 3px 0 0 2px;
+ width: 12px;
}
.dropdown-select:after {
background-position: -103px 10px;
border-left: 1px solid;
- margin-top: 0;
+ content: '';
+ position: absolute;
top: 0;
right: 0;
- height: 21px;
- width: 15px;
+ height: 22px;
+ width: 16px;
}
.dropdown-visible .dropdown-select:after, .nojs .dropdown-container:hover .dropdown-select:after {
background-position: -103px -10px;
}
-.dropdown-select-icon:before {
- content: '';
- display: block;
+.buttons, .buttons .button {
float: left;
- margin-right: 4px;
- margin-top: 2px;
+}
+
+.buttons .button, .dropdown-select {
+ margin-right: 5px;
}
/* Big button images */
-.buttons div.reply-icon a:after, .buttons div.pmreply-icon a:after { background-position: -20px 0; }
-.buttons div.reply-icon a:hover:after, .buttons div.pmreply-icon a:hover:after { background-position: -20px -20px; }
+.reply-icon:before, .pmreply-icon:before { background-position: -20px 0; }
+.reply-icon:hover:before, .pmreply-icon:hover:before { background-position: -20px -20px; }
-.buttons div.post-icon a:after, .buttons div.newpm-icon a:after { background-position: 0 0; }
-.buttons div.post-icon a:hover:after, .buttons div.newpm-icon a:hover:after { background-position: 0 -20px; }
+.post-icon:before, .newpm-icon:before, .reply-all:before { background-position: 0 0; }
+.post-icon:hover:before,
+.newpm-icon:hover:before,
+.reply-all:hover:before { background-position: 0 -20px; }
-.buttons div.locked-icon a:after { background-position: -60px 0; }
-.buttons div.locked-icon a:hover:after { background-position: -60px -20px; }
+.locked-icon:before { background-position: -60px 0; }
+.locked-icon:hover:before { background-position: -60px -20px; }
-.buttons div.forwardpm-icon a:after { background-position: -40px 0; }
-.buttons div.forwardpm-icon a:hover:after { background-position: -40px -20px; }
+.forwardpm-icon:before { background-position: -40px 0; }
+.forwardpm-icon:hover:before { background-position: -40px -20px; }
-.dropdown-select.tools-icon:before { background-position: -80px 0; height: 16px; width: 16px; }
+.tools-icon:before {
+ background-position: -80px 0;
+ height: 16px;
+ margin-top: 2px;
+ width: 16px;
+}
-.dropdown-visible .dropdown-select.tools-icon:before,
-.nojs .dropdown-container:hover .dropdown-select.tools-icon:before { background-position: -80px -20px; }
+.dropdown-visible .tools-icon:before,
+.nojs .dropdown-container:hover .tools-icon:before { background-position: -80px -20px; }
/* Icon images
---------------------------------------- */
@@ -118,102 +100,8 @@ ul.linklist.bulletin li.small-icon:before {
display: none;
}
-/* Poster profile icons
+/* Poster contact icons
----------------------------------------*/
-ul.profile-icons {
- padding-top: 10px;
- list-style: none;
-}
-
-/* Rollover state */
-ul.profile-icons li {
- float: left;
- margin: 0 6px 3px 0;
- background-position: 0 100%;
-}
-
-/* Rolloff state */
-ul.profile-icons li a {
- display: block;
- width: 100%;
- height: 100%;
- background-position: 0 0;
-}
-
-/* Hide <a> 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; }
-
-/* Positioning of moderator icons */
-.postbody ul.profile-icons {
- float: right;
- width: auto;
- padding: 0;
-}
-
-.postbody ul.profile-icons li {
- margin: 0 3px;
-}
-
-/* Responsive icons in postbody */
-.postbody ul.profile-icons.responsive .responsive-menu {
- position: relative;
-}
-
-ul.profile-icons.responsive a.responsive-menu-link {
- display: inline-block;
- position: relative;
- margin: 0 5px;
- width: 20px;
- height: 20px;
- text-decoration: none;
- background: none top left no-repeat;
-}
-
-ul.profile-icons.responsive a.responsive-menu-link:hover {
- background-position: 0 -20px;
-}
-
-ul.profile-icons.responsive a.responsive-menu-link:before {
- content: '';
- position: absolute;
- left: 0;
- top: 7px;
- height: .125em;
- width: 14px;
- border-bottom: 0.125em solid transparent;
- border-top: 0.375em double transparent;
-}
-
-.postbody ul.profile-icons.responsive .popup-pointer {
- left: auto;
- right: 7px;
- top: 20px;
-}
-
-.postbody ul.profile-icons .dropdown li, .postbody ul.profile-icons .dropdown li a {
- display: block;
- background: transparent none;
- width: auto;
- height: auto;
- margin: 0;
- padding: 0;
- float: none;
- list-style-type: none;
-}
-
-.postbody ul.profile-icons .dropdown li span {
- display: block;
- text-align: right;
- font-size: 1.2em;
- line-height: 1.8em;
- white-space: nowrap;
-}
-
-.hasjs .postbody ul.profile-icons {
- max-width: 40%;
-}
-
.contact-icons.dropdown-contents {
min-width: 0;
padding: 0;
@@ -245,8 +133,7 @@ ul.profile-icons.responsive a.responsive-menu-link:before {
clear: left;
}
-
-/* Profile & navigation icons */
+/* Profile icons */
.pm-icon { background-position: 0 0; }
.email-icon { background-position: -21px 0; }
.jabber-icon { background-position: -80px 0; }
@@ -261,39 +148,74 @@ ul.profile-icons.responsive a.responsive-menu-link:before {
.phpbb_twitter-icon { background-position: -203px 0; }
.phpbb_yahoo-icon { background-position: -224px 0; }
-.quote-icon, .quote-icon a { background: none top left no-repeat; }
-
-/* Moderator icons */
-.report-icon, .report-icon a { background: none top left no-repeat; }
-.warn-icon, .warn-icon a { background: none top left no-repeat; }
-.edit-icon, .edit-icon a { background: none top left no-repeat; }
-.delete-icon, .delete-icon a { background: none top left no-repeat; }
-.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; }
-ul.profile-icons li.delete-icon { width: 20px; height: 20px; }
-ul.profile-icons li.info-icon { width: 20px; height: 20px; }
-ul.profile-icons li.warn-icon { width: 20px; height: 20px; }
-ul.profile-icons a.responsive-menu-link { width: 20px; height: 20px; }
-
-/* Fix profile icon default margins */
-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; }
+/* Post control buttons
+--------------------------------------------- */
+.post-buttons {
+ float: right;
+ list-style: none;
+ margin-top: 2px;
+}
+
+.notouch.section-viewtopic .post-buttons {
+ opacity: 0;
+ transition: opacity .5s;
+}
+
+.notouch.section-viewtopic .post:hover .post-buttons {
+ opacity: 1;
+}
+
+.post-buttons li {
+ float: left;
+ margin-right: 3px;
+}
+
+.post-buttons .icon-button {
+ padding: 0 5px;
+}
+
+.hastouch .post-buttons .icon-button {
+ padding: 2px 8px;
+}
+.post-buttons .icon-button span {
+ display: block;
+ height: 0;
+ overflow: hidden;
+ position: absolute;
+ width: 1px;
+}
+
+.post-buttons .icon-button:before {
+ margin-left: 0;
+}
+
+.quote-icon:before { background-position: -122px 0; }
+.quote-icon:hover:before { background-position: -122px -21px; }
+.edit-icon:before { background-position: -137px 0; }
+.edit-icon:hover:before { background-position: -137px -21px; }
+.warn-icon:before { background-position: -208px 0; }
+.warn-icon:hover:before { background-position: -208px -21px; }
+.delete-icon:before { background-position: -152px 0; }
+.delete-icon:hover:before { background-position: -152px -21px; }
+.report-icon:before { background-position: -165px 0; }
+.report-icon:hover:before { background-position: -165px -21px; }
+.info-icon:before { background-position: -175px 0; }
+.info-icon:hover:before { background-position: -175px -21px; }
+.button.responsive-menu-link:before { background-position: -191px 0; }
+.button.responsive-menu-link:hover:before { background-position: -191px -21px; }
+
+/* Responsive buttons in post body */
+.post-buttons .dropdown {
+ top: 18px;
+}
+
+.post-buttons .dropdown a {
+ display: block;
+ font-size: 1.2em;
+ text-align: right;
+}
+
+.hasjs .postbody .post-buttons {
+ max-width: 40%;
+}
diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css
index acb2df92a0..72c8b5f226 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; }
@@ -668,8 +668,7 @@ dd.profile-warnings {
--------------------------------------------------------------
Colours and backgrounds for buttons.css
-------------------------------------------------------------- */
-
-.buttons div a, .dropdown-select {
+.button, .button:visited {
border-color: #C7C3BF;
background-color: #FFFFFF;
background-image: -moz-linear-gradient(top, #FFFFFF, #E9E9E9);
@@ -679,19 +678,10 @@ Colours and backgrounds for buttons.css
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#FFFFFF', EndColorStr='#E9E9E9')";
box-shadow: 0 0 0 1px #FFFFFF inset;
-webkit-box-shadow: 0 0 0 1px #FFFFFF inset;
- color: #BC2A4D !important;
-}
-
-.dropdown-select {
- color: #5C6482 !important;
-}
-
-.dropdown-select:after {
- border-color: #DADADA;
+ color: #BC2A4D;
}
-.buttons div a:hover, .dropdown-select:hover, .dropdown-visible .dropdown-select,
-.dropdown-visible .dropdown-select:hover, .nojs .dropdown-container:hover .dropdown-select {
+.button:hover, .dropdown-visible .dropdown-select, .nojs .dropdown-container:hover .dropdown-select {
border-color: #0a8ed0;
background-image: -moz-linear-gradient(top, #E9E9E9, #FFFFFF);
background-image: -webkit-linear-gradient(top, #E9E9E9, #FFFFFF);
@@ -701,26 +691,16 @@ Colours and backgrounds for buttons.css
text-shadow: 1px 1px 0 #FFFFFF, -1px -1px 0 #FFFFFF, -1px -1px 0 rgba(188, 42, 77, 0.2);
}
-.dropdown-select:hover {
- border-color: #C7C3BF;
-}
+.dropdown-select:after { border-color: #DADADA; }
+.dropdown-select:hover { border-color: #C7C3BF; }
.dropdown-visible .dropdown-select, .dropdown-visible .dropdown-select:hover, .nojs .dropdown-container:hover .dropdown-select {
border-color: #A6B2BA;
- color: #105289 !important;
-}
-
-.buttons div a:after, .dropdown-select-icon:before, .dropdown-select:after {
- background-image: url("images/buttons.png");
-}
-
-.contact-icons a {
- border-color: #DCDCDC;
+ color: #105289;
}
-.contact-icons a:hover {
- background-color: #F2F6F9;
-}
+.contact-icons a { border-color: #DCDCDC; }
+.contact-icons a:hover { background-color: #F2F6F9; }
/* Icon images
---------------------------------------- */
@@ -744,17 +724,8 @@ Colours and backgrounds for buttons.css
.icon-print { background-image: url("./images/icon_print.gif"); }
/* Profile & navigation icons */
-.contact-icon { background-image: url("./images/icons_contact.png"); }
-
-.quote-icon, .quote-icon a { background-image: url("./en/icon_post_quote.gif"); }
-ul.profile-icons.responsive a.responsive-menu-link { background-image: url("./images/icon_post_menu.png"); }
-
-/* Moderator icons */
-.report-icon, .report-icon a { background-image: url("./images/icon_post_report.gif"); }
-.edit-icon, .edit-icon a { background-image: url("./en/icon_post_edit.gif"); }
-.delete-icon, .delete-icon a { background-image: url("./images/icon_post_delete.gif"); }
-.info-icon, .info-icon a { background-image: url("./images/icon_post_info.gif"); }
-.warn-icon, .warn-icon a { background-image: url("./images/icon_user_warn.gif"); } /* Need updated warn icon */
+.contact-icon { background-image: url("./images/icons_contact.png"); }
+.icon-button:before, .dropdown-select:after { background-image: url("./images/icons_button.png"); }
/* Forum icons & Topic icons */
.global_read { background-image: url("./images/announce_read.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 ec190118fe..0000000000
--- a/phpBB/styles/prosilver/theme/en/icon_contact_pm.gif
+++ /dev/null
Binary files differ
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 19006f95a7..0000000000
--- a/phpBB/styles/prosilver/theme/en/icon_post_edit.gif
+++ /dev/null
Binary files differ
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 c3708a1477..0000000000
--- a/phpBB/styles/prosilver/theme/en/icon_post_quote.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/en/stylesheet.css b/phpBB/styles/prosilver/theme/en/stylesheet.css
index d8ca2558e5..bf4bd31ffc 100644
--- a/phpBB/styles/prosilver/theme/en/stylesheet.css
+++ b/phpBB/styles/prosilver/theme/en/stylesheet.css
@@ -1,26 +1,6 @@
-/* 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"); }
-/* 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/images/buttons.png b/phpBB/styles/prosilver/theme/images/buttons.png
deleted file mode 100644
index 3a8c2f2f65..0000000000
--- a/phpBB/styles/prosilver/theme/images/buttons.png
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_post_delete.gif b/phpBB/styles/prosilver/theme/images/icon_post_delete.gif
deleted file mode 100644
index f51ffc24a6..0000000000
--- a/phpBB/styles/prosilver/theme/images/icon_post_delete.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_post_info.gif b/phpBB/styles/prosilver/theme/images/icon_post_info.gif
deleted file mode 100644
index af089d8656..0000000000
--- a/phpBB/styles/prosilver/theme/images/icon_post_info.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_post_menu.png b/phpBB/styles/prosilver/theme/images/icon_post_menu.png
deleted file mode 100644
index 2b48289fdb..0000000000
--- a/phpBB/styles/prosilver/theme/images/icon_post_menu.png
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_post_report.gif b/phpBB/styles/prosilver/theme/images/icon_post_report.gif
deleted file mode 100644
index 72c6ae89d0..0000000000
--- a/phpBB/styles/prosilver/theme/images/icon_post_report.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_user_warn.gif b/phpBB/styles/prosilver/theme/images/icon_user_warn.gif
deleted file mode 100644
index 9c4ad98e5c..0000000000
--- a/phpBB/styles/prosilver/theme/images/icon_user_warn.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icons_button.png b/phpBB/styles/prosilver/theme/images/icons_button.png
new file mode 100644
index 0000000000..a45a0cc2ba
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icons_button.png
Binary files differ
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;
diff --git a/phpBB/styles/prosilver/theme/responsive.css b/phpBB/styles/prosilver/theme/responsive.css
index 13711c1267..b76f6b60cd 100644
--- a/phpBB/styles/prosilver/theme/responsive.css
+++ b/phpBB/styles/prosilver/theme/responsive.css
@@ -423,10 +423,6 @@ fieldset.polls dd.resultbar, fieldset.polls dd.poll_option_percent {
margin: 0;
}
-.postprofile ul.profile-icons {
- display: none;
-}
-
.postprofile .avatar {
display: block;
float: left;
diff --git a/tests/config/db_text_test.php b/tests/config/db_text_test.php
index b24c2fb17f..a91abf990f 100644
--- a/tests/config/db_text_test.php
+++ b/tests/config/db_text_test.php
@@ -13,8 +13,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()
{
@@ -52,6 +52,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);
@@ -93,6 +99,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);
diff --git a/tests/dbal/sql_affected_rows_test.php b/tests/dbal/sql_affected_rows_test.php
new file mode 100644
index 0000000000..860b8bf237
--- /dev/null
+++ b/tests/dbal/sql_affected_rows_test.php
@@ -0,0 +1,64 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2014 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+class phpbb_dbal_sql_affected_rows_test extends phpbb_database_test_case
+{
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->db = $this->new_dbal();
+ }
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
+ }
+
+ 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_same_value_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());
+ }
+}
diff --git a/travis/setup-webserver.sh b/travis/setup-webserver.sh
index ed4a7536cd..a9941d4def 100755
--- a/travis/setup-webserver.sh
+++ b/travis/setup-webserver.sh
@@ -33,10 +33,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 \