Skip to content

Commit

Permalink
Added notification in SP editor if hits or date is disabled for all p…
Browse files Browse the repository at this point in the history
…ages in config

For #883. Give warning if hits or date is disabled for viewing in Staticpage config for all pages. Also only display divider between date and hits when needed.
  • Loading branch information
eSilverStrike committed Sep 28, 2018
1 parent 1dbda3f commit 7a30684
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 5 deletions.
1 change: 1 addition & 0 deletions plugins/staticpages/language/english.php
Expand Up @@ -121,6 +121,7 @@
'draft_yes' => 'Yes',
'draft_no' => 'No',
'show_on_page' => 'Show on Page',
'show_on_page_disabled' => 'Note: This is currently disabled for all pages in the Staticpage Configuration.',
'cache_time' => 'Cache Time',
'cache_time_desc' => 'This staticpage content will be cached for no longer than this many seconds. If 0 caching is disabled. If -1 cached until page is edited again. Staticpages with PHP enabled or are a template will not be cached. (3600 = 1 hour, 86400 = 1 day)',
'autotag_desc_staticpage' => '[staticpage: id alternate title] - Displays a link to a static page using the static page title as the title. An alternate title may be specified but is not required.',
Expand Down
1 change: 1 addition & 0 deletions plugins/staticpages/language/english_utf-8.php
Expand Up @@ -120,6 +120,7 @@
'draft_yes' => 'Yes',
'draft_no' => 'No',
'show_on_page' => 'Show on Page',
'show_on_page_disabled' => 'Note: This is currently disabled for all pages in the Staticpage Configuration.',
'cache_time' => 'Cache Time',
'cache_time_desc' => 'This staticpage content will be cached for no longer than this many seconds. If 0 caching is disabled. If -1 cached until page is edited again. Staticpages with PHP enabled or are a template will not be cached. (3600 = 1 hour, 86400 = 1 day)',
'autotag_desc_staticpage' => '[staticpage: id alternate title] - Displays a link to a static page using the static page title as the title. An alternate title may be specified but is not required.',
Expand Down
1 change: 1 addition & 0 deletions plugins/staticpages/language/japanese_utf-8.php
Expand Up @@ -126,6 +126,7 @@
'draft_yes' => '○',
'draft_no' => '-',
'show_on_page' => 'ページに表示する',
'show_on_page_disabled' => 'Note: This is currently disabled for all pages in the Staticpage Configuration.',
'cache_time' => 'キャッシュタイム',
'cache_time_desc' => 'この静的ページコンテンツはここで指定された秒数以上にキャッシュされることはありません。もしキャッシュが0ならキャッシュ無効 (3600 = 1時間, 86400 = 1日)。静的ページPHPまたはテンプレートの場合はキャッシュされません。',
'autotag_desc_staticpage' => '[staticpage: id alternate title] - 静的ページタイトルで静的ページへのリンクを表示。アンカーテキストの指定は任意です。',
Expand Down
2 changes: 2 additions & 0 deletions plugins/staticpages/templates/default/admin/editor.thtml
Expand Up @@ -58,12 +58,14 @@
<dd class="controls_text">
{sp_formateddate}
(<input type="checkbox" name="sp_onlastupdate" id="sp-editor-sp_onlastupdate" {onlastupdate_checked}{xhtml}> {lang_show_on_page})
{!if lang_show_on_page_date_disabled}<dd class="description">{lang_show_on_page_date_disabled}</dd>{!endif}
</dd>

<dt><label for="sp-editor-sp_onhits">{lang_hits}</label></dt>
<dd class="controls_text">
<input type="hidden" name="sp_hits" value="{sp_hits}"{xhtml}>{sp_hits_formatted}
(<input type="checkbox" name="sp_onhits" id="sp-editor-sp_onhits" {onhits_checked}{xhtml}> {lang_show_on_page})
{!if lang_show_on_page_hits_disabled}<dd class="description">{lang_show_on_page_hits_disabled}</dd>{!endif}
</dd>

<dt><label>{lang_comments}</label></dt>
Expand Down
Expand Up @@ -91,12 +91,14 @@
<dd class="controls_text">
{sp_formateddate}
(<input type="checkbox" name="sp_onlastupdate" id="sp-editor-sp_onlastupdate" {onlastupdate_checked}{xhtml}> {lang_show_on_page})
{!if lang_show_on_page_date_disabled}<dd class="description">{lang_show_on_page_date_disabled}</dd>{!endif}
</dd>

<dt><label for="sp-editor-sp_onhits">{lang_hits}</label></dt>
<dd class="controls_text">
<input type="hidden" name="sp_hits" value="{sp_hits}"{xhtml}>{sp_hits_formatted}
(<input type="checkbox" name="sp_onhits" id="sp-editor-sp_onhits" {onhits_checked}{xhtml}> {lang_show_on_page})
{!if lang_show_on_page_hits_disabled}<dd class="description">{lang_show_on_page_hits_disabled}</dd>{!endif}
</dd>

<dt><label>{lang_comments}</label></dt>
Expand Down
2 changes: 1 addition & 1 deletion plugins/staticpages/templates/default/staticpage.thtml
Expand Up @@ -5,7 +5,7 @@
{content}
{block_end}
<p class="aligncenter">
{!if lastupdate}{lastupdate}<span style="padding-left:5px;padding-right:5px">|</span>{!endif}
{!if lastupdate}{lastupdate}{!if hits}<span style="padding-left:5px;padding-right:5px">|</span>{!endif}{!endif}
{!if hits}{hits}{!endif}
{print_icon}{edit_icon}
</p>
Expand Down
2 changes: 2 additions & 0 deletions plugins/staticpages/templates/denim/admin/editor.thtml
Expand Up @@ -58,12 +58,14 @@
<dd class="controls_text">
{sp_formateddate}
(<input type="checkbox" name="sp_onlastupdate" id="sp-editor-sp_onlastupdate" {onlastupdate_checked}{xhtml}> {lang_show_on_page})
{!if lang_show_on_page_date_disabled}<dd class="description">{lang_show_on_page_date_disabled}</dd>{!endif}
</dd>

<dt><label for="sp-editor-sp_onhits">{lang_hits}</label></dt>
<dd class="controls_text">
<input type="hidden" name="sp_hits" value="{sp_hits}"{xhtml}>{sp_hits_formatted}
(<input type="checkbox" name="sp_onhits" id="sp-editor-sp_onhits" {onhits_checked}{xhtml}> {lang_show_on_page})
{!if lang_show_on_page_hits_disabled}<dd class="description">{lang_show_on_page_hits_disabled}</dd>{!endif}
</dd>

<dt><label>{lang_comments}</label></dt>
Expand Down
Expand Up @@ -91,12 +91,14 @@
<dd class="controls_text">
{sp_formateddate}
(<input type="checkbox" name="sp_onlastupdate" id="sp-editor-sp_onlastupdate" {onlastupdate_checked}{xhtml}> {lang_show_on_page})
{!if lang_show_on_page_date_disabled}<dd class="description">{lang_show_on_page_date_disabled}</dd>{!endif}
</dd>

<dt><label for="sp-editor-sp_onhits">{lang_hits}</label></dt>
<dd class="controls_text">
<input type="hidden" name="sp_hits" value="{sp_hits}"{xhtml}>{sp_hits_formatted}
(<input type="checkbox" name="sp_onhits" id="sp-editor-sp_onhits" {onhits_checked}{xhtml}> {lang_show_on_page})
{!if lang_show_on_page_hits_disabled}<dd class="description">{lang_show_on_page_hits_disabled}</dd>{!endif}
</dd>

<dt><label>{lang_comments}</label></dt>
Expand Down
2 changes: 1 addition & 1 deletion plugins/staticpages/templates/denim/staticpage.thtml
Expand Up @@ -5,7 +5,7 @@
{content}
{block_end}
<p class="uk-text-center">
{!if lastupdate}{lastupdate}<span class="uk-margin-small-left uk-margin-small-right">|</span>{!endif}
{!if lastupdate}{lastupdate}{!if hits}<span class="uk-margin-small-left uk-margin-small-right">|</span>{!endif}{!endif}
{!if hits}{hits}{!endif}
{print_icon}{edit_icon}
</p>
Expand Down
2 changes: 2 additions & 0 deletions plugins/staticpages/templates/denim_three/admin/editor.thtml
Expand Up @@ -58,12 +58,14 @@
<dd class="controls_text">
{sp_formateddate}
(<input type="checkbox" name="sp_onlastupdate" id="sp-editor-sp_onlastupdate" class="uk-checkbox" {onlastupdate_checked}{xhtml}> {lang_show_on_page})
{!if lang_show_on_page_date_disabled}<dd class="description">{lang_show_on_page_date_disabled}</dd>{!endif}
</dd>

<dt><label for="sp-editor-sp_onhits">{lang_hits}</label></dt>
<dd class="controls_text">
<input type="hidden" name="sp_hits" value="{sp_hits}"{xhtml}>{sp_hits_formatted}
(<input type="checkbox" name="sp_onhits" id="sp-editor-sp_onhits" class="uk-checkbox" {onhits_checked}{xhtml}> {lang_show_on_page})
{!if lang_show_on_page_hits_disabled}<dd class="description">{lang_show_on_page_hits_disabled}</dd>{!endif}
</dd>

<dt><label>{lang_comments}</label></dt>
Expand Down
Expand Up @@ -91,12 +91,14 @@
<dd class="controls_text">
{sp_formateddate}
(<input type="checkbox" name="sp_onlastupdate" id="sp-editor-sp_onlastupdate" class="uk-checkbox" {onlastupdate_checked}{xhtml}> {lang_show_on_page})
{!if lang_show_on_page_date_disabled}<dd class="description">{lang_show_on_page_date_disabled}</dd>{!endif}
</dd>

<dt><label for="sp-editor-sp_onhits">{lang_hits}</label></dt>
<dd class="controls_text">
<input type="hidden" name="sp_hits" value="{sp_hits}"{xhtml}>{sp_hits_formatted}
(<input type="checkbox" name="sp_onhits" id="sp-editor-sp_onhits" class="uk-checkbox" {onhits_checked}{xhtml}> {lang_show_on_page})
{!if lang_show_on_page_hits_disabled}<dd class="description">{lang_show_on_page_hits_disabled}</dd>{!endif}
</dd>

<dt><label>{lang_comments}</label></dt>
Expand Down
2 changes: 1 addition & 1 deletion plugins/staticpages/templates/denim_three/staticpage.thtml
Expand Up @@ -5,7 +5,7 @@
{content}
{block_end}
<p class="uk-text-center">
{!if lastupdate}{lastupdate}<span class="uk-margin-small-left uk-margin-small-right">|</span>{!endif}
{!if lastupdate}{lastupdate}{!if hits}<span class="uk-margin-small-left uk-margin-small-right">|</span>{!endif}{!endif}
{!if hits}{hits}{!endif}
{print_icon}{edit_icon}
</p>
Expand Down
6 changes: 6 additions & 0 deletions public_html/admin/plugins/staticpages/index.php
Expand Up @@ -488,6 +488,9 @@ function staticpageeditor_form(array $A)
} else {
$sp_template->set_var('onlastupdate_checked', '');
}
if ($_SP_CONF['show_date'] != 1) {
$sp_template->set_var('lang_show_on_page_date_disabled', $LANG_STATIC['show_on_page_disabled']);
}

$sp_template->set_var('lang_label', $LANG_STATIC['label']);
if (isset($A['sp_label'])) {
Expand Down Expand Up @@ -537,6 +540,9 @@ function staticpageeditor_form(array $A)
$sp_template->set_var('lang_allowedhtml', $allowed);
$sp_template->set_var('lang_allowed_html', $allowed);
$sp_template->set_var('lang_show_on_page', $LANG_STATIC['show_on_page']);
if ($_SP_CONF['show_hits'] != 1) {
$sp_template->set_var('lang_show_on_page_hits_disabled', $LANG_STATIC['show_on_page_disabled']);
}
$sp_template->set_var('lang_hits', $LANG_STATIC['hits']);
if (empty($A['sp_hits'])) {
$sp_template->set_var('sp_hits', '0');
Expand Down
4 changes: 2 additions & 2 deletions public_html/docs/english/staticpages.html
Expand Up @@ -205,12 +205,12 @@ <h3><a name="main">Static Pages Main Settings</a></h3>
<tr>
<td><a name="desc_show_hits">show_hits</a></td>
<td>true</td>
<td>Whether to show the number of hits for a static page. This is also used for the default per page setting and it overrides the per page setting.</td>
<td>Whether to show the number of hits for a static page. This is also used for the default when creating a new page. Setting this to false overrides the per page setting.</td>
</tr>
<tr>
<td><a name="desc_show_date">show_date</a></td>
<td>true</td>
<td>Whether to show the date and time of the last change to a static page. This is also used for the default per page setting and it overrides the per page setting.</td>
<td>Whether to show the date and time of the last change to a static page. This is also used for the default when creating a new page. Setting this to false overrides the per page setting.</td>
</tr>
<tr>
<td><a name="desc_filter_html">filter_html</a></td>
Expand Down

0 comments on commit 7a30684

Please sign in to comment.