# HG changeset patch # User Dan # Date 1197071257 18000 # Node ID 474f8be559435acbde533646cef5fab189ad541e # Parent 854eecfada2025fa26c2442fed7b0a7112b6ea22 Localized remainder of on-page tools and parts of PageProcess diff -r 854eecfada20 -r 474f8be55943 includes/pageprocess.php --- a/includes/pageprocess.php Fri Dec 07 16:42:22 2007 -0500 +++ b/includes/pageprocess.php Fri Dec 07 18:47:37 2007 -0500 @@ -152,6 +152,8 @@ function send( $do_stats = false ) { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; + if ( !$this->perms->get_permissions('read') ) { $this->err_access_denied(); @@ -187,7 +189,7 @@ { if ( !$this->page_exists ) { - redirect( makeUrl(getConfig('main_page')), 'Can\'t find special page', 'The special or administration page you requested does not exist. You will now be transferred to the main page.', 2 ); + die_semicritical('Exception in PageProcessor', '

Special page not existent but exception not previously caught by path manager.

'); } $func_name = "page_{$this->namespace}_{$this->page_id}"; if ( function_exists($func_name) ) @@ -196,9 +198,8 @@ } else { - $title = 'Page backend not found'; - $message = "The administration page you are looking for was properly registered using the page API, but the backend function - ($fname) was not found. If this is a plugin page, then this is almost certainly a bug with the plugin."; + $title = $lang->get('page_err_custompage_function_missing_title'); + $message = $lang->get('page_err_custompage_function_missing_body', array( 'function_name' => $fname )); if ( $this->send_headers ) { @@ -291,7 +292,7 @@ $page_id_data = RenderMan::strToPageID($page_to); if ( count($this->redirect_stack) >= 3 ) { - $this->render( (!$strict_no_headers), '
The maximum number of internal redirects has been exceeded.
' ); + $this->render( (!$strict_no_headers), '
' . $lang->get('page_err_redirects_exceeded') . '
' ); } else { @@ -381,6 +382,7 @@ function render($incl_inner_headers = true, $_errormsg = false) { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; $text = $this->fetch_text(); $text = preg_replace('/([\s]*)__NOBREADCRUMBS__([\s]*)/', '', $text); @@ -414,11 +416,7 @@ Cute wet-floor icon - This page is a redirector.
- This means that this page will not show its own content by default. Instead it will display the contents of the page it redirects to.

- To create a redirect page, make the first characters in the page content #redirect [[Page_ID]]. For more information, see the - Enano Wiki formatting guide.

- This page redirects to ' . $a . '. + ' . $lang->get('page_msg_this_is_a_redirector', array( 'redirect_target' => $a )) . ' @@ -956,19 +954,29 @@ function _handle_redirect($page_id, $namespace) { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; $arr_pid = array($this->page_id, $this->namespace); if ( $namespace == 'Special' || $namespace == 'Admin' ) { - return 'This page redirects to a Special or Administration page, which is not allowed.'; + return $lang->get('page_err_redirect_to_special'); } - if ( in_array($this->redirect_stack, $arr_pid) ) + $looped = false; + foreach ( $this->redirect_stack as $page ) { - return 'This page infinitely redirects with another page (or another series of pages), and the infinite redirect was trapped.'; + if ( $page[0] == $arr_pid[0] && $page[1] == $arr_pid[1] ) + { + $looped = true; + break; + } + } + if ( $looped ) + { + return $lang->get('page_err_redirect_infinite_loop'); } $page_id_key = $paths->nslist[ $namespace ] . sanitize_page_id($page_id); if ( !isset($paths->pages[$page_id_key]) ) { - return 'This page redirects to another page that doesn\'t exist.'; + return $lang->get('page_err_redirect_to_nonexistent'); } $this->redirect_stack[] = $arr_pid; @@ -988,6 +996,8 @@ function err_access_denied() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; + global $email; // Log it for crying out loud $q = $db->sql_query('INSERT INTO '.table_prefix.'logs(log_type,action,time_id,date_string,author,edit_summary,page_text) VALUES(\'security\', \'illegal_page\', '.time().', \''.date('d M Y h:i a').'\', \''.$db->escape($session->username).'\', \''.$db->escape($_SERVER['REMOTE_ADDR']).'\', \'' . $db->escape(serialize(array($this->page_id, $this->namespace))) . '\')'); @@ -1022,7 +1032,10 @@ } } - $ob .= '
Access to this page is denied.
This may be because you are not logged in or you have not met certain criteria for viewing this page.
'; + $email_link = $email->encryptEmail(getConfig('contact_email'), '', '', $lang->get('page_err_access_denied_siteadmin')); + + $ob .= "

" . $lang->get('page_err_access_denied_title') . "

"; + $ob .= "

" . $lang->get('page_err_access_denied_body', array('site_administration' => $email_link)) . "

"; if ( $this->send_headers ) { diff -r 854eecfada20 -r 474f8be55943 includes/template.php --- a/includes/template.php Fri Dec 07 16:42:22 2007 -0500 +++ b/includes/template.php Fri Dec 07 18:47:37 2007 -0500 @@ -535,7 +535,7 @@ } $menubtn->assign_vars(array( - 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxDeletePage()); return false; }" title="Delete this page. This is always reversible unless the logs are cleared. (alt-k)" accesskey="k"', + 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxDeletePage()); return false; }" title="' . $lang->get('onpage_tip_deletepage') . '" accesskey="k"', 'HREF' => makeUrl($paths->page, 'do=deletepage', true), 'TEXT' => $s, )); @@ -591,7 +591,7 @@ if ( $session->user_level >= USER_LEVEL_ADMIN && $paths->page_exists && $paths->namespace != 'Special' && $paths->namespace != 'Admin' ) { $menubtn->assign_vars(array( - 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxAdminPage()); return false; }" title="Administrative options for this page" accesskey="g"', + 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxAdminPage()); return false; }" title="' . $lang->get('onpage_tip_adminoptions') . '" accesskey="g"', 'HREF' => makeUrlNS('Special', 'Administration', 'module='.$paths->nslist['Admin'].'PageManager', true), 'TEXT' => $lang->get('onpage_btn_admin'), )); @@ -601,7 +601,7 @@ if ( strlen($this->toolbar_menu) > 0 ) { $button->assign_vars(array( - 'FLAGS' => 'id="mdgToolbar_moreoptions" onclick="if ( !KILL_SWITCH ) { return false; }" title="Additional options for working with this page"', + 'FLAGS' => 'id="mdgToolbar_moreoptions" onclick="if ( !KILL_SWITCH ) { return false; }" title="' . $lang->get('onpage_tip_moreoptions') . '"', 'PARENTFLAGS' => '', 'HREF' => makeUrl($paths->page, 'do=moreoptions', true), 'TEXT' => $lang->get('onpage_btn_moreoptions') diff -r 854eecfada20 -r 474f8be55943 language/english/enano.json --- a/language/english/enano.json Fri Dec 07 16:42:22 2007 -0500 +++ b/language/english/enano.json Fri Dec 07 18:47:37 2007 -0500 @@ -204,6 +204,9 @@ tip_protect_off: 'Allows everyone to edit this page. [alt-o]', tip_protect_semi: 'Allows only users who have been registered for 4 days to edit this page. [alt-p]', tip_flushlogs: 'Remove all edit and action logs for this page from the database. IRREVERSIBLE! (alt-l)', + tip_deletepage: 'Delete this page. This is always reversible unless the logs are cleared. (alt-k)', + tip_adminoptions: 'Administrative options for this page', + tip_moreoptions: 'Additional options for working with this page', tip_password: 'Require a password in order for this page to be viewed', tip_aclmanager: 'Manage who can do what with this page (alt-m)', @@ -383,6 +386,26 @@ detag_err_page_exists: 'The detag action is only valid for pages that have been deleted in the past.', detag_success_title: 'Page detagged', detag_success_body: 'All stale tags have been removed from this page.', + + err_custompage_function_missing_title: 'Page backend not found', + err_custompage_function_missing_body: 'The administration page you are looking for was properly registered using the page API, but the backend function (%function_name%) was not found. If this is a plugin page, then this is almost certainly a bug with the plugin.', + err_redirects_exceeded: 'The maximum number of internal redirects has been exceeded.', + err_redirect_to_nonexistent: 'This page redirects to another page that doesn\'t exist.', + err_redirect_infinite_loop: 'This page infinitely redirects with another page (or another series of pages), and the infinite redirect was trapped.', + err_redirect_to_special: 'This page redirects to a Special or Administration page, which is not allowed.', + err_access_denied_title: 'You don\'t have permission to view this page.', + err_access_denied_body: '

Your user account doesn\'t have the necessary permission to view this page. There are a number of possible reasons for this:

+ +

If you would like to inquire further about this message, you may contact the %site_administration%.

', + err_access_denied_siteadmin: 'site administrator', + msg_this_is_a_redirector: 'This page is a redirector.
+ This means that this page will not show its own content by default. Instead it will display the contents of the page it redirects to.

+ To create a redirect page, make the first characters in the page content #redirect [[Page_ID]]. For more information, see the + Enano Wiki formatting guide.

+ This page redirects to %redirect_target%.' }, catedit: { title: 'Select which categories this page should be included in.',