diff options
| -rw-r--r-- | includes/classes/class_menubar.php | 2 | ||||
| -rw-r--r-- | includes/functions/functions.php | 1 | ||||
| -rw-r--r-- | includes/functions/functions_print.php | 6 | ||||
| -rw-r--r-- | includes/session.php | 29 | ||||
| -rw-r--r-- | login.php | 10 |
5 files changed, 18 insertions, 30 deletions
diff --git a/includes/classes/class_menubar.php b/includes/classes/class_menubar.php index 7ea45d7293..7e5136f8b9 100644 --- a/includes/classes/class_menubar.php +++ b/includes/classes/class_menubar.php @@ -855,7 +855,7 @@ class MenuBar */ static function getHelpMenu() { global $TEXT_DIRECTION, $WT_IMAGE_DIR, $WT_IMAGES, $SEARCH_SPIDER; - global $SHOW_CONTEXT_HELP, $QUERY_STRING, $helpindex, $action; + global $QUERY_STRING, $helpindex, $action; if ($TEXT_DIRECTION=="rtl") $ff="_rtl"; else $ff=""; if (!empty($SEARCH_SPIDER)) { $menu = new Menu("", "", ""); diff --git a/includes/functions/functions.php b/includes/functions/functions.php index ddc5be20a3..3034b6719a 100644 --- a/includes/functions/functions.php +++ b/includes/functions/functions.php @@ -267,7 +267,6 @@ function load_gedcom_settings($ged_id=WT_GED_ID) { global $SAVE_WATERMARK_THUMB; $SAVE_WATERMARK_THUMB =get_gedcom_setting($ged_id, 'SAVE_WATERMARK_THUMB'); global $SEARCH_FACTS_DEFAULT; $SEARCH_FACTS_DEFAULT =get_gedcom_setting($ged_id, 'SEARCH_FACTS_DEFAULT'); global $SHOW_AGE_DIFF; $SHOW_AGE_DIFF =get_gedcom_setting($ged_id, 'SHOW_AGE_DIFF'); - global $SHOW_CONTEXT_HELP; $SHOW_CONTEXT_HELP =get_gedcom_setting($ged_id, 'SHOW_CONTEXT_HELP'); global $SHOW_COUNTER; $SHOW_COUNTER =get_gedcom_setting($ged_id, 'SHOW_COUNTER'); global $SHOW_DEAD_PEOPLE; $SHOW_DEAD_PEOPLE =get_gedcom_setting($ged_id, 'SHOW_DEAD_PEOPLE'); global $SHOW_EMPTY_BOXES; $SHOW_EMPTY_BOXES =get_gedcom_setting($ged_id, 'SHOW_EMPTY_BOXES'); diff --git a/includes/functions/functions_print.php b/includes/functions/functions_print.php index 61eeaf00e5..9ef81f70b0 100644 --- a/includes/functions/functions_print.php +++ b/includes/functions/functions_print.php @@ -1221,13 +1221,13 @@ function print_privacy_error() { function help_link($help_topic, $module='') { global $WT_USE_HELPIMG, $WT_IMAGES, $WT_IMAGE_DIR, $SEARCH_SPIDER; - if ($SEARCH_SPIDER || !$_SESSION['show_context_help']) { - return ''; - } else { + if ($_SESSION['show_context_help']) { return '<a class="help" tabindex="0" href="javascript: '.$help_topic.'" onclick="helpPopup(\''.$help_topic.'\',\''.$module.'\'); return false;"> '. ($WT_USE_HELPIMG ? '<img src="'.$WT_IMAGE_DIR.'/'.$WT_IMAGES['help']['small'].'" class="icon" width="15" height="15" alt="" />' : i18n::translate('?')). ' </a>'; + } else { + return ''; } } diff --git a/includes/session.php b/includes/session.php index d77d048c7e..a64891b0e9 100644 --- a/includes/session.php +++ b/includes/session.php @@ -177,20 +177,6 @@ if (!isset($_SERVER['REQUEST_URI'])) { } } -/** - * Cleanup some variables - */ - -if (empty($_SERVER['QUERY_STRING'])) { - $QUERY_STRING=''; -} else { - $QUERY_STRING=str_replace( - array('&','<', 'show_context_help=no', 'show_context_help=yes'), - array('&','<', '', ''), - $_SERVER['QUERY_STRING'] - ); -} - // Common functions require WT_ROOT.'includes/functions/functions.php'; require WT_ROOT.'includes/functions/functions_name.php'; @@ -388,12 +374,17 @@ if (WT_USER_ID && safe_GET_bool('logout')) { exit; } -$show_context_help = ''; -if (!empty($_REQUEST['show_context_help'])) $show_context_help = $_REQUEST['show_context_help']; -if (!isset($_SESSION['show_context_help'])) $_SESSION['show_context_help'] = $SHOW_CONTEXT_HELP; +// Do we show context help on the page? +if (isset($_GET['show_context_help'])) { + $_SESSION['show_context_help']=safe_GET_bool('show_context_help'); + unset($_GET['show_context_help']); +} elseif ($SEARCH_SPIDER) { + $_SESSION['show_context_help']=false; +} elseif (!isset($_SESSION['show_context_help'])) { + $_SESSION['show_context_help']=get_gedcom_setting(WT_GED_ID, 'SHOW_CONTEXT_HELP'); +} + if (!isset($_SESSION['wt_user'])) $_SESSION['wt_user'] = ''; -if (isset($SHOW_CONTEXT_HELP) && $show_context_help==='yes') $_SESSION['show_context_help'] = true; -if (isset($SHOW_CONTEXT_HELP) && $show_context_help==='no') $_SESSION['show_context_help'] = false; if (WT_SCRIPT_NAME!='help_text.php') { if (!get_gedcom_setting(WT_GED_ID, 'imported') && !in_array(WT_SCRIPT_NAME, array('editconfig_gedcom.php', 'help_text.php', 'editgedcoms.php', 'downloadgedcom.php', 'logs.php', 'login.php', 'siteconfig.php', 'admin.php', 'addmedia.php', 'client.php', 'gedcheck.php', 'useradmin.php', 'export_gedcom.php', 'edit_changes.php', 'import.php'))) { @@ -196,12 +196,10 @@ $tab=0; // initialize tab index <td class="topbottombar" colspan="2"> <input type="submit" tabindex="<?php echo ++$tab; ?>" value="<?php print i18n::translate('Login'); ?>" /> <?php - if ($SHOW_CONTEXT_HELP) { - if ($REQUIRE_AUTHENTICATION) { - echo help_link('login_buttons_aut'); - } else { - echo help_link('login_buttons'); - } + if ($REQUIRE_AUTHENTICATION) { + echo help_link('login_buttons_aut'); + } else { + echo help_link('login_buttons'); } ?> </td> |
