Merge pull request #541 from tobiasd/20180311-pageheader

[pageheader] bugfix: missing open/close of settings block
This commit is contained in:
Hypolite Petovan 2018-03-11 14:02:19 -04:00 committed by GitHub
commit 688daf435b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 13 deletions

View file

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-27 05:01-0500\n"
"POT-Creation-Date: 2018-03-11 18:52+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,14 +17,24 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: pageheader.php:50
#: pageheader.php:53
msgid "\"pageheader\" Settings"
msgstr ""
#: pageheader.php:55
msgid "Submit"
#: pageheader.php:54
msgid "Message"
msgstr ""
#: pageheader.php:68
#: pageheader.php:54
msgid ""
"Message to display on every page on this server (or put a pageheader.html "
"file in your docroot)"
msgstr ""
#: pageheader.php:55
msgid "Save Settings"
msgstr ""
#: pageheader.php:69
msgid "pageheader Settings saved."
msgstr ""

View file

@ -48,14 +48,12 @@ function pageheader_addon_settings(&$a,&$s) {
if(! $words)
$words = '';
$s .= '<div class="settings-block">';
$s .= '<h3>' . L10n::t('"pageheader" Settings') . '</h3>';
$s .= '<div id="pageheader-wrapper">';
$s .= '<label id="pageheader-label" for="pageheader-words">' . L10n::t('Message to display on every page on this server (or put a pageheader.html file in your docroot)') . ' </label>';
$s .= '<textarea id="pageheader-words" type="text" name="pageheader-words">' . $words . '</textarea>';
$s .= '</div><div class="clear"></div>';
$s .= '<div class="settings-submit-wrapper" ><input type="submit" id="pageheader-submit" name="pageheader-submit" class="settings-submit" value="' . L10n::t('Save Settings') . '" /></div></div>';
$t = get_markup_template("settings.tpl", "addon/pageheader/");
$s .= replace_macros($t, [
'$title' => L10n::t('"pageheader" Settings'),
'$phwords' => ['pageheader-words', L10n::t('Message'), $words, L10n::t('Message to display on every page on this server (or put a pageheader.html file in your docroot)')],
'$submit' => L10n::t('Save Settings')
]);
return;

View file

@ -0,0 +1,14 @@
<span id="settings_pageheader_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose('settings_pageheader_expanded'); openClose('settings_pageheader_inflated');">
<h3>{{$title}}</h3>
</span>
<div id="settings_pageheader_expanded" class="settings-block" style="display: none;">
<span class="fakelink" onclick="openClose('settings_pageheader_expanded'); openClose('settings_pageheader_inflated');">
<h3>{{$title}}</h3>
</span>
{{include file="field_textarea.tpl" field=$phwords}}
<div class="settings-submit-wrapper" >
<input type="submit" id="pageheader-submit" name="pageheader-submit" class="settings-submit" value="{{$submit}}" />
</div>
</div>
<div class="clear"></div>