Changeset 202
- Timestamp:
- Apr 30, 2009, 11:30:37 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Readme.txt
r185 r202 26 26 finance/doklady - vlastníka nastavit na apache 27 27 aktuality/uploads - vlastníka nastavit na apache 28 28 29 29 30 5) Generování PDF dokumentů -
trunk/aktuality/index.php
r196 r202 179 179 if($Row['Name'] == '') $Author = $Row['Author']; 180 180 else $Author = $Row['Name']; 181 $Output .= '<div style="border: thin dotted #97ADFF; background: #F6F7FF; margin-top: 5px; padding: 0px 5px 5px 5px;"><div style="padding-bottom: 1px; border-bottom-width: 1; border-bottom-style: solid; border-bottom-color: silver;"><strong><a href="?action=view& id='.$Row['Id'].'">'.$Row['Title'].'</a> ('.HumanDate($Row['Date']).', '.$Author.')</strong>';181 $Output .= '<div style="border: thin dotted #97ADFF; background: #F6F7FF; margin-top: 5px; padding: 0px 5px 5px 5px;"><div style="padding-bottom: 1px; border-bottom-width: 1; border-bottom-style: solid; border-bottom-color: silver;"><strong><a href="?action=view&id='.$Row['Id'].'">'.$Row['Title'].'</a> ('.HumanDate($Row['Date']).', '.$Author.')</strong>'; 182 182 if($this->System->Modules['User']->User['Id'] == $Row['User']) 183 183 { -
trunk/config.sample.php
r189 r202 14 14 'Web' => array 15 15 ( 16 'FormatHTML' => false, 16 17 'Charset' => 'utf-8', 17 18 'Host' => 'localhost', -
trunk/form_classes.php
r189 r202 51 51 'Title' => 'Základní nastavení', 52 52 'Table' => 'User', 53 'SubmitText' => 'Uložit', 53 54 'Items' => array( 54 55 'Login' => array('Type' => 'String', 'Caption' => 'Přihlašovací jméno', 'Default' => ''), … … 62 63 'UserRegister' => array( 63 64 'Title' => 'Registrace uživatele', 65 'SubmitText' => 'Registrovat', 64 66 'Table' => 'User', 65 67 'Items' => array( … … 90 92 'PasswordRecovery' => array( 91 93 'Title' => 'Obnova hesla', 94 'SubmitText' => 'Obnovit', 92 95 'Table' => '', 93 96 'Items' => array( 94 97 'Name' => array('Type' => 'String', 'Caption' => 'Přihlašovací jméno', 'Default' => ''), 95 98 'Email' => array('Type' => 'String', 'Caption' => 'E-mail', 'Default' => ''), 99 ), 100 ), 101 'UserLogin' => array( 102 'Title' => 'Přihlášení uživatele', 103 'SubmitText' => 'Přihlásit', 104 'Table' => '', 105 'Items' => array( 106 'Username' => array('Type' => 'String', 'Caption' => 'Přihlašovací jméno', 'Default' => ''), 107 'Password' => array('Type' => 'Password', 'Caption' => 'Heslo', 'Default' => ''), 96 108 ), 97 109 ), -
trunk/forms.php
r187 r202 9 9 var $Values = array(); 10 10 var $OnSubmit = ''; 11 11 12 12 function Form($ClassName) 13 13 { … … 19 19 function ShowEditForm() 20 20 { 21 $Output = '<form action="'.$this->OnSubmit.'" method="post"><center>'.$this->ShowEditBlock().'<input type="submit" value="Uložit"></center></form>'; 21 if(!array_key_exists('SubmitText', $this->Definition)) $this->Definition['SubmitText'] = 'Uložit'; 22 $Output = '<form class="Form" action="'.$this->OnSubmit.'" method="post">'.$this->ShowEditBlock().'<div><input type="submit" value="'.$this->Definition['SubmitText'].'" /></div></form>'; 22 23 return($Output); 23 24 } … … 39 40 case 'Boolean': 40 41 if($this->Values[$Index] == 0) $Checked = ''; else $Checked = ' CHECKED'; 41 $Edit = '<input type="checkbox" name="'.$Context.$Index.'"'.$Checked.' >';42 $Edit = '<input type="checkbox" name="'.$Context.$Index.'"'.$Checked.' />'; 42 43 break; 43 44 case 'String': 44 $Edit = '<input type="text" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" >';45 break; 46 case 'Password': 47 $Edit = '<input type="password" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" >';45 $Edit = '<input type="text" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" />'; 46 break; 47 case 'Password': 48 $Edit = '<input type="password" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" />'; 48 49 break; 49 50 case 'Integer': 50 $Edit = '<input type="text" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" >';51 $Edit = '<input type="text" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" />'; 51 52 break; 52 53 case 'Float': 53 $Edit = '<input type="text" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" >';54 $Edit = '<input type="text" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" />'; 54 55 break; 55 56 case 'Time': 56 57 if($this->Values[$Index] == 'Now') $this->Values[$Index] = date('j.n.Y'); 57 $Edit = '<input type="text" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" >';58 $Edit = '<input type="text" name="'.$Context.$Index.'" value="'.$this->Values[$Index].'" />'; 58 59 break; 59 60 case 'Array': … … 69 70 "scr.parentNode.insertBefore(newcontent, scr); }". 70 71 '</script>'; 71 $Edit .= '<form><input type="button" onclick="AddItem();" value="Přidat položku" ></form>';72 $Edit .= '<form><input type="button" onclick="AddItem();" value="Přidat položku" /></form>'; 72 73 break; 73 74 default: … … 101 102 array_push($Table['Rows'], array($Item['Caption'].':', $Edit)); 102 103 } 103 $Output = '<fieldset style="width: 500px;"><legend>'.$this->Definition['Title'].'</legend>'.Table($Table).104 $Output = '<fieldset><legend>'.$this->Definition['Title'].'</legend>'.Table($Table). 104 105 '</fieldset>'; 105 106 return($Output); … … 166 167 foreach($this->Definition['Items'] as $Index => $Item) 167 168 { 169 if(array_key_exists($Context.$Index, $_POST)) 168 170 switch($Item['Type']) 169 171 { … … 227 229 { 228 230 $Result = '<table class="BasicTable">'; 229 $Result .= '<tr>';230 231 if(array_key_exists('Header', $Table)) 231 232 { 233 $Result .= '<tr>'; 232 234 foreach($Table['Header'] as $Item) 233 235 $Result .= '<th>'.$Item.'</th>'; -
trunk/index.php
r197 r202 68 68 'fun' => array('Zábava', 69 69 array('Youtube', 'http://www.youtube.com/', ''), 70 array('Stream.cz', 'http://www.stream.cz/', ''), 70 71 array('Last.fm', 'http://www.last.fm/', ''), 71 72 ), … … 100 101 function InfoBar() 101 102 { 102 $this->Database->select_db('is'); 103 global $Config; 104 105 $Database->select_db($Config['Database']['Database']); 103 106 104 107 $Output2 = ''; … … 197 200 function GetServerUptime() 198 201 { 199 $Data = explode(' ', exec('uptime'));202 $Data = explode(' ', exec('uptime')); 200 203 $Data = array_slice($Data, 3, -8); 201 204 $Uptime = ''; … … 227 230 if($_GET['Action'] == 'LoginForm') 228 231 { 229 $Output .= '<form action="?Action=Login" method="post"><center><fieldset style="width: 500px;"><legend>Přihlašovací údaje</legend>'. 230 '<table class="hidden">'. 231 '<tr align="left"><td colspan="2">Jméno:</td></tr>'. 232 '<tr align="left"><td colspan="2"><input type="text" name="Username" size="40" maxlength="16" /></td></tr>'. 233 '<tr align="left"><td colspan="2">Heslo:</td></tr>'. 234 '<tr align="left"><td colspan="2"><input type="password" name="Password" size="40" maxlength="16" /></td></tr>'. 235 '<tr><td colspan="2"> </td></tr>'. 236 '<tr align="left">'. 237 //<td><input type="checkbox" name="remember" value="1" checked="checked" /> Trvalé přihlášení</td> 238 '<td align="center" colspan="2"><input type="submit" value="Přihlásit" /></td>'. 239 '</tr>'. 240 '<tr align="left">'. 241 '<td><a href="?Action=UserRegister">Registrovat se</a></td>'. 242 '<td><a href="?Action=PasswordRecovery">Obnova zapomenutého hesla</a></td>'. 243 '</tr>'. 244 '</table>'. 245 '</fieldset></center>'. 246 '</form>'; 247 // $Output .= $this->SystemMessage('Test', $Output); 232 $Form = new Form('UserLogin'); 233 $Form->OnSubmit = '?Action=Login'; 234 $Output .= $Form->ShowEditForm(); 235 $Output .= '<div class="Centred"><a href="?Action=UserRegister">Registrovat se</a> '. 236 '<a href="?Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>'; 248 237 } else 249 238 if($_GET['Action'] == 'Login') 250 239 { 251 $Output .= $this->SystemMessage('Přihlášení', $this->System->Modules['User']->Login($_POST['Username'], $_POST['Password'])); 240 $Form = new Form('UserLogin'); 241 $Form->OnSubmit = '?Action=Login'; 242 $Result = $this->System->Modules['User']->Login($_POST['Username'], $_POST['Password']); 243 $Output .= $this->SystemMessage('Přihlášení', $Result); 244 if($Result <> USER_LOGGED_IN) 245 { 246 $Form->LoadValuesFromForm(); 247 $Form->Values['Password'] = ''; 248 $Output .= $Form->ShowEditForm(); 249 $Output .= '<div class="Centred"><a href="?Action=UserRegister">Registrovat se</a> '. 250 '<a href="?Action=PasswordRecovery">Obnova zapomenutého hesla</a></div>'; 251 } 252 252 } else 253 253 if($_GET['Action'] == 'Logout') … … 275 275 if($_GET['Action'] == 'UserRegister') 276 276 { 277 $UserRegister = new Form('UserRegister'); 278 $UserRegister->OnSubmit = '?Action=UserRegisterSave'; 279 $Output .= $UserRegister->ShowEditForm(); 277 $Form = new Form('UserRegister'); 278 $Form->LoadValuesFromForm(); 279 $Form->OnSubmit = '?Action=UserRegisterSave'; 280 $Output .= $Form->ShowEditForm(); 280 281 } else 281 282 if($_GET['Action'] == 'UserRegisterConfirm') 282 283 { 283 $Output .= $this->SystemMessage('Potvrzení registrace', $this->System->Modules['User']->RegisterConfirm($_GET['User'], $_GET['H']));284 $Output .= $this->SystemMessage('Registrace nového účtu', $this->System->Modules['User']->RegisterConfirm($_GET['User'], $_GET['H'])); 284 285 } else 285 286 if($_GET['Action'] == 'PasswordRecovery') … … 293 294 $Form = new Form('PasswordRecovery'); 294 295 $Form->LoadValuesFromForm(); 295 296 $Output .= $this->SystemMessage('Obnova hesla', $this->System->Modules['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email'])); 296 $Result = $this->System->Modules['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']); 297 $Output .= $this->SystemMessage('Obnova hesla', $Result); 298 if($Result <> USER_PASSWORD_RECOVERY_SUCCESS) 299 { 300 $Output .= $Form->ShowEditForm(); 301 } 297 302 } else 298 303 if($_GET['Action'] == 'PasswordRecoveryConfirm') … … 302 307 if($_GET['Action'] == 'UserRegisterSave') 303 308 { 304 $UserRegister = new Form('UserRegister', array()); 305 $UserRegister->LoadValuesFromForm(); 306 $Output .= $this->SystemMessage('Nastavení', $this->System->Modules['User']->Register($UserRegister->Values['Login'], $UserRegister->Values['Password'], $UserRegister->Values['Password2'], $UserRegister->Values['Email'], $UserRegister->Values['Name'], $UserRegister->Values['PhoneNumber'], $UserRegister->Values['ICQ'])); 309 $Form = new Form('UserRegister', array()); 310 $Form->LoadValuesFromForm(); 311 $Result = $this->System->Modules['User']->Register($Form->Values['Login'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name'], $Form->Values['PhoneNumber'], $Form->Values['ICQ']); 312 $Output .= $this->SystemMessage('Nastavení', $Result); 313 if($Result <> USER_REGISTRATED) 314 { 315 $Form->OnSubmit = '?Action=UserRegisterSave'; 316 $Output .= $Form->ShowEditForm(); 317 } 307 318 } else 308 319 if($_GET['Action'] == 'MemberOptions') … … 344 355 } 345 356 346 $Database->select_db( 'is');357 $Database->select_db($Config['Database']['Database']); 347 358 348 359 //$Output .= $this->InfoBar(); -
trunk/page.php
r197 r202 172 172 function GetOutput() 173 173 { 174 global $Config; 175 174 176 $Output = $this->Show(); 175 177 $Output = $this->ShowHeader($this->FullTitle, $this->ShortTitle).$Output; 176 178 $Output .= $this->ShowFooter(); 177 //echo($this->FormatOutput($Output));178 e cho($Output);179 if($Config['Web']['FormatHTML'] == true) echo($this->FormatOutput($Output)); 180 else echo($Output); 179 181 } 180 182 -
trunk/style.css
r165 r202 179 179 } 180 180 181 .Centred 182 { 183 text-align: center; 184 margin-left: auto; 185 margin-right: auto; 186 } 187 188 .Form 189 { 190 width: 500px; 191 text-align: center; 192 margin-left: auto; 193 margin-right: auto; 194 } 195 181 196 .BasicTable 182 197 { 183 198 width: 100%; 199 text-align: center; 200 margin-left: auto; 201 margin-right: auto; 184 202 } 185 203
Note:
See TracChangeset
for help on using the changeset viewer.