Changeset 493 for trunk/Common/Update.php
- Timestamp:
- Mar 1, 2013, 9:20:14 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Update.php
r491 r493 8 8 var $Trace; 9 9 var $VersionTable; 10 /* @var Database */ 10 11 var $Database; 11 12 var $InstallMethod; … … 16 17 $this->Trace = array(); 17 18 $this->VersionTable = 'SystemVersion'; 19 $this->InstallMethod = 'FullInstall'; 20 $this->InsertSampleDataMethod = 'InsertSampleData'; 18 21 } 19 22 … … 28 31 { 29 32 $DbResult = $this->Database->query('SHOW TABLES LIKE "'.$this->VersionTable.'"'); 30 return($DbResult->num_rows > 0); 33 return($DbResult->num_rows > 0); 31 34 } 32 35 … … 63 66 } 64 67 68 function InsertSampleData() 69 { 70 $InstallMethod = $this->InsertSampleDataMethod; 71 $InstallMethod($this); 72 } 73 65 74 function Execute($Query) 66 75 { 67 echo($Query.' <br/>');76 echo($Query.';<br/>'); 68 77 flush(); 69 78 $this->Database->query($Query); … … 110 119 if(!$this->UpdateManager->IsUpToDate()) 111 120 $Output .= '<input type="submit" name="update" value="Aktualizovat"/> '; 121 $Output .= '<input type="submit" name="insert_sample_data" value="Vložit vzorová data"/> '; 112 122 $Output .= '<input type="submit" name="uninstall" value="Odinstalovat"/> '; 113 123 } else $Output .= '<input type="submit" name="install" value="Instalovat"/> '; … … 120 130 function Show() 121 131 { 122 session_start();123 124 132 $Output = '<?xml version="1.0" encoding="utf-8"?> 125 133 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> … … 167 175 { 168 176 $Output .= '<h3>Aktualizace</h3>'; 169 $ UpdateManager->Update();177 $this->UpdateManager->Update(); 170 178 $Output .= $this->ControlPanel(); 171 179 } else … … 173 181 { 174 182 $Output .= '<h3>Instalace</h3>'; 175 $UpdateManager->Install(); 183 $this->UpdateManager->Install(); 184 $this->UpdateManager->Update(); 176 185 $Output .= $this->ControlPanel(); 177 186 } else … … 179 188 { 180 189 $Output .= '<h3>Odinstalace</h3>'; 181 $UpdateManager->Uninstall(); 190 $this->UpdateManager->Uninstall(); 191 $Output .= $this->ControlPanel(); 192 } else 193 if(array_key_exists('insert_sample_data', $_POST)) 194 { 195 $Output .= '<h3>Vložení vzorových dat</h3>'; 196 $this->UpdateManager->InsertSampleData(); 182 197 $Output .= $this->ControlPanel(); 183 198 } else
Note:
See TracChangeset
for help on using the changeset viewer.