[pLog-svn] r590 - in plog/trunk: . templates/wizard

oscar at devel.plogworld.net oscar at devel.plogworld.net
Tue Dec 28 15:02:34 GMT 2004


Author: oscar
Date: 2004-12-28 15:02:34 +0000 (Tue, 28 Dec 2004)
New Revision: 590

Removed:
   plog/trunk/templates/wizard/error.template
Modified:
   plog/trunk/templates/wizard/header.template
   plog/trunk/templates/wizard/update1.template
   plog/trunk/templates/wizard/update2.template
   plog/trunk/templates/wizard/update3.template
   plog/trunk/templates/wizard/update4.template
   plog/trunk/wizard.php
Log:
updated the part of the wizard that updates from 0.3.x to 1.0, now it should work well too!


Deleted: plog/trunk/templates/wizard/error.template
===================================================================
--- plog/trunk/templates/wizard/error.template	2004-12-28 13:41:53 UTC (rev 589)
+++ plog/trunk/templates/wizard/error.template	2004-12-28 15:02:34 UTC (rev 590)
@@ -1,11 +0,0 @@
-{include file="wizard/header.template"}
- <h1>Error</h1>
- <p>
-  There has been an error during the process. Please have a look at the following error
-  message(s) and try again.
- </p>
- <p>
-  <font color="red">{$message}</font>
- </p>
- <input type="button" onclick="javascript:history.go(-1)" name="back" value="&laquo; Back" />
-{include file="wizard/footer.template"}

Modified: plog/trunk/templates/wizard/header.template
===================================================================
--- plog/trunk/templates/wizard/header.template	2004-12-28 13:41:53 UTC (rev 589)
+++ plog/trunk/templates/wizard/header.template	2004-12-28 15:02:34 UTC (rev 590)
@@ -35,6 +35,13 @@
 			<li {if $step==5}class="currentStep"{/if}>&raquo; 5 Blog Configuration</li>
 			<li {if $step==6}class="currentStep"{/if}>&raquo; 6 Done!</li>
 		  </ul>	
+		  {else}
+		  <ul>
+		   <li {if $step==1}class="currentStep"{/if}>1 Update</li>
+		   <li {if $step==2}class="currentStep"{/if}>&raquo; 2 Database Changes</li>
+		   <li {if $step==3}class="currentStep"{/if}>&raquo; 3 Data changes</li>
+		   <li {if $step==4}class="currentStep"{/if}>&raquo; 4 Done!</li>		   
+		  </ul> 
 		  {/if}
           <br style="clear:both;"/>
         </div>

Modified: plog/trunk/templates/wizard/update1.template
===================================================================
--- plog/trunk/templates/wizard/update1.template	2004-12-28 13:41:53 UTC (rev 589)
+++ plog/trunk/templates/wizard/update1.template	2004-12-28 15:02:34 UTC (rev 590)
@@ -1,16 +1,21 @@
-{include file="wizard/header.template" title="1. Update"}
+{include file="wizard/header.template" title="1 Update" step=1 mode=update}
 <form name="databaseInfo" method="post">
 <fieldset class="inputField">
- <legend>Database Info</legend>
+<legend>Database Info</legend>
 {if $viewIsError}
-  <span style="color:red">{$viewErrorMessage}</span>
+     <div class="wizardError">
+     <img src="imgs/icon_error-16.png" alt="Error" class="wizardInfoIcon" />
+     <p style="color:red;margin-left:20px;">{$viewErrorMessage}</p>
+    </div> 
 {else}
-  <div class="wizardInfo">
+ <div class="wizardInfo">
+  <img src="imgs/icon_info-16.png" alt="Info" class="wizardInfoIcon" />
+   <p class="wizardInfoText">
   The following database settings have been detected in the configuration file. Please make sure
   that they are correct and press "Next" to move to the next step. If they are not correct,
   please make the necessary changes in your configuration file before continuing.<br/><br/>
   The following step will consist of making the changes to the database structure, required by
-  some of the new features in 1.0.  
+  some of the new features in 1.0.</p>  
   </div>
 {/if}
     <div class="field">

Modified: plog/trunk/templates/wizard/update2.template
===================================================================
--- plog/trunk/templates/wizard/update2.template	2004-12-28 13:41:53 UTC (rev 589)
+++ plog/trunk/templates/wizard/update2.template	2004-12-28 15:02:34 UTC (rev 590)
@@ -1,35 +1,26 @@
-{assign var="step" value="2"}
-{assign var="steps" value="4"}
-{include file="wizard/header.template"}
- <h1>Update to pLog 1.0</h1>
-  {if $errors}
- <p>
-  The following errors were found:
- <p>
- <p style="color:red">
-  {$message}
- </p>
- <p>
-  Correct the above errors and try again.
- </p>
- {/if}
- <p>
-  {$message}
- </p>
-  <p>
-   All the necessary changes have been made to the database. 
-  </p>
-  <p>
-   The following step will consist in filling in some of the new fields needed by the 
-   search engine. The base content of these fields will be the current data in for example
-   your posts, but all markup and unnecessary information will be removed so that the
-   search engine can perform its work better.
-  </p>
- <p>
-  <form name="update2" action="wizard.php" method="post">
+{include file="wizard/header.template" step=2 title="2 Database Changes"}
+<form name="update2" method="post">
+<fieldset class="inputField">
+<legend>Database Changes</legend>
+{if $viewIsError}
+    <div class="wizardError">
+     <img src="imgs/icon_error-16.png" alt="Error" class="wizardInfoIcon" />
+     <p style="color:red;margin-left:20px;">{$viewErrorMessage}</p>
+    </div>
+{else}
+   <div class="wizardInfo">
+    <img src="imgs/icon_info-16.png" alt="Info" class="wizardInfoIcon" />
+    <p class="wizardInfoText">
+     All the necessary changes have been made to the database:<br/><br/>
+     {$message}
+    </p> 
+   </div>
+{/if}
+</fieldset>
+<div class="buttons">
+   <input type="button" name="Prev" value="&laquo; Previous" onClick="javascript:history.go(-1);" />
    <input type="hidden" name="nextStep" value="Update3"/>
    <input type="submit" name="Next" value="Next &raquo;"/>
-  </form>
-  </p>
- </form>
+</div>
+</form>
 {include file="wizard/footer.template"}
\ No newline at end of file

Modified: plog/trunk/templates/wizard/update3.template
===================================================================
--- plog/trunk/templates/wizard/update3.template	2004-12-28 13:41:53 UTC (rev 589)
+++ plog/trunk/templates/wizard/update3.template	2004-12-28 15:02:34 UTC (rev 590)
@@ -1,33 +1,27 @@
-{assign var="step" value="3"}
-{assign var="steps" value="4"}
-{include file="wizard/header.template"}
- <h1>Update to pLog 1.0</h1>
-  {if $errors}
- <p>
-  The following errors were found:
- <p>
- <p style="color:red">
-  {$message}
- </p>
- <p>
-  Correct the above errors and try again.
- </p>
- {/if}
- <p>
-  {$message}
- </p>
-  <p>
-   The table holding the posts has been updated successfully. In total, {$numPosts} posts have
-   been updated.
-  </p>
-  <p>
-   The next step will repeat the same operation but for the rest of tables. 
-  </p>
- <p>
-  <form name="update2" action="wizard.php" method="post">
+{include file="wizard/header.template" step=3 mode=update title="3 Data Changes"}
+<form name="update2" method="post">
+<fieldset class="inputField">
+<legend>Data Changes</legend>
+{if $viewIsError}
+    <div class="wizardError">
+     <img src="imgs/icon_error-16.png" alt="Error" class="wizardInfoIcon" />
+     <p style="color:red;margin-left:20px;">{$viewErrorMessage}</p>
+    </div>
+{else}
+   <div class="wizardInfo">
+    <img src="imgs/icon_info-16.png" alt="Info" class="wizardInfoIcon" />
+    <p class="wizardInfoText">
+    The table holding the posts has been updated successfully. In total, {$numPosts} posts have
+    been updated.<br/><br/>
+    The next step will repeat the same operation but for the rest of tables.
+    </p>
+   </div> 
+{/if}
+</fieldset>
+<div class="buttons">
    <input type="hidden" name="nextStep" value="Update4"/>
+   <input type="submit" name="Prev" value="&laquo; Previous"/>   
    <input type="submit" name="Next" value="Next &raquo;"/>
-  </form>
-  </p>
- </form>
+</div>  
+</form>
 {include file="wizard/footer.template"}
\ No newline at end of file

Modified: plog/trunk/templates/wizard/update4.template
===================================================================
--- plog/trunk/templates/wizard/update4.template	2004-12-28 13:41:53 UTC (rev 589)
+++ plog/trunk/templates/wizard/update4.template	2004-12-28 15:02:34 UTC (rev 590)
@@ -1,22 +1,33 @@
-{assign var="step" value="4"}
-{assign var="steps" value="4"}
-{include file="wizard/header.template"}
- <h1>Update complete</h1>
- <p>
-  {$message}
- </p>
- <p>
-  Installation is complete. Your 0.3-based installation has been updated
-  to version 1.0. Click here to proceed to the administrative interface
-  and enjoy the new features: <a href="admin.php">Administrative Interface</a>.
- </p> 
- <p>
-  <span style="color:red">WARNING: </span>For security reasons, you must now remove this file, <b>wizard.php</b>. If you are
-  not planning to allow internet users to create new blogs in this server, then you should also
-  remove <b>register.php</b>.
- </p>
- <p>
-  Enjoy!<br/><b/>
-  <a href="http://www.plogworld.org">The pLog team</a>.
- </p>
+{include file="wizard/header.template" step=4 mode=upgrade title="4 Done!"}
+<form method="post">
+<fieldset class="inputField">
+<legend>Upgrade Complete</legend>
+{if $viewIsError}
+    <div class="wizardError">
+     <img src="imgs/icon_error-16.png" alt="Error" class="wizardInfoIcon" />
+     <p style="color:red;margin-left:20px;">{$viewErrorMessage}</p>
+    </div>
+{else}
+   <div class="wizardInfo">
+    <img src="imgs/icon_info-16.png" alt="Info" class="wizardInfoIcon" />
+    <p class="wizardInfoText">
+  Installation is complete. Congratulations, Your 0.3-based installation has been updated
+  to version 1.0.
+    </p> 
+   </div>
+{/if}
+<p>
+  <p>
+   <span style="color:red">WARNING: </span>For security reasons, you must now remove this file, <b>wizard.php</b>. If you are
+   not planning to allow internet users to create new blogs in this server, then you should also
+   remove <b>summary.php</b>.<br/><br/>
+   Enjoy,<br/>
+  <a href="{$version->getProjectPage()}">The pLog team</a>.
+  </p>
+ </fieldset> 
+ <div class="buttons">
+  <input value="Go to blog" type="button" onClick="javascript:window.location='index.php'" /> 
+  <input value="Go to administration interface" type="button" onClick="javascript:window.location='admin.php'" />
+ </div> 
+</form> 
 {include file="wizard/footer.template"}

Modified: plog/trunk/wizard.php
===================================================================
--- plog/trunk/wizard.php	2004-12-28 13:41:53 UTC (rev 589)
+++ plog/trunk/wizard.php	2004-12-28 15:02:34 UTC (rev 590)
@@ -123,6 +123,7 @@
   settings text NOT NULL,
   mangled_blog varchar(50) NOT NULL default '',
   status int(4) NOT NULL default '1',
+  show_in_summary int(4) not null default '1',
   PRIMARY KEY  (id)
 ) TYPE=MyISAM;";
 
@@ -392,7 +393,8 @@
 								       
 	$Changes["Blogs"] = Array( "ALTER TABLE {dbprefix}blogs ADD COLUMN mangled_blog VARCHAR(50) NOT NULL DEFAULT ''",
 	                           "ALTER TABLE {dbprefix}blogs ADD COLUMN properties TEXT NOT NULL DEFAULT ''",
-	                           "ALTER TABLE {dbprefix}blogs ADD COLUMN status INTEGER(4) NOT NULL DEFAULT '1'" );
+	                           "ALTER TABLE {dbprefix}blogs ADD COLUMN status INTEGER(4) NOT NULL DEFAULT '1'",
+	                           "ALTER TABLE {dbprefix}blogs ADD COLUMN show_in_summary INTEGER(4) NOT NULL DEFAULT '1'" );
 	                           
 	$Changes["Gallery Albums"] = Array( "ALTER TABLE {dbprefix}gallery_albums ADD COLUMN normalized_name VARCHAR(255) NOT NULL DEFAULT ''",
 	                                    "ALTER TABLE {dbprefix}gallery_albums ADD COLUMN normalized_description TEXT NOT NULL DEFAULT ''",
@@ -465,9 +467,6 @@
 $Inserts[41] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('maximum_file_upload_size', 2000000, 1);";
 $Inserts[42] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('upload_forbidden_files', '*.php *.php3 *.php4 *.phtml', 3);";
 $Inserts[43] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('comments_order', 1, 1);";
-// ---
-// new config settings added in 0.3
-// ---
 $Inserts[44] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('security_pipeline_enabled', 1, 1);";
 $Inserts[45] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('maximum_comment_size', 0, 1 );";
 $Inserts[46] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('resources_enabled', 1, 1 );";
@@ -479,9 +478,6 @@
 $Inserts[52] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xmlrpc_api_enabled', 1, 1);";
 $Inserts[53] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('uploads_enabled', 1, 1);";
 $Inserts[54] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_rss_profile', 'rss090', 3);";
-// ---
-// config settings for the bayesian filter added in 0.3
-// ---
 $Inserts[55] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_enabled', 1, 2);";
 $Inserts[56] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_spam_probability_treshold', '0.9', 6);";
 $Inserts[57] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_nonspam_probability_treshold', '0.2', 6);";
@@ -494,19 +490,10 @@
 $Inserts[64] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('thumbnail_format','same',3);";
 $Inserts[65] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resources_folder','./gallery/',3);";
 $Inserts[66] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('beautify_comments_text', '1', 1);";
-// ---
-// some other settings added in 0.3.1
-// ---
 $Inserts[67] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('disable_apache_error_handler', '0', 1);";
 $Inserts[68] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('show_future_posts_in_calendar', '0', 1);";
-// ---
-// added in 0.3.2
-// ---
 $Inserts[69] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('xhtml_converter_enabled', '1', 1);";
 $Inserts[70] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('xhtml_converter_aggresive_mode_enabled', '0', 1);";
-// ---
-// parameters added in 1.0
-// ---
 $Inserts[71] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('search_engine_enabled', '1', 1);";
 $Inserts[72] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('search_in_custom_fields', '1', 1);";
 $Inserts[73] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('search_in_comments', '1', 1);";
@@ -646,8 +633,10 @@
             // place
             if( WizardTools::isNewInstallation()) 
                 $this->_view = new WizardView( "intro" );
-            else
-                $this->_view = new WizardView( "update1" );
+            else {
+                Controller::setForwardAction( "Update1" );
+                return false;
+            }
                 
             $this->setCommonData();
         }
@@ -886,13 +875,16 @@
                 $message .= "The helper tool 'convert' (from the ImageMagick package) was found in $pathToConvert<br/>";
 
             if( $errors ) {
-                $this->_view = new WizardView( "error" );
-                $message = "There was an error initializing some of the tables. Please make sure that the user chosen to connect to the database has enough permissions to add records to the database.<br/><br/>$message";
+                $this->_view = new WizardView( "step1" );
+                $this->setDbConfigValues( &$this->_view );
+                $message = "There was an error initializing some of the tables. Please make sure that the user chosen to connect to the database has enough permissions to add records to the database.<br/><br/>$message";                
+                $this->_view->setErrorMessage( $message );
+                $this->setCommonData();
             }
-            else
+            else {
                 $this->_view = new WizardView( "step2" );
-
-            $this->_view->setValue( "message", $message );
+                $this->_view->setValue( "message", $message );                
+            }
         }
     }
 
@@ -1181,14 +1173,9 @@
 
         function perform()
         {
-            $config = new ConfigFileStorage();
-
-            $this->_view = new WizardView( "update1" );
-            $this->_view->setValue( "dbServer", $config->getValue( "db_host" ));
-            $this->_view->setValue( "dbUser", $config->getValue( "db_username" ));
-            $this->_view->setValue( "dbPassword", $config->getValue( "db_password" ));
-            $this->_view->setValue( "dbName", $config->getValue( "db_database" ));
-            $this->_view->setValue( "dbPrefix", $config->getValue( "db_prefix" ));
+            $this->_view = new WizardView( "update1" );        
+            WizardStepTwo::setDbConfigValues( &$this->_view );
+            $this->setCommonData();
         }
     }
 
@@ -1222,9 +1209,9 @@
             $this->_db = connectDb();
 
             if( !$this->_db ) {
-                $this->_view = new WizardView( "error" );
-                $this->_view->setValue( "message", "There was an error connecting to the database. Please check your settings." );
-
+                $this->_view = new WizardView( "update1" );
+                WizardStepTwo::setDbConfigValues( &$this->_view );
+                $this->_view->setErrorMessage( "There was an error connecting to the database. Please check your settings." );
                 return false;
             }
 
@@ -1238,7 +1225,7 @@
                 // and run the query
                 $query = str_replace( "{dbprefix}", $this->_dbPrefix, $table["code"] );
                 if( $this->_db->Execute( $query ))
-                    $message .= "New table ".$table["desc"]." created successfully.<br/>";
+                    $message .= "New table <strong>".$table["desc"]."</strong> created successfully.<br/>";
                 else {
                     $message .= "Error creating table: ".$this->_db->ErrorMsg()."<br/>";
                     $errors = true;
@@ -1261,7 +1248,7 @@
                 }
                 
                 if( !$errors )
-                    $message .= "Changes to table $tableId executed successfully.<br/>";
+                    $message .= "Changes to table <strong>$tableId</strong> executed successfully.<br/>";
                 else {
                     $message .= "Error modifying table $tableId: ".$this->_db->ErrorMsg()."<br/>";
                 }
@@ -1292,8 +1279,9 @@
                 $this->_view->setValue( "message", $message );
             }
             else {
-                $this->_view = new WizardView( "error" );
-                $this->_view->setValue( "message", $message );
+                $this->_view = new WizardView( "update1" );
+                WizardStepTwo::setDbConfigValues( &$this->_view );
+                $this->_view->setErrorMessage( $message );
             }
         }
     }
@@ -1357,8 +1345,9 @@
 			
 			// if error
 			if( $errors ) {
-                $this->_view = new WizardView( "error" );
-                $this->_view->setValue( "message", "There was an error updating the articles table." );
+                $this->_view = new WizardView( "update2" );
+                $this->_view->setErrorMessage( "There was an error updating the articles table." );
+                $this->setCommonData();
                 return false;
 			}
 			
@@ -1588,8 +1577,8 @@
                 $result = $this->$method();
                 
                 if( !$result ) {
-                    $this->_view = new WizardView( "error" );
-                    $this->_view->setValue( "message", $this->message );
+                    $this->_view = new WizardView( "update3" );
+                    $this->_view->setErrorMessage( $this->message );
                     return false;                    
                 }
             }




More information about the pLog-svn mailing list