diff options
91 files changed, 1755 insertions, 1044 deletions
diff --git a/phpBB/adm/style/install_update.html b/phpBB/adm/style/install_update.html index f0df138641..898233f72d 100644 --- a/phpBB/adm/style/install_update.html +++ b/phpBB/adm/style/install_update.html @@ -184,72 +184,105 @@ <form id="install_update" method="post" action="{U_UPDATE_ACTION}"> - <!-- IF .up_to_date --> - <h2>{L_FILES_UP_TO_DATE}</h2> - <p>{L_FILES_UP_TO_DATE_EXPLAIN}</p> - - <fieldset> - <legend><img src="{T_IMAGE_PATH}file_up_to_date.gif" alt="{L_STATUS_UP_TO_DATE}" /></legend> - <!-- BEGIN up_to_date --> + <!-- IF .deleted --> + <h2>{L_FILES_DELETED}</h2> + <div style="float: {S_CONTENT_FLOW_END};">» <a href="#" onclick="phpbb.toggleDisplay('deleted', 0); return false;">{L_TOGGLE_DISPLAY}</a></div> + <p>{L_FILES_DELETED_EXPLAIN}</p> + + <fieldset id="deleted"> + <legend><img src="{T_IMAGE_PATH}icon_delete.gif" alt="{L_STATUS_DELETED}" /></legend> + <!-- BEGIN deleted --> <dl> - <dd class="full" style="text-align: {S_CONTENT_FLOW_BEGIN};"><strong>{up_to_date.FILENAME}</strong></dd> + <dt style="width: 60%;"><strong><!-- IF deleted.DIR_PART -->{deleted.DIR_PART}<br /><!-- ENDIF -->{deleted.FILE_PART}</strong></dt> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;"> + <!-- IF not deleted.S_BINARY -->[<a href="{deleted.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{deleted.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --> + </dd> </dl> - <!-- END up_to_date --> + <!-- END deleted --> </fieldset> <!-- ENDIF --> - <!-- IF .new --> - <h2>{L_FILES_NEW}</h2> - <p>{L_FILES_NEW_EXPLAIN}</p> + <!-- IF .conflict --> + <h2>{L_FILES_CONFLICT}</h2> + <div style="float: {S_CONTENT_FLOW_END};">» <a href="#" onclick="phpbb.toggleDisplay('conflict', 0); return false;">{L_TOGGLE_DISPLAY}</a></div> + <p>{L_FILES_CONFLICT_EXPLAIN}</p> - <fieldset> - <legend><img src="{T_IMAGE_PATH}file_new.gif" alt="{L_STATUS_NEW}" /></legend> - <!-- BEGIN new --> + <!-- BEGIN conflict --> + <fieldset id="conflict"> + <legend><img src="{T_IMAGE_PATH}file_conflict.gif" alt="{L_STATUS_CONFLICT}" /></legend> <dl> - <dt style="width: 60%;"><strong><!-- IF new.DIR_PART -->{new.DIR_PART}<br /><!-- ENDIF -->{new.FILE_PART}</strong> - <!-- IF new.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{new.CUSTOM_ORIGINAL}</span><!-- ENDIF --> - </dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"> - <!-- IF not new.S_BINARY -->[<a href="{new.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --> - </dd> - <!-- IF new.S_CUSTOM --> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{new.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd> - <!-- ENDIF --> + <dt style="width: 60%;"><strong><!-- IF conflict.DIR_PART -->{conflict.DIR_PART}<br /><!-- ENDIF -->{conflict.FILE_PART}</strong> + <!-- IF conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF --> + <!-- IF conflict.NUM_CONFLICTS --><br /><span>{L_NUM_CONFLICTS}{L_COLON} {conflict.NUM_CONFLICTS}</span><!-- ENDIF --> + </dt> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"> + <!-- IF not conflict.S_BINARY -->[<a href="{conflict.U_SHOW_DIFF}">{L_DOWNLOAD_CONFLICTS}</a>]<br />{L_DOWNLOAD_CONFLICTS_EXPLAIN} + <!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --> + </dd> + <!-- IF conflict.S_CUSTOM --> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd> + <!-- ENDIF --> </dl> - <!-- END new --> + <!-- IF conflict.S_BINARY --> + <dl> + <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="1" checked="checked" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"> </dd> + </dl> + <!-- ELSE --> + <dl> + <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="3" checked="checked" /> {L_MERGE_NEW_FILE_OPTION}</label></dt> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_NEW_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd> + </dl> + <dl> + <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="4" /> {L_MERGE_MOD_FILE_OPTION}</label></dt> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_MOD_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd> + </dl> + <dl> + <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="1" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd> + </dl> + <dl> + <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="2" /> {L_MERGE_NO_MERGE_MOD_OPTION}</label></dt> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_MOD}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd> + </dl> + <!-- ENDIF --> </fieldset> + <!-- END conflict --> <!-- ENDIF --> - <!-- IF .not_modified --> - <h2>{L_FILES_NOT_MODIFIED}</h2> - <div style="float: {S_CONTENT_FLOW_END};">» <a href="#" onclick="phpbb.toggleDisplay('not_modified', 0); return false;">{L_TOGGLE_DISPLAY}</a></div> - <p>{L_FILES_NOT_MODIFIED_EXPLAIN}</p> + <!-- IF .new_conflict --> + <h2>{L_FILES_NEW_CONFLICT}</h2> + <div style="float: {S_CONTENT_FLOW_END};">» <a href="#" onclick="phpbb.toggleDisplay('new_conflict', 0); return false;">{L_TOGGLE_DISPLAY}</a></div> + <p>{L_FILES_NEW_CONFLICT_EXPLAIN}</p> - <fieldset id="not_modified" style="display: none;"> - <legend><img src="{T_IMAGE_PATH}file_not_modified.gif" alt="{L_STATUS_NOT_MODIFIED}" /></legend> - <!-- BEGIN not_modified --> + <fieldset id="new_conflict"> + <legend><img src="{T_IMAGE_PATH}file_new_conflict.gif" alt="{L_STATUS_NEW_CONFLICT}" /></legend> + <!-- BEGIN new_conflict --> <dl> - <dt style="width: 60%;"><strong><!-- IF not_modified.DIR_PART -->{not_modified.DIR_PART}<br /><!-- ENDIF -->{not_modified.FILE_PART}</strong> - <!-- IF not_modified.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{not_modified.CUSTOM_ORIGINAL}</span><!-- ENDIF --> - </dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><!-- IF not not_modified.S_BINARY -->[<a href="{not_modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{not_modified.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd> - <!-- IF not_modified.S_CUSTOM --> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{not_modified.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd> - <!-- ENDIF --> + <dt style="width: 60%;"><strong><!-- IF new_conflict.DIR_PART -->{new_conflict.DIR_PART}<br /><!-- ENDIF -->{new_conflict.FILE_PART}</strong> + <!-- IF new_conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{new_conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF --> + </dt> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"> + <!-- IF not new_conflict.S_BINARY -->[<a href="{new_conflict.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new_conflict.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --> + </dd> + <!-- IF new_conflict.S_CUSTOM --> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{new_conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd> + <!-- ENDIF --> </dl> - <!-- END not_modified --> + <!-- END new_conflict --> </fieldset> <!-- ENDIF --> <!-- IF .modified --> <h2>{L_FILES_MODIFIED}</h2> + <div style="float: {S_CONTENT_FLOW_END};">» <a href="#" onclick="phpbb.toggleDisplay('modified', 0); return false;">{L_TOGGLE_DISPLAY}</a></div> <p>{L_FILES_MODIFIED_EXPLAIN}</p> <!-- BEGIN modified --> - <fieldset> + <fieldset id="modified"> <legend><img src="{T_IMAGE_PATH}file_modified.gif" alt="{L_STATUS_MODIFIED}" /></legend> <dl> <dt style="width: 60%;"><strong><!-- IF modified.DIR_PART -->{modified.DIR_PART}<br /><!-- ENDIF -->{modified.FILE_PART}</strong> @@ -277,74 +310,65 @@ <!-- ENDIF --> - <!-- IF .new_conflict --> - <h2>{L_FILES_NEW_CONFLICT}</h2> - <p>{L_FILES_NEW_CONFLICT_EXPLAIN}</p> + <!-- IF .new --> + <h2>{L_FILES_NEW}</h2> + <div style="float: {S_CONTENT_FLOW_END};">» <a href="#" onclick="phpbb.toggleDisplay('new_files', 0); return false;">{L_TOGGLE_DISPLAY}</a></div> + <p>{L_FILES_NEW_EXPLAIN}</p> - <fieldset> - <legend><img src="{T_IMAGE_PATH}file_new_conflict.gif" alt="{L_STATUS_NEW_CONFLICT}" /></legend> - <!-- BEGIN new_conflict --> + <fieldset id="new_files" style="display: none;"> + <legend><img src="{T_IMAGE_PATH}file_new.gif" alt="{L_STATUS_NEW}" /></legend> + <!-- BEGIN new --> <dl> - <dt style="width: 60%;"><strong><!-- IF new_conflict.DIR_PART -->{new_conflict.DIR_PART}<br /><!-- ENDIF -->{new_conflict.FILE_PART}</strong> - <!-- IF new_conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{new_conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF --> + <dt style="width: 60%;"><strong><!-- IF new.DIR_PART -->{new.DIR_PART}<br /><!-- ENDIF -->{new.FILE_PART}</strong> + <!-- IF new.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{new.CUSTOM_ORIGINAL}</span><!-- ENDIF --> </dt> <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"> - <!-- IF not new_conflict.S_BINARY -->[<a href="{new_conflict.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new_conflict.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --> + <!-- IF not new.S_BINARY -->[<a href="{new.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --> </dd> - <!-- IF new_conflict.S_CUSTOM --> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{new_conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd> + <!-- IF new.S_CUSTOM --> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{new.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd> <!-- ENDIF --> </dl> - <!-- END new_conflict --> + <!-- END new --> </fieldset> <!-- ENDIF --> - <!-- IF .conflict --> - <h2>{L_FILES_CONFLICT}</h2> - <p>{L_FILES_CONFLICT_EXPLAIN}</p> + <!-- IF .not_modified --> + <h2>{L_FILES_NOT_MODIFIED}</h2> + <div style="float: {S_CONTENT_FLOW_END};">» <a href="#" onclick="phpbb.toggleDisplay('not_modified', 0); return false;">{L_TOGGLE_DISPLAY}</a></div> + <p>{L_FILES_NOT_MODIFIED_EXPLAIN}</p> - <!-- BEGIN conflict --> - <fieldset> - <legend><img src="{T_IMAGE_PATH}file_conflict.gif" alt="{L_STATUS_CONFLICT}" /></legend> + <fieldset id="not_modified" style="display: none;"> + <legend><img src="{T_IMAGE_PATH}file_not_modified.gif" alt="{L_STATUS_NOT_MODIFIED}" /></legend> + <!-- BEGIN not_modified --> <dl> - <dt style="width: 60%;"><strong><!-- IF conflict.DIR_PART -->{conflict.DIR_PART}<br /><!-- ENDIF -->{conflict.FILE_PART}</strong> - <!-- IF conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF --> - <!-- IF conflict.NUM_CONFLICTS --><br /><span>{L_NUM_CONFLICTS}{L_COLON} {conflict.NUM_CONFLICTS}</span><!-- ENDIF --> + <dt style="width: 60%;"><strong><!-- IF not_modified.DIR_PART -->{not_modified.DIR_PART}<br /><!-- ENDIF -->{not_modified.FILE_PART}</strong> + <!-- IF not_modified.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{not_modified.CUSTOM_ORIGINAL}</span><!-- ENDIF --> </dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"> - <!-- IF not conflict.S_BINARY -->[<a href="{conflict.U_SHOW_DIFF}">{L_DOWNLOAD_CONFLICTS}</a>]<br />{L_DOWNLOAD_CONFLICTS_EXPLAIN} - <!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --> - </dd> - <!-- IF conflict.S_CUSTOM --> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><!-- IF not not_modified.S_BINARY -->[<a href="{not_modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{not_modified.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd> + <!-- IF not_modified.S_CUSTOM --> + <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{not_modified.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd> <!-- ENDIF --> </dl> - <!-- IF conflict.S_BINARY --> - <dl> - <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="1" checked="checked" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"> </dd> - </dl> - <!-- ELSE --> - <dl> - <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="3" checked="checked" /> {L_MERGE_NEW_FILE_OPTION}</label></dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_NEW_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd> - </dl> - <dl> - <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="4" /> {L_MERGE_MOD_FILE_OPTION}</label></dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_MOD_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd> - </dl> - <dl> - <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="1" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd> - </dl> - <dl> - <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="2" /> {L_MERGE_NO_MERGE_MOD_OPTION}</label></dt> - <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_MOD}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd> - </dl> - <!-- ENDIF --> + <!-- END not_modified --> + </fieldset> + + <!-- ENDIF --> + + <!-- IF .up_to_date --> + <h2>{L_FILES_UP_TO_DATE}</h2> + <div style="float: {S_CONTENT_FLOW_END};">» <a href="#" onclick="phpbb.toggleDisplay('up_to_date', 0); return false;">{L_TOGGLE_DISPLAY}</a></div> + <p>{L_FILES_UP_TO_DATE_EXPLAIN}</p> + + <fieldset id="up_to_date" style="display: none;"> + <legend><img src="{T_IMAGE_PATH}file_up_to_date.gif" alt="{L_STATUS_UP_TO_DATE}" /></legend> + <!-- BEGIN up_to_date --> + <dl> + <dd class="full" style="text-align: {S_CONTENT_FLOW_BEGIN};"><strong>{up_to_date.FILENAME}</strong></dd> + </dl> + <!-- END up_to_date --> </fieldset> - <!-- END conflict --> <!-- ENDIF --> diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index 785aa141f0..2c35875dca 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -1296,11 +1296,29 @@ phpbb.toggleDropdown = function() { else if ((offset + width + 2) > windowWidth) { $this.css('margin-left', (windowWidth - offset - width - 2) + 'px'); } + + // Check whether the vertical scrollbar is present. + $this.toggleClass('dropdown-nonscroll', this.scrollHeight === $this.innerHeight()); + }); var freeSpace = parent.offset().left - 4; if (direction == 'left') { options.dropdown.css('margin-left', '-' + freeSpace + 'px'); + + // Try to position the notification dropdown correctly in RTL-responsive mode + if (options.dropdown.hasClass('dropdown-extended')) { + var contentWidth, + fullFreeSpace = freeSpace + parent.outerWidth(); + + options.dropdown.find('.dropdown-contents').each(function() { + contentWidth = parseInt($(this).outerWidth()); + $(this).css({marginLeft: 0, left: 0}); + }); + + var maxOffset = Math.min(contentWidth, fullFreeSpace) + 'px'; + options.dropdown.css({'width': maxOffset, 'margin-left': '-' + maxOffset}); + } } else { options.dropdown.css('margin-right', '-' + (windowWidth + freeSpace) + 'px'); } diff --git a/phpBB/common.php b/phpBB/common.php index 4b06cd1eda..e96a34938a 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -95,6 +95,8 @@ $phpbb_class_loader->register(); $phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx); $phpbb_class_loader_ext->register(); +phpbb_load_extensions_autoloaders($phpbb_root_path); + // Set up container $phpbb_container = phpbb_create_default_container($phpbb_root_path, $phpEx); diff --git a/phpBB/config/services.yml b/phpBB/config/services.yml index e0826f9165..735a49c99b 100644 --- a/phpBB/config/services.yml +++ b/phpBB/config/services.yml @@ -260,7 +260,6 @@ services: arguments: - @auth - @config - - @config_text - @dbal.conn - @user - %core.root_path% @@ -360,3 +359,6 @@ services: - @cache - @config - @user + + viewonline_helper: + class: phpbb\viewonline_helper diff --git a/phpBB/docs/CREDITS.txt b/phpBB/docs/CREDITS.txt index a4ba4cb87c..edb6361b2a 100644 --- a/phpBB/docs/CREDITS.txt +++ b/phpBB/docs/CREDITS.txt @@ -28,6 +28,7 @@ phpBB Developers: bantu (Andreas Fischer) imkingdavid (David King) marc1706 (Marc Alexander) nickvergessen (Joas Schilling) + nicofuma (Tristan Darricau) prototech (Cesar Gallegos) For a list of phpBB Team members, please see: diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 34f2c4b6ec..f1c03672c3 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -246,21 +246,21 @@ index_body_block_stats_prepend * Since: 3.1.0-b3 * Purpose: Prepend content to the statistics list on the Board index -index_body_linklist_after +index_body_markforums_after === * Locations: + styles/prosilver/template/index_body.html + styles/subsilver2/template/index_body.html -* Since: 3.1.0-a3 -* Purpose: Add content after the linklist above the forum list on Board index +* Since: 3.1.0-RC2 +* Purpose: Add content after the mark-read link above the forum list on Board index -index_body_linklist_before +index_body_markforums_before === * Locations: + styles/prosilver/template/index_body.html + styles/subsilver2/template/index_body.html -* Since: 3.1.0-a3 -* Purpose: Add content before the linklist above the forum list on Board index +* Since: 3.1.0-RC2 +* Purpose: Add content before the mark-read link above the forum list on Board index index_body_stat_blocks_after === @@ -344,25 +344,54 @@ memberlist_view_user_statistics_before * Since: 3.1.0-a1 * Purpose: Add entries before the user statistics part of any user profile -navbar_header_username_append +navbar_header_logged_out_content === * Locations: + styles/prosilver/template/navbar_header.html -* Since: 3.1.0-b4 -* Purpose: Add text and HTMl after the username shown in the navbar. +* Since: 3.1.0-RC1 +* Purpose: Add text and HTML in place of the username when not logged in. -navbar_header_logged_out_content +navbar_header_profile_list_after === * Locations: + styles/prosilver/template/navbar_header.html -* Since: 3.1.0-b4 -* Purpose: Add text and HTML in place of the username when not logged in. +* Since: 3.1.0-RC2 +* Purpose: Add links to the bottom of the profile drop-down menu in the header navbar + +navbar_header_profile_list_before +=== +* Locations: + + styles/prosilver/template/navbar_header.html +* Since: 3.1.0-RC2 +* Purpose: Add links to the top of the profile drop-down menu in the header navbar + +navbar_header_quick_links_after +=== +* Locations: + + styles/prosilver/template/navbar_header.html +* Since: 3.1.0-RC2 +* Purpose: Add links to the bottom of the quick-links drop-down menu in the header + +navbar_header_quick_links_before +=== +* Locations: + + styles/prosilver/template/navbar_header.html +* Since: 3.1.0-RC2 +* Purpose: Add links to the top of the quick-links drop-down menu in the header + +navbar_header_username_append +=== +* Locations: + + styles/prosilver/template/navbar_header.html +* Since: 3.1.0-RC1 +* Purpose: Add text and HTMl after the username shown in the navbar. navbar_header_username_prepend === * Locations: + styles/prosilver/template/navbar_header.html -* Since: 3.1.0-b4 +* Since: 3.1.0-RC1 +* Purpose: Add text and HTMl before the username shown in the navbar. overall_footer_after === diff --git a/phpBB/download/file.php b/phpBB/download/file.php index d00b852ad1..abafeee667 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -59,6 +59,8 @@ if (isset($_GET['avatar'])) $phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx); $phpbb_class_loader_ext->register(); + phpbb_load_extensions_autoloaders($phpbb_root_path); + // Set up container $phpbb_container = phpbb_create_default_container($phpbb_root_path, $phpEx); diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 74df9240a1..1811748c2f 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -410,7 +410,7 @@ class acp_board 'ip_check' => array('lang' => 'IP_VALID', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_ip_check', 'explain' => true), 'browser_check' => array('lang' => 'BROWSER_VALID', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'forwarded_for_check' => array('lang' => 'FORWARDED_FOR_VALID', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'referer_validation' => array('lang' => 'REFERER_VALID', 'validate' => 'int:0:3','type' => 'custom', 'method' => 'select_ref_check', 'explain' => true), + 'referer_validation' => array('lang' => 'REFERRER_VALID', 'validate' => 'int:0:3','type' => 'custom', 'method' => 'select_ref_check', 'explain' => true), 'check_dnsbl' => array('lang' => 'CHECK_DNSBL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'email_check_mx' => array('lang' => 'EMAIL_CHECK_MX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'max_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:8:255', 'type' => false, 'method' => false, 'explain' => false,), diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index b2a6820461..aba9caaece 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -137,7 +137,7 @@ class acp_extensions trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING); } - if ($phpbb_extension_manager->enabled($ext_name)) + if ($phpbb_extension_manager->is_enabled($ext_name)) { redirect($this->u_action); } @@ -162,7 +162,7 @@ class acp_extensions trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING); } - if ($phpbb_extension_manager->enabled($ext_name)) + if ($phpbb_extension_manager->is_enabled($ext_name)) { redirect($this->u_action); } @@ -194,7 +194,7 @@ class acp_extensions break; case 'disable_pre': - if (!$phpbb_extension_manager->enabled($ext_name)) + if (!$phpbb_extension_manager->is_enabled($ext_name)) { redirect($this->u_action); } @@ -209,7 +209,7 @@ class acp_extensions break; case 'disable': - if (!$phpbb_extension_manager->enabled($ext_name)) + if (!$phpbb_extension_manager->is_enabled($ext_name)) { redirect($this->u_action); } @@ -234,7 +234,7 @@ class acp_extensions break; case 'delete_data_pre': - if ($phpbb_extension_manager->enabled($ext_name)) + if ($phpbb_extension_manager->is_enabled($ext_name)) { redirect($this->u_action); } @@ -248,7 +248,7 @@ class acp_extensions break; case 'delete_data': - if ($phpbb_extension_manager->enabled($ext_name)) + if ($phpbb_extension_manager->is_enabled($ext_name)) { redirect($this->u_action); } diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 7d367ebb84..9d5770069d 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -21,6 +21,37 @@ if (!defined('IN_PHPBB')) // Common global functions /** +* Load the autoloaders added by the extensions. +* +* @param string $phpbb_root_path Path to the phpbb root directory. +*/ +function phpbb_load_extensions_autoloaders($phpbb_root_path) +{ + $iterator = new \RecursiveIteratorIterator( + new \phpbb\recursive_dot_prefix_filter_iterator( + new \RecursiveDirectoryIterator( + $phpbb_root_path . 'ext/', + \FilesystemIterator::SKIP_DOTS + ) + ), + \RecursiveIteratorIterator::SELF_FIRST + ); + $iterator->setMaxDepth(2); + + foreach ($iterator as $file_info) + { + if ($file_info->getFilename() === 'vendor' && $iterator->getDepth() === 2) + { + $filename = $file_info->getRealPath() . '/autoload.php'; + if (file_exists($filename)) + { + require $filename; + } + } + } +} + +/** * Casts a variable to the given type. * * @deprecated @@ -4881,6 +4912,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id = 'PRIVATE_MESSAGE_COUNT' => (!empty($user->data['user_unread_privmsg'])) ? $user->data['user_unread_privmsg'] : 0, 'CURRENT_USER_AVATAR' => phpbb_get_user_avatar($user->data), + 'CURRENT_USERNAME_SIMPLE' => get_username_string('no_profile', $user->data['user_id'], $user->data['username'], $user->data['user_colour']), 'CURRENT_USERNAME_FULL' => get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour']), 'UNREAD_NOTIFICATIONS_COUNT' => ($notifications !== false) ? $notifications['unread_count'] : '', 'NOTIFICATIONS_COUNT' => ($notifications !== false) ? $notifications['unread_count'] : '', diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 74b3e0c70f..ee78364083 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -174,8 +174,9 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list $template->assign_block_vars('jumpbox_forums', array( 'FORUM_ID' => ($select_all) ? 0 : -1, 'FORUM_NAME' => ($select_all) ? $user->lang['ALL_FORUMS'] : $user->lang['SELECT_FORUM'], - 'S_FORUM_COUNT' => $iteration) - ); + 'S_FORUM_COUNT' => $iteration, + 'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $forum_id)), + )); $iteration++; $display_jumpbox = true; @@ -188,8 +189,9 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list 'S_FORUM_COUNT' => $iteration, 'S_IS_CAT' => ($row['forum_type'] == FORUM_CAT) ? true : false, 'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false, - 'S_IS_POST' => ($row['forum_type'] == FORUM_POST) ? true : false) - ); + 'S_IS_POST' => ($row['forum_type'] == FORUM_POST) ? true : false, + 'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $row['forum_id'])), + )); for ($i = 0; $i < $padding; $i++) { @@ -1334,9 +1336,9 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', global $phpbb_root_path, $phpEx; $_profile_cache['base_url'] = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u={USER_ID}'); - $_profile_cache['tpl_noprofile'] = '{USERNAME}'; + $_profile_cache['tpl_noprofile'] = '<span class="username">{USERNAME}</span>'; $_profile_cache['tpl_noprofile_colour'] = '<span style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</span>'; - $_profile_cache['tpl_profile'] = '<a href="{PROFILE_URL}">{USERNAME}</a>'; + $_profile_cache['tpl_profile'] = '<a href="{PROFILE_URL}" class="username">{USERNAME}</a>'; $_profile_cache['tpl_profile_colour'] = '<a href="{PROFILE_URL}" style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</a>'; } @@ -1452,16 +1454,19 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', /** * Add an option to the quick-mod tools. * + * @param string $url The recepting URL for the quickmod actions. * @param string $option The language key for the value of the option. * @param string $lang_string The language string to use. */ -function phpbb_add_quickmod_option($option, $lang_string) +function phpbb_add_quickmod_option($url, $option, $lang_string) { - global $template, $user; + global $template, $user, $phpbb_path_helper; + $lang_string = $user->lang($lang_string); $template->assign_block_vars('quickmod', array( - 'VALUE' => $option, - 'TITLE' => $lang_string, + 'VALUE' => $option, + 'TITLE' => $lang_string, + 'LINK' => $phpbb_path_helper->append_url_params($url, array('action' => $option)), )); } diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index f42200d249..94383b935f 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -85,7 +85,16 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) // Editing information if ($message_row['message_edit_count'] && $config['display_last_edited']) { - $l_edited_by = '<br /><br />' . $user->lang('EDITED_TIMES_TOTAL', (int) $message_row['message_edit_count'], (!$message_row['message_edit_user']) ? $message_row['username'] : $message_row['message_edit_user'], $user->format_date($message_row['message_edit_time'], false, true)); + if (!$message_row['message_edit_user']) + { + $display_username = get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour']); + } + else + { + $edit_user_info = get_user_information($message_row['message_edit_user'], false); + $display_username = get_username_string('full', $message_row['message_edit_user'], $edit_user_info['username'], $edit_user_info['user_colour']); + } + $l_edited_by = '<br /><br />' . $user->lang('EDITED_TIMES_TOTAL', (int) $message_row['message_edit_count'], $display_username, $user->format_date($message_row['message_edit_time'], false, true)); } else { diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index ab5fcc3f2b..c6f771a7d5 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -396,7 +396,7 @@ class install_update extends module 'S_COLLECTED' => (int) $update_list['status'], 'S_TO_COLLECT' => sizeof($this->update_info['files']), 'L_IN_PROGRESS' => $user->lang['COLLECTING_FILE_DIFFS'], - 'L_IN_PROGRESS_EXPLAIN' => sprintf($user->lang['NUMBER_OF_FILES_COLLECTED'], (int) $update_list['status'], sizeof($this->update_info['files'])), + 'L_IN_PROGRESS_EXPLAIN' => sprintf($user->lang['NUMBER_OF_FILES_COLLECTED'], (int) $update_list['status'], sizeof($this->update_info['files']) + sizeof($this->update_info['deleted'])), )); return; @@ -422,7 +422,7 @@ class install_update extends module // Now assign the list to the template foreach ($update_list as $status => $filelist) { - if ($status == 'no_update' || !sizeof($filelist) || $status == 'status') + if ($status == 'no_update' || !sizeof($filelist) || $status == 'status' || $status == 'status_deleted') { continue; } @@ -489,7 +489,7 @@ class install_update extends module $all_up_to_date = true; foreach ($update_list as $status => $filelist) { - if ($status != 'up_to_date' && $status != 'custom' && $status != 'status' && sizeof($filelist)) + if ($status != 'up_to_date' && $status != 'custom' && $status != 'status' && $status != 'status_deleted' && sizeof($filelist)) { $all_up_to_date = false; break; @@ -831,7 +831,7 @@ class install_update extends module foreach ($update_list as $status => $files) { - if ($status == 'up_to_date' || $status == 'no_update' || $status == 'status') + if ($status == 'up_to_date' || $status == 'no_update' || $status == 'status' || $status == 'status_deleted') { continue; } @@ -1221,6 +1221,16 @@ class install_update extends module $this->page_title = 'VIEWING_FILE_CONTENTS'; break; + + case 'deleted': + + $diff = $this->return_diff(array(), $phpbb_root_path . $original_file); + + $template->assign_var('S_DIFF_NEW_FILE', true); + $diff_mode = 'inline'; + $this->page_title = 'VIEWING_FILE_CONTENTS'; + + break; } $diff_mode_options = ''; @@ -1266,7 +1276,9 @@ class install_update extends module 'new_conflict' => array(), 'conflict' => array(), 'no_update' => array(), + 'deleted' => array(), 'status' => 0, + 'status_deleted'=> 0, ); } @@ -1345,7 +1357,31 @@ class install_update extends module $update_list['status']++; } + foreach ($this->update_info['deleted'] as $index => $file) + { + if (is_int($update_list['status_deleted']) && $index < $update_list['status_deleted']) + { + continue; + } + + if ($num_bytes_processed >= 500 * 1024) + { + return; + } + + if (file_exists($phpbb_root_path . $file)) + { + $update_list['deleted'][] = array('filename' => $file, 'custom' => false, 'as_expected' => false); + $num_bytes_processed += filesize($phpbb_root_path . $file); + } + + $update_list['status_deleted']++; + $update_list['status']++; + } + + $update_list['status_deleted'] = -1; $update_list['status'] = -1; + /* if (!sizeof($this->update_info['files'])) { return $update_list; diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 638e9907ac..d451bdd515 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -524,8 +524,8 @@ $lang = array_merge($lang, array( 'PASS_TYPE_SYMBOL' => 'Must contain symbols', 'REF_HOST' => 'Only validate host', 'REF_PATH' => 'Also validate path', - 'REFERER_VALID' => 'Validate Referer', - 'REFERER_VALID_EXPLAIN' => 'If enabled, the referer of POST requests will be checked against the host/script path settings. This may cause issues with boards using several domains and or external logins.', + 'REFERRER_VALID' => 'Validate Referrer', + 'REFERRER_VALID_EXPLAIN' => 'If enabled, the referrer of POST requests will be checked against the host/script path settings. This may cause issues with boards using several domains and or external logins.', 'TPL_ALLOW_PHP' => 'Allow php in templates', 'TPL_ALLOW_PHP_EXPLAIN' => 'If this option is enabled, <code>PHP</code> and <code>INCLUDEPHP</code> statements will be recognised and parsed in templates.', )); diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 8470014161..b374e39367 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -702,7 +702,7 @@ $lang = array_merge($lang, array( 'LOG_REASON_REMOVED' => '<strong>Removed report/denial reason</strong><br />» %s', 'LOG_REASON_UPDATED' => '<strong>Updated report/denial reason</strong><br />» %s', - 'LOG_REFERER_INVALID' => '<strong>Referer validation failed</strong><br />»Referer was “<em>%1$s</em>”. The request was rejected and the session killed.', + 'LOG_REFERER_INVALID' => '<strong>Referrer validation failed</strong><br />»Referrer was “<em>%1$s</em>”. The request was rejected and the session killed.', 'LOG_RESET_DATE' => '<strong>Board start date reset</strong>', 'LOG_RESET_ONLINE' => '<strong>Most users online reset</strong>', 'LOG_RESYNC_FILES_STATS' => '<strong>File statistics resynchronised</strong>', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 61baef663b..dbef16c5f2 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -64,7 +64,7 @@ $lang = array_merge($lang, array( 'ACCOUNT_DEACTIVATED' => 'Your account has been manually deactivated and is only able to be reactivated by an administrator.', 'ACCOUNT_NOT_ACTIVATED' => 'Your account has not been activated yet.', 'ACP' => 'Administration Control Panel', - 'ACP_SHORT' => 'Administer', + 'ACP_SHORT' => 'ACP', 'ACTIVE' => 'active', 'ACTIVE_ERROR' => 'The specified username is currently inactive. If you have problems activating your account, please contact a board administrator.', 'ADMINISTRATOR' => 'Administrator', @@ -393,7 +393,7 @@ $lang = array_merge($lang, array( 'MB' => 'MB', 'MIB' => 'MiB', 'MCP' => 'Moderator Control Panel', - 'MCP_SHORT' => 'Moderate', + 'MCP_SHORT' => 'MCP', 'MEMBERLIST' => 'Members', 'MEMBERLIST_EXPLAIN' => 'View complete list of members', 'MERGE' => 'Merge', @@ -595,6 +595,8 @@ $lang = array_merge($lang, array( 'PRIVATE_MESSAGING' => 'Private messaging', 'PROFILE' => 'User Control Panel', + 'QUICK_LINKS' => 'Quick links', + 'RANK' => 'Rank', 'READING_FORUM' => 'Viewing topics in %s', 'READING_GLOBAL_ANNOUNCE' => 'Reading global announcement', @@ -661,15 +663,15 @@ $lang = array_merge($lang, array( 'SEARCH_ADV_EXPLAIN' => 'View the advanced search options', 'SEARCH_KEYWORDS' => 'Search for keywords', 'SEARCHING_FORUMS' => 'Searching forums', - 'SEARCH_ACTIVE_TOPICS' => 'View active topics', + 'SEARCH_ACTIVE_TOPICS' => 'Active topics', 'SEARCH_FOR' => 'Search for', 'SEARCH_FORUM' => 'Search this forum…', - 'SEARCH_NEW' => 'View new posts', + 'SEARCH_NEW' => 'New posts', 'SEARCH_POSTS_BY' => 'Search posts by', - 'SEARCH_SELF' => 'View your posts', + 'SEARCH_SELF' => 'Your posts', 'SEARCH_TOPIC' => 'Search this topic…', - 'SEARCH_UNANSWERED' => 'View unanswered posts', - 'SEARCH_UNREAD' => 'View unread posts', + 'SEARCH_UNANSWERED' => 'Unanswered posts', + 'SEARCH_UNREAD' => 'Unread posts', 'SEARCH_USER_POSTS' => 'Search user’s posts', 'SECONDS' => 'Seconds', 'SEE_ALL' => 'See All', diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 2b7f377f5b..65448e3299 100644 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -345,7 +345,7 @@ $lang = array_merge($lang, array( 'SUB_LICENSE' => 'License', 'SUB_SUPPORT' => 'Support', 'SUCCESSFUL_CONNECT' => 'Successful connection', - 'SUPPORT_BODY' => 'Full support will be provided for the current stable release of phpBB3, free of charge. This includes:</p><ul><li>installation</li><li>configuration</li><li>technical questions</li><li>problems relating to potential bugs in the software</li><li>updating from Release Candidate (RC) versions to the latest stable version</li><li>converting from phpBB 2.0.x to phpBB3</li><li>converting from other discussion board software to phpBB3 (please see the <a href="https://www.phpbb.com/community/viewforum.php?f=65">Convertors Forum</a>)</li></ul><p>We encourage users still running beta versions of phpBB3 to replace their installation with a fresh copy of the latest version.</p><h2>MODs / Styles</h2><p>For issues relating to MODs, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=81">Modifications Forum</a>.<br />For issues relating to styles, templates and themes, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=80">Styles Forum</a>.<br /><br />If your question relates to a specific package, please post directly in the topic dedicated to the package.</p><h2>Obtaining Support</h2><p><a href="https://www.phpbb.com/community/viewtopic.php?f=14&t=571070">The phpBB Welcome Package</a><br /><a href="https://www.phpbb.com/support/">Support Section</a><br /><a href="https://www.phpbb.com/support/documentation/3.0/quickstart/">Quick Start Guide</a><br /><br />To ensure you stay up to date with the latest news and releases, why not <a href="https://www.phpbb.com/support/">subscribe to our mailing list</a>?<br /><br />', + 'SUPPORT_BODY' => 'Full support will be provided for the current stable release of phpBB3, free of charge. This includes:</p><ul><li>installation</li><li>configuration</li><li>technical questions</li><li>problems relating to potential bugs in the software</li><li>updating from Release Candidate (RC) versions to the latest stable version</li><li>converting from phpBB 2.0.x to phpBB3</li><li>converting from other discussion board software to phpBB3 (please see the <a href="https://www.phpbb.com/community/viewforum.php?f=486">Convertors Forum</a>)</li></ul><p>We encourage users still running beta versions of phpBB3 to replace their installation with a fresh copy of the latest version.</p><h2>Extensions / Styles</h2><p>For issues relating to Extensions, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=451">Extensions Forum</a>.<br />For issues relating to styles, templates and themes, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=471">Styles Forum</a>.<br /><br />If your question relates to a specific package, please post directly in the topic dedicated to the package.</p><h2>Obtaining Support</h2><p><a href="https://www.phpbb.com/community/viewtopic.php?f=14&t=571070">The phpBB Welcome Package</a><br /><a href="https://www.phpbb.com/support/">Support Section</a><br /><a href="https://www.phpbb.com/support/documentation/3.1/quickstart/">Quick Start Guide</a><br /><br />To ensure you stay up to date with the latest news and releases, why not <a href="https://www.phpbb.com/support/">subscribe to our mailing list</a>?<br /><br />', 'SYNC_FORUMS' => 'Starting to synchronise forums', 'SYNC_POST_COUNT' => 'Synchronising post_counts', 'SYNC_POST_COUNT_ID' => 'Synchronising post_counts from <var>entry</var> %1$s to %2$s.', @@ -427,6 +427,8 @@ $lang = array_merge($lang, array( 'FILE_USED' => 'Information used from', // Single file 'FILES_CONFLICT' => 'Conflict files', 'FILES_CONFLICT_EXPLAIN' => 'The following files are modified and do not represent the original files from the old version. phpBB determined that these files create conflicts if they are tried to be merged. Please investigate the conflicts and try to manually resolve them or continue the update choosing the preferred merging method. If you resolve the conflicts manually check the files again after you modified them. You are also able to choose between the preferred merge method for every file. The first one will result in a file where the conflicting lines from your old file will be lost, the other one will result in losing the changes from the newer file.', + 'FILES_DELETED' => 'Deleted files', + 'FILES_DELETED_EXPLAIN' => 'The following files do not exist in the new version. These files have to be deleted from your installation.', 'FILES_MODIFIED' => 'Modified files', 'FILES_MODIFIED_EXPLAIN' => 'The following files are modified and do not represent the original files from the old version. The updated file will be a merge between your modifications and the new file.', 'FILES_NEW' => 'New files', @@ -497,6 +499,7 @@ $lang = array_merge($lang, array( 'SELECT_DOWNLOAD_FORMAT' => 'Select download archive format', 'SELECT_FTP_SETTINGS' => 'Select FTP settings', 'SHOW_DIFF_CONFLICT' => 'Show differences/conflicts', + 'SHOW_DIFF_DELETED' => 'Show file contents', 'SHOW_DIFF_FINAL' => 'Show resulting file', 'SHOW_DIFF_MODIFIED' => 'Show merged differences', 'SHOW_DIFF_NEW' => 'Show file contents', @@ -510,6 +513,7 @@ $lang = array_merge($lang, array( 'STAGE_UPDATE_FILES' => 'Update files', 'STAGE_VERSION_CHECK' => 'Version check', 'STATUS_CONFLICT' => 'Modified file producing conflicts', + 'STATUS_DELETED' => 'Deleted file', 'STATUS_MODIFIED' => 'Modified file', 'STATUS_NEW' => 'New file', 'STATUS_NEW_CONFLICT' => 'Conflicting new file', diff --git a/phpBB/phpbb/auth/provider/oauth/token_storage.php b/phpBB/phpbb/auth/provider/oauth/token_storage.php index fe1a376cfe..023cf402ca 100644 --- a/phpBB/phpbb/auth/provider/oauth/token_storage.php +++ b/phpBB/phpbb/auth/provider/oauth/token_storage.php @@ -266,7 +266,7 @@ class token_storage implements TokenStorageInterface // Ensure that the token was serialized/unserialized correctly if (!($token instanceof TokenInterface)) { - $this->clearToken(); + $this->clearToken($data['provider']); throw new TokenNotFoundException('AUTH_PROVIDER_OAUTH_TOKEN_ERROR_INCORRECTLY_STORED'); } diff --git a/phpBB/phpbb/console/command/extension/disable.php b/phpBB/phpbb/console/command/extension/disable.php index 5f0e74b984..c04848aa01 100644 --- a/phpBB/phpbb/console/command/extension/disable.php +++ b/phpBB/phpbb/console/command/extension/disable.php @@ -37,7 +37,7 @@ class disable extends command $this->manager->disable($name); $this->manager->load_extensions(); - if ($this->manager->enabled($name)) + if ($this->manager->is_enabled($name)) { $output->writeln("<error>Could not disable extension $name</error>"); return 1; diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php index 0cdf26d4db..86a034cdf4 100644 --- a/phpBB/phpbb/console/command/extension/enable.php +++ b/phpBB/phpbb/console/command/extension/enable.php @@ -37,9 +37,9 @@ class enable extends command $this->manager->enable($name); $this->manager->load_extensions(); - if ($this->manager->enabled($name)) + if ($this->manager->is_enabled($name)) { - $this->log->add('admin', ANONYMOUS, '', 'LOG_EXTENSION_ENABLE', time(), array($name)); + $this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_ENABLE', time(), array($name)); $output->writeln("<info>Successfully enabled extension $name</info>"); return 0; } diff --git a/phpBB/phpbb/console/command/extension/purge.php b/phpBB/phpbb/console/command/extension/purge.php index 4e57641d83..841598b90a 100644 --- a/phpBB/phpbb/console/command/extension/purge.php +++ b/phpBB/phpbb/console/command/extension/purge.php @@ -37,7 +37,7 @@ class purge extends command $this->manager->purge($name); $this->manager->load_extensions(); - if ($this->manager->enabled($name)) + if ($this->manager->is_enabled($name)) { $output->writeln("<error>Could not purge extension $name</error>"); return 1; diff --git a/phpBB/phpbb/db/driver/mysqli.php b/phpBB/phpbb/db/driver/mysqli.php index 8fc306b2cc..2ed08211ad 100644 --- a/phpBB/phpbb/db/driver/mysqli.php +++ b/phpBB/phpbb/db/driver/mysqli.php @@ -61,7 +61,11 @@ class mysqli extends \phpbb\db\driver\mysql_base } $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 (!@mysqli_real_connect($this->db_connect_id, $this->server, $this->user, $sqlpassword, $this->dbname, $port, $socket, MYSQLI_CLIENT_FOUND_ROWS)) + { + $this->db_connect_id = ''; + } if ($this->db_connect_id && $this->dbname != '') { diff --git a/phpBB/phpbb/db/migration/profilefield_base_migration.php b/phpBB/phpbb/db/migration/profilefield_base_migration.php index 9cdd5d0927..d416a9b228 100644 --- a/phpBB/phpbb/db/migration/profilefield_base_migration.php +++ b/phpBB/phpbb/db/migration/profilefield_base_migration.php @@ -79,12 +79,13 @@ abstract class profilefield_base_migration extends \phpbb\db\migration\migration $sql = 'SELECT lang_id FROM ' . LANG_TABLE; $result = $this->db->sql_query($sql); + $lang_name = (strpos($this->profilefield_name, 'phpbb_') === 0) ? strtoupper(substr($this->profilefield_name, 6)) : strtoupper($this->profilefield_name); while ($lang_id = (int) $this->db->sql_fetchfield('lang_id')) { $insert_buffer->insert(array( 'field_id' => $field_id, 'lang_id' => $lang_id, - 'lang_name' => strtoupper(substr($this->profilefield_name, 6)),// Remove phpbb_ from field name + 'lang_name' => $lang_name, 'lang_explain' => '', 'lang_default_value' => '', )); diff --git a/phpBB/phpbb/extension/manager.php b/phpBB/phpbb/extension/manager.php index 4130e8455a..b19eb9f8a3 100644 --- a/phpBB/phpbb/extension/manager.php +++ b/phpBB/phpbb/extension/manager.php @@ -515,7 +515,7 @@ class manager * @param string $name Extension name to check NOTE: Can be user input * @return bool Depending on whether or not the extension is available */ - public function available($name) + public function is_available($name) { return file_exists($this->get_extension_path($name, true)); } @@ -526,12 +526,50 @@ class manager * @param string $name Extension name to check * @return bool Depending on whether or not the extension is enabled */ - public function enabled($name) + public function is_enabled($name) { return isset($this->extensions[$name]) && $this->extensions[$name]['ext_active']; } /** + * Check to see if a given extension is disabled + * + * @param string $name Extension name to check + * @return bool Depending on whether or not the extension is disabled + */ + public function is_disabled($name) + { + return isset($this->extensions[$name]) && !$this->extensions[$name]['ext_active']; + } + + /** + * Check to see if a given extension is configured + * + * All enabled and disabled extensions are considered configured. A purged + * extension that is no longer in the database is not configured. + * + * @param string $name Extension name to check + * @return bool Depending on whether or not the extension is configured + */ + public function is_configured($name) + { + return isset($this->extensions[$name]); + } + + /** + * Check to see if a given extension is purged + * + * An extension is purged if it is available, not enabled and not disabled. + * + * @param string $name Extension name to check + * @return bool Depending on whether or not the extension is purged + */ + public function is_purged($name) + { + return $this->is_available($name) && !$this->is_configured($name); + } + + /** * Instantiates a \phpbb\finder. * * @param bool $use_all_available Should we load all extensions, or just enabled ones diff --git a/phpBB/phpbb/extension/metadata_manager.php b/phpBB/phpbb/extension/metadata_manager.php index 014d8c79c7..1051021ea7 100644 --- a/phpBB/phpbb/extension/metadata_manager.php +++ b/phpBB/phpbb/extension/metadata_manager.php @@ -306,7 +306,7 @@ class metadata_manager */ public function validate_require_phpbb() { - if (!isset($this->metadata['require']['phpbb/phpbb'])) + if (!isset($this->metadata['extra']['soft-require']['phpbb/phpbb'])) { return false; } @@ -369,7 +369,7 @@ class metadata_manager 'META_REQUIRE_PHP' => (isset($this->metadata['require']['php'])) ? htmlspecialchars($this->metadata['require']['php']) : '', 'META_REQUIRE_PHP_FAIL' => !$this->validate_require_php(), - 'META_REQUIRE_PHPBB' => (isset($this->metadata['require']['phpbb/phpbb'])) ? htmlspecialchars($this->metadata['require']['phpbb/phpbb']) : '', + 'META_REQUIRE_PHPBB' => (isset($this->metadata['extra']['soft-require']['phpbb/phpbb'])) ? htmlspecialchars($this->metadata['extra']['soft-require']['phpbb/phpbb']) : '', 'META_REQUIRE_PHPBB_FAIL' => !$this->validate_require_phpbb(), 'META_DISPLAY_NAME' => (isset($this->metadata['extra']['display-name'])) ? htmlspecialchars($this->metadata['extra']['display-name']) : '', diff --git a/phpBB/phpbb/profilefields/lang_helper.php b/phpBB/phpbb/profilefields/lang_helper.php index c055931181..2e353722b2 100644 --- a/phpBB/phpbb/profilefields/lang_helper.php +++ b/phpBB/phpbb/profilefields/lang_helper.php @@ -49,43 +49,50 @@ class lang_helper } /** - * Get language entries for options and store them here for later use + * Loads preview options into language entries for options + * + * @param int $field_id + * @param int $lang_id + * @param mixed $preview_options */ - public function get_option_lang($field_id, $lang_id, $field_type, $preview_options) + public function load_preview_options($field_id, $lang_id, $preview_options) { - if ($preview_options !== false) - { - $lang_options = (!is_array($preview_options)) ? explode("\n", $preview_options) : $preview_options; + $lang_options = (!is_array($preview_options)) ? explode("\n", $preview_options) : $preview_options; - foreach ($lang_options as $num => $var) + foreach ($lang_options as $num => $var) + { + if (!isset($this->options_lang[$field_id])) + { + $this->options_lang[$field_id] = array(); + } + if (!isset($this->options_lang[$field_id][$lang_id])) { - if (!isset($this->options_lang[$field_id])) - { - $this->options_lang[$field_id] = array(); - } - if (!isset($this->options_lang[$field_id][$lang_id])) - { - $this->options_lang[$field_id][$lang_id] = array(); - } - $this->options_lang[$field_id][$lang_id][($num + 1)] = $var; + $this->options_lang[$field_id][$lang_id] = array(); } + $this->options_lang[$field_id][$lang_id][($num + 1)] = $var; } - else - { - $sql = 'SELECT option_id, lang_value + } + + /** + * Fetches language entries for options from DB + * + * @param int $lang_id + */ + public function load_option_lang($lang_id) + { + $sql = 'SELECT field_id, option_id, lang_value FROM ' . $this->language_table . ' - WHERE field_id = ' . (int) $field_id . ' - AND lang_id = ' . (int) $lang_id . " - AND field_type = '" . $this->db->sql_escape($field_type) . "' + WHERE lang_id = ' . (int) $lang_id . " ORDER BY option_id"; - $result = $this->db->sql_query($sql); - while ($row = $this->db->sql_fetchrow($result)) - { - $this->options_lang[$field_id][$lang_id][($row['option_id'] + 1)] = $row['lang_value']; - } - $this->db->sql_freeresult($result); + $result = $this->db->sql_query($sql); + + while ($row = $this->db->sql_fetchrow($result)) + { + $this->options_lang[$row['field_id']][$lang_id][($row['option_id'] + 1)] = $row['lang_value']; } + + $this->db->sql_freeresult($result); } /** diff --git a/phpBB/phpbb/profilefields/manager.php b/phpBB/phpbb/profilefields/manager.php index 490db0419a..26c11d9e22 100644 --- a/phpBB/phpbb/profilefields/manager.php +++ b/phpBB/phpbb/profilefields/manager.php @@ -389,6 +389,7 @@ class manager { $profile_field = $this->type_collection[$ident_ary['data']['field_type']]; $value = $profile_field->get_profile_value($ident_ary['value'], $ident_ary['data']); + $value_raw = $profile_field->get_profile_value_raw($ident_ary['value'], $ident_ary['data']); if ($value === null) { @@ -412,26 +413,28 @@ class manager } $tpl_fields['row'] += array( - 'PROFILE_' . strtoupper($ident) . '_IDENT' => $ident, - 'PROFILE_' . strtoupper($ident) . '_VALUE' => $value, - 'PROFILE_' . strtoupper($ident) . '_CONTACT'=> $contact_url, - 'PROFILE_' . strtoupper($ident) . '_DESC' => $field_desc, - 'PROFILE_' . strtoupper($ident) . '_TYPE' => $ident_ary['data']['field_type'], - 'PROFILE_' . strtoupper($ident) . '_NAME' => $this->user->lang($ident_ary['data']['lang_name']), - 'PROFILE_' . strtoupper($ident) . '_EXPLAIN'=> $this->user->lang($ident_ary['data']['lang_explain']), + 'PROFILE_' . strtoupper($ident) . '_IDENT' => $ident, + 'PROFILE_' . strtoupper($ident) . '_VALUE' => $value, + 'PROFILE_' . strtoupper($ident) . '_VALUE_RAW' => $value_raw, + 'PROFILE_' . strtoupper($ident) . '_CONTACT' => $contact_url, + 'PROFILE_' . strtoupper($ident) . '_DESC' => $field_desc, + 'PROFILE_' . strtoupper($ident) . '_TYPE' => $ident_ary['data']['field_type'], + 'PROFILE_' . strtoupper($ident) . '_NAME' => $this->user->lang($ident_ary['data']['lang_name']), + 'PROFILE_' . strtoupper($ident) . '_EXPLAIN' => $this->user->lang($ident_ary['data']['lang_explain']), 'S_PROFILE_' . strtoupper($ident) . '_CONTACT' => $ident_ary['data']['field_is_contact'], 'S_PROFILE_' . strtoupper($ident) => true, ); $tpl_fields['blockrow'][] = array( - 'PROFILE_FIELD_IDENT' => $ident, - 'PROFILE_FIELD_VALUE' => $value, - 'PROFILE_FIELD_CONTACT' => $contact_url, - 'PROFILE_FIELD_DESC' => $field_desc, - 'PROFILE_FIELD_TYPE' => $ident_ary['data']['field_type'], - 'PROFILE_FIELD_NAME' => $this->user->lang($ident_ary['data']['lang_name']), - 'PROFILE_FIELD_EXPLAIN' => $this->user->lang($ident_ary['data']['lang_explain']), + 'PROFILE_FIELD_IDENT' => $ident, + 'PROFILE_FIELD_VALUE' => $value, + 'PROFILE_FIELD_VALUE_RAW' => $value_raw, + 'PROFILE_FIELD_CONTACT' => $contact_url, + 'PROFILE_FIELD_DESC' => $field_desc, + 'PROFILE_FIELD_TYPE' => $ident_ary['data']['field_type'], + 'PROFILE_FIELD_NAME' => $this->user->lang($ident_ary['data']['lang_name']), + 'PROFILE_FIELD_EXPLAIN' => $this->user->lang($ident_ary['data']['lang_explain']), 'S_PROFILE_CONTACT' => $ident_ary['data']['field_is_contact'], 'S_PROFILE_' . strtoupper($ident) => true, diff --git a/phpBB/phpbb/profilefields/type/type_bool.php b/phpBB/phpbb/profilefields/type/type_bool.php index eb8d3e47d6..0582722833 100644 --- a/phpBB/phpbb/profilefields/type/type_bool.php +++ b/phpBB/phpbb/profilefields/type/type_bool.php @@ -155,7 +155,7 @@ class type_bool extends type_base if (!$this->lang_helper->is_set($field_id, $lang_id)) { - $this->lang_helper->get_option_lang($field_id, $lang_id, FIELD_BOOL, false); + $this->lang_helper->load_option_lang($lang_id); } if (!$field_value && $field_data['field_show_novalue']) @@ -180,6 +180,24 @@ class type_bool extends type_base /** * {@inheritDoc} */ + public function get_profile_value_raw($field_value, $field_data) + { + if ($field_value == $field_data['field_novalue'] && !$field_data['field_show_novalue']) + { + return null; + } + + if (!$field_value && $field_data['field_show_novalue']) + { + $field_value = $field_data['field_novalue']; + } + + return $field_value; + } + + /** + * {@inheritDoc} + */ public function generate_field($profile_row, $preview_options = false) { $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident']; @@ -203,7 +221,14 @@ class type_bool extends type_base { if (!$this->lang_helper->is_set($profile_row['field_id'], $profile_row['lang_id'], 1)) { - $this->lang_helper->get_option_lang($profile_row['field_id'], $profile_row['lang_id'], $this->get_service_name(), $preview_options); + if ($preview_options) + { + $this->lang_helper->load_preview_options($profile_row['field_id'], $profile_row['lang_id'], $preview_options); + } + else + { + $this->lang_helper->load_option_lang($profile_row['lang_id']); + } } $options = $this->lang_helper->get($profile_row['field_id'], $profile_row['lang_id']); diff --git a/phpBB/phpbb/profilefields/type/type_date.php b/phpBB/phpbb/profilefields/type/type_date.php index 158eec6a0c..90ac9a6703 100644 --- a/phpBB/phpbb/profilefields/type/type_date.php +++ b/phpBB/phpbb/profilefields/type/type_date.php @@ -208,6 +208,19 @@ class type_date extends type_base /** * {@inheritDoc} */ + public function get_profile_value_raw($field_value, $field_data) + { + if (($field_value === '' || $field_value === null) && !$field_data['field_show_novalue']) + { + return null; + } + + return $field_value; + } + + /** + * {@inheritDoc} + */ public function generate_field($profile_row, $preview_options = false) { $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident']; diff --git a/phpBB/phpbb/profilefields/type/type_dropdown.php b/phpBB/phpbb/profilefields/type/type_dropdown.php index 52c9fcf86a..17ae89e1b2 100644 --- a/phpBB/phpbb/profilefields/type/type_dropdown.php +++ b/phpBB/phpbb/profilefields/type/type_dropdown.php @@ -135,7 +135,7 @@ class type_dropdown extends type_base // retrieve option lang data if necessary if (!$this->lang_helper->is_set($field_data['field_id'], $field_data['lang_id'], 1)) { - $this->lang_helper->get_option_lang($field_data['field_id'], $field_data['lang_id'], $this->get_service_name(), false); + $this->lang_helper->load_option_lang($field_data['lang_id']); } if (!$this->lang_helper->is_set($field_data['field_id'], $field_data['lang_id'], $field_value)) @@ -160,7 +160,7 @@ class type_dropdown extends type_base $lang_id = $field_data['lang_id']; if (!$this->lang_helper->is_set($field_id, $lang_id)) { - $this->lang_helper->get_option_lang($field_id, $lang_id, $this->get_service_name(), false); + $this->lang_helper->load_option_lang($lang_id); } if ($field_value == $field_data['field_novalue'] && !$field_data['field_show_novalue']) @@ -189,6 +189,24 @@ class type_dropdown extends type_base /** * {@inheritDoc} */ + public function get_profile_value_raw($field_value, $field_data) + { + if ($field_value == $field_data['field_novalue'] && !$field_data['field_show_novalue']) + { + return null; + } + + if (!$field_value && $field_data['field_show_novalue']) + { + $field_value = $field_data['field_novalue']; + } + + return $field_value; + } + + /** + * {@inheritDoc} + */ public function generate_field($profile_row, $preview_options = false) { $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident']; @@ -199,7 +217,14 @@ class type_dropdown extends type_base if (!$this->lang_helper->is_set($profile_row['field_id'], $profile_row['lang_id'], 1)) { - $this->lang_helper->get_option_lang($profile_row['field_id'], $profile_row['lang_id'], $this->get_service_name(), $preview_options); + if ($preview_options) + { + $this->lang_helper->load_preview_options($profile_row['field_id'], $profile_row['lang_id'], $preview_options); + } + else + { + $this->lang_helper->load_option_lang($profile_row['lang_id']); + } } $profile_row['field_value'] = (int) $value; diff --git a/phpBB/phpbb/profilefields/type/type_int.php b/phpBB/phpbb/profilefields/type/type_int.php index 78f1c7d2c9..dd08df94c1 100644 --- a/phpBB/phpbb/profilefields/type/type_int.php +++ b/phpBB/phpbb/profilefields/type/type_int.php @@ -154,6 +154,18 @@ class type_int extends type_base /** * {@inheritDoc} */ + public function get_profile_value_raw($field_value, $field_data) + { + if (($field_value === '' || $field_value === null) && !$field_data['field_show_novalue']) + { + return null; + } + return (int) $field_value; + } + + /** + * {@inheritDoc} + */ public function generate_field($profile_row, $preview_options = false) { $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident']; diff --git a/phpBB/phpbb/profilefields/type/type_interface.php b/phpBB/phpbb/profilefields/type/type_interface.php index 489e916fd5..2dd13fa480 100644 --- a/phpBB/phpbb/profilefields/type/type_interface.php +++ b/phpBB/phpbb/profilefields/type/type_interface.php @@ -94,6 +94,15 @@ interface type_interface public function get_profile_value($field_value, $field_data); /** + * Get Profile Value ID for display (the raw, unprocessed user data) + * + * @param mixed $field_value Field value as stored in the database + * @param array $field_data Array with requirements of the field + * @return mixed Field value ID to display + */ + public function get_profile_value_raw($field_value, $field_data); + + /** * Get Profile Value for display * * When displaying a contact field, we don't want to have links already parsed and more diff --git a/phpBB/phpbb/profilefields/type/type_string_common.php b/phpBB/phpbb/profilefields/type/type_string_common.php index b48e3c5add..c2b951b6c9 100644 --- a/phpBB/phpbb/profilefields/type/type_string_common.php +++ b/phpBB/phpbb/profilefields/type/type_string_common.php @@ -112,6 +112,19 @@ abstract class type_string_common extends type_base /** * {@inheritDoc} */ + public function get_profile_value_raw($field_value, $field_data) + { + if (!$field_value && !$field_data['field_show_novalue']) + { + return null; + } + + return $field_value; + } + + /** + * {@inheritDoc} + */ public function get_profile_contact_value($field_value, $field_data) { if (!$field_value && !$field_data['field_show_novalue']) diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php index cceefda7ef..c5dc7273ba 100644 --- a/phpBB/phpbb/template/twig/lexer.php +++ b/phpBB/phpbb/template/twig/lexer.php @@ -285,7 +285,7 @@ class lexer extends \Twig_Lexer return "<!-- {$matches[1]}IF{$inner}-->"; }; - return preg_replace_callback('#<!-- (ELSE)?IF((.*?) \(*!?[\$|\.]([^\s]+)(.*?))-->#', $callback, $code); + return preg_replace_callback('#<!-- (ELSE)?IF((.*?) (?:\(*!?[\$|\.]([^\s]+)(.*?))?)-->#', $callback, $code); } /** diff --git a/phpBB/phpbb/viewonline_helper.php b/phpBB/phpbb/viewonline_helper.php new file mode 100644 index 0000000000..3fc33119a3 --- /dev/null +++ b/phpBB/phpbb/viewonline_helper.php @@ -0,0 +1,37 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb; + +/** +* Class to handle viewonline related tasks +*/ +class viewonline_helper +{ + /** + * Get user page + * + * @param string $session_page User's session page + * @return array Match array filled by preg_match() + */ + public function get_user_page($session_page) + { + preg_match('#^([./\\]*+[a-z0-9/_-]+)#i', $session_page, $on_page); + if (empty($on_page)) + { + $on_page[1] = ''; + } + + return $on_page; + } +} diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js index e9f8064b9e..70bc703582 100644 --- a/phpBB/styles/prosilver/template/ajax.js +++ b/phpBB/styles/prosilver/template/ajax.js @@ -356,37 +356,6 @@ $('.display_post').click(function(e) { $('#post_hidden' + post_id).hide(); }); - - -/** - * This AJAXifies the quick-mod tools. The reason it cannot be a standard - * callback / data attribute is that it requires filtering - some of the options - * can be ajaxified, while others cannot. - */ -phpbb.ajaxify({ - selector: '#quickmodform', - refresh: true, - filter: function (data) { - var action = $('#quick-mod-select').val(); - - if (action === 'make_normal') { - return $(this).find('select option[value="make_global"]').length > 0; - } else if (action === 'lock' || action === 'unlock') { - return true; - } - - if (action === 'delete_topic' || action === 'make_sticky' || action === 'make_announce' || action === 'make_global') { - return true; - } - - return false; - } -}); - -$('#quick-mod-select').change(function () { - $('#quickmodform').submit(); -}); - $('#delete_permanent').click(function () { if ($(this).prop('checked')) { $('#delete_reason').hide(); diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index ea2b815e77..4929e14ef7 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -382,10 +382,7 @@ function parse_document(container) */ if (oldBrowser) { // Fix .linklist.bulletin lists - container.find('ul.linklist.bulletin li:first-child, ul.linklist.bulletin li.rightside:last-child').addClass('no-bulletin'); - - // Do not run functions below for old browsers - return; + container.find('ul.linklist.bulletin > li:first-child, ul.linklist.bulletin > li.rightside:last-child').addClass('no-bulletin'); } /** @@ -483,6 +480,167 @@ function parse_document(container) }); /** + * Responsive link lists + */ + 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]', + filterLast = '.edit-icon, .quote-icon, [data-last-responsive]', + persist = $this.attr('id') == 'nav-main', + allLinks = $this.children(), + links = allLinks.not(filterSkip), + html = '<li class="responsive-menu" style="display:none;"><a href="javascript:void(0);" class="responsive-menu-link"> </a><div class="dropdown" style="display:none;"><div class="pointer"><div class="pointer-inner" /></div><ul class="dropdown-contents" /></div></li>', + filterLastList = links.filter(filterLast), + slack = 1; // Vertical slack space (in pixels). Determines how sensitive the script is in determining whether a line-break has occured. + + if (!persist) { + if (links.is('.rightside')) + { + links.filter('.rightside:first').before(html); + $this.children('.responsive-menu').addClass('rightside'); + } + else + { + $this.append(html); + } + } + + var item = $this.children('.responsive-menu'), + menu = item.find('.dropdown-contents'), + lastWidth = false, + compact = false, + responsive = false, + copied = false; + + function check() { + var width = $body.width(); + if (responsive && width <= lastWidth) { + return; + } + + // Unhide the quick-links menu if it has content + if (persist) { + item.addClass('hidden'); + if (menu.find('li:not(.separator, .clone)').length || (responsive && menu.find('li.clone').length)) { + item.removeClass('hidden'); + } + } + + // Reset responsive and compact layout + if (responsive) { + responsive = false; + $this.removeClass('responsive'); + links.css('display', ''); + if (!persist) item.css('display', 'none'); + } + + if (compact) { + compact = false; + $this.removeClass('compact'); + } + + // Find tallest element + var maxHeight = 0; + allLinks.each(function() { + if (!$(this).height()) return; + maxHeight = Math.max(maxHeight, $(this).outerHeight(true)); + }); + + if (maxHeight < 1) { + return; + } + + // Nothing to resize if block's height is not bigger than tallest element's height + if ($this.height() <= (maxHeight + slack)) { + return; + } + + // Enable compact layout, find tallest element, compare to height of whole block + compact = true; + $this.addClass('compact'); + + var compactMaxHeight = 0; + allLinks.each(function() { + if (!$(this).height()) return; + compactMaxHeight = Math.max(compactMaxHeight, $(this).outerHeight(true)); + }); + + if ($this.height() <= (maxHeight + slack)) { + return; + } + + // Compact layout did not resize block enough, switch to responsive layout + compact = false; + $this.removeClass('compact'); + responsive = true; + + if (!copied) { + var clone = links.clone(true); + clone.filter('.rightside').each(function() { + if (persist) $(this).addClass('clone'); + menu.prepend(this); + }); + + if (persist) { + menu.prepend(clone.not('.rightside').addClass('clone')); + } else { + 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 { + menu.children().css('display', ''); + } + + item.css('display', ''); + $this.addClass('responsive'); + + // Try to not hide filtered items + if (filterLastList.length) { + links.not(filterLast).css('display', 'none'); + + maxHeight = 0; + filterLastList.each(function() { + if (!$(this).height()) return; + maxHeight = Math.max(maxHeight, $(this).outerHeight(true)); + }); + + if ($this.height() <= (maxHeight + slack)) { + menu.children().filter(filterLast).css('display', 'none'); + return; + } + } + + // If even responsive isn't enough, use both responsive and compact at same time + compact = true; + $this.addClass('compact'); + + links.css('display', 'none'); + } + + if (!persist) phpbb.registerDropdown(item.find('a.responsive-menu-link'), item.find('.dropdown')); + + check(); + $(window).resize(check); + }); + + /** + * Do not run functions below for old browsers + */ + if (oldBrowser) { + return; + } + + /** * Adjust topiclist lists with check boxes */ container.find('ul.topiclist dd.mark').siblings('dt').children('.list-inner').addClass('with-mark'); @@ -667,136 +825,6 @@ function parse_document(container) }); /** - * Responsive link lists - */ - 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]', - filterLast = '.pagination, .icon-notifications, .icon-pm, .icon-logout, .icon-login, .mark-read, .edit-icon, .quote-icon', - allLinks = $this.children(), - links = allLinks.not(filterSkip), - html = '<li class="responsive-menu" style="display:none;"><a href="javascript:void(0);" class="responsive-menu-link"> </a><div class="dropdown" style="display:none;"><div class="pointer"><div class="pointer-inner" /></div><ul class="dropdown-contents" /></div></li>', - filterLastList = links.filter(filterLast); - - if (links.is('.rightside')) - { - links.filter('.rightside:first').before(html); - } - else - { - $this.append(html); - } - - var item = $this.children('.responsive-menu'), - menu = item.find('.dropdown-contents'), - lastWidth = false, - compact = false, - responsive = false, - copied = false; - - function check() { - var width = $body.width(); - if (responsive && width <= lastWidth) { - return; - } - - // Reset responsive and compact layout - if (responsive) { - responsive = false; - $this.removeClass('responsive'); - links.css('display', ''); - item.css('display', 'none'); - } - - if (compact) { - compact = false; - $this.removeClass('compact'); - } - - // Find tallest element - var maxHeight = 0; - allLinks.each(function() { - if (!$(this).height()) return; - maxHeight = Math.max(maxHeight, $(this).outerHeight(true)); - }); - - if (maxHeight < 1) { - return; - } - - // Nothing to resize if block's height is not bigger than tallest element's height - if ($this.height() <= maxHeight) { - return; - } - - // Enable compact layout, find tallest element, compare to height of whole block - compact = true; - $this.addClass('compact'); - - var compactMaxHeight = 0; - allLinks.each(function() { - if (!$(this).height()) return; - compactMaxHeight = Math.max(compactMaxHeight, $(this).outerHeight(true)); - }); - - if ($this.height() <= maxHeight) { - return; - } - - // Compact layout did not resize block enough, switch to responsive layout - compact = false; - $this.removeClass('compact'); - responsive = true; - - if (!copied) { - var clone = links.clone(true); - clone.filter('.rightside').each(function() { - menu.prepend(this); - }); - 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 { - menu.children().css('display', ''); - } - - item.css('display', ''); - $this.addClass('responsive'); - - // Try to not hide filtered items - if (filterLastList.length) { - links.not(filterLast).css('display', 'none'); - - maxHeight = 0; - filterLastList.each(function() { - if (!$(this).height()) return; - maxHeight = Math.max(maxHeight, $(this).outerHeight(true)); - }); - - if ($this.height() <= maxHeight) { - menu.children().filter(filterLast).css('display', 'none'); - return; - } - } - - links.css('display', 'none'); - } - - phpbb.registerDropdown(item.find('a.responsive-menu-link'), item.find('.dropdown')); - - check(); - $(window).resize(check); - }); - - /** * Responsive tabs */ container.find('#tabs, #minitabs').not('[data-skip-responsive]').each(function() { diff --git a/phpBB/styles/prosilver/template/index_body.html b/phpBB/styles/prosilver/template/index_body.html index f9c5b4cf20..1e1eb22c6f 100644 --- a/phpBB/styles/prosilver/template/index_body.html +++ b/phpBB/styles/prosilver/template/index_body.html @@ -1,27 +1,15 @@ <!-- INCLUDE overall_header.html --> -<p class="{S_CONTENT_FLOW_END} responsive-center<!-- IF S_USER_LOGGED_IN --> rightside<!-- ENDIF -->"><!-- IF S_USER_LOGGED_IN -->{LAST_VISIT_DATE}<!-- ELSE -->{CURRENT_TIME}<!-- ENDIF --></p> -<!-- IF S_USER_LOGGED_IN --><p class="responsive-center">{CURRENT_TIME}<!-- IF U_MCP or U_ACP --> <br />[ <!-- IF U_ACP --><a href="{U_ACP}" title="{L_ACP}" data-responsive-text="{L_ACP_SHORT}">{L_ACP}</a><!-- IF U_MCP --> | <!-- ENDIF --><!-- ENDIF --><!-- IF U_MCP --><a href="{U_MCP}" title="{L_MCP}" data-responsive-text="{L_MCP_SHORT}">{L_MCP}</a><!-- ENDIF --> ]<!-- ENDIF --></p><!-- ENDIF --> +<p class="{S_CONTENT_FLOW_END} responsive-center time<!-- IF S_USER_LOGGED_IN --> rightside<!-- ENDIF -->"><!-- IF S_USER_LOGGED_IN -->{LAST_VISIT_DATE}<!-- ELSE -->{CURRENT_TIME}<!-- ENDIF --></p> +<!-- IF S_USER_LOGGED_IN --><p class="responsive-center time">{CURRENT_TIME}</p><!-- ENDIF --> -<!-- EVENT index_body_linklist_before --> - -<!-- IF S_DISPLAY_SEARCH or (S_USER_LOGGED_IN and not S_IS_BOT) --> -<ul class="linklist bulletin"> - <!-- IF S_DISPLAY_SEARCH --> - <li><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a></li> - <!-- IF S_LOAD_UNREADS --> - <li><a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a></li> - <!-- ENDIF --> - <!-- IF S_USER_LOGGED_IN --> - <li><a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a></li> - <!-- ENDIF --> - <li><a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></li> - <!-- ENDIF --> - <!-- IF not S_IS_BOT and U_MARK_FORUMS --><li class="rightside mark-read"><a href="{U_MARK_FORUMS}" accesskey="m" data-ajax="mark_forums_read">{L_MARK_FORUMS_READ}</a></li><!-- ENDIF --> -</ul> +<!-- EVENT index_body_markforums_before --> +<!-- IF U_MARK_FORUMS --> + <div class="action-bar compact"> + <a href="{U_MARK_FORUMS}" class="mark-read rightside" accesskey="m" data-ajax="mark_forums_read">{L_MARK_FORUMS_READ}</a> + </div> <!-- ENDIF --> - -<!-- EVENT index_body_linklist_after --> +<!-- EVENT index_body_markforums_after --> <!-- INCLUDE forumlist_body.html --> diff --git a/phpBB/styles/prosilver/template/jumpbox.html b/phpBB/styles/prosilver/template/jumpbox.html index 47d322407d..44b479ab3f 100644 --- a/phpBB/styles/prosilver/template/jumpbox.html +++ b/phpBB/styles/prosilver/template/jumpbox.html @@ -10,24 +10,22 @@ <!-- ENDIF --> <!-- IF S_DISPLAY_JUMPBOX --> - <form method="get" id="jumpbox" action="{S_JUMPBOX_ACTION}" onsubmit="if(this.f.value == -1){return false;}"> - <!-- IF $CUSTOM_FIELDSET_CLASS --> - <fieldset class="{$CUSTOM_FIELDSET_CLASS}"> - <!-- ELSE --> - <fieldset class="jumpbox"> - <!-- ENDIF --> - {HIDDEN_FIELDS_FOR_JUMPBOX} - <label for="f" accesskey="j"><!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->{L_COLON}</label> - <select name="f" id="f" onchange="if(this.options[this.selectedIndex].value != -1){ document.forms['jumpbox'].submit() }"> + <div class="dropdown-container dropdown-container-{S_CONTENT_FLOW_END}<!-- IF not S_IN_MCP --> dropdown-up<!-- ENDIF --> dropdown-{S_CONTENT_FLOW_BEGIN} dropdown-button-control" id="jumpbox"> + <span title="<!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->" class="dropdown-trigger button dropdown-select"> + <!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF --> + </span> + <div class="dropdown hidden"> + <div class="pointer"><div class="pointer-inner"></div></div> + <ul class="dropdown-contents"> <!-- BEGIN jumpbox_forums --> - <!-- IF jumpbox_forums.S_FORUM_COUNT == 1 --><option value="-1">------------------</option><!-- ENDIF --> - <option value="{jumpbox_forums.FORUM_ID}"{jumpbox_forums.SELECTED}><!-- BEGIN level --> <!-- END level -->{jumpbox_forums.FORUM_NAME}</option> + <!-- IF jumpbox_forums.FORUM_ID neq -1 --> + <li><!-- BEGIN level --> <!-- END level --><a href="{jumpbox_forums.LINK}">{jumpbox_forums.FORUM_NAME}</a></li> + <!-- ENDIF --> <!-- END jumpbox_forums --> - </select> - <input type="submit" value="{L_GO}" class="button2" /> - </fieldset> - </form> + </ul> + </div> + </div> <!-- ELSE --> <br /><br /> diff --git a/phpBB/styles/prosilver/template/navbar_footer.html b/phpBB/styles/prosilver/template/navbar_footer.html index e2259e8712..65a7cdddba 100644 --- a/phpBB/styles/prosilver/template/navbar_footer.html +++ b/phpBB/styles/prosilver/template/navbar_footer.html @@ -1,23 +1,25 @@ <div class="navbar"> <div class="inner"> - <ul class="linklist bulletin"> - <li class="small-icon icon-home breadcrumbs"> + <ul id="nav-footer" class="linklist bulletin" role="menubar"> + <li class="small-icon icon-home breadcrumbs" role="navigation"> <!-- IF U_SITE_HOME --><span class="crumb"><a href="{U_SITE_HOME}" data-navbar-reference="home">{L_SITE_HOME}</a></span><!-- ENDIF --> <span class="crumb"><a href="{U_INDEX}" data-navbar-reference="index">{L_INDEX}</a></span> <!-- EVENT overall_footer_breadcrumb_append --> </li> <!-- IF not S_IS_BOT --> - <!-- IF U_WATCH_FORUM_LINK --><li class="small-icon icon-<!-- IF S_WATCHING_FORUM -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->"><a href="{U_WATCH_FORUM_LINK}" title="{S_WATCH_FORUM_TITLE}" data-ajax="toggle_link" data-toggle-class="small-icon icon-<!-- IF not S_WATCHING_FORUM -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->" data-toggle-text="{S_WATCH_FORUM_TOGGLE}" data-toggle-url="{U_WATCH_FORUM_TOGGLE}">{S_WATCH_FORUM_TITLE}</a></li><!-- ENDIF --> + <!-- IF U_WATCH_FORUM_LINK --><li class="small-icon icon-<!-- IF S_WATCHING_FORUM -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->" data-last-responsive="true"><a href="{U_WATCH_FORUM_LINK}" title="{S_WATCH_FORUM_TITLE}" data-ajax="toggle_link" data-toggle-class="small-icon icon-<!-- IF not S_WATCHING_FORUM -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->" data-toggle-text="{S_WATCH_FORUM_TOGGLE}" data-toggle-url="{U_WATCH_FORUM_TOGGLE}">{S_WATCH_FORUM_TITLE}</a></li><!-- ENDIF --> <!-- ENDIF --> + <!-- EVENT overall_footer_timezone_before --> <li class="rightside">{S_TIMEZONE}</li> <!-- EVENT overall_footer_timezone_after --> - <!-- IF not S_IS_BOT --><li class="rightside"><a href="{U_DELETE_COOKIES}" data-ajax="true" data-refresh="true">{L_DELETE_COOKIES}</a></li><!-- ENDIF --> + <!-- IF not S_IS_BOT --><li class="small-icon icon-delete-cookies rightside"><a href="{U_DELETE_COOKIES}" data-ajax="true" data-refresh="true" role="menuitem">{L_DELETE_COOKIES}</a></li><!-- ENDIF --> + <!-- IF S_REGISTERED_USER and S_DISPLAY_MEMBERLIST --><li class="small-icon icon-members rightside" data-last-responsive="true"><a href="{U_MEMBERLIST}" title="{L_MEMBERLIST_EXPLAIN}" role="menuitem">{L_MEMBERLIST}</a></li><!-- ENDIF --> <!-- EVENT overall_footer_teamlink_before --> - <!-- IF U_TEAM --><li class="rightside"><a href="{U_TEAM}">{L_THE_TEAM}</a></li><!-- ENDIF --> - <!-- IF U_CONTACT_US --><li class="rightside"><a href="{U_CONTACT_US}">{L_CONTACT_US}</a></li><!-- ENDIF --> + <!-- IF S_REGISTERED_USER and U_TEAM --><li class="small-icon icon-team rightside" data-last-responsive="true"><a href="{U_TEAM}" role="menuitem">{L_THE_TEAM}</a></li><!-- ENDIF --> <!-- EVENT overall_footer_teamlink_after --> + <!-- IF U_CONTACT_US --><li class="small-icon icon-contact rightside" data-last-responsive="true"><a href="{U_CONTACT_US}" role="menuitem">{L_CONTACT_US}</a></li><!-- ENDIF --> </ul> </div> diff --git a/phpBB/styles/prosilver/template/navbar_header.html b/phpBB/styles/prosilver/template/navbar_header.html index 67a3b553fd..4cd306f87b 100644 --- a/phpBB/styles/prosilver/template/navbar_header.html +++ b/phpBB/styles/prosilver/template/navbar_header.html @@ -1,68 +1,102 @@ -<div class="navbar"> +<div class="navbar" role="navigation"> <div class="inner"> - <ul class="linklist navlinks"> - <!-- DEFINE $MICRODATA = ' itemtype="http://data-vocabulary.org/Breadcrumb" itemscope=""' --> - <li class="small-icon icon-home breadcrumbs"> - <!-- IF U_SITE_HOME --><span class="crumb"><a href="{U_SITE_HOME}"{$MICRODATA} data-navbar-reference="home">{L_SITE_HOME}</a></span><!-- ENDIF --> - <span class="crumb"><a href="{U_INDEX}" accesskey="h"{$MICRODATA} data-navbar-reference="index">{L_INDEX}</a></span> - <!-- BEGIN navlinks --> - <!-- EVENT overall_header_navlink_prepend --> - <span class="crumb"><a href="{navlinks.U_VIEW_FORUM}"{$MICRODATA}<!-- IF navlinks.MICRODATA --> {navlinks.MICRODATA}<!-- ENDIF -->>{navlinks.FORUM_NAME}</a></span> - <!-- EVENT overall_header_navlink_append --> - <!-- END navlinks --> - <!-- EVENT overall_header_breadcrumb_append --> + <ul id="nav-main" class="linklist bulletin" role="menubar"> + + <li id="quick-links" class="small-icon responsive-menu dropdown-container<!-- IF not S_DISPLAY_QUICK_LINKS and not S_DISPLAY_SEARCH --> hidden<!-- ENDIF -->" data-skip-responsive="true"> + <a href="#" class="responsive-menu-link dropdown-trigger">{L_QUICK_LINKS}</a> + <div class="dropdown hidden"> + <div class="pointer"><div class="pointer-inner"></div></div> + <ul class="dropdown-contents" role="menu"> + <!-- EVENT navbar_header_quick_links_before --> + + <!-- IF S_DISPLAY_SEARCH --> + <li class="separator"></li> + <!-- IF S_REGISTERED_USER --> + <li class="small-icon icon-search-self"><a href="{U_SEARCH_SELF}" role="menuitem">{L_SEARCH_SELF}</a></li> + <!-- ENDIF --> + <li class="small-icon icon-search-unanswered"><a href="{U_SEARCH_UNANSWERED}" role="menuitem">{L_SEARCH_UNANSWERED}</a></li> + <!-- IF S_LOAD_UNREADS --> + <li class="small-icon icon-search-unread"><a href="{U_SEARCH_UNREAD}" role="menuitem">{L_SEARCH_UNREAD}</a></li> + <!-- ENDIF --> + <!-- IF S_USER_LOGGED_IN --> + <li class="small-icon icon-search-new"><a href="{U_SEARCH_NEW}" role="menuitem">{L_SEARCH_NEW}</a></li> + <!-- ENDIF --> + <li class="small-icon icon-search-active"><a href="{U_SEARCH_ACTIVE_TOPICS}" role="menuitem">{L_SEARCH_ACTIVE_TOPICS}</a></li> + <!-- ENDIF --> + <li class="separator"></li> + + <!-- EVENT navbar_header_quick_links_after --> + </ul> + </div> </li> + <!-- IF U_ACP --><li class="small-icon icon-acp" data-skip-responsive="true"><a href="{U_ACP}" title="{L_ACP}" role="menuitem">{L_ACP_SHORT}</a></li><!-- ENDIF --> + <!-- IF U_MCP --><li class="small-icon icon-mcp" data-skip-responsive="true"><a href="{U_MCP}" title="{L_MCP}" role="menuitem">{L_MCP_SHORT}</a></li><!-- ENDIF --> - <!-- IF S_REGISTERED_USER --> - <li id="username_logged_in" class="rightside"> - <!-- EVENT navbar_header_username_prepend --> - <!-- IF CURRENT_USER_AVATAR --> - <a href="{U_USER_PROFILE}" class="header-avatar">{CURRENT_USER_AVATAR}</a> - <!-- ENDIF --> - {CURRENT_USERNAME_FULL} - <!-- EVENT navbar_header_username_append --> - </li> - <!-- ELSE --> - <li id="logged_out" class="rightside"> - <!-- EVENT navbar_header_logged_out_content --> - </li> - <!-- ENDIF --> - <!-- IF S_DISPLAY_SEARCH and not S_IN_SEARCH --><li class="responsive-search rightside" style="display: none;"><a href="{U_SEARCH}" title="{L_SEARCH_ADV_EXPLAIN}">{L_SEARCH}</a></li><!-- ENDIF --> - </ul> + <!-- EVENT overall_header_navigation_prepend --> + <li class="small-icon icon-faq" <!-- IF not S_USER_LOGGED_IN -->data-skip-responsive="true"<!-- ELSE -->data-last-responsive="true"<!-- ENDIF -->><a href="{U_FAQ}" title="{L_FAQ_EXPLAIN}" role="menuitem">{L_FAQ}</a></li> + <!-- EVENT overall_header_navigation_append --> - <ul class="linklist bulletin"> - <!-- IF not S_IS_BOT and S_USER_LOGGED_IN --> - <!-- IF S_NOTIFICATIONS_DISPLAY --> - <li class="small-icon icon-notification dropdown-container dropdown-{S_CONTENT_FLOW_END}" data-skip-responsive="true"> - <a href="{U_VIEW_ALL_NOTIFICATIONS}" id="notification_list_button" class="dropdown-trigger"><span>{L_NOTIFICATIONS} [</span><strong>{NOTIFICATIONS_COUNT}</strong><span>]</span></a> - <!-- INCLUDE notification_dropdown.html --> + <!-- IF S_REGISTERED_USER --> + <li id="username_logged_in" class="rightside <!-- IF CURRENT_USER_AVATAR --> no-bulletin<!-- ENDIF -->" data-skip-responsive="true"> + <!-- EVENT navbar_header_username_prepend --> + <div class="header-profile dropdown-container"> + <a href="{U_PROFILE}" class="header-avatar dropdown-trigger"><!-- IF CURRENT_USER_AVATAR -->{CURRENT_USER_AVATAR} <!-- ENDIF -->{CURRENT_USERNAME_SIMPLE}</a> + <div class="dropdown hidden"> + <div class="pointer"><div class="pointer-inner"></div></div> + <ul class="dropdown-contents" role="menu"> + <!-- IF U_RESTORE_PERMISSIONS --><li class="small-icon icon-restore-permissions"><a href="{U_RESTORE_PERMISSIONS}">{L_RESTORE_PERMISSIONS}</a></li><!-- ENDIF --> + + <!-- EVENT navbar_header_profile_list_before --> + + <li class="small-icon icon-ucp"><a href="{U_PROFILE}" title="{L_PROFILE}" role="menuitem">{L_PROFILE}</a></li> + <li class="small-icon icon-profile"><a href="{U_USER_PROFILE}" title="{L_READ_PROFILE}" role="menuitem">{L_READ_PROFILE}</a></li> + + <!-- EVENT navbar_header_profile_list_after --> + + <li class="separator"></li> + <li class="small-icon icon-logout"><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x" role="menuitem">{L_LOGIN_LOGOUT}</a></li> + </ul> + </div> + </div> + <!-- EVENT navbar_header_username_append --> </li> - <!-- ENDIF --> <!-- IF S_DISPLAY_PM --> - <li class="small-icon icon-pm"> - <a href="{U_PRIVATEMSGS}"><span>{L_PRIVATE_MESSAGES} [</span><strong>{PRIVATE_MESSAGE_COUNT}</strong><span>]</span></a> + <li class="small-icon icon-pm rightside" data-skip-responsive="true"> + <a href="{U_PRIVATEMSGS}" role="menuitem"><span>{L_PRIVATE_MESSAGES} [</span><strong>{PRIVATE_MESSAGE_COUNT}</strong><span>]</span></a> </li> <!-- ENDIF --> - <li class="small-icon icon-ucp"> - <a href="{U_PROFILE}" title="{L_PROFILE}" accesskey="e">{L_PROFILE}</a> - </li> - <!-- IF S_DISPLAY_SEARCH --> - <li class="icon-search-self"><a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a></li> + <!-- IF S_NOTIFICATIONS_DISPLAY --> + <li class="small-icon icon-notification dropdown-container dropdown-{S_CONTENT_FLOW_END} rightside" data-skip-responsive="true"> + <a href="{U_VIEW_ALL_NOTIFICATIONS}" id="notification_list_button" class="dropdown-trigger"><span>{L_NOTIFICATIONS} [</span><strong>{NOTIFICATIONS_COUNT}</strong><span>]</span></a> + <!-- INCLUDE notification_dropdown.html --> + </li> <!-- ENDIF --> - <!-- IF U_RESTORE_PERMISSIONS --> - <li class="icon-restore-permissions"><a href="{U_RESTORE_PERMISSIONS}">{L_RESTORE_PERMISSIONS}</a></li> + <!-- ELSE --> + <li class="small-icon icon-logout rightside" data-skip-responsive="true"><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x" role="menuitem">{L_LOGIN_LOGOUT}</a></li> + <!-- IF S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) --> + <li class="small-icon icon-register rightside" data-skip-responsive="true"><a href="{U_REGISTER}" role="menuitem">{L_REGISTER}</a></li> <!-- ENDIF --> + <!-- EVENT navbar_header_logged_out_content --> <!-- ENDIF --> + </ul> - <!-- EVENT overall_header_navigation_append --> - <!-- IF not S_IS_BOT --> - <li class="small-icon icon-logout rightside no-bulletin"><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x">{L_LOGIN_LOGOUT}</a></li> - <!-- IF not S_USER_LOGGED_IN and S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) --><li class="small-icon icon-register rightside no-bulletin"><a href="{U_REGISTER}">{L_REGISTER}</a></li><!-- ENDIF --> - <!-- IF S_DISPLAY_MEMBERLIST --><li class="small-icon icon-members rightside no-bulletin"><a href="{U_MEMBERLIST}" title="{L_MEMBERLIST_EXPLAIN}">{L_MEMBERLIST}</a></li><!-- ENDIF --> + <ul id="nav-breadcrumbs" class="linklist navlinks" role="menubar"> + <!-- DEFINE $MICRODATA = ' itemtype="http://data-vocabulary.org/Breadcrumb" itemscope=""' --> + <li class="small-icon icon-home breadcrumbs" role="navigation"> + <!-- IF U_SITE_HOME --><span class="crumb"><a href="{U_SITE_HOME}"{$MICRODATA} data-navbar-reference="home">{L_SITE_HOME}</a></span><!-- ENDIF --> + <span class="crumb"><a href="{U_INDEX}" accesskey="h"{$MICRODATA} data-navbar-reference="index">{L_INDEX}</a></span> + <!-- BEGIN navlinks --> + <!-- EVENT overall_header_navlink_prepend --> + <span class="crumb"><a href="{navlinks.U_VIEW_FORUM}"{$MICRODATA}<!-- IF navlinks.MICRODATA --> {navlinks.MICRODATA}<!-- ENDIF -->>{navlinks.FORUM_NAME}</a></span> + <!-- EVENT overall_header_navlink_append --> + <!-- END navlinks --> + <!-- EVENT overall_header_breadcrumb_append --> + </li> + + <!-- IF S_DISPLAY_SEARCH and not S_IN_SEARCH --> + <li class="rightside responsive-search" style="display: none;"><a href="{U_SEARCH}" title="{L_SEARCH_ADV_EXPLAIN}" role="menuitem">{L_SEARCH}</a></li> <!-- ENDIF --> - <li class="small-icon icon-faq rightside no-bulletin"><a href="{U_FAQ}" title="{L_FAQ_EXPLAIN}">{L_FAQ}</a></li> - <!-- EVENT overall_header_navigation_prepend --> </ul> </div> diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html index c44e830b9c..a3fb8aa6da 100644 --- a/phpBB/styles/prosilver/template/viewforum_body.html +++ b/phpBB/styles/prosilver/template/viewforum_body.html @@ -1,5 +1,5 @@ <!-- INCLUDE overall_header.html --> -<!-- IF U_MCP or U_ACP --><p class="responsive-center">[ <!-- IF U_ACP --><a href="{U_ACP}" title="{L_ACP}" data-responsive-text="{L_ACP_SHORT}">{L_ACP}</a><!-- IF U_MCP --> | <!-- ENDIF --><!-- ENDIF --><!-- IF U_MCP --><a href="{U_MCP}" title="{L_MCP}" data-responsive-text="{L_MCP_SHORT}">{L_MCP}</a><!-- ENDIF --> ]</p><!-- ENDIF --> + <h2 class="forum-title"><!-- EVENT viewforum_forum_name_prepend --><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a><!-- EVENT viewforum_forum_name_append --></h2> <!-- IF FORUM_DESC or MODERATORS or U_MCP --> @@ -27,9 +27,9 @@ <!-- IF S_HAS_SUBFORUM --> <!-- IF not S_IS_BOT and U_MARK_FORUMS --> -<ul class="linklist"> - <li class="rightside mark-read"><a href="{U_MARK_FORUMS}" data-ajax="mark_forums_read">{L_MARK_SUBFORUMS_READ}</a></li> -</ul> + <div class="action-bar compact"> + <a href="{U_MARK_FORUMS}" class="mark-read rightside" data-ajax="mark_forums_read">{L_MARK_SUBFORUMS_READ}</a> + </div> <!-- ENDIF --> <!-- INCLUDE forumlist_body.html --> <!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index 03da6a74de..b764979f97 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -1,5 +1,5 @@ <!-- INCLUDE overall_header.html --> -<!-- IF U_MCP or U_ACP --><p class="responsive-center">[ <!-- IF U_ACP --><a href="{U_ACP}" title="{L_ACP}" data-responsive-text="{L_ACP_SHORT}">{L_ACP}</a><!-- IF U_MCP --> | <!-- ENDIF --><!-- ENDIF --><!-- IF U_MCP --><a href="{U_MCP}" title="{L_MCP}" data-responsive-text="{L_MCP_SHORT}">{L_MCP}</a><!-- ENDIF --> ]</p><!-- ENDIF --> + <h2 class="topic-title"><!-- EVENT viewtopic_topic_title_prepend --><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><!-- EVENT viewtopic_topic_title_append --></h2> <!-- NOTE: remove the style="display: none" when you want to have the forum description on the topic body --> <!-- IF FORUM_DESC --><div style="display: none !important;">{FORUM_DESC}<br /></div><!-- ENDIF --> @@ -350,6 +350,21 @@ <!-- INCLUDE viewtopic_topic_tools.html --> + <!-- IF .quickmod --> + <div class="dropdown-container dropdown-container-{S_CONTENT_FLOW_BEGIN} dropdown-up dropdown-{S_CONTENT_FLOW_END} dropdown-button-control" id="quickmod"> + <span title="{L_QUICK_MOD}" class="dropdown-trigger button icon-button modtools-icon dropdown-select">{L_QUICK_MOD}</span> + <div class="dropdown hidden"> + <div class="pointer"><div class="pointer-inner"></div></div> + <ul class="dropdown-contents"> + <!-- BEGIN quickmod --> + <!-- DEFINE $QUICKMOD_AJAX = (quickmod.VALUE in ['lock', 'unlock', 'delete_topic', 'restore_topic', 'make_normal', 'make_sticky', 'make_announce', 'make_global']) --> + <li><a href="{quickmod.LINK}"<!-- IF $QUICKMOD_AJAX --> data-ajax="true" data-refresh="true"<!-- ENDIF -->>{quickmod.TITLE}</a></li> + <!-- END quickmod --> + </ul> + </div> + </div> + <!-- ENDIF --> + <!-- IF .pagination or TOTAL_POSTS --> <div class="pagination"> {TOTAL_POSTS} @@ -366,21 +381,6 @@ <!-- EVENT viewtopic_body_footer_before --> <!-- INCLUDE jumpbox.html --> -<!-- IF .quickmod --> - <form method="post" action="{S_MOD_ACTION}" id="quickmodform"> - <fieldset class="quickmod"> - <label for="quick-mod-select">{L_QUICK_MOD}{L_COLON}</label> - <select name="action" id="quick-mod-select"> - <!-- BEGIN quickmod --> - <option value="{quickmod.VALUE}">{quickmod.TITLE}</option> - <!-- END quickmod --> - </select> - <input type="submit" value="{L_GO}" class="button2" /> - {S_FORM_TOKEN} - </fieldset> - </form> -<!-- ENDIF --> - <!-- IF S_DISPLAY_ONLINE_LIST --> <div class="stat-block online-list"> <h3><!-- IF U_VIEWONLINE --><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a><!-- ELSE -->{L_WHO_IS_ONLINE}<!-- ENDIF --></h3> diff --git a/phpBB/styles/prosilver/template/viewtopic_topic_tools.html b/phpBB/styles/prosilver/template/viewtopic_topic_tools.html index 5394c00f6a..2a34ebd446 100644 --- a/phpBB/styles/prosilver/template/viewtopic_topic_tools.html +++ b/phpBB/styles/prosilver/template/viewtopic_topic_tools.html @@ -7,16 +7,12 @@ <!-- EVENT viewtopic_topic_tools_before --> <!-- IF U_WATCH_TOPIC --> <li class="small-icon icon-<!-- IF S_WATCHING_TOPIC -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->"> - <a href="{U_WATCH_TOPIC}" class="watch-topic-link" title="{S_WATCH_TOPIC_TITLE}" data-ajax="toggle_link" data-toggle-class="small-icon icon-<!-- IF not S_WATCHING_TOPIC -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->" data-toggle-text="{S_WATCH_TOPIC_TOGGLE}" data-toggle-url="{U_WATCH_TOPIC_TOGGLE}" data-update-all=".watch-topic-link"> - {S_WATCH_TOPIC_TITLE} - </a> + <a href="{U_WATCH_TOPIC}" class="watch-topic-link" title="{S_WATCH_TOPIC_TITLE}" data-ajax="toggle_link" data-toggle-class="small-icon icon-<!-- IF not S_WATCHING_TOPIC -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->" data-toggle-text="{S_WATCH_TOPIC_TOGGLE}" data-toggle-url="{U_WATCH_TOPIC_TOGGLE}" data-update-all=".watch-topic-link">{S_WATCH_TOPIC_TITLE}</a> </li> <!-- ENDIF --> <!-- IF U_BOOKMARK_TOPIC --> <li class="small-icon icon-bookmark"> - <a href="{U_BOOKMARK_TOPIC}" class="bookmark-link" title="{L_BOOKMARK_TOPIC}" data-ajax="alt_text" data-alt-text="{S_BOOKMARK_TOGGLE}" data-update-all=".bookmark-link"> - {S_BOOKMARK_TOPIC} - </a> + <a href="{U_BOOKMARK_TOPIC}" class="bookmark-link" title="{L_BOOKMARK_TOPIC}" data-ajax="alt_text" data-alt-text="{S_BOOKMARK_TOGGLE}" data-update-all=".bookmark-link">{S_BOOKMARK_TOPIC}</a> </li> <!-- ENDIF --> <!-- IF U_BUMP_TOPIC --><li class="small-icon icon-bump"><a href="{U_BUMP_TOPIC}" title="{L_BUMP_TOPIC}" data-ajax="true">{L_BUMP_TOPIC}</a></li><!-- ENDIF --> diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css index 2e9253928e..65a1816c24 100644 --- a/phpBB/styles/prosilver/theme/bidi.css +++ b/phpBB/styles/prosilver/theme/bidi.css @@ -59,20 +59,20 @@ /* Horizontal lists ----------------------------------------*/ -.rtl ul.linklist li { +.rtl ul.linklist > li { float: right; margin-right: 0; - margin-left: 5px; + margin-left: 7px; } -.rtl ul.linklist li.rightside, .rtl p.rightside { +.rtl ul.linklist > li.rightside, .rtl p.rightside, .rtl a.rightside { float: left; - margin-right: 5px; + margin-right: 7px; margin-left: 0; text-align: left; } -.rtl ul.leftside li, .rtl ul.rightside li { +.rtl ul.leftside > li, .rtl ul.rightside > li { float: left; } @@ -92,11 +92,16 @@ /* Bulletin icons for list items ----------------------------------------*/ -.rtl ul.linklist.bulletin li:before { +.rtl ul.linklist.bulletin > li:before { padding-left: 4px; padding-right: 0; } +.rtl ul.linklist li.responsive-menu a.responsive-menu-link:before { + left: auto; + right: 0; +} + /* Dropdown menu ---------------------------------------- */ .rtl .dropdown-container.topic-tools { @@ -112,6 +117,10 @@ padding-right: 10px; } +.rtl .dropdown-extended .header { + text-align: right; +} + .rtl .dropdown-extended .header .header_settings { float: left; } @@ -276,12 +285,15 @@ text-align: left; } -.rtl .forabg { - width: 99%; /* fix for IE6 */ +.rtl #quick-links { + margin-left: 7px; + margin-right: 0; } -.rtl .forumbg { - width: 99%; /* fix for IE6 */ +.rtl .header-avatar span:after { + float: left; + margin-left: 0; + margin-right: 2px; } .rtl .member-search { @@ -436,7 +448,7 @@ ul.linklist li.small-icon > a, ul.linklist li.breadcrumbs span:first-child > a { margin-right: 2px; } -.rtl dd.lastpost span, .rtl ul.topiclist dd.info span, .rtl ul.topiclist dd.time span, .rtl dd.redirect span, .rtl dd.moderation span { +.rtl dd.lastpost > span, .rtl ul.topiclist dd.info > span, .rtl ul.topiclist dd.time > span, .rtl dd.redirect > span, .rtl dd.moderation > span { padding-left: 0; padding-right: 5px; } @@ -616,7 +628,8 @@ ul.linklist li.small-icon > a, ul.linklist li.breadcrumbs span:first-child > a { ---------------------------------------- */ .rtl .small-icon { background-position: 100% 50%; - padding: 0 19px 0 0; + padding-left: 0; + padding-right: 19px; } .rtl ul.linklist li.small-icon { diff --git a/phpBB/styles/prosilver/theme/buttons.css b/phpBB/styles/prosilver/theme/buttons.css index 96743bef5d..18c71d251e 100644 --- a/phpBB/styles/prosilver/theme/buttons.css +++ b/phpBB/styles/prosilver/theme/buttons.css @@ -21,8 +21,8 @@ vertical-align: bottom; } -.icon-button.dropdown-select { - padding-right: 28px; +.dropdown-select { + padding-right: 24px; } .icon-button:before { @@ -35,6 +35,10 @@ width: 12px; } +.dropdown-select.icon-button:before { + margin-right: 4px; +} + .dropdown-select:after { background-position: -103px 10px; border-left: 1px solid; @@ -58,6 +62,10 @@ margin-right: 5px; } +#jumpbox .dropdown-select { + margin: 0; +} + /* Big button images */ .reply-icon:before, .pmreply-icon:before { background-position: -20px 0; } .reply-icon:hover:before, .pmreply-icon:hover:before { background-position: -20px -20px; } @@ -73,7 +81,11 @@ .forwardpm-icon:before { background-position: -40px 0; } .forwardpm-icon:hover:before { background-position: -40px -20px; } -.tools-icon:before { +.modtools-icon { + font-size: 0; +} + +.tools-icon:before, .modtools-icon:before { background-position: -80px 0; height: 16px; margin-top: 2px; @@ -83,6 +95,10 @@ .dropdown-visible .tools-icon:before, .nojs .dropdown-container:hover .tools-icon:before { background-position: -80px -20px; } +.modtools-icon:before { background-position: -225px 0; } +.dropdown-visible .modtools-icon:before, +.nojs .dropdown-container:hover .modtools-icon:before { background-position: -225px -20px; } + /* Icon images ---------------------------------------- */ .small-icon { @@ -96,7 +112,7 @@ ul.linklist li.small-icon { padding-left: 0; } -ul.linklist.bulletin li.small-icon:before { +ul.linklist.bulletin > li.small-icon:before { display: none; } @@ -157,7 +173,7 @@ ul.linklist.bulletin li.small-icon:before { margin-top: 2px; } -.post-buttons li { +.post-buttons > li { float: left; margin-right: 3px; } diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css index 4b7532ab8a..606a788036 100644 --- a/phpBB/styles/prosilver/theme/colours.css +++ b/phpBB/styles/prosilver/theme/colours.css @@ -5,7 +5,7 @@ Colours and backgrounds for common.css html, body { color: #536482; - background-color: #FFFFFF; + background-color: #F5F7FA; } h1 { @@ -43,6 +43,11 @@ hr { /* Round cornered boxes and backgrounds ---------------------------------------- */ +#wrap { + background-color: #FFF; + border-color: #E6E9ED; +} + .headerbar { background-color: #12A3EB; background-image: url("./images/bg_header.gif"); @@ -106,7 +111,7 @@ table.zebra-list tr:nth-child(even) td, ul.zebra-list li:nth-child(even) { ----------------------------------------*/ ul.navlinks { - border-bottom-color: #FFFFFF; + border-top-color: #FFFFFF; } /* Table styles @@ -241,16 +246,10 @@ Colours and backgrounds for links.css -------------------------------------------------------------- */ a { color: #105289; } -a:visited { color: #105289; } a:hover { color: #D31141; } -a:active { color: #368AD2; } /* Links on gradient backgrounds */ -#search-box a:link, .navbg a:link, .forumbg .header a:link, .forabg .header a:link, th a:link { - color: #FFFFFF; -} - -#search-box a:visited, .navbg a:visited, .forumbg .header a:visited, .forabg .header a:visited, th a:visited { +#search-box a, .navbg a, .forumbg .header a, .forabg .header a, th a { color: #FFFFFF; } @@ -258,44 +257,11 @@ a:active { color: #368AD2; } color: #A8D8FF; } -#search-box a:active, .navbg a:active, .forumbg .header a:active, .forabg .header a:active, th a:active { - color: #C8E6FF; -} - /* Notification mark read link */ .dropdown-extended a.mark_read { background-color: #FFFFFF; } -/* Links for forum/topic lists */ -a.forumtitle { - color: #105289; -} - -/* a.forumtitle:visited { color: #105289; } */ - -a.forumtitle:hover { - color: #BC2A4D; -} - -a.forumtitle:active { - color: #105289; -} - -a.topictitle { - color: #105289; -} - -/* a.topictitle:visited { color: #368AD2; } */ - -a.topictitle:hover { - color: #BC2A4D; -} - -a.topictitle:active { - color: #105289; -} - /* Post body links */ .postlink { color: #368AD2; @@ -307,7 +273,7 @@ a.topictitle:active { border-bottom-color: #5D8FBD; } -.postlink:active { +.postlink { color: #368AD2; } @@ -316,32 +282,10 @@ a.topictitle:active { color: #0D4473; } -.signature a, .signature a:visited, .signature a:hover, .signature a:active { +.signature a, .signature a:hover { background-color: transparent; } -/* Profile links */ -.postprofile a:link, .postprofile a:visited, .postprofile dt.author a { - color: #105289; -} - -.postprofile a:hover, .postprofile dt.author a:hover { - color: #D31141; -} - -.postprofile a:active { - color: #105289; -} - -/* Profile searchresults */ -.search .postprofile a { - color: #105289; -} - -.search .postprofile a:hover { - color: #D31141; -} - /* Back to top of page */ a.top { background-image: url("./images/icon_back_top.gif"); @@ -369,7 +313,6 @@ a.arrow-right:hover { color: #368AD2; } - /* -------------------------------------------------------------- Colours and backgrounds for content.css @@ -658,7 +601,7 @@ dd.profile-warnings { -------------------------------------------------------------- Colours and backgrounds for buttons.css -------------------------------------------------------------- */ -.button, .button:visited { +.button { border-color: #C7C3BF; background-color: #FFFFFF; background-image: -moz-linear-gradient(top, #FFFFFF, #E9E9E9); @@ -668,7 +611,11 @@ 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; + color: #D31141; +} + +.dropdown-select, .dropdown-select:visited { + color: #536482; } .button:hover, .dropdown-visible .dropdown-select, .nojs .dropdown-container:hover .dropdown-select { @@ -694,24 +641,37 @@ Colours and backgrounds for buttons.css /* Icon images ---------------------------------------- */ -.icon-faq { background-image: url("./images/icon_faq.gif"); } -.icon-members { background-image: url("./images/icon_members.gif"); } -.icon-home { background-image: url("./images/icon_home.gif"); } -.icon-ucp { background-image: url("./images/icon_ucp.gif"); } -.icon-register { background-image: url("./images/icon_register.gif"); } -.icon-logout { background-image: url("./images/icon_logout.gif"); } -.icon-bookmark { background-image: url("./images/icon_bookmark.gif"); } -.icon-bump { background-image: url("./images/icon_bump.gif"); } -.icon-subscribe { background-image: url("./images/icon_subscribe.gif"); } -.icon-unsubscribe { background-image: url("./images/icon_unsubscribe.gif"); } -.icon-pages { background-image: url("./images/icon_pages.gif"); } +.icon-acp { background-image: url("./images/icon_acp.gif"); } +.icon-bookmark { background-image: url("./images/icon_bookmark.gif"); } +.icon-bump { background-image: url("./images/icon_bump.gif"); } +.icon-contact { background-image: url("./images/icon_pm.gif"); } +.icon-delete-cookies { background-image: url("./images/icon_delete_cookies.gif"); } +.icon-download { background-image: url("./images/icon_download.gif"); } +.icon-faq { background-image: url("./images/icon_faq.gif"); } +.icon-home { background-image: url("./images/icon_home.gif"); } +.icon-logout { background-image: url("./images/icon_logout.gif"); } +.icon-mark { background-image: url("./images/icon_mark.gif"); } +.icon-mcp { background-image: url("./images/icon_mcp.gif"); } +.icon-members { background-image: url("./images/icon_members.gif"); } +.icon-notification { background-image: url("./images/icon_notification.gif"); } +.icon-pages { background-image: url("./images/icon_pages.gif"); } +.icon-pm { background-image: url("./images/icon_pm.gif"); } +.icon-print { background-image: url("./images/icon_print.gif"); } +.icon-profile { background-image: url("./images/icon_profile.gif"); } +.icon-quick-links { background-image: url("./images/icon_quick_links.gif"); } +.icon-register { background-image: url("./images/icon_register.gif"); } .icon-search, .responsive-search a { background-image: url("./images/icon_search.gif"); } -.icon-notification { background-image: url("./images/icon_notification.gif"); } -.icon-pm { background-image: url("./images/icon_pm.gif"); } -.icon-download { background-image: url("./images/icon_download.gif"); } -.icon-mark { background-image: url("./images/icon_mark.gif"); } -.icon-sendemail { background-image: url("./images/icon_sendemail.gif"); } -.icon-print { background-image: url("./images/icon_print.gif"); } +.icon-search-active { background-image: url("./images/subforum_read.gif"); } +.icon-search-advanced { background-image: url("./images/icon_search_adv.gif"); } +.icon-search-new { background-image: url("./images/subforum_unread.gif"); } +.icon-search-self { background-image: url("./images/icon_topic_latest.gif"); } +.icon-search-unanswered { background-image: url("./images/icon_post_target.gif"); } +.icon-search-unread { background-image: url("./images/subforum_unread.gif"); } +.icon-sendemail { background-image: url("./images/icon_sendemail.gif"); } +.icon-subscribe { background-image: url("./images/icon_subscribe.gif"); } +.icon-team { background-image: url("./images/icon_team.gif"); } +.icon-ucp { background-image: url("./images/icon_ucp.gif"); } +.icon-unsubscribe { background-image: url("./images/icon_unsubscribe.gif"); } /* Profile & navigation icons */ .contact-icon { background-image: url("./images/icons_contact.png"); } @@ -814,7 +774,7 @@ ul.cplist { #tabs .tab > a:hover { background: #DDEDFB; - color: #BC2A4D; + color: #D31141; } #tabs .activetab > a, @@ -855,7 +815,7 @@ ul.cplist { } .responsive-tab .responsive-tab-link:hover:before { - border-color: #BC2A4D; + border-color: #D31141; } /* UCP navigation menu @@ -1079,7 +1039,7 @@ a.button2, input.button2, input.button3 { } /* <a> button in the style of the form buttons */ -a.button1, a.button1:link, a.button1:visited, a.button1:active, a.button2, a.button2:link, a.button2:visited, a.button2:active { +a.button1, a.button2 { color: #000000; } @@ -1122,7 +1082,7 @@ input.disabled { } .dropdown-extended ul li { - border-bottom-color: #B9B9B9; + border-top-color: #B9B9B9; } .dropdown-extended ul li:hover { @@ -1184,6 +1144,10 @@ ul.linklist li.responsive-menu a.responsive-menu-link:hover:before, ul.linklist border-color: #DCDCDC; } +.dropdown li.separator { + border-color: #DCDCDC; +} + /* Notifications ---------------------------------------- */ diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index a52f5e494d..749d02c50c 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -59,7 +59,7 @@ body { font-size: 10px; line-height: normal; margin: 0; - padding: 12px 0; + padding: 0; word-wrap: break-word; } @@ -175,8 +175,18 @@ ol ol ul, ol ul ul, ul ol ul, ul ul ul { /* Main blocks ---------------------------------------- */ #wrap { - padding: 0 20px; - min-width: 650px; + border: 1px solid transparent; + border-radius: 8px; + margin: 12px auto; + max-width: 1152px; + min-width: 625px; + padding: 15px; +} + +@media only screen and (max-width: 1220px), only screen and (max-device-width: 1220px) { + #wrap { + margin: 12px; + } } #simple-wrap { @@ -261,7 +271,7 @@ ol ol ul, ol ul ul, ul ol ul, ul ul ul { } .navbar { - padding: 5px 10px 5px 10px; + padding: 3px 10px; border-radius: 7px; } @@ -307,6 +317,10 @@ ol ol ul, ol ul ul, ul ol ul, ul ul ul { /* Horizontal lists ----------------------------------------*/ +.navbar ul.linklist { + padding: 2px 0; +} + ul.linklist { display: block; margin: 0; @@ -322,29 +336,25 @@ ul.linklist:after { padding: 5px 10px; } -ul.linklist li { - display: block; - list-style-type: none; +ul.linklist > li { float: left; - width: auto; - margin-right: 5px; font-size: 1.1em; line-height: 2.2em; + list-style-type: none; + margin-right: 7px; padding-top: 1px; + width: auto; } -ul.linklist li.rightside, p.rightside { +ul.linklist > li.rightside, p.rightside, a.rightside { float: right; margin-right: 0; - margin-left: 5px; + margin-left: 7px; text-align: right; } ul.navlinks { - padding-bottom: 1px; - margin-bottom: 1px; - border-bottom: 1px solid transparent; - font-weight: bold; + border-top: 1px solid transparent; } ul.leftside { @@ -372,7 +382,7 @@ ul.linklist li.responsive-menu a.responsive-menu-link { font-size: 16px; position: relative; width: 16px; - line-height: 16.5px; + line-height: 20px; text-decoration: none; } @@ -403,27 +413,18 @@ li.responsive-menu.dropdown-left .dropdown { right: -6px; } -li.responsive-menu .dropdown .dropdown-contents { - padding: 0 5px; -} - -ul.linklist .dropdown-down .dropdown { +ul.linklist .dropdown { top: 22px; } ul.linklist .dropdown-up .dropdown { bottom: 18px; + top: auto; } -ul.linklist .dropdown li { - clear: both; -} - - - /* Bulletin icons for list items ----------------------------------------*/ -ul.linklist.bulletin li:before { +ul.linklist.bulletin > li:before { display: inline-block; content: "\2022"; font-size: inherit; @@ -431,11 +432,12 @@ ul.linklist.bulletin li:before { padding-right: 4px; } -ul.linklist.bulletin li:first-child:before, ul.linklist.bulletin li.rightside:last-child:before { +ul.linklist.bulletin > li:first-child:before, +ul.linklist.bulletin > li.rightside:last-child:before { content: none; } -ul.linklist.bulletin li.no-bulletin:before { +ul.linklist.bulletin > li.no-bulletin:before { content: none; } @@ -443,20 +445,46 @@ ul.linklist.bulletin li.no-bulletin:before { display: none !important; } -/* Avatar in overall_header.html */ +/* Profile in overall_header.html */ +.header-profile { + display: inline-block; + vertical-align: top; +} + +.header-avatar:hover { + text-decoration: none; +} + .header-avatar img { margin-bottom: 2px; - max-height: 25px; + max-height: 20px; vertical-align: middle; width: auto; } +.header-avatar span:after { + content: '\25BC'; + display: inline-block; + font-size: 9px; + float: right; + margin-left: 2px; + opacity: 0.7; +} + /* Dropdown menu ----------------------------------------*/ .dropdown-container { position: relative; } +.dropdown-container-right { + float: right; +} + +.dropdown-container-left { + float: left; +} + .nojs .dropdown-container:hover .dropdown { display: block !important; } @@ -556,14 +584,14 @@ ul.linklist.bulletin li.no-bulletin:before { padding: 5px; position: relative; min-width: 40px; - max-height: 200px; + max-height: 300px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .dropdown li { - border-bottom: 1px dotted transparent; + border-top: 1px dotted transparent; float: none !important; line-height: normal !important; font-size: 1em !important; @@ -575,8 +603,16 @@ ul.linklist.bulletin li.no-bulletin:before { text-align: left; } -.dropdown li:last-child, .dropdown li li { - border-bottom: 0; +.dropdown-contents > li { + padding-right: 15px; +} + +.dropdown-nonscroll > li { + padding-right: 0; +} + +.dropdown li:first-child, .dropdown li.separator + li, .dropdown li li { + border-top: 0; } .dropdown li li:first-child { @@ -596,7 +632,13 @@ ul.linklist.bulletin li.no-bulletin:before { white-space: normal; } -.dropdown li:before, .dropdown li:after { +.dropdown li.separator { + border-top: 1px solid transparent; + margin: 4px 0; + padding: 0; +} + +.dropdown li.separator:first-child, .dropdown li.separator:last-child { display: none !important; } @@ -604,6 +646,7 @@ ul.linklist.bulletin li.no-bulletin:before { ----------------------------------------*/ .breadcrumbs .crumb { float: left; + font-weight: bold; word-wrap: normal; } @@ -912,14 +955,14 @@ fieldset.fields1 dl.pmlist dd.recipients { .phpbb_alert { border: 1px solid transparent; display: none; - left: 0; + left: 0; padding: 0 25px 20px 25px; position: fixed; - right: 0; + right: 0; top: 150px; z-index: 50; width: 620px; - margin: 0 auto; + margin: 0 auto; } @media only screen and (max-height: 500px), only screen and (max-device-width: 500px) @@ -1062,6 +1105,14 @@ form > p.post-notice strong { line-height: 20px; } +#jumpbox { + margin: 5px 0; +} + +.stat-block { + clear: both; +} + #top { position: absolute; top: -20px; @@ -1099,11 +1150,7 @@ form > p.post-notice strong { .dropdown-extended { display: none; - position: absolute; - left: 0; - width: 340px; z-index: 1; - top: 22px; } .dropdown-extended ul { @@ -1117,24 +1164,30 @@ form > p.post-notice strong { padding: 0; margin: 0 !important; float: none; - border-bottom: 1px solid; + border-top: 1px solid; list-style-type: none; font-size: 0.95em; clear: both; position: relative; } -.dropdown-extended ul li.no_notifications { - padding: 10px; +.dropdown-extended ul li:first-child { + border-top: none; } -.dropdown-extended ul li:before, .dropdown-extended ul li:after { - display: none; +.dropdown-extended ul li.no_notifications { + padding: 10px; } .dropdown-extended .dropdown-contents { max-height: none; padding: 0; + position: absolute; + width: 340px; +} + +.nojs .dropdown-extended .dropdown-contents { + position: relative; } .dropdown-extended .header { @@ -1142,8 +1195,9 @@ form > p.post-notice strong { font-family: Arial, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 11px; font-weight: bold; + text-align: left; text-shadow: 1px 1px 1px white; - text-transform: uppercase; + text-transform: uppercase; line-height: 30px; border-bottom: 1px solid; border-radius: 5px 5px 0 0; @@ -1233,6 +1287,30 @@ form > p.post-notice strong { display: block; } +/* Navbar specific list items +----------------------------------------*/ + +#quick-links { + margin: 0 7px 0 0; +} + +#quick-links a.responsive-menu-link { + display: block; + font-size: inherit; + line-height: inherit; + margin: 0; + width: auto; +} + +#quick-links a.responsive-menu-link:before { + font-size: 16px; + line-height: 16.5px; +} + +.compact #quick-links a.responsive-menu-link { + font-size: 0; +} + .compact .icon-notification > a > span, .compact .icon-pm > a > span { display: none; } @@ -1252,3 +1330,19 @@ form > p.post-notice strong { .dropdown-page-jump input.tiny { width: 50px; } + +.dropdown .clone { + display: none; +} + +.responsive .dropdown .clone { + display: inherit; +} + +.dropdown .clone + li.separator { + display: none; +} + +.responsive .dropdown .clone + li.separator { + display: inherit; +} diff --git a/phpBB/styles/prosilver/theme/content.css b/phpBB/styles/prosilver/theme/content.css index b99312a5be..0f7f843010 100644 --- a/phpBB/styles/prosilver/theme/content.css +++ b/phpBB/styles/prosilver/theme/content.css @@ -210,7 +210,7 @@ dd.time { line-height: 200%; } -dd.lastpost span, ul.topiclist dd.info span, ul.topiclist dd.time span, dd.redirect span, dd.moderation span { +dd.lastpost > span, ul.topiclist dd.info > span, ul.topiclist dd.time > span, dd.redirect > span, dd.moderation > span { display: block; padding-left: 5px; } @@ -351,10 +351,6 @@ dd.option { line-height: 1.4em; } -span.corners-top, span.corners-bottom { - display: none; -} - dl.faq { font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; font-size: 1.1em; diff --git a/phpBB/styles/prosilver/theme/forms.css b/phpBB/styles/prosilver/theme/forms.css index 0c0a3e5ca9..a1d70dedf6 100644 --- a/phpBB/styles/prosilver/theme/forms.css +++ b/phpBB/styles/prosilver/theme/forms.css @@ -201,24 +201,6 @@ fieldset.forum-selection2 { float: right; } -/* Jumpbox */ -fieldset.jumpbox { - text-align: right; - margin-top: 15px; - min-height: 2.5em; -} - -fieldset.jumpbox select { - max-width: 50%; -} - -fieldset.quickmod { - width: 50%; - float: right; - text-align: right; - height: 2.5em; -} - /* Submit button fieldset */ fieldset.submit-buttons { text-align: center; diff --git a/phpBB/styles/prosilver/theme/images/icon_acp.gif b/phpBB/styles/prosilver/theme/images/icon_acp.gif Binary files differnew file mode 100644 index 0000000000..3afa98ee8f --- /dev/null +++ b/phpBB/styles/prosilver/theme/images/icon_acp.gif diff --git a/phpBB/styles/prosilver/theme/images/icon_delete_cookies.gif b/phpBB/styles/prosilver/theme/images/icon_delete_cookies.gif Binary files differnew file mode 100644 index 0000000000..f7665ebff8 --- /dev/null +++ b/phpBB/styles/prosilver/theme/images/icon_delete_cookies.gif diff --git a/phpBB/styles/prosilver/theme/images/icon_mcp.gif b/phpBB/styles/prosilver/theme/images/icon_mcp.gif Binary files differnew file mode 100644 index 0000000000..80de2e53f7 --- /dev/null +++ b/phpBB/styles/prosilver/theme/images/icon_mcp.gif diff --git a/phpBB/styles/prosilver/theme/images/icon_profile.gif b/phpBB/styles/prosilver/theme/images/icon_profile.gif Binary files differnew file mode 100644 index 0000000000..a0ec098460 --- /dev/null +++ b/phpBB/styles/prosilver/theme/images/icon_profile.gif diff --git a/phpBB/styles/prosilver/theme/images/icon_team.gif b/phpBB/styles/prosilver/theme/images/icon_team.gif Binary files differnew file mode 100644 index 0000000000..613158257b --- /dev/null +++ b/phpBB/styles/prosilver/theme/images/icon_team.gif diff --git a/phpBB/styles/prosilver/theme/images/icons_button.png b/phpBB/styles/prosilver/theme/images/icons_button.png Binary files differindex a45a0cc2ba..da9ae6f1b4 100644 --- a/phpBB/styles/prosilver/theme/images/icons_button.png +++ b/phpBB/styles/prosilver/theme/images/icons_button.png diff --git a/phpBB/styles/prosilver/theme/links.css b/phpBB/styles/prosilver/theme/links.css index 89639dde02..890f854baa 100644 --- a/phpBB/styles/prosilver/theme/links.css +++ b/phpBB/styles/prosilver/theme/links.css @@ -5,19 +5,10 @@ a { direction: ltr; unicode-bidi: embed; -} - -a:link, a:visited { text-decoration: none; } -a:hover { - text-decoration: underline; -} - -a:active { - text-decoration: none; -} +a:hover { text-decoration: underline; } /* Coloured usernames */ .username-coloured { @@ -27,11 +18,7 @@ a:active { } /* Links on gradient backgrounds */ -#search-box a:link, .navbg a:link, .forumbg .header a:link, .forabg .header a:link, th a:link { - text-decoration: none; -} - -#search-box a:visited, .navbg a:visited, .forumbg .header a:visited, .forabg .header a:visited, th a:visited { +#search-box a, .navbg a, .forumbg .header a, .forabg .header a, th a { text-decoration: none; } @@ -39,10 +26,6 @@ a:active { text-decoration: underline; } -#search-box a:active, .navbg a:active, .forumbg .header a:active, .forabg .header a:active, th a:active { - text-decoration: none; -} - /* Navigation bar links */ ul.linklist li.small-icon > a, ul.linklist li.breadcrumbs span:first-child > a { display: inline-block; @@ -118,13 +101,13 @@ a.lastsubject:hover { text-decoration: none; } -.signature a, .signature a:visited, .signature a:hover, .signature a:active { +.signature a, .signature a:hover { border: none; text-decoration: underline; } /* Profile links */ -.postprofile a:link, .postprofile a:visited, .postprofile dt.author a { +.postprofile a, .postprofile dt.author a { font-weight: bold; text-decoration: none; } @@ -133,22 +116,14 @@ a.lastsubject:hover { text-decoration: underline; } -/* CSS spec requires a:link, a:visited, a:hover and a:active rules to be specified in this order. */ -/* See http://www.phpbb.com/bugs/phpbb3/59685 */ -.postprofile a:active { - font-weight: bold; - text-decoration: none; -} - - -/* Profile searchresults */ +/* Profile searchresults */ .search .postprofile a { - text-decoration: none; + text-decoration: none; font-weight: normal; } .search .postprofile a:hover { - text-decoration: underline; + text-decoration: underline; } /* Back to top of page */ @@ -182,7 +157,7 @@ a.arrow-down { background: none no-repeat right center; } a.arrow-left { background: none no-repeat 3px 60%; } a.arrow-right { background: none no-repeat 95% 60%; } -a.arrow-up, a.arrow-up:link, a.arrow-up:active, a.arrow-up:visited { +a.arrow-up { padding-left: 10px; text-decoration: none; border-bottom-width: 0; @@ -192,7 +167,7 @@ a.arrow-up:hover { background-position: left top; } -a.arrow-down, a.arrow-down:link, a.arrow-down:active, a.arrow-down:visited { +a.arrow-down { padding-right: 10px; } @@ -201,7 +176,7 @@ a.arrow-down:hover { text-decoration: none; } -a.arrow-left, a.arrow-left:active, a.arrow-left:visited { +a.arrow-left { padding-left: 12px; } @@ -210,7 +185,7 @@ a.arrow-left:hover { background-position: 0 60%; } -a.arrow-right, a.arrow-right:active, a.arrow-right:visited { +a.arrow-right { padding-right: 12px; } diff --git a/phpBB/styles/prosilver/theme/responsive.css b/phpBB/styles/prosilver/theme/responsive.css index e27a2292b3..9615f1a0b4 100644 --- a/phpBB/styles/prosilver/theme/responsive.css +++ b/phpBB/styles/prosilver/theme/responsive.css @@ -12,13 +12,12 @@ html { height: auto; } -body { - padding: 0 5px; -} - #wrap { - min-width: 300px; - padding: 0; + border: none; + border-radius: 0; + margin: 0; + min-width: 290px; + padding: 0 5px; } /* Common block wrappers @@ -73,7 +72,7 @@ body { .responsive-search a { display: block; width: 16px; - height: 18px; + height: 22px; text-indent: 99px; overflow: hidden; background-position: 50% 50%; @@ -190,8 +189,8 @@ ul.topiclist li.row dt a.subforum { ----------------------------------------*/ @media only screen and (max-width: 350px), only screen and (max-device-width: 350px) { - .dropdown-extended { - width: 250px; + .dropdown-extended .dropdown-contents { + width: auto; } } diff --git a/phpBB/styles/prosilver/theme/tweaks.css b/phpBB/styles/prosilver/theme/tweaks.css index 9a8ed5d399..28eb328cb1 100644 --- a/phpBB/styles/prosilver/theme/tweaks.css +++ b/phpBB/styles/prosilver/theme/tweaks.css @@ -69,5 +69,5 @@ dd.option { /* Fixes header-avatar aspect-ratio in IE8 */ .header-avatar img { - height: 25px; + height: 20px; } diff --git a/phpBB/styles/subsilver2/template/index_body.html b/phpBB/styles/subsilver2/template/index_body.html index 2fdd0c77c1..1a2786015f 100644 --- a/phpBB/styles/subsilver2/template/index_body.html +++ b/phpBB/styles/subsilver2/template/index_body.html @@ -1,6 +1,6 @@ <!-- INCLUDE overall_header.html --> -<!-- EVENT index_body_linklist_before --> +<!-- EVENT index_body_markforums_before --> <!-- IF U_MCP or U_ACP --> <div id="pageheader"> @@ -10,7 +10,7 @@ <br clear="all" /><br /> <!-- ENDIF --> -<!-- EVENT index_body_linklist_after --> +<!-- EVENT index_body_markforums_after --> <!-- INCLUDE forumlist_body.html --> diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index 4513a6570b..4c897c58aa 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -44,6 +44,7 @@ if (!$auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) } $pagination = $phpbb_container->get('pagination'); +$viewonline_helper = $phpbb_container->get('viewonline_helper'); $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_JOINED'], 'c' => $user->lang['SORT_LOCATION']); $sort_key_sql = array('a' => 'u.username_clean', 'b' => 's.session_time', 'c' => 's.session_page'); @@ -213,11 +214,7 @@ while ($row = $db->sql_fetchrow($result)) continue; } - preg_match('#^([a-z0-9/_-]+)#i', $row['session_page'], $on_page); - if (!sizeof($on_page)) - { - $on_page[1] = ''; - } + $on_page = $viewonline_helper->get_user_page($row['session_page']); switch ($on_page[1]) { diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index d87f7de2b0..23f2fe8e3d 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -523,6 +523,19 @@ gen_forum_auth_level('topic', $forum_id, $topic_data['forum_status']); // Quick mod tools $allow_change_type = ($auth->acl_get('m_', $forum_id) || ($user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster'])) ? true : false; +$s_quickmod_action = append_sid( + "{$phpbb_root_path}mcp.$phpEx", + array( + 'f' => $forum_id, + 't' => $topic_id, + 'start' => $start, + 'quickmod' => 1, + 'redirect' => urlencode(str_replace('&', '&', $viewtopic_url)), + ), + true, + $user->session_id +); + $quickmod_array = array( // 'key' => array('LANG_KEY', $userHasPermissions), @@ -546,7 +559,7 @@ foreach($quickmod_array as $option => $qm_ary) { if (!empty($qm_ary[1])) { - phpbb_add_quickmod_option($option, $qm_ary[0]); + phpbb_add_quickmod_option($s_quickmod_action, $option, $qm_ary[0]); } } @@ -631,7 +644,7 @@ $template->assign_vars(array( 'S_SELECT_SORT_DAYS' => $s_limit_days, 'S_SINGLE_MODERATOR' => (!empty($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id]) > 1) ? false : true, 'S_TOPIC_ACTION' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start")), - 'S_MOD_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start") . "&quickmod=1&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url)), true, $user->session_id), + 'S_MOD_ACTION' => $s_quickmod_action, 'L_RETURN_TO_FORUM' => $user->lang('RETURN_TO', $topic_data['forum_name']), 'S_VIEWTOPIC' => true, diff --git a/tests/auth/fixtures/oauth_tokens.xml b/tests/auth/fixtures/oauth_tokens.xml index 9bfb5a4422..6c82e94e62 100644 --- a/tests/auth/fixtures/oauth_tokens.xml +++ b/tests/auth/fixtures/oauth_tokens.xml @@ -5,6 +5,12 @@ <column>session_id</column> <column>provider</column> <column>oauth_token</column> + <row> + <value>1</value> + <value>abcd</value> + <value>auth.provider.oauth.service.testing</value> + <value>{"token_class":"phpbb_not_a_token","accessToken":"error","refreshToken":0,"endOfLife":null,"extraParams":null}</value> + </row> </table> </dataset> diff --git a/tests/auth/phpbb_not_a_token.php b/tests/auth/phpbb_not_a_token.php new file mode 100644 index 0000000000..61cc14fa10 --- /dev/null +++ b/tests/auth/phpbb_not_a_token.php @@ -0,0 +1,23 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class phpbb_not_a_token +{ + public function __construct($param1, $param2, $param3, $param4) + { + } + + public function setEndOfLife() + { + } +} diff --git a/tests/auth/provider_oauth_token_storage_test.php b/tests/auth/provider_oauth_token_storage_test.php index ec28e546bd..45daa9816b 100644 --- a/tests/auth/provider_oauth_token_storage_test.php +++ b/tests/auth/provider_oauth_token_storage_test.php @@ -13,6 +13,8 @@ use OAuth\OAuth2\Token\StdOAuth2Token; +require_once dirname(__FILE__) . '/phpbb_not_a_token.php'; + class phpbb_auth_provider_oauth_token_storage_test extends phpbb_database_test_case { protected $db; @@ -73,6 +75,22 @@ class phpbb_auth_provider_oauth_token_storage_test extends phpbb_database_test_c $this->assertEquals($token, $stored_token); } + public function test_retrieveAccessToken_wrong_token() + { + $this->user->data['session_id'] = 'abcd'; + try + { + $this->token_storage->retrieveAccessToken($this->service_name); + $this->fail('The token can not be deserialized and an exception should be thrown.'); + } + catch (\OAuth\Common\Storage\Exception\TokenNotFoundException $e) + { + } + + $row = $this->get_token_row_by_session_id('abcd'); + $this->assertFalse($row); + } + public function test_retrieveAccessToken_from_db() { $expected_token = new StdOAuth2Token('access', 'refresh', StdOAuth2Token::EOL_NEVER_EXPIRES); diff --git a/tests/extension/ext/barfoo/composer.json b/tests/extension/ext/barfoo/composer.json index d88fd413c9..05bb099707 100644 --- a/tests/extension/ext/barfoo/composer.json +++ b/tests/extension/ext/barfoo/composer.json @@ -13,10 +13,12 @@ "role": "N/A" }], "require": { - "php": ">=5.3", - "phpbb/phpbb": "3.1.*@dev" + "php": ">=5.3" }, "extra": { - "display-name": "phpBB BarFoo Extension" + "display-name": "phpBB BarFoo Extension", + "soft-require": { + "phpbb/phpbb": "3.1.*@dev" + } } } diff --git a/tests/extension/ext/vendor/moo/composer.json b/tests/extension/ext/vendor/moo/composer.json index b8fc544c01..d49aab47cd 100644 --- a/tests/extension/ext/vendor/moo/composer.json +++ b/tests/extension/ext/vendor/moo/composer.json @@ -13,10 +13,12 @@ "role": "N/A" }], "require": { - "php": ">=5.3", - "phpbb/phpbb": "3.1.*@dev" + "php": ">=5.3" }, "extra": { - "display-name": "phpBB Moo Extension" + "display-name": "phpBB Moo Extension", + "soft-require": { + "phpbb/phpbb": "3.1.*@dev" + } } } diff --git a/tests/extension/ext/vendor2/bar/composer.json b/tests/extension/ext/vendor2/bar/composer.json index 215e7d59db..9d2ed86a0c 100644 --- a/tests/extension/ext/vendor2/bar/composer.json +++ b/tests/extension/ext/vendor2/bar/composer.json @@ -12,10 +12,12 @@ "role": "N/A" }], "require": { - "php": ">=5.3", - "phpbb/phpbb": "3.1.*@dev" + "php": ">=5.3" }, "extra": { - "display-name": "phpBB Bar Extension" + "display-name": "phpBB Bar Extension", + "soft-require": { + "phpbb/phpbb": "3.1.*@dev" + } } } diff --git a/tests/extension/ext/vendor2/foo/composer.json b/tests/extension/ext/vendor2/foo/composer.json index 7b2a80f5d3..efcdfc338f 100644 --- a/tests/extension/ext/vendor2/foo/composer.json +++ b/tests/extension/ext/vendor2/foo/composer.json @@ -12,10 +12,12 @@ "role": "N/A" }], "require": { - "php": ">=5.3", - "phpbb/phpbb": "3.1.*@dev" + "php": ">=5.3" }, "extra": { - "display-name": "phpBB Foo Extension" + "display-name": "phpBB Foo Extension", + "soft-require": { + "phpbb/phpbb": "3.1.*@dev" + } } } diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php index d9f8fbd1a4..230c90c7c7 100644 --- a/tests/extension/manager_test.php +++ b/tests/extension/manager_test.php @@ -32,22 +32,62 @@ class phpbb_extension_manager_test extends phpbb_database_test_case $this->extension_manager = $this->create_extension_manager(); } - public function test_available() + public function test_all_available() { // barfoo and vendor3/bar should not listed due to missing composer.json. barfoo also has incorrect dir structure. $this->assertEquals(array('vendor/moo', 'vendor2/bar', 'vendor2/foo'), array_keys($this->extension_manager->all_available())); } - public function test_enabled() + public function test_all_enabled() { $this->assertEquals(array('vendor2/foo'), array_keys($this->extension_manager->all_enabled())); } - public function test_configured() + public function test_all_configured() { $this->assertEquals(array('vendor/moo', 'vendor2/foo'), array_keys($this->extension_manager->all_configured())); } + public function test_is_enabled() + { + $this->assertSame(true, $this->extension_manager->is_enabled('vendor2/foo')); + $this->assertSame(false, $this->extension_manager->is_enabled('vendor/moo')); + $this->assertSame(false, $this->extension_manager->is_enabled('vendor2/bar')); + $this->assertSame(false, $this->extension_manager->is_enabled('bertie/worlddominationplan')); + } + + public function test_is_disabled() + { + $this->assertSame(false, $this->extension_manager->is_disabled('vendor2/foo')); + $this->assertSame(true, $this->extension_manager->is_disabled('vendor/moo')); + $this->assertSame(false, $this->extension_manager->is_disabled('vendor2/bar')); + $this->assertSame(false, $this->extension_manager->is_disabled('bertie/worlddominationplan')); + } + + public function test_is_purged() + { + $this->assertSame(false, $this->extension_manager->is_purged('vendor2/foo')); + $this->assertSame(false, $this->extension_manager->is_purged('vendor/moo')); + $this->assertSame(true, $this->extension_manager->is_purged('vendor2/bar')); + $this->assertSame(false, $this->extension_manager->is_purged('bertie/worlddominationplan')); + } + + public function test_is_configured() + { + $this->assertSame(true, $this->extension_manager->is_configured('vendor2/foo')); + $this->assertSame(true, $this->extension_manager->is_configured('vendor/moo')); + $this->assertSame(false, $this->extension_manager->is_configured('vendor2/bar')); + $this->assertSame(false, $this->extension_manager->is_configured('bertie/worlddominationplan')); + } + + public function test_is_available() + { + $this->assertSame(true, $this->extension_manager->is_available('vendor2/foo')); + $this->assertSame(true, $this->extension_manager->is_available('vendor/moo')); + $this->assertSame(true, $this->extension_manager->is_available('vendor2/bar')); + $this->assertSame(false, $this->extension_manager->is_available('bertie/worlddominationplan')); + } + public function test_enable() { vendor2\bar\ext::$state = 0; diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php index 3678ac0a3f..6b6ea80d82 100644 --- a/tests/extension/metadata_manager_test.php +++ b/tests/extension/metadata_manager_test.php @@ -19,8 +19,11 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case protected $cache; protected $config; protected $db; + protected $db_tools; + protected $table_prefix; protected $phpbb_root_path; protected $phpEx; + protected $migrator; protected $template; protected $user; @@ -70,7 +73,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case new \phpbb\db\migration\helper() ); $container = new phpbb_mock_container_builder(); - $container->set('migrator', $migrator); + $container->set('migrator', $this->migrator); $this->extension_manager = new \phpbb\extension\manager( $container, @@ -96,9 +99,10 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case { $manager->get_metadata(); } - catch(\phpbb\extension\exception $e){} - - $this->assertEquals((string) $e, $this->user->lang('FILE_NOT_FOUND', $this->phpbb_root_path . $this->extension_manager->get_extension_path($ext_name) . 'composer.json')); + catch (\phpbb\extension\exception $e) + { + $this->assertEquals((string) $e, $this->user->lang('FILE_NOT_FOUND', $this->phpbb_root_path . $this->extension_manager->get_extension_path($ext_name) . 'composer.json')); + } } // Should be the same as a direct json_decode of the composer.json file @@ -112,7 +116,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case { $metadata = $manager->get_metadata(); } - catch(\phpbb\extension\exception $e) + catch (\phpbb\extension\exception $e) { $this->fail($e); } @@ -122,64 +126,42 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case $this->assertEquals($metadata, $json); } - public function test_validator_non_existant() + public function validator_non_existing_data() { - $ext_name = 'validator'; - - $manager = $this->get_metadata_manager($ext_name); - - // Non-existant data - try - { - $manager->validate('name'); - - $this->fail('Exception not triggered'); - } - catch(\phpbb\extension\exception $e) - { - $this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', 'name')); - } - - try - { - $manager->validate('type'); - - $this->fail('Exception not triggered'); - } - catch(\phpbb\extension\exception $e) - { - $this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', 'type')); - } - - try - { - $manager->validate('license'); - - $this->fail('Exception not triggered'); - } - catch(\phpbb\extension\exception $e) - { - $this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', 'license')); - } + return array( + array('name'), + array('type'), + array('license'), + array('version'), + ); + } + /** + * @dataProvider validator_non_existing_data + */ + public function test_validator_non_existing($field_name) + { + $manager = $this->get_metadata_manager('validator'); try { - $manager->validate('version'); - + $manager->validate($field_name); $this->fail('Exception not triggered'); } catch(\phpbb\extension\exception $e) { - $this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', 'version')); + $this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', $field_name)); } + } + public function test_validator_non_existing_authors() + { + $manager = $this->get_metadata_manager('validator'); try { $manager->validate_authors(); - $this->fail('Exception not triggered'); } - catch(\phpbb\extension\exception $e) + catch (\phpbb\extension\exception $e) { $this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', 'authors')); } @@ -193,72 +175,44 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case try { $manager->validate_authors(); - $this->fail('Exception not triggered'); } - catch(\phpbb\extension\exception $e) + catch (\phpbb\extension\exception $e) { $this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', 'author name')); } } - - public function test_validator_invalid() + public function validator_invalid_data() { - $ext_name = 'validator'; + return array( + array('name', 'asdf'), + array('type', 'asdf'), + array('license', ''), + array('version', ''), + ); + } - $manager = $this->get_metadata_manager($ext_name); + /** + * @dataProvider validator_invalid_data + */ + public function test_validator_invalid($field_name, $field_value) + { + $manager = $this->get_metadata_manager('validator'); // Invalid data $manager->set_metadata(array( - 'name' => 'asdf', - 'type' => 'asdf', - 'license' => '', - 'version' => '', + $field_name => $field_value, )); try { - $manager->validate('name'); - + $manager->validate($field_name); $this->fail('Exception not triggered'); } catch(\phpbb\extension\exception $e) { - $this->assertEquals((string) $e, $this->user->lang('META_FIELD_INVALID', 'name')); - } - - try - { - $manager->validate('type'); - - $this->fail('Exception not triggered'); - } - catch(\phpbb\extension\exception $e) - { - $this->assertEquals((string) $e, $this->user->lang('META_FIELD_INVALID', 'type')); - } - - try - { - $manager->validate('license'); - - $this->fail('Exception not triggered'); - } - catch(\phpbb\extension\exception $e) - { - $this->assertEquals((string) $e, $this->user->lang('META_FIELD_INVALID', 'license')); - } - - try - { - $manager->validate('version'); - - $this->fail('Exception not triggered'); - } - catch(\phpbb\extension\exception $e) - { - $this->assertEquals((string) $e, $this->user->lang('META_FIELD_INVALID', 'version')); + $this->assertEquals((string) $e, $this->user->lang('META_FIELD_INVALID', $field_name)); } } @@ -286,143 +240,83 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case } } - - public function test_validator_requirements() + public function validator_requirements_data() { - $ext_name = 'validator'; - - $manager = $this->get_metadata_manager($ext_name); - // Too high of requirements - $manager->merge_metadata(array( - 'require' => array( - 'php' => '10.0.0', - 'phpbb/phpbb' => '3.2.0', // config is set to 3.1.0 + return array( + array( + '10.0.0', + '100.2.0', + false, + false, + 'Versions are not compared at the moment', ), - )); - - try - { - //$this->assertEquals(false, $manager->validate_require_php()); - //$this->assertEquals(false, $manager->validate_require_phpbb()); - } - catch(\phpbb\extension\exception $e) - { - $this->fail($e); - } - - - // Too high of requirements - $manager->merge_metadata(array( - 'require' => array( - 'php' => '5.3.0', - 'phpbb/phpbb' => '3.1.0-beta', // config is set to 3.1.0 + array( + '5.3.0', + '3.1.0-beta', + true, + true, ), - )); - - try - { - $this->assertEquals(true, $manager->validate_require_php()); - $this->assertEquals(true, $manager->validate_require_phpbb()); - } - catch(\phpbb\extension\exception $e) - { - $this->fail($e); - } - - - // Too high of requirements - $manager->merge_metadata(array( - 'require' => array( - 'php' => '>' . phpversion(), - 'phpbb/phpbb' => '>3.1.0', // config is set to 3.1.0 + array( + '>' . phpversion(), + '>3.1.0', + false, + false, + 'Versions are not compared at the moment', ), - )); - - try - { - //$this->assertEquals(false, $manager->validate_require_php()); - //$this->assertEquals(false, $manager->validate_require_phpbb()); - } - catch(\phpbb\extension\exception $e) - { - $this->fail($e); - } - - - // Too high of current install - $manager->merge_metadata(array( - 'require' => array( - 'php' => '<' . phpversion(), - 'phpbb/phpbb' => '<3.1.0', // config is set to 3.1.0 + array( + '<' . phpversion(), + '<3.1.0', + false, + false, + 'Versions are not compared at the moment', ), - )); - - try - { - //$this->assertEquals(false, $manager->validate_require_php()); - //$this->assertEquals(false, $manager->validate_require_phpbb()); - } - catch(\phpbb\extension\exception $e) - { - $this->fail($e); - } - - - // Matching requirements - $manager->merge_metadata(array( - 'require' => array( - 'php' => phpversion(), - 'phpbb/phpbb' => '3.1.0', // config is set to 3.1.0 + array( + phpversion(), + '3.1.0', + true, + true, ), - )); - - try - { - $this->assertEquals(true, $manager->validate_require_php()); - $this->assertEquals(true, $manager->validate_require_phpbb()); - } - catch(\phpbb\extension\exception $e) - { - $this->fail($e); - } - - - // Matching requirements - $manager->merge_metadata(array( - 'require' => array( - 'php' => '>=' . phpversion(), - 'phpbb/phpbb' => '>=3.1.0', // config is set to 3.1.0 + array( + '>=' . phpversion(), + '>=3.1.0', + true, + true, ), - )); + array( + '<=' . phpversion(), + '<=3.1.0', + true, + true, + ), + ); + } - try - { - $this->assertEquals(true, $manager->validate_require_php()); - $this->assertEquals(true, $manager->validate_require_phpbb()); - } - catch(\phpbb\extension\exception $e) + /** + * @dataProvider validator_requirements_data + */ + public function test_validator_requirements($php_version, $phpbb_version, $expected_php, $expected_phpbb, $incomplete_reason = '') + { + if ($incomplete_reason) { - $this->fail($e); + $this->markTestIncomplete($incomplete_reason); } - - // Matching requirements + $ext_name = 'validator'; + $manager = $this->get_metadata_manager($ext_name); + // Too high of requirements $manager->merge_metadata(array( 'require' => array( - 'php' => '<=' . phpversion(), - 'phpbb/phpbb' => '<=3.1.0', // config is set to 3.1.0 + 'php' => $php_version, + ), + 'extra' => array( + 'soft-require' => array( + 'phpbb/phpbb' => $phpbb_version, // config is set to 3.1.0 + ), ), )); - try - { - $this->assertEquals(true, $manager->validate_require_php()); - $this->assertEquals(true, $manager->validate_require_phpbb()); - } - catch(\phpbb\extension\exception $e) - { - $this->fail($e); - } + $this->assertEquals($expected_php, $manager->validate_require_php()); + $this->assertEquals($expected_phpbb, $manager->validate_require_phpbb()); } /** diff --git a/tests/functional/download_test.php b/tests/functional/download_test.php index dbf197fcfa..6a6df14c81 100644 --- a/tests/functional/download_test.php +++ b/tests/functional/download_test.php @@ -205,12 +205,8 @@ class phpbb_functional_download_test extends phpbb_functional_test_case ), )); - $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Download Topic #1']}&sid={$this->sid}"); - $this->add_lang('posting'); - $form = $crawler->selectButton('Go')->eq(2)->form(); - $form['action']->select('delete_topic'); - $crawler = self::submit($form); + $crawler = $this->get_quickmod_page($this->data['topics']['Download Topic #1'], 'DELETE_TOPIC'); $this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text()); $this->add_lang('mcp'); diff --git a/tests/functional/feed_test.php b/tests/functional/feed_test.php index a474ecf27f..7aa2d0da7d 100644 --- a/tests/functional/feed_test.php +++ b/tests/functional/feed_test.php @@ -619,12 +619,8 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case ), )); - $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Feeds #1 - Topic #2']}&sid={$this->sid}"); - $this->add_lang('posting'); - $form = $crawler->selectButton('Go')->eq(2)->form(); - $form['action']->select('delete_topic'); - $crawler = self::submit($form); + $crawler = $this->get_quickmod_page($this->data['topics']['Feeds #1 - Topic #2'], 'DELETE_TOPIC'); $this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text()); $this->add_lang('mcp'); diff --git a/tests/functional/fixtures/ext/foo/bar/composer.json b/tests/functional/fixtures/ext/foo/bar/composer.json index 2f91426d2a..f0c7f0e6c1 100644 --- a/tests/functional/fixtures/ext/foo/bar/composer.json +++ b/tests/functional/fixtures/ext/foo/bar/composer.json @@ -13,10 +13,12 @@ "role": "Developer" }], "require": { - "php": ">=5.3", - "phpbb/phpbb": "3.1.*@dev" + "php": ">=5.3" }, "extra": { - "display-name": "phpBB 3.1 Extension Testing" + "display-name": "phpBB 3.1 Extension Testing", + "soft-require": { + "phpbb/phpbb": "3.1.*@dev" + } } } diff --git a/tests/functional/jumpbox_test.php b/tests/functional/jumpbox_test.php index 9eddcb6bf6..f5a671b1b9 100644 --- a/tests/functional/jumpbox_test.php +++ b/tests/functional/jumpbox_test.php @@ -20,18 +20,16 @@ class phpbb_functional_jumpbox_test extends phpbb_functional_test_case { $this->login(); - $crawler = self::request('GET', "viewtopic.php?t=1&sid={$this->sid}"); - $form = $crawler->filter('#quickmodform')->selectButton($this->lang('GO'))->form(array( - 'action' => 'merge_topic', - )); + $this->crawler = $this->get_quickmod_page(1, 'MERGE_TOPIC'); + $this->check_valid_jump('Your first forum'); - $crawler = self::submit($form); - $this->assertContains($this->lang('FORUM') . ': Your first forum', $crawler->filter('#cp-main h2')->text()); - $form = $crawler->filter('#jumpbox')->selectButton($this->lang('GO'))->form(array( - 'f' => 1, - )); + $link = $this->crawler->filter('#jumpbox')->selectLink('Your first category')->link()->getUri(); + $this->crawler = self::request('GET', substr($link, strpos($link, 'mcp.'))); + $this->check_valid_jump('Your first category'); + } - $crawler = self::submit($form); - $this->assertContains($this->lang('FORUM') . ': Your first category', $crawler->filter('#cp-main h2')->text()); + protected function check_valid_jump($forum) + { + $this->assertContains($this->lang('FORUM') . ": $forum", $this->crawler->filter('#cp-main h2')->text(), $this->crawler->text()); } } diff --git a/tests/functional/mcp_test.php b/tests/functional/mcp_test.php index e4d950ef34..31d835f4fa 100644 --- a/tests/functional/mcp_test.php +++ b/tests/functional/mcp_test.php @@ -35,11 +35,7 @@ class phpbb_functional_mcp_test extends phpbb_functional_test_case public function test_handle_quickmod($crawler) { // Test moving a post - $form = $crawler->selectButton('Go')->eq(1)->form(); - $form['action']->select('merge'); - $crawler = self::submit($form); - - return $crawler; + return $this->get_quickmod_page(0, 'MERGE_POSTS', $crawler); } /** diff --git a/tests/functional/visibility_softdelete_test.php b/tests/functional/visibility_softdelete_test.php index 5b5f09905c..794f0cde68 100644 --- a/tests/functional/visibility_softdelete_test.php +++ b/tests/functional/visibility_softdelete_test.php @@ -186,11 +186,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ 'forum_last_post_id' => 0, ), 'before moving #2'); - $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}"); - - $form = $crawler->selectButton('Go')->eq(2)->form(); - $form['action']->select('move'); - $crawler = self::submit($form); + $crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #1'], 'MOVE_TOPIC'); $this->assertContainsLang('SELECT_DESTINATION_FORUM', $crawler->text()); $this->add_lang('mcp'); @@ -261,12 +257,8 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ 'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'], ), 'before softdeleting #2'); - $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}"); - $this->add_lang('posting'); - $form = $crawler->selectButton('Go')->eq(2)->form(); - $form['action']->select('delete_topic'); - $crawler = self::submit($form); + $crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #1'], 'DELETE_TOPIC'); $this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text()); $this->add_lang('mcp'); @@ -336,11 +328,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ 'forum_last_post_id' => 0, ), 'before moving #2'); - $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}"); - - $form = $crawler->selectButton('Go')->eq(2)->form(); - $form['action']->select('move'); - $crawler = self::submit($form); + $crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #1'], 'MOVE_TOPIC'); $this->assertContainsLang('SELECT_DESTINATION_FORUM', $crawler->text()); $this->add_lang('mcp'); @@ -484,12 +472,9 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ 'forum_last_post_id' => 0, ), 'before splitting #2'); - $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}"); + $crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #1'], 'SPLIT_TOPIC'); $this->add_lang('mcp'); - $form = $crawler->selectButton('Go')->eq(2)->form(); - $form['action']->select('split'); - $crawler = self::submit($form); $this->assertContainsLang('SPLIT_TOPIC_EXPLAIN', $crawler->text()); $form = $crawler->selectButton('Submit')->form(array( @@ -546,12 +531,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ ), )); - $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #2']}&sid={$this->sid}"); - - $form = $crawler->selectButton('Go')->eq(1)->form(); - $form['action']->select('move'); - $crawler = self::submit($form); - + $crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #2'], 'MOVE_TOPIC'); $form = $crawler->selectButton('Yes')->form(); $form['to_forum_id']->select($this->data['forums']['Soft Delete #1']); $crawler = self::submit($form); @@ -605,9 +585,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ $this->assertContainsLang('BOOKMARK_ADDED', $crawler_bookmark->text()); $this->add_lang('mcp'); - $form = $crawler->selectButton('Go')->eq(1)->form(); - $form['action']->select('merge_topic'); - $crawler = self::submit($form); + $crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #2'], 'MERGE_TOPIC', $crawler); $this->assertContainsLang('SELECT_MERGE', $crawler->text()); $crawler = self::request('GET', "mcp.php?f={$this->data['forums']['Soft Delete #1']}&t={$this->data['topics']['Soft Delete Topic #2']}&i=main&mode=forum_view&action=merge_topic&to_topic_id={$this->data['topics']['Soft Delete Topic #1']}"); @@ -670,12 +648,8 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_ 'forum_last_post_id' => 0, ), 'before forking #2'); - $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}"); - $this->add_lang('mcp'); - $form = $crawler->selectButton('Go')->eq(2)->form(); - $form['action']->select('fork'); - $crawler = self::submit($form); + $crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #1'], 'FORK_TOPIC'); $this->assertContainsLang('FORK_TOPIC', $crawler->text()); $form = $crawler->selectButton('Yes')->form(); diff --git a/tests/functions/obtain_online_test.php b/tests/functions/obtain_online_test.php index 830b52fb4c..e793a4eb82 100644 --- a/tests/functions/obtain_online_test.php +++ b/tests/functions/obtain_online_test.php @@ -128,19 +128,19 @@ class phpbb_functions_obtain_online_test extends phpbb_database_test_case { return array( array(0, false, array( - 'online_userlist' => 'REGISTERED_USERS 2, 3', + 'online_userlist' => 'REGISTERED_USERS <span class="username">2</span>, <span class="username">3</span>', 'l_online_users' => 'ONLINE_USERS_TOTAL 5 REG_USERS_TOTAL 2 HIDDEN_USERS_TOTAL 3', )), array(0, true, array( - 'online_userlist' => 'REGISTERED_USERS 2, 3', + 'online_userlist' => 'REGISTERED_USERS <span class="username">2</span>, <span class="username">3</span>', 'l_online_users' => 'ONLINE_USERS_TOTAL_GUESTS 7 REG_USERS_TOTAL 2 HIDDEN_USERS_TOTAL 3 GUEST_USERS_TOTAL 2', )), array(1, false, array( - 'online_userlist' => 'BROWSING_FORUM 3', + 'online_userlist' => 'BROWSING_FORUM <span class="username">3</span>', 'l_online_users' => 'ONLINE_USERS_TOTAL 2 REG_USERS_TOTAL 1 HIDDEN_USERS_TOTAL 1', )), array(1, true, array( - 'online_userlist' => 'BROWSING_FORUM_GUESTS 1 3', + 'online_userlist' => 'BROWSING_FORUM_GUESTS 1 <span class="username">3</span>', 'l_online_users' => 'ONLINE_USERS_TOTAL_GUESTS 3 REG_USERS_TOTAL 1 HIDDEN_USERS_TOTAL 1 GUEST_USERS_TOTAL 1', )), array(2, false, array( diff --git a/tests/functions_content/get_username_string_test.php b/tests/functions_content/get_username_string_test.php index 502796d1df..01ec97f6a4 100644 --- a/tests/functions_content/get_username_string_test.php +++ b/tests/functions_content/get_username_string_test.php @@ -94,11 +94,11 @@ class phpbb_functions_content_get_username_string_test extends phpbb_test_case global $phpbb_root_path, $phpEx; return array( - array(0, '', '', false, false, 'Guest'), - array(ANONYMOUS, 'Anonymous', '', false, false, 'Anonymous'), + array(0, '', '', false, false, '<span class="username">Guest</span>'), + array(ANONYMOUS, 'Anonymous', '', false, false, '<span class="username">Anonymous</span>'), array(2, 'Administrator', 'FF0000', false, false, '<a href="' . $phpbb_root_path . 'memberlist.' . $phpEx . '?mode=viewprofile&u=2" style="color: #FF0000;" class="username-coloured">Administrator</a>'), - array(5, 'User5', '', false, 'http://www.example.org/user.php?mode=show', '<a href="http://www.example.org/user.php?mode=show&u=5">User5</a>'), - array(8, 'Eight', '', false, false, '<a href="' . $phpbb_root_path . 'memberlist.php?mode=viewprofile&u=8">Eight</a>'), + array(5, 'User5', '', false, 'http://www.example.org/user.php?mode=show', '<a href="http://www.example.org/user.php?mode=show&u=5" class="username">User5</a>'), + array(8, 'Eight', '', false, false, '<a href="' . $phpbb_root_path . 'memberlist.php?mode=viewprofile&u=8" class="username">Eight</a>'), ); } @@ -113,10 +113,10 @@ class phpbb_functions_content_get_username_string_test extends phpbb_test_case public function get_username_string_no_profile_data() { return array( - array(ANONYMOUS, 'Anonymous', '', false, false, 'Anonymous'), - array(ANONYMOUS, 'Anonymous', '', '', false, 'Guest'), + array(ANONYMOUS, 'Anonymous', '', false, false, '<span class="username">Anonymous</span>'), + array(ANONYMOUS, 'Anonymous', '', '', false, '<span class="username">Guest</span>'), array(2, 'Administrator', 'FF0000', false, false, '<span style="color: #FF0000;" class="username-coloured">Administrator</span>'), - array(8, 'Eight', '', false, false, 'Eight'), + array(8, 'Eight', '', false, false, '<span class="username">Eight</span>'), ); } diff --git a/tests/log/function_view_log_test.php b/tests/log/function_view_log_test.php index b7e60c7393..02e0b3912f 100644 --- a/tests/log/function_view_log_test.php +++ b/tests/log/function_view_log_test.php @@ -40,7 +40,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'user_id' => 1, 'username' => 'Anonymous', - 'username_full' => 'Anonymous', + 'username_full' => '<span class="username">Anonymous</span>', 'ip' => '127.0.0.1', 'time' => 1, @@ -59,7 +59,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'user_id' => 1, 'username' => 'Anonymous', - 'username_full' => 'Anonymous', + 'username_full' => '<span class="username">Anonymous</span>', 'ip' => '127.0.0.1', 'time' => 1, @@ -78,7 +78,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'user_id' => 1, 'username' => 'Anonymous', - 'username_full' => 'Anonymous', + 'username_full' => '<span class="username">Anonymous</span>', 'ip' => '127.0.0.1', 'time' => 1, @@ -97,7 +97,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'user_id' => 1, 'username' => 'Anonymous', - 'username_full' => 'Anonymous', + 'username_full' => '<span class="username">Anonymous</span>', 'ip' => '127.0.0.1', 'time' => 1, @@ -118,7 +118,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'user_id' => 1, 'username' => 'Anonymous', - 'username_full' => 'Anonymous', + 'username_full' => '<span class="username">Anonymous</span>', 'ip' => '127.0.0.1', 'time' => 1, @@ -139,7 +139,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'user_id' => 1, 'username' => 'Anonymous', - 'username_full' => 'Anonymous', + 'username_full' => '<span class="username">Anonymous</span>', 'ip' => '127.0.0.1', 'time' => 1, @@ -160,7 +160,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'user_id' => 1, 'username' => 'Anonymous', - 'username_full' => 'Anonymous', + 'username_full' => '<span class="username">Anonymous</span>', 'ip' => '127.0.0.1', 'time' => 1, @@ -177,11 +177,11 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'reportee_id' => 2, 'reportee_username' => 'admin', - 'reportee_username_full'=> 'admin', + 'reportee_username_full'=> '<span class="username">admin</span>', 'user_id' => 1, 'username' => 'Anonymous', - 'username_full' => 'Anonymous', + 'username_full' => '<span class="username">Anonymous</span>', 'ip' => '127.0.0.1', 'time' => 1, @@ -196,11 +196,11 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'reportee_id' => 1, 'reportee_username' => 'Anonymous', - 'reportee_username_full'=> 'Anonymous', + 'reportee_username_full'=> '<span class="username">Anonymous</span>', 'user_id' => 1, 'username' => 'Anonymous', - 'username_full' => 'Anonymous', + 'username_full' => '<span class="username">Anonymous</span>', 'ip' => '127.0.0.1', 'time' => 1, @@ -219,7 +219,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'user_id' => 1, 'username' => 'Anonymous', - 'username_full' => 'Anonymous', + 'username_full' => '<span class="username">Anonymous</span>', 'ip' => '127.0.0.1', 'time' => 1, @@ -238,7 +238,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'user_id' => 1, 'username' => 'Anonymous', - 'username_full' => 'Anonymous', + 'username_full' => '<span class="username">Anonymous</span>', 'ip' => '127.0.0.1', 'time' => 1, diff --git a/tests/notification/user_list_trim_test.php b/tests/notification/user_list_trim_test.php index 85d8961e82..851c9ec221 100644 --- a/tests/notification/user_list_trim_test.php +++ b/tests/notification/user_list_trim_test.php @@ -86,7 +86,7 @@ class phpbb_notification_user_list_trim_test extends phpbb_database_test_case array('username' => '', 'poster_id' => 3), ), ), - '<strong>Reply</strong> from A and B in topic:', + '<strong>Reply</strong> from A and <span class="username">B</span> in topic:', ), array( array( @@ -98,7 +98,7 @@ class phpbb_notification_user_list_trim_test extends phpbb_database_test_case array('username' => '', 'poster_id' => 4), ), ), - '<strong>Reply</strong> from A, B, and C in topic:', + '<strong>Reply</strong> from A, <span class="username">B</span>, and <span class="username">C</span> in topic:', ), array( array( @@ -111,7 +111,7 @@ class phpbb_notification_user_list_trim_test extends phpbb_database_test_case array('username' => '', 'poster_id' => 5), ), ), - '<strong>Reply</strong> from A, B, C, and D in topic:', + '<strong>Reply</strong> from A, <span class="username">B</span>, <span class="username">C</span>, and <span class="username">D</span> in topic:', ), array( array( @@ -125,7 +125,7 @@ class phpbb_notification_user_list_trim_test extends phpbb_database_test_case array('username' => '', 'poster_id' => 6), ), ), - '<strong>Reply</strong> from A, B, C, and 2 others in topic:', + '<strong>Reply</strong> from A, <span class="username">B</span>, <span class="username">C</span>, and 2 others in topic:', ), ); } diff --git a/tests/profilefields/type_bool_test.php b/tests/profilefields/type_bool_test.php index 29c118d57d..bdab179c8c 100644 --- a/tests/profilefields/type_bool_test.php +++ b/tests/profilefields/type_bool_test.php @@ -74,10 +74,10 @@ class phpbb_profilefield_type_bool_test extends phpbb_test_case { return array( array( - false, - array('field_required' => true), - 'FIELD_REQUIRED-field', - 'Field should not accept empty values for required fields', + false, + array('field_required' => true), + 'FIELD_REQUIRED-field', + 'Field should not accept empty values for required fields', ), ); } @@ -130,6 +130,54 @@ class phpbb_profilefield_type_bool_test extends phpbb_test_case $this->assertSame($expected, $result, $description); } + public function profile_value_raw_data() + { + return array( + array( + '4', + array('field_show_novalue' => true), + '4', + 'Field should return the correct raw value', + ), + array( + '', + array('field_show_novalue' => false), + null, + 'Field should return correct raw value', + ), + array( + '', + array('field_show_novalue' => true), + null, + 'Field should return correct raw value', + ), + array( + null, + array('field_show_novalue' => false), + null, + 'Field should return correct raw value', + ), + array( + null, + array('field_show_novalue' => true), + null, + 'Field should return correct raw value', + ), + ); + } + + /** + * @dataProvider profile_value_raw_data + */ + public function test_get_profile_value_raw($value, $field_options, $expected, $description) + { + $field_options = array_merge($this->field_options, $field_options); + + $result = $this->cp->get_profile_value_raw($value, $field_options); + + $this->assertSame($expected, $result, $description); + } + public function is_set_callback($field_id, $lang_id, $field_value) { return isset($this->options[$field_value]); diff --git a/tests/profilefields/type_date_test.php b/tests/profilefields/type_date_test.php index 39fe95b97f..0ad2cde9fe 100644 --- a/tests/profilefields/type_date_test.php +++ b/tests/profilefields/type_date_test.php @@ -179,6 +179,42 @@ class phpbb_profilefield_type_date_test extends phpbb_test_case $this->assertSame($expected, $result, $description); } + public function profile_value_raw_data() + { + return array( + array( + '', + array('field_show_novalue' => false), + null, + 'Field should return the correct raw value', + ), + array( + '', + array('field_show_novalue' => true), + '', + 'Field should return correct raw value', + ), + array( + '12/06/2014', + array('field_show_novalue' => true), + '12/06/2014', + 'Field should return correct raw value', + ), + ); + } + + /** + * @dataProvider profile_value_raw_data + */ + public function test_get_profile_value_raw($value, $field_options, $expected, $description) + { + $field_options = array_merge($this->field_options, $field_options); + + $result = $this->cp->get_profile_value_raw($value, $field_options); + + $this->assertSame($expected, $result, $description); + } + public function return_callback_implode() { return implode('-', func_get_args()); diff --git a/tests/profilefields/type_dropdown_test.php b/tests/profilefields/type_dropdown_test.php index 0e92afd504..ebecbf97f0 100644 --- a/tests/profilefields/type_dropdown_test.php +++ b/tests/profilefields/type_dropdown_test.php @@ -170,6 +170,54 @@ class phpbb_profilefield_type_dropdown_test extends phpbb_test_case $this->assertSame($expected, $result, $description); } + public function profile_value_raw_data() + { + return array( + array( + '4', + array('field_show_novalue' => true), + '4', + 'Field should return the correct raw value', + ), + array( + '', + array('field_show_novalue' => false), + null, + 'Field should null for empty value without show_novalue', + ), + array( + '', + array('field_show_novalue' => true), + 0, + 'Field should return 0 for empty value with show_novalue', + ), + array( + null, + array('field_show_novalue' => false), + null, + 'Field should return correct raw value', + ), + array( + null, + array('field_show_novalue' => true), + 0, + 'Field should return 0 for empty value with show_novalue', + ), + ); + } + + /** + * @dataProvider profile_value_raw_data + */ + public function test_get_profile_value_raw($value, $field_options, $expected, $description) + { + $field_options = array_merge($this->field_options, $field_options); + + $result = $this->cp->get_profile_value_raw($value, $field_options); + + $this->assertSame($expected, $result, $description); + } + public function is_set_callback($field_id, $lang_id, $field_value) { return isset($this->dropdown_options[$field_value]); diff --git a/tests/profilefields/type_int_test.php b/tests/profilefields/type_int_test.php index 611edd32b9..ac48c10a84 100644 --- a/tests/profilefields/type_int_test.php +++ b/tests/profilefields/type_int_test.php @@ -169,6 +169,66 @@ class phpbb_profilefield_type_int_test extends phpbb_test_case $this->assertSame($expected, $result, $description); } + public function profile_value_raw_data() + { + return array( + array( + '10', + array('field_show_novalue' => true), + 10, + 'Field should return the correct raw value', + ), + array( + '0', + array('field_show_novalue' => true), + 0, + 'Field should return correct raw value', + ), + array( + '', + array('field_show_novalue' => true), + 0, + 'Field should return correct raw value', + ), + array( + '10', + array('field_show_novalue' => false), + 10, + 'Field should return the correct raw value', + ), + array( + '0', + array('field_show_novalue' => false), + 0, + 'Field should return correct raw value', + ), + array( + '', + array('field_show_novalue' => false), + null, + 'Field should return correct raw value', + ), + array( + 'string', + array('field_show_novalue' => false), + 0, + 'Field should return int cast of passed string' + ), + ); + } + + /** + * @dataProvider profile_value_raw_data + */ + public function test_get_profile_value_raw($value, $field_options, $expected, $description) + { + $field_options = array_merge($this->field_options, $field_options); + + $result = $this->cp->get_profile_value_raw($value, $field_options); + + $this->assertSame($expected, $result, $description); + } + public function return_callback_implode() { return implode('-', func_get_args()); diff --git a/tests/profilefields/type_string_test.php b/tests/profilefields/type_string_test.php index cee8a1d863..f6c14ee38b 100644 --- a/tests/profilefields/type_string_test.php +++ b/tests/profilefields/type_string_test.php @@ -225,6 +225,60 @@ class phpbb_profilefield_type_string_test extends phpbb_test_case $this->assertSame($expected, $result, $description); } + public function profile_value_raw_data() + { + return array( + array( + '[b]bbcode test[/b]', + array('field_show_novalue' => true), + '[b]bbcode test[/b]', + 'Field should return the correct raw value', + ), + array( + '[b]bbcode test[/b]', + array('field_show_novalue' => false), + '[b]bbcode test[/b]', + 'Field should return correct raw value', + ), + array( + 125, + array('field_show_novalue' => false), + 125, + 'Field should return value of integer as is', + ), + array( + 0, + array('field_show_novalue' => false), + null, + 'Field should return null for empty integer without show_novalue', + ), + array( + 0, + array('field_show_novalue' => true), + 0, + 'Field should return 0 for empty integer with show_novalue', + ), + array( + null, + array('field_show_novalue' => true), + null, + 'field should return null value as is', + ), + ); + } + + /** + * @dataProvider profile_value_raw_data + */ + public function test_get_profile_value_raw($value, $field_options, $expected, $description) + { + $field_options = array_merge($this->field_options, $field_options); + + $result = $this->cp->get_profile_value_raw($value, $field_options); + + $this->assertSame($expected, $result, $description); + } + public function return_callback_implode() { return implode('-', func_get_args()); diff --git a/tests/profilefields/type_url_test.php b/tests/profilefields/type_url_test.php index 9957510d90..a45a28e7c7 100644 --- a/tests/profilefields/type_url_test.php +++ b/tests/profilefields/type_url_test.php @@ -104,6 +104,36 @@ class phpbb_profilefield_type_url_test extends phpbb_test_case $this->assertSame($expected, $result, $description); } + public function profile_value_raw_data() + { + return array( + array( + 'http://example.com', + array('field_show_novalue' => true), + 'http://example.com', + 'Field should return the correct raw value', + ), + array( + 'http://example.com', + array('field_show_novalue' => false), + 'http://example.com', + 'Field should return correct raw value', + ), + ); + } + + /** + * @dataProvider profile_value_raw_data + */ + public function test_get_profile_value_raw($value, $field_options, $expected, $description) + { + $field_options = array_merge($this->field_options, $field_options); + + $result = $this->cp->get_profile_value_raw($value, $field_options); + + $this->assertSame($expected, $result, $description); + } + public function return_callback_implode() { return implode('-', func_get_args()); diff --git a/tests/template/template_test.php b/tests/template/template_test.php index 4f5b7629d5..0bbfe3848d 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -352,6 +352,13 @@ class phpbb_template_template_test extends phpbb_template_template_test_case array(), "13FOOBAR|foobar", ), + array( + 'if_nested_tags.html', + array('S_VALUE' => true,), + array(), + array(), + 'inner_value', + ), ); } diff --git a/tests/template/templates/if_nested_tags.html b/tests/template/templates/if_nested_tags.html new file mode 100644 index 0000000000..0348a31a8d --- /dev/null +++ b/tests/template/templates/if_nested_tags.html @@ -0,0 +1 @@ +<!-- IF S_VALUE --><!-- DEFINE $INNER_VALUE = 'inner_value' --><!-- ENDIF -->{$INNER_VALUE} diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index eef30fbcc7..07ef826abf 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -971,12 +971,8 @@ class phpbb_functional_test_case extends phpbb_mink_test_case */ public function delete_topic($topic_id) { - $crawler = self::request('GET', "viewtopic.php?t={$topic_id}&sid={$this->sid}"); - $this->add_lang('posting'); - $form = $crawler->selectButton('Go')->eq(1)->form(); - $form['action']->select('delete_topic'); - $crawler = self::submit($form); + $crawler = $this->get_quickmod_page($topic_id, 'DELETE_TOPIC'); $this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text()); $this->add_lang('mcp'); @@ -1067,4 +1063,25 @@ class phpbb_functional_test_case extends phpbb_mink_test_case return $manager; } + + /** + * Get quickmod page + * + * @param int $topic_id + * @param string $action Language key for the quickmod action + * @param Symfony\Component\DomCrawler\Crawler Optional crawler object to use instead of creating new one. + * @return Symfony\Component\DomCrawler\Crawler + */ + public function get_quickmod_page($topic_id, $action, $crawler = false) + { + $this->add_lang('viewtopic'); + + if ($crawler === false) + { + $crawler = self::request('GET', "viewtopic.php?t={$topic_id}&sid={$this->sid}"); + } + $link = $crawler->filter('#quickmod')->selectLink($this->lang($action))->link()->getUri(); + + return self::request('GET', substr($link, strpos($link, 'mcp.'))); + } } diff --git a/tests/viewonline/helper_test.php b/tests/viewonline/helper_test.php new file mode 100644 index 0000000000..e4950bb51a --- /dev/null +++ b/tests/viewonline/helper_test.php @@ -0,0 +1,42 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +class phpbb_viewonline_helper_test extends phpbb_test_case +{ + public function setUp() + { + parent::setUp(); + + $this->viewonline_helper = new \phpbb\viewonline_helper(); + } + + public function session_pages_data() + { + return array( + array('index.php', 'index.php'), + array('foobar/test.php', 'foobar/test.php'), + array('', ''), + array('../index.php', '../index.php'), + ); + } + + /** + * @dataProvider session_pages_data + */ + public function test_get_user_page($expected, $session_page) + { + $on_page = $this->viewonline_helper->get_user_page($session_page); + $this->assertArrayHasKey(1, $on_page); + $this->assertSame($expected, $on_page[1]); + } +} |