aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2016-02-02 12:19:55 +0100
committerMarc Alexander <admin@m-a-styles.de>2016-12-03 14:20:28 +0100
commitc07ecb060dd04c76d8bd166a0a8a7226a8167f06 (patch)
tree26770244f6f9facc5afbfe6240d88f70f1edaa95
parentcc7a0aa4fb2d6c8efd5c78df7d68328c9f8d4d32 (diff)
downloadforums-c07ecb060dd04c76d8bd166a0a8a7226a8167f06.tar
forums-c07ecb060dd04c76d8bd166a0a8a7226a8167f06.tar.gz
forums-c07ecb060dd04c76d8bd166a0a8a7226a8167f06.tar.bz2
forums-c07ecb060dd04c76d8bd166a0a8a7226a8167f06.tar.xz
forums-c07ecb060dd04c76d8bd166a0a8a7226a8167f06.zip
[ticket/14492] Add events for modifying help phpBB page
PHPBB3-14492
-rw-r--r--phpBB/adm/style/acp_help_phpbb.html17
-rw-r--r--phpBB/adm/style/admin.css6
-rw-r--r--phpBB/docs/events.md12
-rw-r--r--phpBB/includes/acp/acp_help_phpbb.php56
4 files changed, 52 insertions, 39 deletions
diff --git a/phpBB/adm/style/acp_help_phpbb.html b/phpBB/adm/style/acp_help_phpbb.html
index cbbe42e8c7..a9406e2c2e 100644
--- a/phpBB/adm/style/acp_help_phpbb.html
+++ b/phpBB/adm/style/acp_help_phpbb.html
@@ -6,6 +6,7 @@
<form id="acp_board" method="post" action="{U_ACTION}">
<div class="send-stats-row">
+ <!-- EVENT acp_help_phpbb_stats_before -->
<div class="send-stats-tile">
<h2><i class="icon fa-bar-chart"></i>Send statistics</h2>
<p>{L_EXPLAIN_SEND_STATISTICS}</p>
@@ -31,23 +32,13 @@
</div>
<dl class="send-stats-settings">
<dt>
- <input id="enable-stats" type="checkbox" checked="checked" />
- <label for="enable-stats"></label>
+ <input id="help_send_statistics" type="checkbox"<!-- IF S_COLLECT_STATS --> checked="checked"<!-- ENDIF --> />
+ <label for="help_send_statistics"></label>
</dt>
<dd>{L_SEND_STATISTICS_LONG}</dd>
</dl>
</div>
- <div class="send-stats-tile">
- <h2><span class="viglink-header">VigLink</span></h2>
- <p>{L_EXPLAIN_ENABLE_VIGLINK}</p>
- <dl class="send-stats-settings">
- <dt>
- <input id="enable-viglink" type="checkbox" />
- <label for="enable-viglink"></label>
- </dt>
- <dd>Enable</dd>
- </dl>
- </div>
+ <!-- EVENT acp_help_phpbb_stats_after -->
<fieldset>
<p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />
diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css
index d4df01dba7..bcf01fe597 100644
--- a/phpBB/adm/style/admin.css
+++ b/phpBB/adm/style/admin.css
@@ -2612,12 +2612,6 @@ fieldset.permissions .padding {
padding-right: 0.3em;
}
-.viglink-header {
- background: url('http://www.viglink.com/wp-content/uploads/2015/05/favicon-96x96.png') no-repeat 0 0;
- padding-left: 30px;
- background-size: 25px;
-}
-
.icon {
font-family: FontAwesome;
font-style: normal;
diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md
index a939c6ff7e..caaff7cb0e 100644
--- a/phpBB/docs/events.md
+++ b/phpBB/docs/events.md
@@ -196,6 +196,18 @@ acp_groups_position_teampage_add_button_before
* Since: 3.1.7-RC1
* Purpose: Add content before adding group to teampage submit button
+acp_help_phpbb_stats_after
+===
+* Location: adm/style/acp_help_phpbb.html
+* Since: 3.2.0-b2
+* Purpose: Add content after send statistics tile
+
+acp_help_phpbb_stats_before
+===
+* Location: adm/style/acp_help_phpbb.html
+* Since: 3.2.0-b2
+* Purpose: Add content before send statistics tile
+
acp_logs_quick_select_forum_button_append
===
* Location: adm/style/acp_logs.html
diff --git a/phpBB/includes/acp/acp_help_phpbb.php b/phpBB/includes/acp/acp_help_phpbb.php
index c981cf79df..9dd641dfd5 100644
--- a/phpBB/includes/acp/acp_help_phpbb.php
+++ b/phpBB/includes/acp/acp_help_phpbb.php
@@ -25,7 +25,7 @@ class acp_help_phpbb
function main($id, $mode)
{
- global $config, $request, $template, $user, $phpbb_admin_path, $phpbb_root_path, $phpEx;
+ global $config, $request, $template, $user, $phpbb_dispatcher, $phpbb_admin_path, $phpbb_root_path, $phpEx;
if (!class_exists('phpbb_questionnaire_data_collector'))
{
@@ -71,33 +71,49 @@ class acp_help_phpbb
$collector->add_data_provider(new phpbb_questionnaire_system_data_provider());
$collector->add_data_provider(new phpbb_questionnaire_phpbb_data_provider($config));
+ /**
+ * Event to add and/or modify acp_board configurations
+ *
+ * @event core.acp_help_phpbb_submit_before
+ * @var boolean submit Do we display the form or process the submission
+ * @since 3.2.0-b2
+ */
+ $vars = array('submit');
+ extract($phpbb_dispatcher->trigger_event('core.acp_help_phpbb_submit_before', compact($vars)));
+
if ($submit)
{
- $client = new \Guzzle\Http\Client(
- $this->u_action,
- array(
- 'timeout' => 6,
- 'connect_timeout' => 6,
- )
- );
-
- $collect_request = $client->post($collect_url, [], [
- 'systemdata' => $collector->get_data_for_form(),
- ]);
-
- $response = $collect_request->send();
- if ($response->isSuccessful())
- {
- trigger_error($user->lang('THANKS_SEND_STATISTICS') . adm_back_link($this->u_action));
- }
- else
+ $config->set('help_send_statistics', $request->variable('help_send_statistics', false));
+
+ if ($config['help_send_statistics'])
{
- trigger_error($user->lang('FAIL_SEND_STATISTICS') . adm_back_link($this->u_action));
+ $client = new \Guzzle\Http\Client(
+ $this->u_action,
+ array(
+ 'timeout' => 6,
+ 'connect_timeout' => 6,
+ )
+ );
+
+ $collect_request = $client->post($collect_url, [], [
+ 'systemdata' => $collector->get_data_for_form(),
+ ]);
+
+ $response = $collect_request->send();
+ if ($response->isSuccessful())
+ {
+ trigger_error($user->lang('THANKS_SEND_STATISTICS') . adm_back_link($this->u_action));
+ }
+ else
+ {
+ trigger_error($user->lang('FAIL_SEND_STATISTICS') . adm_back_link($this->u_action));
+ }
}
}
$template->assign_vars(array(
'U_COLLECT_STATS' => $collect_url,
+ 'S_COLLECT_STATS' => (!empty($config['help_send_statistics'])) ? true : false,
'RAW_DATA' => $collector->get_data_for_form(),
'U_ACP_MAIN' => append_sid("{$phpbb_admin_path}index.$phpEx"),
));