Changeset 10712


Ignore:
Timestamp:
Apr 30, 2011, 10:12:23 PM (9 years ago)
Author:
LucMorizur
Message:

Add tooltips on identification page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/LCAS/trunk/main.inc.php

    r10643 r10712  
    8080    if (isset($_POST['username']) and isset($conf_LCAS[0]))
    8181    {
    82       $new_username = LCAS_SearchCaseUsername($_POST['username'],$conf_LCAS[0]);
    83       $_POST['username'] = $new_username == '' ? $_POST['username'] : $new_username;
     82      $new_username =
     83       LCAS_SearchCaseUsername($_POST['username'], $conf_LCAS[0]);
     84      $_POST['username'] = ($new_username == '') ?
     85       $_POST['username'] : $new_username;
    8486    }
    8587  }
    8688 
    87   // Add tooltips on register page
    88   if (script_basename() == 'register') {
     89  // Add tooltips on register and identification page
     90  $sb = script_basename(); $fn = '';
     91  if ($sb == 'register' or $sb == 'identification')
     92   $fn = ($sb == 'register') ?
     93    'LCAS_add_tooltips_prefilter_register' :
     94    'LCAS_add_tooltips_prefilter_identification';
     95  if ($fn != '') {
    8996    $template->assign(array(
    90       'LCAS_username_tooltip' => $lang['LCAS_tooltip_username_register'][intval($conf_LCAS[0])],
    91       'LCAS_password_tooltip' => $lang['LCAS_tooltip_password_register'],
     97      'LCAS_username_tooltip' =>
     98       $lang['LCAS_tooltip_username_register'][intval($conf_LCAS[0])],
     99      'LCAS_password_tooltip' =>
     100       $lang['LCAS_tooltip_password_register'],
    92101    ));
    93     $template->set_prefilter('register', 'LCAS_add_tooltips_prefilter_register');
     102    $template->set_prefilter($sb, $fn);
    94103  }
    95104}
     
    113122  $search = 'name="password_conf"';
    114123  $replacement = 'name="password_conf" title="{$LCAS_password_tooltip}"';
     124  $content = str_replace($search, $replacement, $content);
     125  return $content;
     126}
     127
     128function LCAS_add_tooltips_prefilter_identification($content, &$smarty) {
     129  $search = 'for="username"';
     130  $replacement = 'for="username" title="{$LCAS_username_tooltip}"';
     131  $content = str_replace($search, $replacement, $content);
     132  $search = 'name="username"';
     133  $replacement = 'name="username" title="{$LCAS_username_tooltip}"';
     134  $content = str_replace($search, $replacement, $content);
     135  $search = 'for="password"';
     136  $replacement = 'for="password" title="{$LCAS_password_tooltip}"';
     137  $content = str_replace($search, $replacement, $content);
     138  $search = 'name="password"';
     139  $replacement = 'name="password" title="{$LCAS_password_tooltip}"';
    115140  $content = str_replace($search, $replacement, $content);
    116141  return $content;
Note: See TracChangeset for help on using the changeset viewer.