------------------------------------------------------------
revno: 1055
committer: Roger Martin <[email protected]>
branch nick: aikiframework
timestamp: Sun 2012-01-29 23:51:04 +0100
message:
  apps/instaler mixed with lib/installer
added:
  assets/apps/installer/images/toggle.png
modified:
  assets/apps/installer/installer.css
  assets/apps/installer/installer.php
  assets/apps/installer/languages/en.pot
  assets/apps/installer/languages/es.po
  assets/apps/installer/library.php


--
lp:aikiframework
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk

Your team Aiki Framework Developers is subscribed to branch lp:aikiframework.
To unsubscribe from this branch go to 
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk/+edit-subscription
=== added file 'assets/apps/installer/images/toggle.png'
Binary files assets/apps/installer/images/toggle.png	1970-01-01 00:00:00 +0000 and assets/apps/installer/images/toggle.png	2012-01-29 22:51:04 +0000 differ
=== modified file 'assets/apps/installer/installer.css'
--- assets/apps/installer/installer.css	2012-01-25 22:53:41 +0000
+++ assets/apps/installer/installer.css	2012-01-29 22:51:04 +0000
@@ -231,21 +231,49 @@
 	margin-bottom: 24px;
 }
 
-
-#requirements {	
+div.links {
+  position: relative;
+  top:  6px;
+  z-index:99;
+  overflow: auto }
+
+a.toggle:hover  { color: #999}
+a.toggle:active { color: #000}	
+
+a.toggle {  
+  outline: none !important;
+  text-transform: uppercase;
+  display:block;
+  float:left;
+  color: #555;
+  padding: 6px 12px 12px 12px;
+  background-position: bottom center;
+  background-repeat: no-repeat;
+  text-decoration:none;}
+
+a.active {
+  background-image: url(images/toggle.png) }
+
+div.toggle pre {
+font-size: 0.8em;}
+  
+div.toggle {	
 	line-height: 1.4em;
 	width:100%;
-	padding:6px 24px 12px 24px;
+	padding:16px 16px 12px 32px;
 	position: relative;
 	left: -24px;
 	border-bottom: 1px solid #f4e355;
 	border-top: 1px solid #f4e355;
 	background-color: #f8ed90;
 	margin-bottom: 24px;
+	overflow: auto;
+	max-height:400px;
 }
 
-#requirements h2 { font-weight: bold; font-size: 1.2em; padding-bottom: 0.2em; }
-#requirements ol { padding-left: 36px;}
+div.toggle h2 { font-weight: bold; font-size: 1.2em; padding-bottom: 0.2em; }
+div.toggle ul,
+div.toggle ol { padding-left: 36px;}
 
-#file-list { oveflow:auto }
+#file-list { overflow:auto }
 #file-list div.col { float:left; width:43%; margin-right:6%;}

=== modified file 'assets/apps/installer/installer.php'
--- assets/apps/installer/installer.php	2012-01-25 22:53:41 +0000
+++ assets/apps/installer/installer.php	2012-01-29 22:51:04 +0000
@@ -8,7 +8,7 @@
  * This source file is subject to the AGPL-3.0 license that is bundled
  * with this package in the file LICENSE.
  *
- * @author      Roger Martin, Aikilab http://www.aikilab.com 
+ * @author      Aikilab http://www.aikilab.com 
  * @copyright   (c) 2008-2011 Aiki Lab Pte Ltd
  * @license     http://www.fsf.org/licensing/licenses/agpl-3.0.html
  * @link        http://www.aikiframework.org
@@ -18,11 +18,8 @@
  *
  *
  *
- * @TODO VERSION, REVISION,
  * @TODO AIKI_LOG_DIR, AIKI_LOG_FILE,AIKI_LOG_PROFILE, AIKI_LOG_LEVEL;
  * 
- * @TODO a step for licences?
- * @TODO a step for authors?
  */
 
 
@@ -58,9 +55,14 @@
   * 
   */
 
-define ("AIKI_INSTALLER_APPS",1);
+	
+// connect using ezSQL
+if( !defined('IN_AIKI') ) {
+	define ("IN_AIKI","AIKI_INSTALLER_APPS");
+}
 
-include_once ("library.php");
+require_once ("library.php");
+require_once ( "../../../libs/Util.php");
 
 // initiate translation system
 include_once("TranslateUsingPo.php");
@@ -76,13 +78,12 @@
 	define(AIKI_VERSION,"0.8.24");
 }
 
-if ( !defined("AIKI_REVISION") ) {
-	define(AIKI_REVISION,"+1019");
-}
-
 $AIKI_ROOT_DIR = realpath( dirname(__FILE__ ). "/../../..");
-$AIKI_AUTHORS  = @file_get_contents("../../../AUTHORS") ;
-$AIKI_SITE_URL = clean_url("http://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI";]) ;
+$AIKI_SITE_URL = clean_url("http://";.
+	$_SERVER["SERVER_NAME"].
+	($_SERVER["SERVER_PORT"]!=80 ? ":" . $_SERVER["SERVER_PORT"] :"" ).
+	$_SERVER["REQUEST_URI"]) ;
+
 
 // Variables necesary for installation
 $config = array(
@@ -117,12 +118,20 @@
 include_once("defaults.php"); 
 
 
+
 $template[0]="<div class='error'>" . $t->t("Installation aborted")."</div><div class='error'>%s</div>";
 
 
 $template[1]=
 	"<div id='welcome'>$INSTALLER_WELCOME_TEXT</div>
-    <div id='requirements'>$INSTALLER_REQUIREMENTS_TEXT</div>".
+	<div class='links'>
+		<a href='#requirements' class='toggle'>". $t->t("Requirements") ."</a>
+		<a href='#license'      class='toggle'>". $t->t("License") ."</a>
+		<a href='#authors'      class='toggle'>". $t->t("Authors") ."</a>
+	</div>
+    <div id='requirements' class='toggle'>$INSTALLER_REQUIREMENTS_TEXT</div>
+    <div id='license'      class='toggle'><pre>". Util::get_license() ."</pre></div>
+    <div id='authors'      class='toggle'><h3>". $t->t("Authors")."</h3>". Util::get_authors("list")."</div>".
 	select_language() .
 	form_hidden(2, "<input type='submit' class='button next' value=' " . $t->t("Next:") ." ".  $t->t("Settings") . "'>");
 
@@ -200,10 +209,30 @@
  * ACTION FOR EACH STEP
  *
  **************************************************************/
-
+$javascripts="";
 switch ( $step){
+	
+	case 1: // welcome, language
+		$javascripts = <<<JAVASCRIPT
+		<script src="../../javascript/jquery/jquery-1.4.2.min.js"></script>
+		<script>
+jQuery(document).ready ( function() {
+	  jQuery('#license,#authors').hide();
+      jQuery('[href=#requirements]').addClass("active");
+	  		
+	  jQuery('a.toggle').click ( function() { 
+			jQuery('div.toggle').hide(); 
+			div = jQuery(this).attr('href');	
+			jQuery(div).show(0);
+			jQuery('a.toggle').removeClass("active");
+			jQuery(this).addClass("active");	
+			 } );	  
+	});	
+		</script>
+		
+JAVASCRIPT;
+		
 	case 0: // pre-installation check
-	case 1: // welcome, language
 	case 2: // settings
 		break;  // only must echo template;
 
@@ -215,12 +244,7 @@
 			$message = "<div class='error'>" . $t->t("Please, fill all required fields")."</div>";
 			break;
 		} 
-		
-		// connect using ezSQL
-		if( !defined('IN_AIKI') ) {
-			define ("IN_AIKI",1);
-		}
-		
+			
 		// use ezSQL library.
 		require_once ( "../../../libs/database/index.php"); // create $db object.
 		
@@ -240,13 +264,13 @@
 				$message = "<div class='message'><p><strong>" . $t->t("created tables")."</strong><br><div id='file-list'>";
 				
 				$errors= "";
-				$cont  =0;
-				
+				$cont  =0;			
 				foreach ( sqls() as $sql ){
 					if ( trim($sql) =="" ){
 						continue;
 					}
 					$table = "";
+					
 					if ( preg_match ( "/CREATE TABLE (IF NOT EXISTS )?`?([^\(`]*)/i", $sql, $table) ){
 						if ( $cont % 10 == 0 ){
 							$message .= ( $cont ? "</div>":"") ."<div class='col'>";
@@ -255,15 +279,20 @@
 						$db->last_error="";		
 						$db->query($sql); // @TODO..why db->query don't return false on error.
 						if ( $db->last_error ) {
-							$errors= $db->last_error . "\n";
+							$errors.= trim($table[2]) .": " .$db->last_error . "\n";
 							$message .="<span class='error'>" . $t->t("error")."</span><br>";														
 						} else {
 							$message .=  " <strong>Ok</strong><br>";						
 						}
 						$cont++;
-					} else {
-						$db->query($sql);
+					} else {																	
+						$db->last_error="";		
+						$db->query($sql); // @TODO..why db->query don't return false on error.		
+						if ( $db->last_error ) {				
+							$errors.= $db->last_error . "\n";
+						}	
 					}
+					
 				}
 
 				$message .= ($cont ? "</div>" : "") . "</div></div>";
@@ -375,13 +404,14 @@
 $stepOf = sprintf( $t->t("Step %d of %d"), $step, count($steps)-1) ;
 $result = sprintf($template[$step], $message, $aditional.$help) ;
 
-$html = <<< HTML
+echo <<< HTML
 <!DOCTYPE HTML>
 <html lang="{$language}" {$text_direction}>
 <head>
 	<title>_{$INSTALLER_TITLE_TAG}</title>
 	<meta charset='utf-8' >
 	<link rel='stylesheet' href='./{$css}' type="text/css" media="all">
+	{$javascripts}
 </head>
 
 <body>
@@ -392,12 +422,4 @@
 </body>
 </html>    
 HTML;
-
-echo $html;
-
-/* make translation  and echo
-echo preg_replace_callback (
-	"/_t\(([^\)]*)\)/",  // all _t(literals)
-	array($t,"t"),       // will be translated by $t->t()
-	$html );*/
 ?>

=== modified file 'assets/apps/installer/languages/en.pot'
--- assets/apps/installer/languages/en.pot	2012-01-25 22:53:41 +0000
+++ assets/apps/installer/languages/en.pot	2012-01-29 22:51:04 +0000
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-01-22 22:32+0100\n"
+"POT-Creation-Date: 2012-01-29 23:45+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <[email protected]>\n"
@@ -17,320 +17,315 @@
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: ../installer.php:118
+#: defaults.php:16
+msgid "Aiki Framework Installer"
+msgstr ""
+
+#: defaults.php:19
+msgid "Aiki Installer"
+msgstr ""
+
+#: defaults.php:24
+msgid ""
+"<strong>Aiki Framework</strong> is an open source high-performance Web "
+"Application Framework for rapid web application development using Open "
+"Standards."
+msgstr ""
+
+#: defaults.php:29 installer.php:128
+msgid "Requirements"
+msgstr ""
+
+#: defaults.php:30
+msgid "Before we start you need the following:"
+msgstr ""
+
+#: defaults.php:32
+msgid "An empty database, with collation set to"
+msgstr ""
+
+#: defaults.php:33
+msgid "PHP 5.2 or above and Apache2"
+msgstr ""
+
+#: defaults.php:34
+msgid "mod_rewrite must be enabled inside apache2 httpd.conf"
+msgstr ""
+
+#: installer.php:122
 msgid "Installation aborted"
 msgstr ""
 
-#: ../installer.php:125 ../installer.php:149 ../installer.php:154
-#: ../installer.php:155
+#: installer.php:129
+msgid "License"
+msgstr ""
+
+#: installer.php:130 installer.php:134
+msgid "Authors"
+msgstr ""
+
+#: installer.php:136 installer.php:161 installer.php:166 installer.php:167
 msgid "Next:"
 msgstr ""
 
-#: ../installer.php:125 ../installer.php:163
+#: installer.php:136 installer.php:175
 msgid "Settings"
 msgstr ""
 
-#: ../installer.php:128
+#: installer.php:139
 msgid "Database"
 msgstr ""
 
-#: ../installer.php:130
+#: installer.php:141
 msgid "Host"
 msgstr ""
 
-#: ../installer.php:131
+#: installer.php:142
 msgid "Database name"
 msgstr ""
 
-#: ../installer.php:132
+#: installer.php:143
 msgid "User"
 msgstr ""
 
-#: ../installer.php:133 ../library.php:395
+#: installer.php:144 library.php:386
 msgid "Password"
 msgstr ""
 
-#: ../installer.php:134
+#: installer.php:145
+msgid "Path/DSN"
+msgstr ""
+
+#: installer.php:146
 msgid "Encoding"
 msgstr ""
 
-#: ../installer.php:137
+#: installer.php:149
 msgid "Admin user / Site"
 msgstr ""
 
-#: ../installer.php:138
+#: installer.php:150
 msgid "Login"
 msgstr ""
 
-#: ../installer.php:139
+#: installer.php:151
 msgid "Full name"
 msgstr ""
 
-#: ../installer.php:140
+#: installer.php:152
 msgid "Email"
 msgstr ""
 
-#: ../installer.php:141
+#: installer.php:153
 msgid "Aiki will send login and password using this email."
 msgstr ""
 
-#: ../installer.php:145
+#: installer.php:157
 msgid "Required Fields"
 msgstr ""
 
-#: ../installer.php:148
+#: installer.php:160
 msgid "Test connection"
 msgstr ""
 
-#: ../installer.php:149 ../installer.php:164
+#: installer.php:161 installer.php:176
 msgid "Create database"
 msgstr ""
 
-#: ../installer.php:154
+#: installer.php:166
 msgid "Write configuration"
 msgstr ""
 
-#: ../installer.php:155 ../installer.php:166
+#: installer.php:167 installer.php:178
 msgid "Pretty urls"
 msgstr ""
 
-#: ../installer.php:161
+#: installer.php:173
 msgid "Pre-installation check"
 msgstr ""
 
-#: ../installer.php:162
+#: installer.php:174
 msgid "Requirements & language"
 msgstr ""
 
-#: ../installer.php:165
+#: installer.php:177
 msgid "Config file"
 msgstr ""
 
-#: ../installer.php:212
+#: installer.php:244
 msgid "Please, fill all required fields"
 msgstr ""
 
-#: ../installer.php:214 ../library.php:322
+#: installer.php:258
 msgid "Error: no connection or database"
 msgstr ""
 
-#: ../installer.php:217
-msgid "Connection OK"
-msgstr ""
-
-#: ../installer.php:217
-msgid "no database name"
-msgstr ""
-
-#: ../installer.php:218
-msgid "Error: can't select database"
-msgstr ""
-
-#: ../installer.php:221
+#: installer.php:261
 msgid "Connection and database OK"
 msgstr ""
 
-#: ../installer.php:224
+#: installer.php:264
 msgid "created tables"
 msgstr ""
 
-#: ../installer.php:241
+#: installer.php:283
 msgid "error"
 msgstr ""
 
-#: ../installer.php:251
+#: installer.php:299
 msgid "Admin login:"
 msgstr ""
 
-#: ../installer.php:251
+#: installer.php:299
 msgid "Password:"
 msgstr ""
 
-#: ../installer.php:252
+#: installer.php:300
 msgid ""
 "<strong>Please, annotate</strong> login and password. You will need them"
 msgstr ""
 
-#: ../installer.php:255
+#: installer.php:303
 #, php-format
 msgid "Data had send to %s"
 msgstr ""
 
-#: ../installer.php:260
+#: installer.php:308
 msgid ""
 "Some errors during creating tables <em>,perhaps tables already exists</em>"
 msgstr ""
 
-#: ../installer.php:264 ../installer.php:299 ../installer.php:334
+#: installer.php:313 installer.php:348 installer.php:383
 msgid "Try again"
 msgstr ""
 
-#: ../installer.php:265
+#: installer.php:314
 msgid "Delete all tables for new installtion, or push next for upgrading"
 msgstr ""
 
-#: ../installer.php:267
+#: installer.php:316
 msgid "All tables have created correctly"
 msgstr ""
 
-#: ../installer.php:280
+#: installer.php:329
 msgid "FATAL ERROR: failed to read config template file"
 msgstr ""
 
-#: ../installer.php:281 ../installer.php:326 ../installer.php:336
+#: installer.php:330 installer.php:375 installer.php:385
 msgid "Path"
 msgstr ""
 
-#: ../installer.php:297
+#: installer.php:346
 msgid "Config file created."
 msgstr ""
 
-#: ../installer.php:301
+#: installer.php:350
 msgid "can't write config file:"
 msgstr ""
 
-#: ../installer.php:301
+#: installer.php:350
 msgid "Path:"
 msgstr ""
 
-#: ../installer.php:302 ../installer.php:337
+#: installer.php:351 installer.php:386
 msgid "Please, copy this code, create file and paste."
 msgstr ""
 
-#: ../installer.php:303 ../installer.php:338
+#: installer.php:352 installer.php:387
 msgid "Check permission in directory"
 msgstr ""
 
-#: ../installer.php:313
+#: installer.php:362
 msgid ""
 "Installation finished <em>pretty urls are enabled with previous .htaccess</"
 "em>"
 msgstr ""
 
-#: ../installer.php:314 ../installer.php:332
+#: installer.php:363 installer.php:381
 msgid "Test my site!!"
 msgstr ""
 
-#: ../installer.php:316
+#: installer.php:365
 msgid "Try/Check again"
 msgstr ""
 
-#: ../installer.php:317
+#: installer.php:366
 msgid "There is a existing .htaccess file."
 msgstr ""
 
-#: ../installer.php:318
+#: installer.php:367
 msgid "Please, remove file or rewrite file with this code:"
 msgstr ""
 
-#: ../installer.php:325
+#: installer.php:374
 msgid "FATAL ERROR: failed to read htaccess.inc file"
 msgstr ""
 
-#: ../installer.php:331
+#: installer.php:380
 msgid "Installation finished <em>pretty urls are enabled.</em>"
 msgstr ""
 
-#: ../installer.php:336
+#: installer.php:385
 msgid "Aiki can't write .htaccess file:"
 msgstr ""
 
-#: ../installer.php:350
+#: installer.php:399
 msgid "installer.css"
 msgstr ""
 
-#: ../installer.php:351
+#: installer.php:400
 msgid "dir='ltr'"
 msgstr ""
 
-#: ../installer.php:355
+#: installer.php:404
 #, php-format
 msgid "Step %d of %d"
 msgstr ""
 
-#: ../library.php:271
+#: library.php:271
 msgid "Select language for installation"
 msgstr ""
 
-#: ../library.php:274
+#: library.php:274
 msgid "Change"
 msgstr ""
 
-#: ../library.php:293
+#: library.php:293
 msgid "oracle 8 or higher"
 msgstr ""
 
-#: ../library.php:325
-msgid "Error: no database selected"
-msgstr ""
-
-#: ../library.php:335
+#: library.php:326
 msgid "There is a existing configuration file."
 msgstr ""
 
-#: ../library.php:336
+#: library.php:327
 msgid "Please remove file to continue installation"
 msgstr ""
 
-#: ../library.php:357
+#: library.php:348
 msgid "Essential files missing"
 msgstr ""
 
-#: ../library.php:391
+#: library.php:382
 msgid "Hello"
 msgstr ""
 
-#: ../library.php:392
+#: library.php:383
 msgid "Your new Aiki installation is ready to be used"
 msgstr ""
 
-#: ../library.php:393
+#: library.php:384
 msgid "Go to"
 msgstr ""
 
-#: ../library.php:394
+#: library.php:385
 msgid "Username"
 msgstr ""
 
-#: ../library.php:396
+#: library.php:387
 msgid "Have a nice day"
 msgstr ""
 
-#: ../library.php:398
+#: library.php:389
 msgid "Your new Aiki installation"
 msgstr ""
-
-#: ../defaults.php:16
-msgid "Aiki Framework Installer"
-msgstr ""
-
-#: ../defaults.php:19
-msgid "Aiki Installer"
-msgstr ""
-
-#: ../defaults.php:24
-msgid ""
-"<strong>Aiki Framework</strong> is an open source high-performance Web "
-"Application Framework for rapid web application development using Open "
-"Standards."
-msgstr ""
-
-#: ../defaults.php:29
-msgid "Requirements"
-msgstr ""
-
-#: ../defaults.php:30
-msgid "Before we start you need the following:"
-msgstr ""
-
-#: ../defaults.php:32
-msgid "An empty database, with collation set to"
-msgstr ""
-
-#: ../defaults.php:33
-msgid "PHP 5.2 or above and Apache2"
-msgstr ""
-
-#: ../defaults.php:34
-msgid "mod_rewrite must be enabled inside apache2 httpd.conf"
-msgstr ""

=== modified file 'assets/apps/installer/languages/es.po'
--- assets/apps/installer/languages/es.po	2012-01-25 22:53:41 +0000
+++ assets/apps/installer/languages/es.po	2012-01-29 22:51:04 +0000
@@ -32,6 +32,16 @@
 msgid "Settings"
 msgstr "Configuraciones"
 
+
+#: installer.php:129
+msgid "License"
+msgstr "Licencia"
+
+#: installer.php:130 installer.php:134
+msgid "Authors"
+msgstr "Autores"
+
+
 #: ../installer.php:128
 msgid "Database"
 msgstr "Base de datos"

=== modified file 'assets/apps/installer/library.php'
--- assets/apps/installer/library.php	2012-01-25 22:53:41 +0000
+++ assets/apps/installer/library.php	2012-01-29 22:51:04 +0000
@@ -419,7 +419,7 @@
  */
 
 function sqls(){
-	global $config, $AIKI_ROOT_DIR, $AIKI_SITE_URL, $AIKI_AUTHORS ;
+	global $config, $AIKI_ROOT_DIR, $AIKI_SITE_URL ;
 
 	$SQLS_DELIMITER = "-- ------------------------------------------------------";
 	
@@ -436,8 +436,8 @@
 		"@ADMIN_PASS@"=> $config["ADMIN_PASSWORD_MD5_MD5"],
 		"@ADMIN_MAIL@"=> $config["ADMIN_EMAIL"],
 		"@VERSION@"   => AIKI_VERSION,
-		"@REVISION@"  => AIKI_REVISION,
-		"@AUTHORS@"   => $AIKI_AUTHORS);
+		"@REVISION@"  => Util::get_last_revision(),
+		"@AUTHORS@"   => Util::get_authors());
 	
 	$files = array (
 		"$AIKI_ROOT_DIR/sql/CreateTables.sql",
@@ -447,8 +447,9 @@
 			
 	foreach ($files as $file ){
 		if ( file_exists($file) ){
-			$ret.= $SQLS_DELIMITER . "\n". @file_get_contents($file) ;
-		}
+			$ret.= $SQLS_DELIMITER . "\n". preg_replace ("#/\*.*\*/#Us","",@file_get_contents($file));
+			// remove coments
+		} 
 	}
 	
 	return explode($SQLS_DELIMITER, strtr ($ret, $replace));

_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help   : https://help.launchpad.net/ListHelp

Reply via email to