forum.coppermine-gallery.net

No Support => Feature requests => Topic started by: OmegaGOD on April 10, 2005, 05:28:42 pm

Title: Help Icons and popups
Post by: OmegaGOD on April 10, 2005, 05:28:42 pm
Refering to CPG 1.4.x, can we change the implementation of the help icon pop-ups. Currently each help icon pops-up a new windows  Can we have it where it will reuse an open pop-up window if one has already been open. Then simply have the help window come to focus?

I am volunteering to code this if accepted.

--OmegaGOD
Title: Re: Help Icons and popups
Post by: Tranz on April 10, 2005, 05:33:11 pm
should be straightforward, no? If they all have the same target name, like "help".
Title: Re: Help Icons and popups
Post by: Joachim Müller on April 10, 2005, 10:03:12 pm
already changed the target name in the cvs (include/functions.inc.php). All that is left to do is set the focus properly (but only for windows triggered by the help icon).
@OmegaGOD: feel free to contribute some code that will accomplish what you're up to.

Joachim
Title: Re: Help Icons and popups
Post by: OmegaGOD on April 11, 2005, 03:48:41 am
@GauGau

Made a few changes to functions.inc.php.

From File Rev. 1.183

Lines 2618-2628
Code: [Select]
function cpg_display_help($reference = 'f=index.htm', $width = '600', $height = '350') {
global $CONFIG, $USER;
if ($reference == '' || $CONFIG['enable_help'] == '0') {return; }
if ($CONFIG['enable_help'] == '2' && GALLERY_ADMIN_MODE == false) {return; }
$help_theme = $CONFIG['theme'];
if (isset($USER['theme'])) {
    $help_theme = $USER['theme'];
}
$help_html = "<a href=\"javascript:;\" onclick=\"MM_openBrWindow('docs/showdoc.php?css=" . $help_theme . "&amp;" . $reference . "','coppermine_help','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=" . $width . ",height=" . $height . "')\" style=\"cursor:help\"><img src=\"images/help.gif\" width=\"13\" height=\"11\" border=\"0\" alt=\"\" title=\"\" /></a>";
return $help_html;

Replace with:

Code: [Select]
function cpg_display_help($reference = 'f=index.htm', $width = '600', $height = '350') {
global $CONFIG, $USER;
if ($reference == '' || $CONFIG['enable_help'] == '0') {return; }
if ($CONFIG['enable_help'] == '2' && GALLERY_ADMIN_MODE == false) {return; }
$help_theme = $CONFIG['theme'];
if (isset($USER['theme'])) {
    $help_theme = $USER['theme'];
}
$help_html = "<a href=\"javascript:;\" onclick=\"coppermine_help_window=window.open('docs/showdoc.php?css=" . $help_theme . "&amp;" . $reference . "','coppermine_help','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=" . $width . ",height=" . $height . "'); coppermine_help_window.focus()\" style=\"cursor:help\"><img src=\"images/help.gif\" width=\"13\" height=\"11\" border=\"0\" alt=\"\" title=\"\" /></a>";
return $help_html;
}

When clicking a help icon, this will bring the help window to focus if there is a current help window open.

Just let me know if this gets commited.

--OmegaGOD
Title: Re: Help Icons and popups
Post by: Joachim Müller on April 11, 2005, 07:22:06 am
committed to devel branch, include/functions.inc.php v1.184

Joachim