Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

SetupDocument.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003  * ImaComm - a web based photo album software
00004  * Copyright (C) 2003, Mikko Kokkonen
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or (at
00009  * your option) any later version.
00010  * 
00011  * This program is distributed in the hope that it will be useful, but
00012  * WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00019  */
00020 $__setupdoc_dir = realpath(dirname(__FILE__)."/../");
00021 // Include Document...
00022 require_once "$__setup_dir/classes/Document.php";
00023 require_once "$__setup_dir/version.php";
00024 
00025 // {{{ class Document
00026 class SetupDocument extends Document
00027 {
00028         // {{{ SetupDocument()
00029         function SetupDocument()
00030         {
00031         }
00032         // }}}
00033 
00034         // {{{ string formBegin ($action = null, $method = "post")
00035         function formBegin($action = null, $method = "post")
00036         {
00037                 global $_page;
00038                 if (is_null($action))
00039                 {
00040                         $action = $_SERVER['PHP_SELF'];
00041                 }
00042                 return "<form method=\"$method\" action=\"$action\">\n<input type=\"hidden\" name=\"page\" value=\"{$_page}\">";
00043         }
00044         // }}}
00045         
00046         // {{{ string formEnd()
00047         function formEnd()
00048         {
00049                 return "</form>";
00050         }
00051         // }}}
00052         
00053         // {{{ string title()
00054         function title()
00055         {
00056                 global $_page, $_numofpages;
00057                 return "ImaComm Setup ($_page/$_numofpages)";
00058         }
00059         // }}}
00060 
00061         // {{{ string theme()
00062         function theme()
00063         {
00064                 return $_SESSION['theme'];
00065         }
00066         // }}}
00067 
00068         // {{{ string header()
00069         function header()
00070         {
00071                 return $this->title.$this->version(VERSION_TYPE_SHORT)." Setup";
00072         }
00073         // }}}
00074 
00075         // {{{ string partheader()
00076         function partheader()
00077         {
00078                 global $_page;
00079 
00080                 switch ($_page) {
00081                         case 1: return "Welcome!";
00082                         case 2: return "Automatic settings resolver";
00083                         case 3: return "Path to the directories...";
00084                         case 4: return "Checking paths...";
00085                         case 5: return "Global settings";
00086                         case 6: return "Saving settings...";
00087                         case 7: return "All done! :-)";
00088                 }
00089                 return deverror("Page $_page is not defined!");
00090         }
00091         // }}}
00092         
00093         // {{{ string information()
00094         function information()
00095         {
00096                 global $_page;
00097                 // Print some generic information...
00098                 // Print some page-spesific information...
00099                 
00100                 if ($_page == 1)
00101                 {
00102                         return "Welcome to ImaComm Setup Druid. This druid will help you set up your ImaComm site. This druid will automatically detect most of settings, but your system might need your attention. For example if your heloer programs are not in PATH environment variable, you must give their path manually.<br />
00103 <br />                  To begin automatic detection, please click next page button to continue. Where it is depends on theme you are currently using, but usually it is located into top right.<br /><br />
00104                         Please notice that JavaScript must be turned on to go throught this setup program. Among other things, next button will be activated by JavaScript if everything is correct.<br />If you doesn't have JavaScript turned onand you cannot or want to turn it on, you can use ImaComm Remote to setup ImaComm server.<br />Download it from here: <a href=\"../icr/\">ImaComm Remote</a><br /><br /><script type=\"text/javascript\">\n<!--\ndocument.writeln('<b>You have JavaScript turned on! Just keep going!</b>');\ndocument.getElement.ById('nextbtn').style='display: true;';\n// -->\n</script>\n";
00105                 }
00106                 if ($_page == 2)
00107                 {
00108                         return "ImaComm setup programs tries now to resolve most important settings, PHP options that may make ImaComm's life difficult and the most important, the location of helpoer programs. All you can do is just wait until all settings are checked. Please be patient.<br /><br />
00109                         During testing you can see (usually on top right) a progress bar which shows how much have been tested. After all tests are run, you see summary on the screen and you can go to the next page.";
00110                 }
00111                 if ($_page == 4)
00112                 {
00113                         return "Please wait while checking if the paths to the directories are correct. If you don't have for example NetPBM installed you must have leaved that field empty, otherwise you will see an error message below and you cannot continue.<br /><br />If there are any errors in paths you will be noticed and you cannot continue until you have fixed the error.<br />Some errors can give a link to the manual which doesn't exists yet. We apologize that error.";
00114                 }
00115                 if ($_page == 5)
00116                 {
00117                         return "ImaComm has many settings and options. Below you can choiose between different graphics suites and between different modules. Please select suite and modules what you like to use.";
00118                 }
00119                 if ($_page == 6)
00120                 {
00121                         return "Please wait while saving our settings. This should not take a long time.";
00122                 }
00123                 if ($_page == 7)
00124                 {
00125                         return "Congarulations! Your ImaComm Server setup is now completed. To continue adminstrating this server, just click Finish-button (usually on the top right) and you are redirected automatically to administrator page.<br />You are requered always to login as administrator class username to access administration tools. This setup has created a default administrator user:<br /><br />Username: <code>admin</code><br />Password: <code>admin</code><br /><br />To keep your server as it is, change adminstrator's password right away. After you have created another user who has administrator rights, you can destroy admin-user.";
00126                 }
00127         }
00128         // }}}
00129 
00130 /*      // {{{ string logo()
00131         function logo()
00132         {
00133                 return "<img src=\"{$_SESSION['theme']}images/logo.png\" alt=\"LOGO\" style=\"vertical-align: top\">";
00134         }
00135         // }}}*/
00136 
00137         // {{{ string navigationButtons()
00138         function navigationButtons()
00139         {
00140                 global $_page, $_numofpages;
00141                 $pb = "<input type=\"submit\" name=\"prev\" value=\"Previous page\" /> ";
00142                 $nb = "<input type=\"submit\" name=\"next\" value=\"Next page\" /> ";
00143                 $fb = "<input type=\"submit\" name=\"finish\" value=\"Finish\" /> ";
00144                 if ($_page > 1 && $_page < ($_numofpages - 1))
00145                 {
00146                         $buf .= jsBegin()."document.writeln('$pb');\n".jsEnd();
00147                 }
00148                 if ($_page < $_numofpages)
00149                 {
00150                         $buf .= jsBegin()."document.writeln('$nb');\n".jsEnd();
00151                 }
00152                 if ($_page == $_numofpages)
00153                 {
00154                         $buf .= jsBegin()."document.writeln('$fb');\n".jsEnd();
00155                 }
00156                 return $buf;
00157         }
00158         // }}}
00159 
00160         // {{{ string navigation($type)
00161         function navigation($type)
00162         {
00163                 global $_page, $_numofpages;
00164                 $pginf = array("Welcome", "Auto-find", "Paths", "Check paths", "Configuration", "Saving settings", "Done!");
00165                 $buf = "<ol>";
00166                 for ($c = 1; $c <= count($pginf); $c++)
00167                 {
00168                         if ($_page > $c)
00169                         {
00170                                 $class = " class=\"history\"";
00171                         }
00172                         else
00173                         {
00174                                 $class = "";
00175                         }
00176                         $buf .= "<li$class>";
00177                         if ($_page == $c)
00178                         {
00179                                 $buf .= "<b>";
00180                         }
00181                         $buf .= $pginf[$c - 1];
00182                         if ($_page == $c)
00183                         {
00184                                 $buf .= "</b>";
00185                         }
00186                         $buf .= "</li>\n";
00187                 }
00188                 $buf .= "</ol>\n";
00189                 return $buf;
00190         }
00191         // }}}
00192 }
00193 // }}}
00194 ?>

Generated on Sun Oct 19 11:08:00 2003 for ImaComm by doxygen1.3