# HG changeset patch # User Dan # Date 1197418526 18000 # Node ID f49e3c8b638c19cf149fdc5eec60514cbffec60a # Parent 6c7060d36a23644231b17be93865a2290dd51964 Fixed focus of AJAX login form fields in IE; removed stale/unused call to $template->makeParserText() in paginate_array(); added hook page_create_request to possibly help control creation of pages of certain namespaces from plugins; fixed critical bug in user CP that prevented plugins from adding custom CP modules diff -r 6c7060d36a23 -r f49e3c8b638c includes/clientside/static/misc.js --- a/includes/clientside/static/misc.js Mon Dec 03 18:45:37 2007 -0500 +++ b/includes/clientside/static/misc.js Tue Dec 11 19:15:26 2007 -0500 @@ -353,42 +353,75 @@ form_html += 'Please re-enter your login details, to verify your identity.

'; } form_html += ' \ - \ - \ - \ - \ - \ - \ - \ + \ +
Username: \ -
Password: \ -
\ -
Trouble logging in? Try the full login form.
'; +
\ + \ + \ + \ + \ + \ + \ + \ - \ -
Username: \ +
Password: \ +
\ +
Trouble logging in? Try the full login form.
'; if ( level <= USER_LEVEL_MEMBER ) { form_html += ' \ - Did you forget your password?
\ - Maybe you need to create an account.
'; + Did you forget your password?
\ + Maybe you need to create an account.'; } form_html += ' \ -
\ - \ - \ -
'; +
\ + \ + \ + '; ajax_auth_mb_cache.updateContent(form_html); $('messageBox').object.nextSibling.firstChild.tabindex = '3'; if ( typeof(response.username) == 'string' ) { $('ajaxlogin_user').object.value = response.username; - $('ajaxlogin_pass').object.focus(); + if ( IE ) + { + setTimeout("document.forms['ajax_login_form'].password.focus();", 200); + } + else + { + $('ajaxlogin_pass').object.focus(); + } } else { - $('ajaxlogin_user').object.focus(); + if ( IE ) + { + setTimeout("document.forms['ajax_login_form'].username.focus();", 200); + } + else + { + $('ajaxlogin_user').object.focus(); + } } $('ajaxlogin_pass').object.onblur = function(e) { if ( !shift ) $('messageBox').object.nextSibling.firstChild.focus(); }; - $('ajaxlogin_pass').object.onkeypress = function(e) { if ( !e && IE ) return true; if ( e.keyCode == 13 ) $('messageBox').object.nextSibling.firstChild.click(); }; + $('ajaxlogin_pass').object.onkeypress = function(e) + { + // Trigger a form submit when the password field is focused and the user presses enter + + // IE doesn't give us an event object when it should - check window.event. If that + // still fails, give up. + if ( !e ) + { + e = window.event; + } + if ( !e && IE ) + { + return true; + } + if ( e.keyCode == 13 ) + { + ajaxValidateLogin(); + } + }; /* ## This causes the background image to disappear under Fx 2 if ( shown_error ) diff -r 6c7060d36a23 -r f49e3c8b638c includes/functions.php --- a/includes/functions.php Mon Dec 03 18:45:37 2007 -0500 +++ b/includes/functions.php Tue Dec 11 19:15:26 2007 -0500 @@ -2223,7 +2223,6 @@ function paginate_array($q, $num_results, $result_url, $start = 0, $perpage = 10, $header = '', $footer = '') { global $db, $session, $paths, $template, $plugins; // Common objects - $parser = $template->makeParserText($tpl_text); $num_pages = ceil ( $num_results / $perpage ); $out = ''; $i = 0; @@ -2668,7 +2667,8 @@ function sanitize_tag($tag) { $tag = strtolower($tag); - $tag = preg_replace('/[^\w _@\$%\^&-]+/', '', $tag); + $tag = preg_replace('/[^\w @\$%\^&-]+/', '', $tag); + $tag = str_replace('_', ' ', $tag); $tag = trim($tag); return $tag; } diff -r 6c7060d36a23 -r f49e3c8b638c includes/pageprocess.php --- a/includes/pageprocess.php Mon Dec 03 18:45:37 2007 -0500 +++ b/includes/pageprocess.php Tue Dec 11 19:15:26 2007 -0500 @@ -807,7 +807,13 @@ echo ''; echo ''; - + + $code = $plugins->setHook('userpage_sidebar_left'); + foreach ( $code as $cmd ) + { + eval($cmd); + } + echo ' '; @@ -923,6 +929,12 @@ echo '' . htmlspecialchars($target_username) . ' hasn\'t posted any real-life contact information.'; } + $code = $plugins->setHook('userpage_sidebar_right'); + foreach ( $code as $cmd ) + { + eval($cmd); + } + echo ' '; diff -r 6c7060d36a23 -r f49e3c8b638c includes/template.php --- a/includes/template.php Mon Dec 03 18:45:37 2007 -0500 +++ b/includes/template.php Tue Dec 11 19:15:26 2007 -0500 @@ -749,7 +749,7 @@ 'JS_DYNAMIC_VARS'=>$js_dynamic, 'UNREAD_PMS'=>$session->unread_pms, 'URL_ABOUT_ENANO' => makeUrlNS('Special', 'About_Enano', '', true), - 'REPORT_URI' => makeUrl($paths->page, 'do=sql_report', true) + 'REPORT_URI' => makeUrl($paths->fullpage, 'do=sql_report', true) ); foreach ( $paths->nslist as $ns_id => $ns_prefix ) diff -r 6c7060d36a23 -r f49e3c8b638c plugins/SpecialPageFuncs.php --- a/plugins/SpecialPageFuncs.php Mon Dec 03 18:45:37 2007 -0500 +++ b/plugins/SpecialPageFuncs.php Tue Dec 11 19:15:26 2007 -0500 @@ -109,6 +109,11 @@ exit; } + $code = $plugins->setHook('page_create_request'); + foreach ( $code as $cmd ) + { + eval($cmd); + } if ( substr($urlname, 0, 8) == 'Project:' ) { $template->header(); diff -r 6c7060d36a23 -r f49e3c8b638c plugins/SpecialUserPrefs.php --- a/plugins/SpecialUserPrefs.php Mon Dec 03 18:45:37 2007 -0500 +++ b/plugins/SpecialUserPrefs.php Tue Dec 11 19:15:26 2007 -0500 @@ -599,7 +599,7 @@ $code = $plugins->setHook('userprefs_body'); foreach ( $code as $cmd ) { - if ( eval($code) ) + if ( eval($cmd) ) $good = true; } if ( !$good ) diff -r 6c7060d36a23 -r f49e3c8b638c themes/oxygen/css/bleu.css --- a/themes/oxygen/css/bleu.css Mon Dec 03 18:45:37 2007 -0500 +++ b/themes/oxygen/css/bleu.css Tue Dec 11 19:15:26 2007 -0500 @@ -233,14 +233,14 @@ td.mdg-menu-btm { height: 12px; background: url(../images/bleu/border-btm.gif); } /* Buttons and textboxes - these settings are used almost everywhere */ -input, textarea, select { border: 1px solid #406080; background-color: #F2F2F2; padding: 3px; font-family: arial, helvetica, sans-serif; font-size: 8pt; } +input, textarea, select, button { border: 1px solid #406080; background-color: #F2F2F2; padding: 3px; font-family: arial, helvetica, sans-serif; font-size: 8pt; } input:hover, textarea:hover, select:hover { border: 1px solid #6080A0; background-color: #F8F8F8; padding: 3px; } input:focus, textarea:focus, select:focus { border: 1px solid #90B0D0; background-color: #FFFFFF; padding: 3px; } label { padding: 3px; cursor: pointer; font-family: arial, helvetica, sans-serif; font-size: 8pt; } label:hover { padding: 3px; cursor: pointer; background-color: #F0F0F0; } input#pageheading { font-size: 14pt; border-bottom: 1px solid #90B0D0; margin-bottom: 0; } -input[type ^="button"], input[type ^="submit"] { +input[type ^="button"], input[type ^="submit"], button { background-image: url(../images/buttonbg.gif); background-repeat: repeat-x; color: #202020;