Skip to content

Commit

Permalink
Fixed Block Help Popup Dialogue which is enabled for blocks with help…
Browse files Browse the repository at this point in the history
… URLs

Fix for #818. Also removed hardcoding of block help icon image
  • Loading branch information
eSilverStrike committed Nov 21, 2017
1 parent 5bf658e commit a79fb30
Show file tree
Hide file tree
Showing 17 changed files with 20 additions and 21 deletions.
1 change: 1 addition & 0 deletions public_html/docs/english/theme.html
Expand Up @@ -208,6 +208,7 @@ <h2><a name="changes220">Theme changes in Geeklog 2.2.0</a></h2>
<ul>
<li>Added "record_edit" block and {record_edit} template variable to <span class="tt">commentform.thtml</span> and <span class="tt">commentform_advanced.thtml</span>. This allows Comment Moderators to bypass recording when a comment edit is done and by whom.</li>
<li>Added "comment_signature" and "comment_edit" blocks and {comment_signature} and {comment_edit} template variable to <span class="tt">comment.thtml</span>. This allows comment signatures and user edits to by styled easier and removes some hardcoded CSS from the code.</li>
<li>Removed {block_help} template variable from all blockheader template files (blockheader.thtml, blockheader-left.thtml, etc..) Added {help_title} template variable and included help icon and link directly into template files. Use {help_url} variable for template if statement to check if it needs to be displayed or not.</li>
</ul>

<h2><a name="changes213">Theme changes in Geeklog 2.1.3</a></h2>
Expand Down
2 changes: 1 addition & 1 deletion public_html/javascript/dialog_help.js
@@ -1,5 +1,5 @@
$(function() {
$('a.blocktitle').each(function() {
$('a[gl-help-popup]').each(function() {
var $link = $(this);
$link.one('click', function() {

Expand Down
2 changes: 1 addition & 1 deletion public_html/layout/denim/blockheader-config.thtml
@@ -1,7 +1,7 @@
{# begin {templatelocation} #}

<nav class="block-config{!if css_classes} {css_classes}{!endif}"{!if css_id} id="{css_id}"{!endif} role="navigation">
<h2 class="block-title">{block_title}{block_help}</h2>
<h2 class="block-title">{block_title}{!if help_url}<a class="blocktitle block-help-icon uk-icon-hover uk-icon-question-circle uk-icon-small" {gl-help-popup} href="{help_url}" title="{help_title}"></a>{!endif}</h2>
<ul class="block-config-content">

{# end {templatelocation} #}
2 changes: 1 addition & 1 deletion public_html/layout/denim/blockheader-left.thtml
@@ -1,7 +1,7 @@
{# begin {templatelocation} #}

<section class="block-left{!if css_classes} {css_classes}{!endif}"{!if css_id} id="{css_id}"{!endif}>
<h2 class="block-title">{block_title}{block_help}</h2>
<h2 class="block-title">{block_title}{!if help_url}<a class="blocktitle block-help-icon uk-icon-hover uk-icon-question-circle uk-icon-small" {gl-help-popup} href="{help_url}" title="{help_title}"></a>{!endif}</h2>
<div class="block-left-content">

{# end {templatelocation} #}
2 changes: 1 addition & 1 deletion public_html/layout/denim/blockheader-list.thtml
@@ -1,7 +1,7 @@
{# begin {templatelocation} #}

<section class="block-list{!if css_classes} {css_classes}{!endif}"{!if css_id} id="{css_id}"{!endif}>
<h2 class="block-title">{block_title}{block_help}</h2>
<h2 class="block-title">{block_title}{!if help_url}<a class="blocktitle block-help-icon uk-icon-hover uk-icon-question-circle uk-icon-small" {gl-help-popup} href="{help_url}" title="{help_title}"></a>{!endif}</h2>
<nav class="block-list-content" role="navigation">
<ul class="noliststyle">

Expand Down
2 changes: 1 addition & 1 deletion public_html/layout/denim/blockheader-message.thtml
Expand Up @@ -2,7 +2,7 @@

<aside class="uk-alert uk-alert-large{!if css_classes} {css_classes}{!endif}"{!if css_id} id="{css_id}"{!endif} data-uk-alert>
<a class="uk-alert-close uk-close" href=""></a>
<h4 class="title">{showhide}{block_title}{block_help}</h4>
<h4 class="title">{showhide}{block_title}{!if help_url}<a class="blocktitle block-help-icon uk-icon-hover uk-icon-question-circle uk-icon-small" {gl-help-popup} href="{help_url}" title="{help_title}"></a>{!endif}</h4>
<div class="message">

{# end {templatelocation} #}
2 changes: 1 addition & 1 deletion public_html/layout/denim/blockheader-related.thtml
@@ -1,7 +1,7 @@
{# begin {templatelocation} #}

<aside class="block-related{!if css_classes} {css_classes}{!endif}"{!if css_id} id="{css_id}"{!endif}>
<h3>{block_title}{block_help}</h3>
<h3>{block_title}{!if help_url}<a class="blocktitle block-help-icon uk-icon-hover uk-icon-question-circle uk-icon-small" {gl-help-popup} href="{help_url}" title="{help_title}"></a>{!endif}</h3>
<div class="block-related-content">

{# end {templatelocation} #}
2 changes: 1 addition & 1 deletion public_html/layout/denim/blockheader-right.thtml
@@ -1,7 +1,7 @@
{# begin {templatelocation} #}

<section class="block-right{!if css_classes} {css_classes}{!endif}"{!if css_id} id="{css_id}"{!endif}>
<h2 class="block-title">{block_title}{block_help}</h2>
<h2 class="block-title">{block_title}{!if help_url}<a class="blocktitle block-help-icon uk-icon-hover uk-icon-question-circle uk-icon-small" {gl-help-popup} href="{help_url}" title="{help_title}"></a>{!endif}</h2>
<div class="block-right-content">

{# end {templatelocation} #}
2 changes: 1 addition & 1 deletion public_html/layout/denim/blockheader.thtml
@@ -1,7 +1,7 @@
{# begin {templatelocation} #}

<section class="block-center{!if css_classes} {css_classes}{!endif}"{!if css_id} id="{css_id}"{!endif}>
<h2>{block_title}{!if block_help}<a class="blocktitle block-help-icon uk-icon-hover uk-icon-question-circle" href="{help_url}" title="Help"></a>{!endif}</h2>
<h2>{block_title}{!if help_url}<a class="blocktitle block-help-icon uk-icon-hover uk-icon-question-circle" {gl-help-popup} href="{help_url}" title="Help"></a>{!endif}</h2>
<div class="block-center-content">

{# end {templatelocation} #}
2 changes: 1 addition & 1 deletion public_html/layout/modern_curve/blockheader-config.thtml
@@ -1,7 +1,7 @@
{# begin {templatelocation} #}

<div class="block-center{!if css_classes} {css_classes}{!endif}"{!if css_id} id="{css_id}"{!endif}>
<h2>{block_title}{block_help}</h2>
<h2>{block_title}{!if help_url}<a class="blocktitle" {gl-help-popup} href="{help_url}" title="{help_title}"><img src="{layout_url}/images/button_help.png" alt="?" /></a>{!endif}</h2>
<div class="block-center-content">
<ul class="block-config-content">

Expand Down
2 changes: 1 addition & 1 deletion public_html/layout/modern_curve/blockheader-left.thtml
@@ -1,7 +1,7 @@
{# begin {templatelocation} #}

<div class="block-left{!if css_classes} {css_classes}{!endif}"{!if css_id} id="{css_id}"{!endif}>
<h2>{block_title}{block_help}</h2>
<h2>{block_title}{!if help_url}<a class="blocktitle" {gl-help-popup} href="{help_url}" title="{help_title}"><img src="{layout_url}/images/button_help.png" alt="?" /></a>{!endif}</h2>
<div class="block-left-content">

{# end {templatelocation} #}
2 changes: 1 addition & 1 deletion public_html/layout/modern_curve/blockheader-list.thtml
@@ -1,7 +1,7 @@
{# begin {templatelocation} #}

<div class="block-list{!if css_classes} {css_classes}{!endif}"{!if css_id} id="{css_id}"{!endif}>
<h2>{block_title}{block_help}</h2>
<h2>{block_title}{!if help_url}<a class="blocktitle" {gl-help-popup} href="{help_url}" title="{help_title}"><img src="{layout_url}/images/button_help.png" alt="?" /></a>{!endif}</h2>
<div class="block-list-content">
<ul>

Expand Down
2 changes: 1 addition & 1 deletion public_html/layout/modern_curve/blockheader-message.thtml
Expand Up @@ -2,7 +2,7 @@

<div class="block-message{!if css_classes} {css_classes}{!endif}"{!if css_id} id="{css_id}"{!endif}>
<dl>
<dt class="title">{showhide}{block_title}{block_help}</dt>
<dt class="title">{showhide}{block_title}{!if help_url}<a class="blocktitle" {gl-help-popup} href="{help_url}" title="{help_title}"><img src="{layout_url}/images/button_help.png" alt="?" /></a>{!endif}</dt>
<dd class="message">

{# end {templatelocation} #}
2 changes: 1 addition & 1 deletion public_html/layout/modern_curve/blockheader-related.thtml
@@ -1,7 +1,7 @@
{# begin {templatelocation} #}

<div class="block-related{!if css_classes} {css_classes}{!endif}"{!if css_id} id="{css_id}"{!endif}>
<h3>{block_title}{block_help}</h3>
<h3>{block_title}{!if help_url}<a class="blocktitle" {gl-help-popup} href="{help_url}" title="{help_title}"><img src="{layout_url}/images/button_help.png" alt="?" /></a>{!endif}</h3>
<div class="block-related-content">

{# end {templatelocation} #}
2 changes: 1 addition & 1 deletion public_html/layout/modern_curve/blockheader-right.thtml
@@ -1,7 +1,7 @@
{# begin {templatelocation} #}

<div class="block-right{!if css_classes} {css_classes}{!endif}"{!if css_id} id="{css_id}"{!endif}>
<h2>{block_title}{block_help}</h2>
<h2>{block_title}{!if help_url}<a class="blocktitle" {gl-help-popup} href="{help_url}" title="{help_title}"><img src="{layout_url}/images/button_help.png" alt="?" /></a>{!endif}</h2>
<div class="block-right-content">

{# end {templatelocation} #}
2 changes: 1 addition & 1 deletion public_html/layout/modern_curve/blockheader.thtml
@@ -1,7 +1,7 @@
{# begin {templatelocation} #}

<div class="block-center{!if css_classes} {css_classes}{!endif}"{!if css_id} id="{css_id}"{!endif}>
<h2>{block_title}{block_help}</h2>
<h2>{block_title}{!if help_url}<a class="blocktitle" {gl-help-popup} href="{help_url}" title="{help_title}"><img src="{layout_url}/images/button_help.png" alt="?" /></a>{!endif}</h2>
<div class="block-center-content">

{# end {templatelocation} #}
10 changes: 4 additions & 6 deletions public_html/lib-common.php
Expand Up @@ -2068,9 +2068,11 @@ function COM_startBlock($title = '', $helpFile = '', $template = 'blockheader.th
));

if (!empty($helpFile)) {
$helpPopup = "";
// Only works when header generated all at once
// Make sure not a full link. Needs to follow help file format (correct location and divs)
if (($_CONF['supported_version_theme'] !== '1.8.1') && !stristr($helpFile, 'http://') && !stristr($helpFile, 'https://')) {
$helpPopup = "gl-help-popup";
// Only need to set it once
if (!defined('GL-HELP-SET')) {
define('GL-HELP-SET', true);
Expand All @@ -2086,19 +2088,15 @@ function COM_startBlock($title = '', $helpFile = '', $template = 'blockheader.th
}
}

$helpImage = $_CONF['layout_url'] . '/images/button_help.' . $_IMAGE_TYPE;
$helpContent = '<img src="' . $helpImage . '" alt="?"' . XHTML . '>';
$helpAttr = array('class' => 'blocktitle', 'title' => "$title");

if (preg_match('@^https?://@', $helpFile)) {
$help_url = $helpFile;
} else {
$help_url = COM_getDocumentUrl('help', $helpFile);
}

$help = COM_createLink($helpContent, $help_url, $helpAttr);
$block->set_var('block_help', $help);
$block->set_var('help_title', $title);
$block->set_var('help_url', $help_url);
$block->set_var('gl-help-popup', $helpPopup);
}

$block->parse('startHTML', 'block');
Expand Down

0 comments on commit a79fb30

Please sign in to comment.