# HG changeset patch
# User Dan
# Date 1194374140 18000
# Node ID f0149a27df5f9ab75790b2bb7cc172cca0b24713
# Parent 0f1b353570a70d26206267d593a5cdfdb03d813b
Localized default sidebar; installer should work now including the lang import; l10n in installer to follow
diff -r 0f1b353570a7 -r f0149a27df5f includes/pageutils.php
--- a/includes/pageutils.php Tue Nov 06 11:10:18 2007 -0500
+++ b/includes/pageutils.php Tue Nov 06 13:35:40 2007 -0500
@@ -1413,6 +1413,11 @@
{
global $db, $session, $paths, $template, $plugins; // Common objects
global $lang;
+ if ( !is_object($lang) && defined('IN_ENANO_INSTALL') )
+ {
+ // This is a special exception for the Enano installer, which doesn't init languages yet.
+ $lang = new Language('eng');
+ }
if(!$session->get_permissions('clear_logs'))
{
return $lang->get('etc_access_denied');
diff -r 0f1b353570a7 -r f0149a27df5f install.php
--- a/install.php Tue Nov 06 11:10:18 2007 -0500
+++ b/install.php Tue Nov 06 13:35:40 2007 -0500
@@ -27,6 +27,9 @@
define('ENANO_VERSION', '1.1.1');
// In beta versions, define ENANO_BETA_VERSION here
+// This is required to make installation work right
+define("ENANO_ALLOW_LOAD_NOLANG", 1);
+
if(!defined('scriptPath')) {
$sp = dirname($_SERVER['REQUEST_URI']);
if($sp == '/' || $sp == '\\') $sp = '';
@@ -119,20 +122,22 @@
function start_install_table()
{
echo '
' . "\n";
+ ob_start();
}
function close_install_table()
{
echo '
' . "\n\n";
+ ob_end_flush();
}
function echo_stage_success($stage_id, $stage_name)
{
global $neutral_color;
$neutral_color = ( $neutral_color == 'A' ) ? 'C' : 'A';
- ob_start();
echo '' . htmlspecialchars($stage_name) . ' | |
' . "\n";
- ob_end_flush();
+ ob_flush();
+ flush();
}
function echo_stage_failure($stage_id, $stage_name, $failure_explanation, $resume_stack)
@@ -140,9 +145,9 @@
global $neutral_color;
$neutral_color = ( $neutral_color == 'A' ) ? 'C' : 'A';
- ob_start();
echo '' . htmlspecialchars($stage_name) . ' | |
' . "\n";
- ob_end_flush();
+ ob_flush();
+ flush();
close_install_table();
$post_data = '';
$mysql_error = mysql_error();
@@ -574,6 +579,19 @@
return false;
}
+function stg_import_language()
+{
+ global $db, $session, $paths, $template, $plugins; // Common objects
+
+ $lang_file = ENANO_ROOT . "/language/english/enano.json";
+ install_language("eng", "English", "English", $lang_file);
+
+ $lang = new Language('eng');
+ $lang->import($lang_file);
+
+ return true;
+}
+
function stg_init_logs()
{
global $db, $session, $paths, $template, $plugins; // Common objects
@@ -1572,6 +1590,8 @@
$session->start();
$paths->init();
+ run_installer_stage('importlang', 'Import default language', 'stg_import_language', 'Enano couldn\'t import the English language file.');
+
run_installer_stage('initlogs', 'Initialize logs', 'stg_init_logs', 'The session manager denied the request to flush logs for the main page.
While under most circumstances you can still finish the installation, you should be aware that some servers cannot
properly set cookies due to limitations with PHP. These limitations are exposed primarily when this issue is encountered during installation. If you choose
diff -r 0f1b353570a7 -r f0149a27df5f schema.sql
--- a/schema.sql Tue Nov 06 11:10:18 2007 -0500
+++ b/schema.sql Tue Nov 06 13:35:40 2007 -0500
@@ -338,13 +338,14 @@
INSERT INTO {{TABLE_PREFIX}}group_members(group_id,user_id,is_mod) VALUES(2, 2, 1);
-INSERT INTO {{TABLE_PREFIX}}acl(target_type,target_id,page_id,namespace,rules) VALUES(1,2,NULL,NULL,'read=4;post_comments=4;edit_comments=4;edit_page=4;view_source=4;mod_comments=4;history_view=4;history_rollback=4;history_rollback_extra=4;protect=4;rename=4;clear_logs=4;vote_delete=4;vote_reset=4;delete_page=4;tag_create=4;tag_delete_own=4;tag_delete_other=4;set_wiki_mode=4;password_set=4;password_reset=4;mod_misc=4;edit_cat=4;even_when_protected=4;upload_files=4;upload_new_version=4;create_page=4;php_in_pages={{ADMIN_EMBED_PHP}};edit_acl=4;'),
+INSERT INTO {{TABLE_PREFIX}}acl(target_type,target_id,page_id,namespace,rules) VALUES
+ (1,2,NULL,NULL,'read=4;post_comments=4;edit_comments=4;edit_page=4;view_source=4;mod_comments=4;history_view=4;history_rollback=4;history_rollback_extra=4;protect=4;rename=4;clear_logs=4;vote_delete=4;vote_reset=4;delete_page=4;tag_create=4;tag_delete_own=4;tag_delete_other=4;set_wiki_mode=4;password_set=4;password_reset=4;mod_misc=4;edit_cat=4;even_when_protected=4;upload_files=4;upload_new_version=4;create_page=4;php_in_pages={{ADMIN_EMBED_PHP}};edit_acl=4;'),
(1,3,NULL,NULL,'read=4;post_comments=4;edit_comments=4;edit_page=4;view_source=4;mod_comments=4;history_view=4;history_rollback=4;history_rollback_extra=4;protect=4;rename=3;clear_logs=2;vote_delete=4;vote_reset=4;delete_page=4;set_wiki_mode=2;password_set=2;password_reset=2;mod_misc=2;edit_cat=4;even_when_protected=4;upload_files=2;upload_new_version=3;create_page=3;php_in_pages=2;edit_acl=2;');
INSERT INTO {{TABLE_PREFIX}}sidebar(item_id, item_order, sidebar_id, block_name, block_type, block_content) VALUES
- (1, 1, 1, 'Navigation', 1, '[[Main Page|Home]]'),
- (2, 2, 1, 'Tools', 1, '[[$NS_SPECIAL$CreatePage|Create a page]]\n[[$NS_SPECIAL$UploadFile|Upload file]]\n[[$NS_SPECIAL$SpecialPages|Special pages]]\n{if auth_admin}\n[[$NS_SPECIAL$EditSidebar|Edit the sidebar]]\n$ADMIN_LINK$\n{/if}'),
- (3, 3, 1, '$USERNAME$', 1, '[[$NS_USER$$USERNAME$|User page]]\n[[$NS_SPECIAL$Contributions/$USERNAME$|My Contributions]]\n{if user_logged_in}\n[[$NS_SPECIAL$Preferences|Preferences]]\n[[$NS_SPECIAL$PrivateMessages|Private messages]]\n[[$NS_SPECIAL$Usergroups|Group control panel]]\n$THEME_LINK$\n{/if}\n{if user_logged_in}\n$LOGOUT_LINK$\n{else}\n[[$NS_SPECIAL$Register|Create an account]]\n$LOGIN_LINK$\n[[$NS_SPECIAL$Login/$NS_SPECIAL$PrivateMessages|Private messages]]\n{/if}'),
- (4, 4, 1, 'Search', 1, ''),
- (5, 2, 2, 'Links', 4, 'Links');
+ (1, 1, 1, '{lang:sidebar_title_navigation}', 1, '{lang:sidebar_btn_home}'),
+ (2, 2, 1, '{lang:sidebar_title_tools}', 1, '[[$NS_SPECIAL$CreatePage|{lang:sidebar_btn_createpage}]]\n[[$NS_SPECIAL$UploadFile|{lang:sidebar_btn_uploadfile}]]\n[[$NS_SPECIAL$SpecialPages|{lang:sidebar_btn_specialpages}]]\n{if auth_admin}\n$ADMIN_LINK$\n[[$NS_SPECIAL$EditSidebar|{lang:sidebar_btn_editsidebar}]]\n{/if}'),
+ (3, 3, 1, '$USERNAME$', 1, '[[$NS_USER$$USERNAME$|{lang:sidebar_btn_userpage}]]\n[[$NS_SPECIAL$Contributions/$USERNAME$|{lang:sidebar_btn_mycontribs}]]\n{if user_logged_in}\n[[$NS_SPECIAL$Preferences|{lang:sidebar_btn_preferences}]]\n[[$NS_SPECIAL$PrivateMessages|{lang:sidebar_btn_privatemessages}]]\n[[$NS_SPECIAL$Usergroups|{lang:sidebar_btn_groupcp}]]\n$THEME_LINK$\n{/if}\n{if user_logged_in}\n$LOGOUT_LINK$\n{else}\n[[$NS_SPECIAL$Register|{lang:sidebar_btn_register}]]\n$LOGIN_LINK$\n[[$NS_SPECIAL$Login/$NS_SPECIAL$PrivateMessages|{lang:sidebar_btn_privatemessages}]]\n{/if}'),
+ (4, 4, 1, '{lang:sidebar_title_search}', 1, ''),
+ (5, 2, 2, '{lang:sidebar_title_links}', 4, 'Links');