diff options
43 files changed, 319 insertions, 316 deletions
diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index 0bb5e10f57..f8ea284acb 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -14,45 +14,45 @@ <!-- IF not S_ADD_ACTION and S_FORUM_ORIG_POST --> if (value == {FORUM_POST}) { - dE('type_actions', -1); + phpbb.toggleDisplay('type_actions', -1); } else { - dE('type_actions', 1); + phpbb.toggleDisplay('type_actions', 1); } <!-- ENDIF --> <!-- IF not S_ADD_ACTION and S_FORUM_ORIG_CAT and S_HAS_SUBFORUMS --> if (value == {FORUM_LINK}) { - dE('cat_to_link_actions', 1); + phpbb.toggleDisplay('cat_to_link_actions', 1); } else { - dE('cat_to_link_actions', -1); + phpbb.toggleDisplay('cat_to_link_actions', -1); } <!-- ENDIF --> if (value == {FORUM_POST}) { - dE('forum_post_options', 1); - dE('forum_link_options', -1); - dE('forum_rules_options', 1); - dE('forum_cat_options', -1); + phpbb.toggleDisplay('forum_post_options', 1); + phpbb.toggleDisplay('forum_link_options', -1); + phpbb.toggleDisplay('forum_rules_options', 1); + phpbb.toggleDisplay('forum_cat_options', -1); } else if (value == {FORUM_LINK}) { - dE('forum_post_options', -1); - dE('forum_link_options', 1); - dE('forum_rules_options', -1); - dE('forum_cat_options', -1); + phpbb.toggleDisplay('forum_post_options', -1); + phpbb.toggleDisplay('forum_link_options', 1); + phpbb.toggleDisplay('forum_rules_options', -1); + phpbb.toggleDisplay('forum_cat_options', -1); } else if (value == {FORUM_CAT}) { - dE('forum_post_options', -1); - dE('forum_link_options', -1); - dE('forum_rules_options', 1); - dE('forum_cat_options', 1); + phpbb.toggleDisplay('forum_post_options', -1); + phpbb.toggleDisplay('forum_link_options', -1); + phpbb.toggleDisplay('forum_rules_options', 1); + phpbb.toggleDisplay('forum_cat_options', 1); } } @@ -64,30 +64,30 @@ { <!-- IF not S_ADD_ACTION and S_FORUM_ORIG_POST --> <!-- IF S_FORUM_POST --> - dE('type_actions', -1); + phpbb.toggleDisplay('type_actions', -1); <!-- ENDIF --> <!-- ENDIF --> <!-- IF not S_ADD_ACTION and S_FORUM_ORIG_CAT and S_HAS_SUBFORUMS --> <!-- IF S_FORUM_CAT --> - dE('cat_to_link_actions', -1); + phpbb.toggleDisplay('cat_to_link_actions', -1); <!-- ENDIF --> <!-- ENDIF --> <!-- IF not S_FORUM_POST --> - dE('forum_post_options', -1); + phpbb.toggleDisplay('forum_post_options', -1); <!-- ENDIF --> <!-- IF not S_FORUM_CAT --> - dE('forum_cat_options', -1); + phpbb.toggleDisplay('forum_cat_options', -1); <!-- ENDIF --> <!-- IF not S_FORUM_LINK --> - dE('forum_link_options', -1); + phpbb.toggleDisplay('forum_link_options', -1); <!-- ENDIF --> <!-- IF S_FORUM_LINK --> - dE('forum_rules_options', -1); + phpbb.toggleDisplay('forum_rules_options', -1); <!-- ENDIF --> } @@ -467,9 +467,9 @@ </td> <td class="actions"> <span class="up-disabled" style="display:none;">{ICON_MOVE_UP_DISABLED}</span> - <span class="up"><a href="{forums.U_MOVE_UP}" data-ajax="row_up" data-overlay="false">{ICON_MOVE_UP}</a></span> + <span class="up"><a href="{forums.U_MOVE_UP}" data-ajax="row_up">{ICON_MOVE_UP}</a></span> <span class="down-disabled" style="display:none;">{ICON_MOVE_DOWN_DISABLED}</span> - <span class="down"><a href="{forums.U_MOVE_DOWN}" data-ajax="row_down" data-overlay="false">{ICON_MOVE_DOWN}</a></span> + <span class="down"><a href="{forums.U_MOVE_DOWN}" data-ajax="row_down">{ICON_MOVE_DOWN}</a></span> <a href="{forums.U_EDIT}">{ICON_EDIT}</a> <!-- IF not forums.S_FORUM_LINK --> <a href="{forums.U_SYNC}" onclick="popup_progress_bar();">{ICON_SYNC}</a> diff --git a/phpBB/adm/style/acp_groups_position.html b/phpBB/adm/style/acp_groups_position.html index b1df6b6162..c01f7aeb03 100644 --- a/phpBB/adm/style/acp_groups_position.html +++ b/phpBB/adm/style/acp_groups_position.html @@ -43,9 +43,9 @@ <td style="text-align: center;">{legend.GROUP_TYPE}</td> <td class="actions"> <span class="up-disabled" style="display: none;">{ICON_MOVE_UP_DISABLED}</span> - <span class="up"><a href="{legend.U_MOVE_UP}" data-ajax="row_up" data-overlay="false">{ICON_MOVE_UP}</a></span> + <span class="up"><a href="{legend.U_MOVE_UP}" data-ajax="row_up">{ICON_MOVE_UP}</a></span> <span class="down-disabled" style="display:none;">{ICON_MOVE_DOWN_DISABLED}</span> - <span class="down"><a href="{legend.U_MOVE_DOWN}" data-ajax="row_down" data-overlay="false">{ICON_MOVE_DOWN}</a></span> + <span class="down"><a href="{legend.U_MOVE_DOWN}" data-ajax="row_down">{ICON_MOVE_DOWN}</a></span> <a href="{legend.U_DELETE}">{ICON_DELETE}</a> </td> </tr> @@ -129,9 +129,9 @@ </td></td> <td class="actions"> <span class="up-disabled" style="display: none;">{ICON_MOVE_UP_DISABLED}</span> - <span class="up"><a href="{teampage.U_MOVE_UP}" data-ajax="row_up" data-overlay="false">{ICON_MOVE_UP}</a></span> + <span class="up"><a href="{teampage.U_MOVE_UP}" data-ajax="row_up">{ICON_MOVE_UP}</a></span> <span class="down-disabled" style="display:none;">{ICON_MOVE_DOWN_DISABLED}</span> - <span class="down"><a href="{teampage.U_MOVE_DOWN}" data-ajax="row_down" data-overlay="false">{ICON_MOVE_DOWN}</a></span> + <span class="down"><a href="{teampage.U_MOVE_DOWN}" data-ajax="row_down">{ICON_MOVE_DOWN}</a></span> <a href="{teampage.U_DELETE}">{ICON_DELETE}</a> </td> </tr> diff --git a/phpBB/adm/style/acp_modules.html b/phpBB/adm/style/acp_modules.html index c7688a610c..3c97706e6a 100644 --- a/phpBB/adm/style/acp_modules.html +++ b/phpBB/adm/style/acp_modules.html @@ -10,11 +10,11 @@ { if (value == 'category') { - dE('modoptions', -1); + phpbb.toggleDisplay('modoptions', -1); } else { - dE('modoptions', 1); + phpbb.toggleDisplay('modoptions', 1); } } diff --git a/phpBB/adm/style/acp_ranks.html b/phpBB/adm/style/acp_ranks.html index be68dda695..dd2d07a837 100644 --- a/phpBB/adm/style/acp_ranks.html +++ b/phpBB/adm/style/acp_ranks.html @@ -35,8 +35,8 @@ </dl> <dl> <dt><label for="special_rank">{L_RANK_SPECIAL}{L_COLON}</label></dt> - <dd><label><input onclick="dE('posts', -1)" type="radio" class="radio" name="special_rank" value="1" id="special_rank"<!-- IF S_SPECIAL_RANK --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> - <label><input onclick="dE('posts', 1)" type="radio" class="radio" name="special_rank" value="0"<!-- IF not S_SPECIAL_RANK --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> + <dd><label><input onclick="phpbb.toggleDisplay('posts', -1)" type="radio" class="radio" name="special_rank" value="1" id="special_rank"<!-- IF S_SPECIAL_RANK --> checked="checked"<!-- ENDIF --> /> {L_YES}</label> + <label><input onclick="phpbb.toggleDisplay('posts', 1)" type="radio" class="radio" name="special_rank" value="0"<!-- IF not S_SPECIAL_RANK --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl> <!-- IF S_SPECIAL_RANK --><div id="posts" style="display: none;"><!-- ELSE --><div id="posts"><!-- ENDIF --> <dl> diff --git a/phpBB/adm/style/acp_send_statistics.html b/phpBB/adm/style/acp_send_statistics.html index 2d6c4837fd..480e438e1f 100644 --- a/phpBB/adm/style/acp_send_statistics.html +++ b/phpBB/adm/style/acp_send_statistics.html @@ -17,8 +17,8 @@ function iframe_updated() return; } - dE('questionnaire-form', -1); - dE('questionnaire-thanks', 1); + phpbb.toggleDisplay('questionnaire-form', -1); + phpbb.toggleDisplay('questionnaire-thanks', 1); } //]]> </script> @@ -31,10 +31,10 @@ function iframe_updated() <p>{L_EXPLAIN_SHOW_STATISTICS}</p> - <p id="show-button"><input type="button" class="button2" onclick="dE('configlist', 1); dE('show-button', -1);" value="{L_SHOW_STATISTICS}" /></p> + <p id="show-button"><input type="button" class="button2" onclick="phpbb.toggleDisplay('configlist', 1); phpbb.toggleDisplay('show-button', -1);" value="{L_SHOW_STATISTICS}" /></p> <div id="configlist"> - <input type="button" class="button2" onclick="dE('show-button', 1); dE('configlist', -1);" value="{L_HIDE_STATISTICS}" /> + <input type="button" class="button2" onclick="phpbb.toggleDisplay('show-button', 1); phpbb.toggleDisplay('configlist', -1);" value="{L_HIDE_STATISTICS}" /> <p class="submit-buttons"> <input class="button1" type="submit" id="submit" name="submit" value="{L_SEND_STATISTICS}" /> </p> @@ -61,11 +61,4 @@ function iframe_updated() <p><strong>{L_THANKS_SEND_STATISTICS}</strong><br /><br /><a href="{U_ACP_MAIN}">« {L_GO_ACP_MAIN}</a></p> </div> -<script type="text/javascript"> -//<![CDATA[ - dE('configlist', -1); - dE('questionnaire-thanks', -1); -//]]> -</script> - <!-- INCLUDE overall_footer.html --> diff --git a/phpBB/adm/style/acp_users_overview.html b/phpBB/adm/style/acp_users_overview.html index 013be80465..506101c3f7 100644 --- a/phpBB/adm/style/acp_users_overview.html +++ b/phpBB/adm/style/acp_users_overview.html @@ -86,11 +86,11 @@ { if (option != 'banuser' && option != 'banemail' && option != 'banip') { - dE('reasons', -1); + phpbb.toggleDisplay('reasons', -1); return; } - dE('reasons', 1); + phpbb.toggleDisplay('reasons', 1); element = document.getElementById('user_quick_tools').ban_reason; diff --git a/phpBB/adm/style/acp_users_prefs.html b/phpBB/adm/style/acp_users_prefs.html index 1092b25b04..d1e389ca04 100644 --- a/phpBB/adm/style/acp_users_prefs.html +++ b/phpBB/adm/style/acp_users_prefs.html @@ -50,7 +50,7 @@ <!-- INCLUDE timezone_option.html --> <dl> <dt><label for="dateoptions">{L_BOARD_DATE_FORMAT}{L_COLON}</label><br /><span>{L_BOARD_DATE_FORMAT_EXPLAIN}</span></dt> - <dd><select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){dE('custom_date',1);}else{dE('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }">{S_DATEFORMAT_OPTIONS}</select></dd> + <dd><select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){phpbb.toggleDisplay('custom_date',1);}else{phpbb.toggleDisplay('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }">{S_DATEFORMAT_OPTIONS}</select></dd> <dd><div id="custom_date"<!-- IF not S_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="30" /></div></dd> </dl> </fieldset> diff --git a/phpBB/adm/style/admin.js b/phpBB/adm/style/admin.js index dd46124f97..7bda86e1e3 100644 --- a/phpBB/adm/style/admin.js +++ b/phpBB/adm/style/admin.js @@ -242,5 +242,9 @@ function parse_document(container) }); parse_document($('body')); + + // Hide configlist and success message in send statistics page + phpbb.toggleDisplay('configlist', -1); + phpbb.toggleDisplay('questionnaire-thanks', -1); }); })(jQuery); diff --git a/phpBB/adm/style/install_header.html b/phpBB/adm/style/install_header.html index 99b98ef068..a8f7009e4b 100644 --- a/phpBB/adm/style/install_header.html +++ b/phpBB/adm/style/install_header.html @@ -7,32 +7,6 @@ <title>{PAGE_TITLE}</title> <link href="{T_TEMPLATE_PATH}/admin.css" rel="stylesheet" type="text/css" media="screen" /> - -<script type="text/javascript"> -// <![CDATA[ - -/** -* Set display of page element -* s[-1,0,1] = hide,toggle display,show -*/ -function dE(n, s, type) -{ - if (!type) - { - type = 'block'; - } - - var e = document.getElementById(n); - if (!s) - { - s = (e.style.display == '' || e.style.display == 'block') ? -1 : 1; - } - e.style.display = (s == 1) ? type : 'none'; -} - -// ]]> -</script> - </head> <body class="{S_CONTENT_DIRECTION} nojs"> diff --git a/phpBB/adm/style/install_update.html b/phpBB/adm/style/install_update.html index d746226753..f0df138641 100644 --- a/phpBB/adm/style/install_update.html +++ b/phpBB/adm/style/install_update.html @@ -224,7 +224,7 @@ <!-- IF .not_modified --> <h2>{L_FILES_NOT_MODIFIED}</h2> - <div style="float: {S_CONTENT_FLOW_END};">» <a href="#" onclick="dE('not_modified', 0); return false;">{L_TOGGLE_DISPLAY}</a></div> + <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> <fieldset id="not_modified" style="display: none;"> diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html index f5d0fda88a..25a82a5faa 100644 --- a/phpBB/adm/style/overall_header.html +++ b/phpBB/adm/style/overall_header.html @@ -36,25 +36,6 @@ function jumpto() } /** -* Set display of page element -* s[-1,0,1] = hide,toggle display,show -*/ -function dE(n, s, type) -{ - if (!type) - { - type = 'block'; - } - - var e = document.getElementById(n); - if (!s) - { - s = (e.style.display == '') ? -1 : 1; - } - e.style.display = (s == 1) ? type : 'none'; -} - -/** * Mark/unmark checkboxes * id = ID of parent container, name = name prefix, state = state [true/false] */ diff --git a/phpBB/adm/style/permissions.js b/phpBB/adm/style/permissions.js index 1c85fbd9ef..9178adab50 100644 --- a/phpBB/adm/style/permissions.js +++ b/phpBB/adm/style/permissions.js @@ -177,7 +177,7 @@ function swap_options(pmask, fmask, cat, adv, view) { var adv_block = document.getElementById('advanced' + pmask + fmask); if (adv_block.style.display === 'block' && adv === true) { - dE('advanced' + pmask + fmask, -1); + phpbb.toggleDisplay('advanced' + pmask + fmask, -1); reset_opacity(1); display_checkboxes(false); return; @@ -207,11 +207,11 @@ function swap_options(pmask, fmask, cat, adv, view) { return; } - dE('options' + active_option, -1); + phpbb.toggleDisplay('options' + active_option, -1); //hiding and showing the checkbox if (document.getElementById('checkbox' + active_pmask + active_fmask)) { - dE('checkbox' + pmask + fmask, -1); + phpbb.toggleDisplay('checkbox' + pmask + fmask, -1); if ((pmask + fmask) !== (active_pmask + active_fmask)) { document.getElementById('checkbox' + active_pmask + active_fmask).style.display = 'inline'; @@ -219,13 +219,13 @@ function swap_options(pmask, fmask, cat, adv, view) { } if (!view) { - dE('advanced' + active_pmask + active_fmask, -1); + phpbb.toggleDisplay('advanced' + active_pmask + active_fmask, -1); } if (!view) { - dE('advanced' + pmask + fmask, 1); + phpbb.toggleDisplay('advanced' + pmask + fmask, 1); } - dE('options' + id, 1); + phpbb.toggleDisplay('options' + id, 1); active_pmask = pmask; active_fmask = fmask; diff --git a/phpBB/adm/style/simple_footer.html b/phpBB/adm/style/simple_footer.html index a559b25b72..c549a2df4e 100644 --- a/phpBB/adm/style/simple_footer.html +++ b/phpBB/adm/style/simple_footer.html @@ -18,6 +18,8 @@ <script type="text/javascript" src="{T_JQUERY_LINK}"></script> <!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF --> +<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script> + <!-- EVENT acp_simple_footer_after --> </body> diff --git a/phpBB/adm/style/simple_header.html b/phpBB/adm/style/simple_header.html index fd5145f0d5..ae25f28d32 100644 --- a/phpBB/adm/style/simple_header.html +++ b/phpBB/adm/style/simple_header.html @@ -49,25 +49,6 @@ function jumpto() } /** -* Set display of page element -* s[-1,0,1] = hide,toggle display,show -*/ -function dE(n, s, type) -{ - if (!type) - { - type = 'block'; - } - - var e = document.getElementById(n); - if (!s) - { - s = (e.style.display == '') ? -1 : 1; - } - e.style.display = (s == 1) ? type : 'none'; -} - -/** * Mark/unmark checkboxes * id = ID of parent container, name = name prefix, state = state [true/false] */ diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index aa9dc9af82..ac866f7c78 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -549,13 +549,23 @@ phpbb.addAjaxCallback = function(id, callback) { * current text so that the process can be repeated. */ phpbb.addAjaxCallback('alt_text', function() { - var el = $(this), + var el, + updateAll = $(this).data('update-all'), altText; - altText = el.attr('data-alt-text'); - el.attr('data-alt-text', el.text()); - el.attr('title', altText); - el.text(altText); + if (updateAll !== undefined && updateAll.length) { + el = $(updateAll); + } else { + el = $(this); + } + + el.each(function() { + var el = $(this); + altText = el.attr('data-alt-text'); + el.attr('data-alt-text', el.text()); + el.attr('title', $.trim(altText)); + el.text(altText); + }); }); /** @@ -568,27 +578,37 @@ phpbb.addAjaxCallback('alt_text', function() { * and changes the link itself. */ phpbb.addAjaxCallback('toggle_link', function() { - var el = $(this), + var el, + updateAll = $(this).data('update-all') , toggleText, toggleUrl, toggleClass; - // Toggle link text + if (updateAll !== undefined && updateAll.length) { + el = $(updateAll); + } else { + el = $(this); + } - toggleText = el.attr('data-toggle-text'); - el.attr('data-toggle-text', el.text()); - el.attr('title', toggleText); - el.text(toggleText); + el.each(function() { + var el = $(this); - // Toggle link url - toggleUrl = el.attr('data-toggle-url'); - el.attr('data-toggle-url', el.attr('href')); - el.attr('href', toggleUrl); + // Toggle link text + toggleText = el.attr('data-toggle-text'); + el.attr('data-toggle-text', el.text()); + el.attr('title', $.trim(toggleText)); + el.text(toggleText); - // Toggle class of link parent - toggleClass = el.attr('data-toggle-class'); - el.attr('data-toggle-class', el.parent().attr('class')); - el.parent().attr('class', toggleClass); + // Toggle link url + toggleUrl = el.attr('data-toggle-url'); + el.attr('data-toggle-url', el.attr('href')); + el.attr('href', toggleUrl); + + // Toggle class of link parent + toggleClass = el.attr('data-toggle-class'); + el.attr('data-toggle-class', el.parent().attr('class')); + el.parent().attr('class', toggleClass); + }); }); /** @@ -1062,6 +1082,27 @@ phpbb.registerPalette = function(el) { } /** +* Set display of page element +* +* @param string id The ID of the element to change +* @param int action Set to 0 if element display should be toggled, -1 for +* hiding the element, and 1 for showing it. +* @param string type Display type that should be used, e.g. inline, block or +* other CSS "display" types +*/ +phpbb.toggleDisplay = function(id, action, type) { + if (!type) { + type = 'block'; + } + + var display = $('#' + id).css('display'); + if (!action) { + action = (display === '' || display === type) ? -1 : 1; + } + $('#' + id).css('display', ((action === 1) ? type : 'none')); +} + +/** * Apply code editor to all textarea elements with data-bbcode attribute */ $(document).ready(function() { diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 7580c212ce..6897c3f22e 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -239,7 +239,7 @@ overall_footer_after overall_footer_breadcrumb_append === * Locations: - + styles/prosilver/template/overall_footer.html + + styles/prosilver/template/navbar_footer.html * Since: 3.1.0-a1 * Purpose: Add links to the list of breadcrumbs in the footer @@ -286,7 +286,7 @@ overall_header_body_before overall_header_breadcrumb_append === * Locations: - + styles/prosilver/template/overall_header.html + + styles/prosilver/template/navbar_header.html + styles/subsilver2/template/breadcrumbs.html * Since: 3.1.0-a1 * Purpose: Add links to the list of breadcrumbs in the header @@ -310,7 +310,7 @@ overall_header_head_append overall_header_navigation_append === * Locations: - + styles/prosilver/template/overall_header.html + + styles/prosilver/template/navbar_header.html + styles/subsilver2/template/overall_header.html * Since: 3.1.0-a1 * Purpose: Add links after the navigation links in the header @@ -318,7 +318,7 @@ overall_header_navigation_append overall_header_navigation_prepend === * Locations: - + styles/prosilver/template/overall_header.html + + styles/prosilver/template/navbar_header.html + styles/subsilver2/template/overall_header.html * Since: 3.1.0-a1 * Purpose: Add links before the navigation links in the header diff --git a/phpBB/includes/functions_container.php b/phpBB/includes/functions_container.php index 448cb0b7ed..4a01c934bf 100644 --- a/phpBB/includes/functions_container.php +++ b/phpBB/includes/functions_container.php @@ -239,7 +239,7 @@ function phpbb_create_dumped_container($config_file, array $extensions, array $p */ function phpbb_create_dumped_container_unless_debug($config_file, array $extensions, array $passes, $phpbb_root_path, $php_ext) { - $container_factory = defined('DEBUG') ? 'phpbb_create_compiled_container' : 'phpbb_create_dumped_container'; + $container_factory = defined('DEBUG_CONTAINER') ? 'phpbb_create_compiled_container' : 'phpbb_create_dumped_container'; return $container_factory($config_file, $extensions, $passes, $phpbb_root_path, $php_ext); } diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index 476535ae5b..4f8ec99d88 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -486,12 +486,14 @@ function adjust_language_keys_callback($matches) * @param array $data Array containing the database connection information * @param string $dbms The name of the DBAL class to use * @param bool $debug If the debug constants should be enabled by default or not +* @param bool $debug_container If the container should be compiled on +* every page load or not * @param bool $debug_test If the DEBUG_TEST constant should be added * NOTE: Only for use within the testing framework * * @return string The output to write to the file */ -function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_test = false) +function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_container = false, $debug_test = false) { $config_data = "<?php\n"; $config_data .= "// phpBB 3.1.x auto-generated configuration file\n// Do not change anything in this file!\n"; @@ -526,6 +528,15 @@ function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_test $config_data .= "// @define('DEBUG', true);\n"; } + if ($debug_container) + { + $config_data .= "@define('DEBUG_CONTAINER', true);\n"; + } + else + { + $config_data .= "// @define('DEBUG_CONTAINER', true);\n"; + } + if ($debug_test) { $config_data .= "@define('DEBUG_TEST', true);\n"; diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index ef2e009a6e..be066de0f0 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -80,7 +80,7 @@ class p_master function list_modules($p_class) { global $auth, $db, $user, $cache; - global $config, $phpbb_root_path, $phpEx; + global $config, $phpbb_root_path, $phpEx, $phpbb_dispatcher; // Sanitise for future path use, it's escaped as appropriate for queries $this->p_class = str_replace(array('.', '/', '\\'), '', basename($p_class)); @@ -284,6 +284,20 @@ class p_master $custom_func($row['module_mode'], $module_row); } + /** + * This event allows to modify parameters for building modules list + * + * @event core.modify_module_row + * @var string url_func Function for building 'url_extra' + * @var string lang_func Function for building the language name + * @var string custom_func Custom function for calling parameters on module init + * @var array row Array holding the basic module data + * @var array module_row Array holding the module display parameters + * @since 3.1.0-b3 + */ + $vars = array('url_func', 'lang_func', 'custom_func', 'row', 'module_row'); + extract($phpbb_dispatcher->trigger_event('core.modify_module_row', compact($vars))); + $this->module_ary[] = $module_row; } diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 79fcb892ef..51bbcb8bae 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1153,7 +1153,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id 'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false, 'S_FRIEND' => ($row['friend']) ? true : false, 'S_IGNORE_POST' => ($row['foe']) ? true : false, - 'L_IGNORE_POST' => ($row['foe']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), "<a href=\"{$u_show_post}\" onclick=\"dE('{$post_anchor}', 1); return false;\">", '</a>') : '', + 'L_IGNORE_POST' => ($row['foe']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), "<a href=\"{$u_show_post}\" onclick=\"phpbb.toggleDisplay('{$post_anchor}', 1); return false;\">", '</a>') : '', 'POST_SUBJECT' => $post_subject, 'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['POST']), diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index 04d483e14c..9d61e39c98 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -64,7 +64,7 @@ class filespec $this->filename = $upload_ary['tmp_name']; $this->filesize = $upload_ary['size']; $name = (STRIP) ? stripslashes($upload_ary['name']) : $upload_ary['name']; - $name = trim(utf8_htmlspecialchars(utf8_basename($name))); + $name = trim(utf8_basename($name)); $this->realname = $this->uploadname = $name; $this->mimetype = $upload_ary['type']; diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index a14f79f9fd..00b53b6576 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -672,7 +672,8 @@ class ucp_profile $sql = 'SELECT key_id, last_ip, last_login FROM ' . SESSIONS_KEYS_TABLE . ' - WHERE user_id = ' . (int) $user->data['user_id']; + WHERE user_id = ' . (int) $user->data['user_id'] . ' + ORDER BY last_login ASC'; $result = $db->sql_query($sql); diff --git a/phpBB/phpbb/path_helper.php b/phpBB/phpbb/path_helper.php index a8e12c4063..fefef39c51 100644 --- a/phpBB/phpbb/path_helper.php +++ b/phpBB/phpbb/path_helper.php @@ -149,6 +149,16 @@ class path_helper $script_name = $this->symfony_request->getScriptName(); /* + * If the path info is empty but we're using app.php, then we + * might be using an empty route like app.php/ which is + * supported by symfony's routing + */ + if ($path_info === '/' && preg_match('/app\.' . $this->php_ext . '\/$/', $request_uri)) + { + return $this->web_root_path = $this->phpbb_root_path . '../'; + } + + /* * If the path info is empty (single /), then we're not using * a route like app.php/foo/bar */ diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index 56dfcb04c7..1594d73517 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -92,23 +92,6 @@ function viewableArea(e, itself) { } /** -* Set display of page element -* s[-1,0,1] = hide,toggle display,show -* type = string: inline, block, inline-block or other CSS "display" type -*/ -function dE(n, s, type) { - if (!type) { - type = 'block'; - } - - var e = document.getElementById(n); - if (!s) { - s = (e.style.display === '' || e.style.display === type) ? -1 : 1; - } - e.style.display = (s === 1) ? type : 'none'; -} - -/** * Alternate display of subPanels */ jQuery(document).ready(function() { diff --git a/phpBB/styles/prosilver/template/index_body.html b/phpBB/styles/prosilver/template/index_body.html index 19552e1804..3e9aae28e3 100644 --- a/phpBB/styles/prosilver/template/index_body.html +++ b/phpBB/styles/prosilver/template/index_body.html @@ -17,7 +17,7 @@ <!-- 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" data-overlay="false">{L_MARK_FORUMS_READ}</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> <!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/navbar_footer.html b/phpBB/styles/prosilver/template/navbar_footer.html new file mode 100644 index 0000000000..32cbecdf8c --- /dev/null +++ b/phpBB/styles/prosilver/template/navbar_footer.html @@ -0,0 +1,17 @@ +<div class="navbar"> + <div class="inner"> + + <ul class="linklist bulletin"> + <li class="small-icon icon-home breadcrumbs"><!-- IF U_SITE_HOME --><span class="crumb"><a href="{U_SITE_HOME}">{L_SITE_HOME}</a> <strong>‹</strong></span> <!-- ENDIF --><span class="crumb"><a href="{U_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 --> + <!-- ENDIF --> + <li class="rightside">{S_TIMEZONE}</li> + <!-- 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 U_TEAM --><li class="rightside"><a href="{U_TEAM}">{L_THE_TEAM}</a><!-- ENDIF --> + </ul> + + </div> +</div> diff --git a/phpBB/styles/prosilver/template/navbar_header.html b/phpBB/styles/prosilver/template/navbar_header.html new file mode 100644 index 0000000000..259aec75ed --- /dev/null +++ b/phpBB/styles/prosilver/template/navbar_header.html @@ -0,0 +1,55 @@ +<div class="navbar"> + <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}>{L_SITE_HOME}</a> <strong>‹</strong></span> <!-- ENDIF --> + <span class="crumb"><a href="{U_INDEX}" accesskey="h"{$MICRODATA}>{L_INDEX}</a></span> + <!-- BEGIN navlinks --> <span class="crumb"><strong>‹</strong> <a href="{navlinks.U_VIEW_FORUM}"{$MICRODATA}>{navlinks.FORUM_NAME}</a></span><!-- END navlinks --> + <!-- EVENT overall_header_breadcrumb_append --> + </li> + + <!-- IF S_REGISTERED_USER --><li id="username_logged_in" class="rightside"><!-- IF CURRENT_USER_AVATAR --><a href="{U_USER_PROFILE}" class="header-avatar">{CURRENT_USER_AVATAR}</a> <!-- ENDIF -->{USERNAME_FULL}</li><!-- ENDIF --> + <!-- IF U_EMAIL_TOPIC --><li class="rightside"><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}" class="sendemail">{L_EMAIL_TOPIC}</a></li><!-- ENDIF --> + <!-- IF U_EMAIL_PM --><li class="rightside"><a href="{U_EMAIL_PM}" title="{L_EMAIL_PM}" class="sendemail">{L_EMAIL_PM}</a></li><!-- ENDIF --> + <!-- IF U_PRINT_TOPIC --><li class="rightside"><a href="{U_PRINT_TOPIC}" title="{L_PRINT_TOPIC}" accesskey="p" class="print">{L_PRINT_TOPIC}</a></li><!-- ENDIF --> + <!-- IF U_PRINT_PM --><li class="rightside"><a href="{U_PRINT_PM}" title="{L_PRINT_PM}" accesskey="p" class="print">{L_PRINT_PM}</a></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> + + <ul class="linklist bulletin"> + <!-- IF not S_IS_BOT and S_USER_LOGGED_IN --> + <!-- IF S_NOTIFICATIONS_DISPLAY --> + <li class="small-icon icon-notification" data-skip-responsive="true"> + <a href="{U_VIEW_ALL_NOTIFICATIONS}" id="notification_list_button"><span>{L_NOTIFICATIONS} [</span><strong>{NOTIFICATIONS_COUNT}</strong><span>]</span></a> + <!-- INCLUDE notification_dropdown.html --> + </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> + <!-- 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> + <!-- ENDIF --> + <!-- IF U_RESTORE_PERMISSIONS --> + <li class="icon-restore-permissions"><a href="{U_RESTORE_PERMISSIONS}">{L_RESTORE_PERMISSIONS}</a></li> + <!-- ENDIF --> + <!-- ENDIF --> + + <!-- 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 --> + <!-- 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> +</div> diff --git a/phpBB/styles/prosilver/template/notification_dropdown.html b/phpBB/styles/prosilver/template/notification_dropdown.html new file mode 100644 index 0000000000..3f32189fe5 --- /dev/null +++ b/phpBB/styles/prosilver/template/notification_dropdown.html @@ -0,0 +1,42 @@ +<div id="notification_list" class="dropdown dropdown-extended notification_list"> + <div class="pointer"><div class="pointer-inner"></div></div> + <div class="dropdown-contents"> + <div class="header"> + {L_NOTIFICATIONS} + <span class="header_settings"> + <a href="{U_NOTIFICATION_SETTINGS}">{L_SETTINGS}</a> + <!-- IF NOTIFICATIONS_COUNT --> + <span id="mark_all_notifications"> • <a href="{U_MARK_ALL_NOTIFICATIONS}" data-ajax="notification.mark_all_read">{L_MARK_ALL_READ}</a></span> + <!-- ENDIF --> + </span> + </div> + + <ul> + <!-- IF not .notifications --> + <li> + {L_NO_NOTIFICATIONS} + </li> + <!-- ENDIF --> + <!-- BEGIN notifications --> + <li class="<!-- IF notifications.UNREAD --> bg2<!-- ENDIF -->"> + <!-- IF notifications.URL --> + <a href="<!-- IF notifications.UNREAD -->{notifications.U_MARK_READ}" data-real-url="{notifications.URL}<!-- ELSE -->{notifications.URL}<!-- ENDIF -->"> + <!-- ENDIF --> + <!-- IF notifications.AVATAR -->{notifications.AVATAR}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" /><!-- ENDIF --> + <div class="notification_text"> + <p>{notifications.FORMATTED_TITLE}</p> + <p>» {notifications.TIME}</p> + </div> + <!-- IF notifications.URL --></a><!-- ENDIF --> + <!-- IF notifications.UNREAD --> + <a href="{notifications.U_MARK_READ}" class="mark_read icon-mark" data-ajax="notification.mark_read" title="{L_MARK_READ}"></a> + <!-- ENDIF --> + </li> + <!-- END notifications --> + </ul> + + <div class="footer"> + <a href="{U_VIEW_ALL_NOTIFICATIONS}"><span>{L_SEE_ALL}</span></a> + </div> + </div> +</div> diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html index 92d43abc7e..a43dd3c8a6 100644 --- a/phpBB/styles/prosilver/template/overall_footer.html +++ b/phpBB/styles/prosilver/template/overall_footer.html @@ -4,24 +4,7 @@ <!-- EVENT overall_footer_page_body_after --> <div id="page-footer"> - - <div class="navbar"> - <div class="inner"> - - <ul class="linklist bulletin"> - <li class="small-icon icon-home breadcrumbs"><!-- IF U_SITE_HOME --><span class="crumb"><a href="{U_SITE_HOME}">{L_SITE_HOME}</a> <strong>‹</strong></span> <!-- ENDIF --><span class="crumb"><a href="{U_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 --> - <!-- ENDIF --> - <li class="rightside">{S_TIMEZONE}</li> - <!-- 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 U_TEAM --><li class="rightside"><a href="{U_TEAM}">{L_THE_TEAM}</a><!-- ENDIF --> - </ul> - - </div> - </div> + <!-- INCLUDE navbar_footer.html --> <div class="copyright"> <!-- EVENT overall_footer_copyright_prepend --> diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html index d342fce441..353ba9139a 100644 --- a/phpBB/styles/prosilver/template/overall_header.html +++ b/phpBB/styles/prosilver/template/overall_header.html @@ -80,103 +80,7 @@ </div> </div> - <div class="navbar"> - <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}>{L_SITE_HOME}</a> <strong>‹</strong></span> <!-- ENDIF --> - <span class="crumb"><a href="{U_INDEX}" accesskey="h"{$MICRODATA}>{L_INDEX}</a></span> - <!-- BEGIN navlinks --> <span class="crumb"><strong>‹</strong> <a href="{navlinks.U_VIEW_FORUM}"{$MICRODATA}>{navlinks.FORUM_NAME}</a></span><!-- END navlinks --> - <!-- EVENT overall_header_breadcrumb_append --> - </li> - - <!-- IF S_REGISTERED_USER --><li id="username_logged_in" class="rightside"><!-- IF CURRENT_USER_AVATAR --><a href="{U_USER_PROFILE}" class="header-avatar">{CURRENT_USER_AVATAR}</a> <!-- ENDIF -->{USERNAME_FULL}</li><!-- ENDIF --> - <!-- IF U_EMAIL_TOPIC --><li class="rightside"><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}" class="sendemail">{L_EMAIL_TOPIC}</a></li><!-- ENDIF --> - <!-- IF U_EMAIL_PM --><li class="rightside"><a href="{U_EMAIL_PM}" title="{L_EMAIL_PM}" class="sendemail">{L_EMAIL_PM}</a></li><!-- ENDIF --> - <!-- IF U_PRINT_TOPIC --><li class="rightside"><a href="{U_PRINT_TOPIC}" title="{L_PRINT_TOPIC}" accesskey="p" class="print">{L_PRINT_TOPIC}</a></li><!-- ENDIF --> - <!-- IF U_PRINT_PM --><li class="rightside"><a href="{U_PRINT_PM}" title="{L_PRINT_PM}" accesskey="p" class="print">{L_PRINT_PM}</a></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> - - <ul class="linklist bulletin"> - <!-- IF not S_IS_BOT and S_USER_LOGGED_IN --> - <!-- IF S_NOTIFICATIONS_DISPLAY --> - <li class="small-icon icon-notification" data-skip-responsive="true"> - <a href="{U_VIEW_ALL_NOTIFICATIONS}" id="notification_list_button"><span>{L_NOTIFICATIONS} [</span><strong>{NOTIFICATIONS_COUNT}</strong><span>]</span></a> - <div id="notification_list" class="dropdown dropdown-extended notification_list"> - <div class="pointer"><div class="pointer-inner"></div></div> - <div class="dropdown-contents"> - <div class="header"> - {L_NOTIFICATIONS} - <span class="header_settings"> - <a href="{U_NOTIFICATION_SETTINGS}">{L_SETTINGS}</a> - <!-- IF NOTIFICATIONS_COUNT --> - <span id="mark_all_notifications"> • <a href="{U_MARK_ALL_NOTIFICATIONS}" data-ajax="notification.mark_all_read">{L_MARK_ALL_READ}</a></span> - <!-- ENDIF --> - </span> - </div> - - <ul> - <!-- IF not .notifications --> - <li> - {L_NO_NOTIFICATIONS} - </li> - <!-- ENDIF --> - <!-- BEGIN notifications --> - <li class="<!-- IF notifications.UNREAD --> bg2<!-- ENDIF -->"> - <!-- IF notifications.URL --> - <a href="<!-- IF notifications.UNREAD -->{notifications.U_MARK_READ}" data-real-url="{notifications.URL}<!-- ELSE -->{notifications.URL}<!-- ENDIF -->"> - <!-- ENDIF --> - <!-- IF notifications.AVATAR -->{notifications.AVATAR}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" /><!-- ENDIF --> - <div class="notification_text"> - <p>{notifications.FORMATTED_TITLE}</p> - <p>» {notifications.TIME}</p> - </div> - <!-- IF notifications.URL --></a><!-- ENDIF --> - <!-- IF notifications.UNREAD --> - <a href="{notifications.U_MARK_READ}" class="mark_read icon-mark" data-ajax="notification.mark_read" title="{L_MARK_READ}"></a> - <!-- ENDIF --> - </li> - <!-- END notifications --> - </ul> - - <div class="footer"> - <a href="{U_VIEW_ALL_NOTIFICATIONS}"><span>{L_SEE_ALL}</span></a> - </div> - </div> - </div> - </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> - <!-- 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> - <!-- ENDIF --> - <!-- IF U_RESTORE_PERMISSIONS --> - <li class="icon-restore-permissions"><a href="{U_RESTORE_PERMISSIONS}">{L_RESTORE_PERMISSIONS}</a></li> - <!-- ENDIF --> - <!-- ENDIF --> - - <!-- 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 --> - <!-- 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> - </div> - + <!-- INCLUDE navbar_header.html --> </div> <!-- EVENT overall_header_page_body_before --> diff --git a/phpBB/styles/prosilver/template/posting_buttons.html b/phpBB/styles/prosilver/template/posting_buttons.html index 1164b2ffbe..3dad6606bb 100644 --- a/phpBB/styles/prosilver/template/posting_buttons.html +++ b/phpBB/styles/prosilver/template/posting_buttons.html @@ -34,7 +34,7 @@ function change_palette() { - dE('colour_palette'); + phpbb.toggleDisplay('colour_palette'); e = document.getElementById('colour_palette'); if (e.style.display == 'block') diff --git a/phpBB/styles/prosilver/template/posting_review.html b/phpBB/styles/prosilver/template/posting_review.html index 2771c9829a..25b719420b 100644 --- a/phpBB/styles/prosilver/template/posting_review.html +++ b/phpBB/styles/prosilver/template/posting_review.html @@ -8,7 +8,7 @@ <div class="inner"> {post_review_row.L_IGNORE_POST} <!-- ELSE --> -<div class="post <!-- IF post_review_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF post_review_row.ONLINE_STATUS --> online<!-- ENDIF -->"> +<div class="post <!-- IF post_review_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF -->"> <div class="inner"> <!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/ucp_prefs_personal.html b/phpBB/styles/prosilver/template/ucp_prefs_personal.html index a5b4852af8..d07aab1a89 100644 --- a/phpBB/styles/prosilver/template/ucp_prefs_personal.html +++ b/phpBB/styles/prosilver/template/ucp_prefs_personal.html @@ -66,7 +66,7 @@ <dl> <dt><label for="dateformat">{L_BOARD_DATE_FORMAT}{L_COLON}</label><br /><span>{L_BOARD_DATE_FORMAT_EXPLAIN}</span></dt> <dd> - <select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){dE('custom_date',1);}else{dE('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }"> + <select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){phpbb.toggleDisplay('custom_date',1);}else{phpbb.toggleDisplay('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }"> {S_DATEFORMAT_OPTIONS} </select> </dd> @@ -109,11 +109,11 @@ // Show/hide custom field if (e.selectedIndex == e.length - 1) { - dE('custom_date',1); + phpbb.toggleDisplay('custom_date',1); } else { - dE('custom_date',-1); + phpbb.toggleDisplay('custom_date',-1); } } diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html index 9848336b75..7372834dd3 100644 --- a/phpBB/styles/prosilver/template/viewforum_body.html +++ b/phpBB/styles/prosilver/template/viewforum_body.html @@ -28,7 +28,7 @@ <!-- 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" data-overlay="false">{L_MARK_SUBFORUMS_READ}</a></li> + <li class="rightside mark-read"><a href="{U_MARK_FORUMS}" data-ajax="mark_forums_read">{L_MARK_SUBFORUMS_READ}</a></li> </ul> <!-- ENDIF --> <!-- INCLUDE forumlist_body.html --> @@ -56,7 +56,7 @@ <!-- ENDIF --> <div class="pagination"> - <!-- IF not S_IS_BOT and U_MARK_TOPICS and .topicrow --><a href="{U_MARK_TOPICS}" accesskey="m" data-ajax="mark_topics_read" data-overlay="false">{L_MARK_TOPICS_READ}</a> • <!-- ENDIF --> + <!-- IF not S_IS_BOT and U_MARK_TOPICS and .topicrow --><a href="{U_MARK_TOPICS}" accesskey="m" data-ajax="mark_topics_read">{L_MARK_TOPICS_READ}</a> • <!-- ENDIF --> {TOTAL_TOPICS} • <!-- IF .pagination --> <!-- INCLUDE pagination.html --> @@ -227,7 +227,7 @@ <!-- ENDIF --> <div class="pagination"> - <!-- IF not S_IS_BOT and U_MARK_TOPICS and .topicrow --><a href="{U_MARK_TOPICS}" data-ajax="mark_topics_read" data-overlay="false">{L_MARK_TOPICS_READ}</a> • <!-- ENDIF --> + <!-- IF not S_IS_BOT and U_MARK_TOPICS and .topicrow --><a href="{U_MARK_TOPICS}" data-ajax="mark_topics_read">{L_MARK_TOPICS_READ}</a> • <!-- ENDIF --> {TOTAL_TOPICS} • <!-- IF .pagination --> <!-- INCLUDE pagination.html --> diff --git a/phpBB/styles/prosilver/template/viewtopic_topic_tools.html b/phpBB/styles/prosilver/template/viewtopic_topic_tools.html index ec17185bae..fcce2267c4 100644 --- a/phpBB/styles/prosilver/template/viewtopic_topic_tools.html +++ b/phpBB/styles/prosilver/template/viewtopic_topic_tools.html @@ -7,14 +7,14 @@ <!-- 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}" 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}"> + <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}" title="{L_BOOKMARK_TOPIC}" data-ajax="alt_text" data-alt-text="{S_BOOKMARK_TOGGLE}"> + <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> diff --git a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html b/phpBB/styles/subsilver2/template/ucp_prefs_personal.html index cd5fc9a13f..93fcfac5b1 100644 --- a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html +++ b/phpBB/styles/subsilver2/template/ucp_prefs_personal.html @@ -2,20 +2,6 @@ <script type="text/javascript"> // <![CDATA[ - /** - * Set display of page element - * s[-1,0,1] = hide,toggle display,show - */ - function dE(n,s) - { - var e = document.getElementById(n); - if (!s) - { - s = (e.style.display == '') ? -1 : 1; - } - e.style.display = (s == 1) ? 'block' : 'none'; - } - var default_dateformat = '{A_DEFAULT_DATEFORMAT}'; // ]]> </script> @@ -70,7 +56,7 @@ <tr> <td class="row1" width="50%"><b class="genmed">{L_BOARD_DATE_FORMAT}{L_COLON}</b><br /><span class="gensmall">{L_BOARD_DATE_FORMAT_EXPLAIN}</span></td> <td class="row2"> - <select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){dE('custom_date',1);}else{dE('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }"> + <select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){phpbb.toggleDisplay('custom_date',1);}else{phpbb.toggleDisplay('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }"> {S_DATEFORMAT_OPTIONS} </select> <div id="custom_date"<!-- IF not S_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="30" class="post" style="margin-top: 3px;" /></div> diff --git a/tests/functional/download_test.php b/tests/functional/download_test.php index 24366992d5..087250157d 100644 --- a/tests/functional/download_test.php +++ b/tests/functional/download_test.php @@ -57,7 +57,7 @@ class phpbb_functional_download_test extends phpbb_functional_test_case $crawler = self::request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}"); $this->assertContains('Re: Download Topic #1-#2', $crawler->filter('html')->text()); - $this->data['posts']['Re: Download Topic #1-#2'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->eq(1)->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p'); + $this->data['posts']['Re: Download Topic #1-#2'] = (int) $post2['post_id']; } public function test_download_accessible() diff --git a/tests/functional/paging_test.php b/tests/functional/paging_test.php index 91f14cb75d..b0e4743d5b 100644 --- a/tests/functional/paging_test.php +++ b/tests/functional/paging_test.php @@ -18,22 +18,22 @@ class phpbb_functional_paging_test extends phpbb_functional_test_case $this->login(); $post = $this->create_topic(2, 'Test Topic 1', 'This is a test topic posted by the testing framework.'); - for ($post_id = 1; $post_id <= 11; $post_id++) + for ($post_id = 1; $post_id <= 16; $post_id++) { $this->create_post(2, $post['topic_id'], 'Re: Test Topic 1', 'This is a test post no' . $post_id . ' posted by the testing framework.'); } $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}"); - $this->assertContains('post no9', $crawler->text()); - $this->assertNotContains('post no11', $crawler->text()); + $this->assertContains('post no4', $crawler->text()); + $this->assertNotContains('post no16', $crawler->text()); $next_link = $crawler->filter('#viewtopic > fieldset > a.arrow-right')->attr('href'); $crawler = self::request('GET', $next_link); - $this->assertContains('post no11', $crawler->text()); - $this->assertNotContains('post no9', $crawler->text()); + $this->assertNotContains('post no4', $crawler->text()); + $this->assertContains('post no16', $crawler->text()); $prev_link = $crawler->filter('#viewtopic > fieldset > a.arrow-left')->attr('href'); $crawler = self::request('GET', $prev_link); - $this->assertContains('post no9', $crawler->text()); - $this->assertNotContains('post no11', $crawler->text()); + $this->assertContains('post no4', $crawler->text()); + $this->assertNotContains('post no16', $crawler->text()); } } diff --git a/tests/functional/prune_shadow_topic_test.php b/tests/functional/prune_shadow_topic_test.php index 901cedb389..a9fd2457bb 100644 --- a/tests/functional/prune_shadow_topic_test.php +++ b/tests/functional/prune_shadow_topic_test.php @@ -76,7 +76,7 @@ class phpbb_functional_prune_shadow_topic_test extends phpbb_functional_test_cas $crawler = self::request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}"); $this->assertContains('Re: Prune Shadow #1-#2', $crawler->filter('html')->text()); - $this->data['posts']['Re: Prune Shadow #1-#2'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->eq(1)->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p'); + $this->data['posts']['Re: Prune Shadow #1-#2'] = (int) $post2['post_id']; $this->assert_forum_details($this->data['forums']['Prune Shadow'], array( 'forum_posts_approved' => 2, diff --git a/tests/functional/softdelete_test.php b/tests/functional/softdelete_test.php index bd4d34cf99..1c86d00b9b 100644 --- a/tests/functional/softdelete_test.php +++ b/tests/functional/softdelete_test.php @@ -83,7 +83,7 @@ class phpbb_functional_softdelete_test extends phpbb_functional_test_case $crawler = self::request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}"); $this->assertContains('Re: Soft Delete Topic #1-#2', $crawler->filter('html')->text()); - $this->data['posts']['Re: Soft Delete Topic #1-#2'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->eq(1)->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p'); + $this->data['posts']['Re: Soft Delete Topic #1-#2'] = (int) $post2['post_id']; $this->assert_forum_details($this->data['forums']['Soft Delete #1'], array( 'forum_posts_approved' => 2, @@ -410,7 +410,7 @@ class phpbb_functional_softdelete_test extends phpbb_functional_test_case $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}"); $this->add_lang('mcp'); - $form = $crawler->selectButton($this->lang('RESTORE'))->form(); + $form = $crawler->filter('#p' . $this->data['posts']['Soft Delete Topic #1'])->selectButton($this->lang('RESTORE'))->form(); $crawler = self::submit($form); $this->assertContainsLang('RESTORE_POST', $crawler->text()); diff --git a/tests/path_helper/web_root_path_test.php b/tests/path_helper/web_root_path_test.php index 2c22511402..ec04135997 100644 --- a/tests/path_helper/web_root_path_test.php +++ b/tests/path_helper/web_root_path_test.php @@ -116,6 +116,13 @@ class phpbb_path_helper_web_root_path_test extends phpbb_test_case '/phpbb3-fork/phpBB/foo/template', '/phpbb3-fork/phpBB/app.php', ), + array( + $this->phpbb_root_path . 'test.php', + $this->phpbb_root_path . '../test.php', + '/', + '/phpbb3-fork/phpBB/app.php/', + '/phpbb3-fork/phpBB/app.php', + ), ); } diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index daa8b802b5..1f372fff0c 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -300,7 +300,7 @@ class phpbb_functional_test_case extends phpbb_test_case // because that step will create a config.php file if phpBB has the // permission to do so. We have to create the config file on our own // in order to get the DEBUG constants defined. - $config_php_data = phpbb_create_config_file_data(self::$config, self::$config['dbms'], true, true); + $config_php_data = phpbb_create_config_file_data(self::$config, self::$config['dbms'], true, false, true); $config_created = file_put_contents($config_file, $config_php_data) !== false; if (!$config_created) { diff --git a/tests/upload/filespec_test.php b/tests/upload/filespec_test.php index 492f31cee6..2d46fd4058 100644 --- a/tests/upload/filespec_test.php +++ b/tests/upload/filespec_test.php @@ -273,4 +273,18 @@ class phpbb_filespec_test extends phpbb_test_case $phpEx = ''; } + + /** + * @dataProvider clean_filename_variables + */ + public function test_uploadname($filename) + { + $type_cast_helper = new \phpbb\request\type_cast_helper(); + + $upload_name = ''; + $type_cast_helper->set_var($upload_name, $filename, 'string', true, true); + $filespec = $this->get_filespec(array('name'=> $upload_name)); + + $this->assertSame(trim(utf8_basename(htmlspecialchars($filename))), $filespec->uploadname); + } } |