diff options
-rw-r--r-- | phpBB/config/profilefields.yml | 1 | ||||
-rw-r--r-- | phpBB/docs/events.md | 16 | ||||
-rw-r--r-- | phpBB/language/en/app.php | 3 | ||||
-rw-r--r-- | phpBB/language/en/common.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/profilefields/manager.php | 45 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/navbar_header.html | 2 | ||||
-rw-r--r-- | phpBB/styles/prosilver/theme/common.css | 1 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/breadcrumbs.html | 2 |
8 files changed, 63 insertions, 9 deletions
diff --git a/phpBB/config/profilefields.yml b/phpBB/config/profilefields.yml index d12a1f8a37..00f025e141 100644 --- a/phpBB/config/profilefields.yml +++ b/phpBB/config/profilefields.yml @@ -4,6 +4,7 @@ services: arguments: - @auth - @dbal.conn + - @dispatcher - @request - @template - @profilefields.type_collection diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index df181fe096..a602547447 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -451,6 +451,22 @@ overall_header_navigation_prepend * Since: 3.1.0-a1 * Purpose: Add links before the navigation links in the header +overall_header_navlink_append +=== +* Locations: + + styles/prosilver/template/navbar_header.html + + styles/subsilver2/template/breadcrumbs.html +* Since: 3.1.0-b3 +* Purpose: Add content after each individual navlink (breadcrumb) + +overall_header_navlink_prepend +=== +* Locations: + + styles/prosilver/template/navbar_header.html + + styles/subsilver2/template/breadcrumbs.html +* Since: 3.1.0-b3 +* Purpose: Add content before each individual navlink (breadcrumb) + overall_header_page_body_before === * Locations: diff --git a/phpBB/language/en/app.php b/phpBB/language/en/app.php index cb56015c30..6697532150 100644 --- a/phpBB/language/en/app.php +++ b/phpBB/language/en/app.php @@ -41,9 +41,6 @@ if (empty($lang) || !is_array($lang)) $lang = array_merge($lang, array( 'CONTROLLER_ARGUMENT_VALUE_MISSING' => 'Missing value for argument #%1$s: <strong>%3$s</strong> in class <strong>%2$s</strong>', 'CONTROLLER_NOT_SPECIFIED' => 'No controller has been specified.', - 'CONTROLLER_NOT_FOUND' => 'The requested page could not be found.', 'CONTROLLER_METHOD_NOT_SPECIFIED' => 'No method was specified for the controller.', - 'CONTROLLER_SERVICE_NOT_GIVEN' => 'The controller "<strong>%s</strong>" must have a service specified in ./config/routing.yml.', 'CONTROLLER_SERVICE_UNDEFINED' => 'The service for controller "<strong>%s</strong>" is not defined in ./config/services.yml.', - 'CONTROLLER_RETURN_TYPE_INVALID' => 'The controller object <strong>%s</strong> must return a Symfony\Component\HttpFoundation\Response object.', )); diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index e31164dfc8..aac4f2516e 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -218,8 +218,6 @@ $lang = array_merge($lang, array( 'ERROR' => 'Error', 'EXPAND_VIEW' => 'Expand view', 'EXTENSION' => 'Extension', - 'EXTENSION_CONTROLLER_MISSING' => 'The extension <strong>%s</strong> is missing a controller class and cannot be accessed through the front-end.', - 'EXTENSION_CLASS_WRONG_TYPE' => 'The extension controller class <strong>%s</strong> is not an instance of the phpbb_extension_controller_interface.', 'EXTENSION_DISABLED' => 'The extension <strong>%s</strong> is not enabled.', 'EXTENSION_DISABLED_AFTER_POSTING' => 'The extension <strong>%s</strong> has been deactivated and can no longer be displayed.', 'EXTENSION_DOES_NOT_EXIST' => 'The extension <strong>%s</strong> does not exist.', diff --git a/phpBB/phpbb/profilefields/manager.php b/phpBB/phpbb/profilefields/manager.php index 37449c67c4..7d545a5f72 100644 --- a/phpBB/phpbb/profilefields/manager.php +++ b/phpBB/phpbb/profilefields/manager.php @@ -28,6 +28,12 @@ class manager protected $db; /** + * Event dispatcher object + * @var \phpbb\event\dispatcher + */ + protected $dispatcher; + + /** * Request object * @var \phpbb\request\request */ @@ -64,6 +70,7 @@ class manager * * @param \phpbb\auth\auth $auth Auth object * @param \phpbb\db\driver\driver_interface $db Database object + * @param \phpbb\event\dispatcher $dispatcher Event dispatcher object * @param \phpbb\request\request $request Request object * @param \phpbb\template\template $template Template object * @param \phpbb\di\service_collection $type_collection @@ -72,10 +79,11 @@ class manager * @param string $fields_language_table * @param string $fields_data_table */ - public function __construct(\phpbb\auth\auth $auth, \phpbb\db\driver\driver_interface $db, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\di\service_collection $type_collection, \phpbb\user $user, $fields_table, $fields_language_table, $fields_data_table) + public function __construct(\phpbb\auth\auth $auth, \phpbb\db\driver\driver_interface $db, \phpbb\event\dispatcher $dispatcher, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\di\service_collection $type_collection, \phpbb\user $user, $fields_table, $fields_language_table, $fields_data_table) { $this->auth = $auth; $this->db = $db; + $this->dispatcher = $dispatcher; $this->request = $request; $this->template = $template; $this->type_collection = $type_collection; @@ -313,6 +321,17 @@ class manager } $this->db->sql_freeresult($result); + /** + * Event to modify profile fields data retrieved from the database + * + * @event core.grab_profile_fields_data + * @var array user_ids Single user id or an array of ids + * @var array field_data Array with profile fields data + * @since 3.1.0-b3 + */ + $vars = array('user_ids', 'field_data'); + extract($this->dispatcher->trigger_event('core.grab_profile_fields_data', compact($vars))); + $user_fields = array(); // Go through the fields in correct order @@ -351,6 +370,18 @@ class manager $tpl_fields = array(); $tpl_fields['row'] = $tpl_fields['blockrow'] = array(); + /** + * Event to modify data of the generated profile fields, before the template assignment loop + * + * @event core.generate_profile_fields_template_data_before + * @var array profile_row Array with users profile field data + * @var array tpl_fields Array with template data fields + * @var bool use_contact_fields Should we display contact fields as such? + * @since 3.1.0-b3 + */ + $vars = array('profile_row', 'tpl_fields', 'use_contact_fields'); + extract($this->dispatcher->trigger_event('core.generate_profile_fields_template_data_before', compact($vars))); + foreach ($profile_row as $ident => $ident_ary) { $profile_field = $this->type_collection[$ident_ary['data']['field_type']]; @@ -404,6 +435,18 @@ class manager ); } + /** + * Event to modify template data of the generated profile fields + * + * @event core.generate_profile_fields_template_data + * @var array profile_row Array with users profile field data + * @var array tpl_fields Array with template data fields + * @var bool use_contact_fields Should we display contact fields as such? + * @since 3.1.0-b3 + */ + $vars = array('profile_row', 'tpl_fields', 'use_contact_fields'); + extract($this->dispatcher->trigger_event('core.generate_profile_fields_template_data', compact($vars))); + return $tpl_fields; } diff --git a/phpBB/styles/prosilver/template/navbar_header.html b/phpBB/styles/prosilver/template/navbar_header.html index 7fbaa1254f..2347b044a3 100644 --- a/phpBB/styles/prosilver/template/navbar_header.html +++ b/phpBB/styles/prosilver/template/navbar_header.html @@ -6,7 +6,7 @@ <li class="small-icon icon-home breadcrumbs"> <!-- IF U_SITE_HOME --><span class="crumb"><a href="{U_SITE_HOME}"{$MICRODATA}>{L_SITE_HOME}</a></span><!-- ENDIF --> <span class="crumb"><a href="{U_INDEX}" accesskey="h"{$MICRODATA}>{L_INDEX}</a></span> - <!-- BEGIN navlinks --><span class="crumb"><a href="{navlinks.U_VIEW_FORUM}"{$MICRODATA}>{navlinks.FORUM_NAME}</a></span><!-- END navlinks --> + <!-- BEGIN navlinks --><!-- EVENT overall_header_navlink_prepend --><span class="crumb"><a href="{navlinks.U_VIEW_FORUM}"{$MICRODATA}>{navlinks.FORUM_NAME}</a></span><!-- EVENT overall_header_navlink_append --><!-- END navlinks --> <!-- EVENT overall_header_breadcrumb_append --> </li> diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index a54b84757c..94fad55ae9 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -261,7 +261,6 @@ a#logo:hover { } .navbar { - padding: 0 10px; padding: 5px 10px 5px 10px; border-radius: 7px; } diff --git a/phpBB/styles/subsilver2/template/breadcrumbs.html b/phpBB/styles/subsilver2/template/breadcrumbs.html index 47cb82c790..646525c206 100644 --- a/phpBB/styles/subsilver2/template/breadcrumbs.html +++ b/phpBB/styles/subsilver2/template/breadcrumbs.html @@ -2,7 +2,7 @@ <table class="tablebg" width="100%" cellspacing="1" cellpadding="0" style="margin-top: 5px;"> <tr> <td class="row1"> - <p class="breadcrumbs"><!-- IF U_SITE_HOME --><a href="{U_SITE_HOME}"{$MICRODATA}>{L_SITE_HOME}</a> <strong>»</strong> <!-- ENDIF --><a href="{U_INDEX}"{$MICRODATA}>{L_INDEX}</a><!-- BEGIN navlinks --> » <a href="{navlinks.U_VIEW_FORUM}"{$MICRODATA}>{navlinks.FORUM_NAME}</a><!-- END navlinks --> + <p class="breadcrumbs"><!-- IF U_SITE_HOME --><a href="{U_SITE_HOME}"{$MICRODATA}>{L_SITE_HOME}</a> <strong>»</strong> <!-- ENDIF --><a href="{U_INDEX}"{$MICRODATA}>{L_INDEX}</a><!-- BEGIN navlinks --><!-- EVENT overall_header_navlink_prepend --> » <a href="{navlinks.U_VIEW_FORUM}"{$MICRODATA}>{navlinks.FORUM_NAME}</a><!-- EVENT overall_header_navlink_append --><!-- END navlinks --> <!-- EVENT overall_header_breadcrumb_append --></p> <!-- EVENT overall_footer_timezone_before --> <p class="datetime">{S_TIMEZONE}</p> |