Compare commits

..

6 commits

9 changed files with 76 additions and 292 deletions

View file

@ -2,7 +2,7 @@
all: png
png: images/boardicons.png images/icons/admin.png images/icons/alerts.png images/icons/home.png images/icons/login.png images/icons/members.png images/icons/moderate.png images/icons/pm.png images/icons/profile.png images/icons/recent.png images/icons/search.png images/icons/unread_replies.png images/icons/unread.png
png: images/icons/admin.png images/icons/alerts.png images/icons/home.png images/icons/login.png images/icons/members.png images/icons/moderate.png images/icons/pm.png images/icons/profile.png images/icons/recent.png images/icons/search.png images/icons/unread_replies.png images/icons/unread.png
%.png: %.svg
mkdir --parents $(shell dirname $@)
@ -10,4 +10,4 @@ png: images/boardicons.png images/icons/admin.png images/icons/alerts.png images
optipng -o7 -quiet $@
clean:
rm --force images/boardicons.png images/icons/admin.png images/icons/alerts.png images/icons/home.png images/icons/login.png images/icons/members.png images/icons/moderate.png images/icons/pm.png images/icons/profile.png images/icons/recent.png images/icons/search.png images/icons/unread_replies.png images/icons/unread.png
rm --force images/icons/admin.png images/icons/alerts.png images/icons/home.png images/icons/login.png images/icons/members.png images/icons/moderate.png images/icons/pm.png images/icons/profile.png images/icons/recent.png images/icons/search.png images/icons/unread_replies.png images/icons/unread.png

View file

@ -120,12 +120,12 @@ function template_main()
{
echo '
<div class="pagesection">
', template_button_strip($context['normal_buttons'], ), '
', $context['menu_separator'], '
<div class="pagelinks">
<a href="#bot" class="button">', $txt['go_down'], '</a>
', $context['page_index'], '
</div>
', $context['menu_separator'], '
', template_button_strip($context['normal_buttons'], ), '
';
// Mobile action buttons (top)
@ -188,7 +188,6 @@ function template_main()
echo '
<div class="', $topic['css_class'], '">
<div class="board_icon">
<img src="', $topic['first_post']['icon_url'], '" alt="">
<div class="icons">
', $topic['is_posted_in'] ? '<span class="main_icons profile_sm"></span>' : '', '
';
@ -229,9 +228,6 @@ function template_main()
<span id="msg_', $topic['first_post']['id'], '">', $topic['first_post']['link'], (!$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span>
</h3>
</div>
<p class="floatleft">
', $txt['started_by'], ' ', $topic['first_post']['member']['link'], '
</p>
', !empty($topic['pages']) ? '<span id="pages' . $topic['first_post']['id'] . '" class="topic_pages">' . $topic['pages'] . '</span>' : '', '
</div><!-- #topic_[first_post][id] -->
</div><!-- .info -->
@ -342,12 +338,12 @@ function template_main()
echo '
<div class="pagesection">
', template_button_strip($context['normal_buttons'], ), '
', $context['menu_separator'], '
<div class="pagelinks">
<a href="#main_content_section" class="button" id="bot">', $txt['go_up'], '</a>
', $context['page_index'], '
</div>';
</div>
', $context['menu_separator'], '
', template_button_strip($context['normal_buttons'], );
// Mobile action buttons (bottom)
if (!empty($context['normal_buttons']))

View file

@ -151,7 +151,6 @@ function template_unread()
echo '
<div class="', $topic['css_class'], '">
<div class="board_icon">
<img src="', $topic['first_post']['icon_url'], '" alt="">
', $topic['is_posted_in'] ? '<span class="main_icons profile_sm"></span>' : '', '
</div>
<div class="info">';

View file

@ -25,6 +25,10 @@ html {
--menu-background-hover: #555555;
--menu-background-active: black;
--menu-font: white;
--font-regular: "Cabin", sans-serif;
--font-emphasis: "Oswald", sans-serif;
--font-mono: "DejaVu Sans Mono", Menlo, Monaco, Consolas, monospace;
--font-copyright: Verdana, sans-serif; /* Copyright must be Verdana! */
}
/* Index */
@ -36,7 +40,7 @@ html {
body {
background: var(--bgcolor);
font-size: 100%;
font-family: "Cabin",sans-serif;
font-family: var(--font-regular);
color: var(--dark-color);
position: relative;
height: 100%;
@ -47,7 +51,7 @@ body {
color: rgba(0, 0, 0, 0.6);
}
h1, h2, h3, h4, h5, h6 {
font-family: "Oswald",sans-serif;
font-family: var(--font-emphasis);
}
/* General reset */
@ -167,7 +171,7 @@ img, input, select, textarea {
/* Use a consistent monospace font everywhere */
.monospace, .bbc_code, .phpcode, pre {
font-family: "DejaVu Sans Mono", Menlo, Monaco, Consolas, monospace;
font-family: var(--font-mono);
}
.sceditor-container textarea, .sceditor-container textarea:focus {
@ -1133,13 +1137,16 @@ generic_menu .dropmenu .subsections ul li a {
border: 1px solid;
border-color: var(--bgcolor);
border-radius: 3px;
box-shadow: 1px 1px 1px rgba(221, 221, 221, 0.57) inset;
box-sizing: border-box;
vertical-align: middle;
background: var(--neutral-color);
outline: none;
padding: 0 0.4em;
}
.button_strip_new_topic {
font-weight: 700;
font-family: var(--font-emphasis);
}
a.button, a.button:hover, .button:focus {
border-bottom: none;
@ -1258,7 +1265,7 @@ html[lang="el-GR"] .inline_mod_check {
flex-wrap: wrap;
justify-content: center;
flex-direction: column;
min-height: 8em;
min-height: 4em;
}
#header::after {
content: "";
@ -1531,7 +1538,7 @@ font-size: large;
}
#footer li.copyright {
display: block;
font-family: Verdana, sans-serif; /* Copyright must be Verdana! */
font-family: var(--font-copyright);
}
#footerfix {
flex: 1 0 auto;
@ -3305,12 +3312,15 @@ h2 .collapse {
margin: 4px 4px 0 0;
}
.board_icon a, .board_icon div {
background: url(../images/boardicons.svg) no-repeat 0 0 / 90px;
background: url(../images/boardicons.png) no-repeat 0 0 / 90px;
display: inline-block;
width: 45px;
height: 45px;
border-bottom:none;
}
#messageindex .board_icon a, #messageindex .board_icon div {
background: none;
}
.board_icon a:hover, .board_icon div:hover {
border-bottom:none;
}
@ -4027,7 +4037,7 @@ ul.post_options li {
/* File error */
.errorfile_table {
font-family: monospace;
font-family: var(--font-mono);
border-spacing: 1px;
}
.errorfile_table td {
@ -4727,15 +4737,6 @@ img.theme_thumbnail {
right: 0;
}
.khbb_subtitle {
display: flex;
justify-content: space-between;
max-width: 1200px;
margin: 0 auto;
width: 90%;
}
.cat_bar {
display: flex;
flex-wrap: wrap;

View file

@ -70,15 +70,9 @@
}
/* Autres modifs maisons */
.khbb_subtitle {
justify-content: center;
}
.khbb_identity {
max-width: initial;
}
.khbb_subtitle .news {
display: none !important;
}
/* Board */
.cat_bar .lastpost {
display: none !important;

1
images/.gitignore vendored
View file

@ -1,4 +1,3 @@
/boardicons.png
/icons/admin.png
/icons/alerts.png
/icons/home.png

BIN
images/boardicons.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

View file

@ -1,202 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="47.625mm"
height="47.625mm"
viewBox="0 0 47.625 47.625"
version="1.1"
id="svg5"
xml:space="preserve"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
sodipodi:docname="boardicons.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="2.6557772"
inkscape:cx="41.0426"
inkscape:cy="102.6065"
inkscape:window-width="1278"
inkscape:window-height="1022"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="layer1"
showguides="false" /><defs
id="defs2" /><g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-28.695021,-30.302504)"><ellipse
style="fill:#bd9098;stroke-width:0.264583;fill-opacity:1"
id="path937"
cx="40.557663"
cy="42.090816"
rx="11.398761"
ry="9.8460035" /><ellipse
style="fill:#bd9098;fill-opacity:1;stroke-width:0.264583"
id="path937-6"
cx="64.561783"
cy="41.876976"
rx="11.398761"
ry="9.8460035" /><ellipse
style="fill:#bd9098;fill-opacity:1;stroke-width:0.264583"
id="path937-6-7"
cx="40.849342"
cy="66.267334"
rx="11.398761"
ry="9.8460035" /><ellipse
style="fill:#bd9098;fill-opacity:1;stroke-width:0.264583"
id="path937-6-5"
cx="64.683205"
cy="65.908531"
rx="11.398761"
ry="9.8460035" /><g
id="g386"
transform="translate(-0.26879614,-0.27100869)"><g
id="g3486-3"
transform="translate(-30.362466,25.451311)"
style="fill:#e8304e;fill-opacity:1"><path
style="fill:#e8304e;fill-opacity:1;stroke:none;stroke-width:0.561057;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
d="m 75.498274,22.254678 c 0,0 0.336734,0.634649 2.389664,1.133196 C 76.323512,22.35551 76.228957,21.18979 76.228957,21.18979"
id="path1508-2-3-5-9"
sodipodi:nodetypes="ccc" /><path
id="path1510-9-6-6-0"
style="fill:#e8304e;fill-opacity:1;stroke-width:0.52564;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
d="m -73.092828,16.117323 a 5.3818111,3.35495 0 0 1 5.303552,2.798279 c -0.80402,0.185379 -1.675644,0.287321 -2.585888,0.287321 -2.060395,0 -3.922483,-0.522612 -5.251876,-1.351339 -0.418728,-0.261029 -0.782948,-0.550035 -1.085722,-0.861446 a 5.3818111,3.35495 0 0 1 3.619934,-0.872815 z m -4.047815,1.144633 c 0.34933,0.374265 0.771055,0.714774 1.250053,1.013375 1.426282,0.889124 3.370805,1.42782 5.515426,1.42782 0.933448,0 1.829376,-0.101859 2.660819,-0.290422 a 5.3818111,3.35495 0 0 1 0.0031,0.05995 5.3818111,3.35495 0 0 1 -5.381584,3.354834 5.3818111,3.35495 0 0 1 -5.3821,-3.354834 5.3818111,3.35495 0 0 1 1.334285,-2.210718 z"
transform="scale(-1,1)" /><g
id="g1642-1-9-8"
transform="translate(30.388612,-24.818836)"
style="fill:#e8304e;fill-opacity:1"><path
style="fill:#e8304e;fill-opacity:1;stroke:none;stroke-width:0.79375;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
d="m 36.583874,43.461557 c 0,0 -0.476392,0.897865 -3.380757,1.603179 2.213258,-1.460528 2.347029,-3.109719 2.347029,-3.109719"
id="path1508-27-4-8"
sodipodi:nodetypes="ccc" /><ellipse
style="fill:#e8304e;fill-opacity:1;stroke:none;stroke-width:0.743645;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
id="path1510-0-8-5"
cx="39.986717"
cy="39.525448"
rx="7.6138706"
ry="4.7463861" /></g></g><g
id="g4200"
style="fill:#e8304e;fill-opacity:1"><path
style="fill:#e8304e;fill-opacity:1;stroke:none;stroke-width:0.561057;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
d="m 69.135808,47.705989 c 0,0 0.336734,0.634649 2.389664,1.133196 -1.564426,-1.032364 -1.658981,-2.198084 -1.658981,-2.198084"
id="path1508-2-3-5-96"
sodipodi:nodetypes="ccc" /><path
id="path1510-9-6-6-3"
style="fill:#e8304e;fill-opacity:1;stroke-width:0.52564;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
d="m 66.730362,41.568634 a 5.3818111,3.35495 0 0 0 -5.303552,2.798279 c 0.80402,0.185379 1.675644,0.287321 2.585888,0.287321 2.060395,0 3.922483,-0.522612 5.251876,-1.351339 0.418728,-0.261029 0.782948,-0.550035 1.085722,-0.861446 a 5.3818111,3.35495 0 0 0 -3.619934,-0.872815 z m 4.047815,1.144633 c -0.34933,0.374265 -0.771055,0.714774 -1.250053,1.013375 -1.426282,0.889124 -3.370805,1.42782 -5.515426,1.42782 -0.933448,0 -1.829376,-0.101859 -2.660819,-0.290422 a 5.3818111,3.35495 0 0 0 -0.0031,0.05995 5.3818111,3.35495 0 0 0 5.381584,3.354834 5.3818111,3.35495 0 0 0 5.3821,-3.354834 5.3818111,3.35495 0 0 0 -1.334285,-2.210718 z" /></g><g
id="g4196"
style="fill:#dddddd;fill-opacity:1"><g
id="g4110-4"
transform="translate(59.000842,-34.843345)"
style="fill:#dddddd;fill-opacity:1"><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.695183;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path3753-8-3"
cx="0.22994268"
cy="79.393974"
rx="0.7073034"
ry="0.43313131" /><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.525692;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path3753-6-3-3"
cx="-0.826244"
cy="80.132942"
rx="0.56068492"
ry="0.31244308" /><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.36305;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path3753-3-1-3"
cx="-1.9399792"
cy="80.540527"
rx="0.40688068"
ry="0.20534968" /></g><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.743645;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
id="path1510-0-8-1"
cx="64.012863"
cy="40.157925"
rx="7.6138706"
ry="4.7463861" /></g><g
id="g4162"
style="fill:#dddddd;fill-opacity:1"><path
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.561057;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
d="m 69.135808,71.705989 c 0,0 0.336734,0.634649 2.389664,1.133196 -1.564426,-1.032364 -1.658981,-2.198084 -1.658981,-2.198084"
id="path1508-2-3-5-4"
sodipodi:nodetypes="ccc" /><path
id="path1510-9-6-6-4"
style="fill:#dddddd;fill-opacity:1;stroke-width:0.52564;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
d="m 66.730362,65.568634 a 5.3818111,3.35495 0 0 0 -5.303552,2.798279 c 0.80402,0.185379 1.675644,0.287321 2.585888,0.287321 2.060395,0 3.922483,-0.522612 5.251876,-1.351339 0.418728,-0.261029 0.782948,-0.550035 1.085722,-0.861446 a 5.3818111,3.35495 0 0 0 -3.619934,-0.872815 z m 4.047815,1.144633 c -0.34933,0.374265 -0.771055,0.714774 -1.250053,1.013375 -1.426282,0.889124 -3.370805,1.42782 -5.515426,1.42782 -0.933448,0 -1.829376,-0.101859 -2.660819,-0.290422 a 5.3818111,3.35495 0 0 0 -0.0031,0.05995 5.3818111,3.35495 0 0 0 5.381584,3.354834 5.3818111,3.35495 0 0 0 5.3821,-3.354834 5.3818111,3.35495 0 0 0 -1.334285,-2.210718 z" /><path
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.79375;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
d="m 60.61002,68.094032 c 0,0 -0.476392,0.897865 -3.380757,1.603179 2.213258,-1.460528 2.347029,-3.109719 2.347029,-3.109719"
id="path1508-27-4-4"
sodipodi:nodetypes="ccc" /><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.743645;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
id="path1510-0-8-7"
cx="64.012863"
cy="64.157921"
rx="7.6138706"
ry="4.7463861" /></g><g
id="g4182"
style="fill:#dddddd;fill-opacity:1"><path
id="path1510-9-6-6-9"
style="fill:#dddddd;fill-opacity:1;stroke-width:0.52564;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
d="m 42.73036,65.568634 a 5.3818111,3.35495 0 0 0 -5.303552,2.798279 c 0.80402,0.185379 1.675644,0.287321 2.585888,0.287321 2.060395,0 3.922483,-0.522612 5.251876,-1.351339 0.418728,-0.261029 0.782948,-0.550035 1.085722,-0.861446 A 5.3818111,3.35495 0 0 0 42.73036,65.568634 Z m 4.047815,1.144633 c -0.34933,0.374265 -0.771055,0.714774 -1.250053,1.013375 -1.426282,0.889124 -3.370805,1.42782 -5.515426,1.42782 -0.933448,0 -1.829376,-0.101859 -2.660819,-0.290422 a 5.3818111,3.35495 0 0 0 -0.0031,0.05995 5.3818111,3.35495 0 0 0 5.381584,3.354834 5.3818111,3.35495 0 0 0 5.3821,-3.354834 5.3818111,3.35495 0 0 0 -1.334285,-2.210718 z" /><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.509371;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path3753-5"
cx="-46.276207"
cy="71.956123"
rx="0.51825184"
ry="0.31736183"
transform="scale(-1,1)" /><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.385182;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path3753-6-9"
cx="-47.050091"
cy="72.497574"
rx="0.41082227"
ry="0.22893174"
transform="scale(-1,1)" /><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.266012;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path3753-3-7"
cx="-47.866142"
cy="72.796219"
rx="0.29812759"
ry="0.15046281"
transform="scale(-1,1)" /></g><g
id="g4176"
style="fill:#dddddd;fill-opacity:1"><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.743645;stroke-linejoin:round;stroke-miterlimit:2;paint-order:stroke fill markers"
id="path1510-0-8-0"
cx="40.012859"
cy="64.157921"
rx="7.6138706"
ry="4.7463861" /><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.695183;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path3753"
cx="35.243378"
cy="68.441536"
rx="0.7073034"
ry="0.43313131" /><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.525692;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path3753-6"
cx="34.187191"
cy="69.180504"
rx="0.56068492"
ry="0.31244308" /><ellipse
style="fill:#dddddd;fill-opacity:1;stroke:none;stroke-width:0.36305;stroke-linejoin:round;stroke-miterlimit:2;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="path3753-3"
cx="33.073456"
cy="69.588089"
rx="0.40688068"
ry="0.20534968" /></g></g><g
id="g1642-1-6"
transform="translate(4.6126872,-24.786987)" /></g></svg>

Before

Width:  |  Height:  |  Size: 12 KiB

View file

@ -218,26 +218,8 @@ echo '<div class="khbb_body">';
<div id="header">
<h1 class="forumtitle">
<a id="top" href="', $scripturl, '">', empty($context['header_logo_url_html_safe']) ? $context['forum_name_html_safe'] : '<img src="' . $context['header_logo_url_html_safe'] . '" alt="' . $context['forum_name_html_safe'] . '">', '</a>
</h1>';
// Sur quel compte on est co ? Ou invité.
echo '
<div class="khbb_subtitle">
<div class="khbb_identity" title="">
<span class="textmenu">', $txt['hello_guest'], $context['user']['name'], '</span></a>
</div> ';
// les slogans ! utilisation des "news" pour cela.
// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']) && !empty($context['random_news_line']))
echo '
<div class="news">
<p>', $context['random_news_line'], '</p>
</div>';
echo '
</div>
</div>';
echo '
</h1>
</div>
<div id="wrapper">';
// début menu du haut. On reconstruit sauce maison.
echo '<a class="mobile_user_menu">
@ -652,8 +634,6 @@ function template_menu()
*/
function template_button_strip($button_strip, $direction = '', $strip_options = array())
{
global $context, $txt;
if (!is_array($strip_options))
$strip_options = array();
@ -661,40 +641,18 @@ function template_button_strip($button_strip, $direction = '', $strip_options =
$buttons = array();
foreach ($button_strip as $key => $value)
{
// As of 2.1, the 'test' for each button happens while the array is being generated. The extra 'test' check here is deprecated but kept for backward compatibility (update your mods, folks!)
if (!isset($value['test']) || !empty($context[$value['test']]))
{
if (!isset($value['id']))
$value['id'] = $key;
// If a "new topic" button is provided, skip it in this first pass.
// It will be added at the end of the strip.
if ( $key == 'new_topic' ) continue;
$button = '
<a class="button button_strip_' . $key . (isset($value['class']) ? ' ' . $value['class'] : '') . '" ' . (!empty($value['url']) ? 'href="' . $value['url'] . '"' : '') . ' ' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '>'.(!empty($value['icon']) ? '<span class="main_icons '.$value['icon'].'"></span>' : '').'' . $txt[$value['text']] . '</a>';
$buttons = template_button_strip_single_button($key, $value, $buttons);
}
// If a "new topic" button is provided, add it at the end of the strip.
if ( array_key_exists('new_topic', $button_strip) ) {
$key = 'new_topic';
$value = $button_strip[$key];
if (!empty($value['sub_buttons']))
{
$button .= '
<div class="top_menu dropmenu ' . $key . '_dropdown">
<div class="viewport">
<div class="overview">';
foreach ($value['sub_buttons'] as $element)
{
if (isset($element['test']) && empty($context[$element['test']]))
continue;
$button .= '
<a href="' . $element['url'] . '"><strong>' . $txt[$element['text']] . '</strong>';
if (isset($txt[$element['text'] . '_desc']))
$button .= '<br><span>' . $txt[$element['text'] . '_desc'] . '</span>';
$button .= '</a>';
}
$button .= '
</div><!-- .overview -->
</div><!-- .viewport -->
</div><!-- .top_menu -->';
}
$buttons[] = $button;
}
$buttons = template_button_strip_single_button($key, $value, $buttons);
}
// No buttons? No button strip either.
@ -706,6 +664,45 @@ function template_button_strip($button_strip, $direction = '', $strip_options =
', implode('', $buttons), '
</div>';
}
function template_button_strip_single_button($key, $value, $buttons) {
global $context, $txt;
// As of 2.1, the 'test' for each button happens while the array is being generated. The extra 'test' check here is deprecated but kept for backward compatibility (update your mods, folks!)
if (!isset($value['test']) || !empty($context[$value['test']]))
{
if (!isset($value['id']))
$value['id'] = $key;
$button = '
<a class="button button_strip_' . $key . (isset($value['class']) ? ' ' . $value['class'] : '') . '" ' . (!empty($value['url']) ? 'href="' . $value['url'] . '"' : '') . ' ' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '>'.(!empty($value['icon']) ? '<span class="main_icons '.$value['icon'].'"></span>' : '').'' . $txt[$value['text']] . '</a>';
if (!empty($value['sub_buttons']))
{
$button .= '
<div class="top_menu dropmenu ' . $key . '_dropdown">
<div class="viewport">
<div class="overview">';
foreach ($value['sub_buttons'] as $element)
{
if (isset($element['test']) && empty($context[$element['test']]))
continue;
$button .= '
<a href="' . $element['url'] . '"><strong>' . $txt[$element['text']] . '</strong>';
if (isset($txt[$element['text'] . '_desc']))
$button .= '<br><span>' . $txt[$element['text'] . '_desc'] . '</span>';
$button .= '</a>';
}
$button .= '
</div><!-- .overview -->
</div><!-- .viewport -->
</div><!-- .top_menu -->';
}
$buttons[] = $button;
}
return $buttons;
}
/**
* Generate a list of quickbuttons.