Changeset 635
- Timestamp:
- Jan 19, 2014, 9:36:28 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Version.php
r634 r635 1 1 <?php 2 2 3 $Revision = 63 4; // Subversion revision3 $Revision = 635; // Subversion revision 4 4 $DatabaseRevision = 633; // SQL structure revision 5 5 $ReleaseTime = strtotime('2014-01-19'); -
trunk/Common/Global.php
r627 r635 13 13 include_once(dirname(__FILE__).'/Mail.php'); 14 14 include_once(dirname(__FILE__).'/Page.php'); 15 include_once(dirname(__FILE__).'/Table.php'); 15 16 include_once(dirname(__FILE__).'/Form/Form.php'); 16 17 include_once(dirname(__FILE__).'/Config.php'); … … 136 137 } 137 138 139 class Pageing 140 { 141 var $TotalCount; 142 var $ItemPerPage; 143 var $Around; 144 145 function __construct() 146 { 147 global $System; 148 149 $this->ItemPerPage = 5; //$System->Config['Web']['ItemsPerPage']; 150 $this->Around = $System->Config['Web']['VisiblePagingItems']; 151 } 152 153 function Show() 154 { 155 $QueryItems = GetQueryStringArray($_SERVER['QUERY_STRING']); 156 157 $Result = ''; 158 if(array_key_exists('all', $QueryItems)) 159 { 160 $PageCount = 1; 161 $ItemPerPage = $this->TotalCount; 162 } else 163 { 164 $ItemPerPage = $this->ItemPerPage; 165 $Around = round($this->Around / 2); 166 $PageCount = floor($this->TotalCount / $ItemPerPage) + 1; 167 } 168 169 if(!array_key_exists('Page', $_SESSION)) $_SESSION['Page'] = 0; 170 if(array_key_exists('page', $_GET)) $_SESSION['Page'] = $_GET['page'] * 1; 171 if($_SESSION['Page'] < 0) $_SESSION['Page'] = 0; 172 if($_SESSION['Page'] >= $PageCount) $_SESSION['Page'] = $PageCount - 1; 173 $CurrentPage = $_SESSION['Page']; 174 175 $Result .= 'Počet položek: <strong>'.$this->TotalCount.'</strong> Stránky: '; 176 177 $Result = ''; 178 if($PageCount > 1) 179 { 180 if($CurrentPage > 0) 181 { 182 $QueryItems['page'] = 0; 183 $Result.= '<a href="?'.SetQueryStringArray($QueryItems).'"><<</a> '; 184 $QueryItems['page'] = ($CurrentPage - 1); 185 $Result.= '<a href="?'.SetQueryStringArray($QueryItems).'"><</a> '; 186 } 187 $PagesMax = $PageCount - 1; 188 $PagesMin = 0; 189 if($PagesMax > ($CurrentPage + $Around)) $PagesMax = $CurrentPage + $Around; 190 if($PagesMin < ($CurrentPage - $Around)) 191 { 192 $Result.= ' ... '; 193 $PagesMin = $CurrentPage - $Around; 194 } 195 for($i = $PagesMin; $i <= $PagesMax; $i++) 196 { 197 if($i == $CurrentPage) $Result.= '<strong>'.($i + 1).'</strong> '; 198 else { 199 $QueryItems['page'] = $i; 200 $Result .= '<a href="?'.SetQueryStringArray($QueryItems).'">'.($i + 1).'</a> '; 201 } 202 } 203 if($PagesMax < ($PageCount - 1)) $Result .= ' ... '; 204 if($CurrentPage < ($PageCount - 1)) 205 { 206 $QueryItems['page'] = ($CurrentPage + 1); 207 $Result.= '<a href="?'.SetQueryStringArray($QueryItems).'">></a> '; 208 $QueryItems['page'] = ($PageCount - 1); 209 $Result.= '<a href="?'.SetQueryStringArray($QueryItems).'">>></a>'; 210 } 211 } 212 $QueryItems['all'] = '1'; 213 if($PageCount > 1) $Result.= ' <a href="?'.SetQueryStringArray($QueryItems).'">Vše</a>'; 214 215 $Result = '<div style="text-align: center">'.$Result.'</div>'; 216 $this->SQLLimit = ' LIMIT '.$CurrentPage * $ItemPerPage.', '.$ItemPerPage; 217 $this->Page = $CurrentPage; 218 return($Result); 219 } 220 } 221 138 222 function GetPageList($TotalCount) 139 223 { -
trunk/Common/Page.php
r634 r635 85 85 if($this->BasicHTML == false) 86 86 { 87 $Output .= '<div class="MainTitle">'.$Title.'</div>88 <div class="Navigation"><span class="MenuItem"><strong>Navigace :: </strong> '.$Navigation.'</span><div class="MenuItem2">';87 //$Output .= '<div class="MainTitle">'.$Title.'</div>'; 88 $Output .= '<div class="MainTitle"><span class="MenuItem"><strong>Navigace :: </strong> '.$Navigation.'</span><div class="MenuItem2">'; 89 89 foreach($this->System->Bars['Top'] as $BarItem) 90 90 $Output .= call_user_func($BarItem); -
trunk/Common/Setup/Setup.php
r619 r635 207 207 208 208 $Output = ''; 209 $PageList = GetPageList(count($this->System->ModuleManager->Modules)); 210 211 $Output .= $PageList['Output']; 212 $Output .= '<table class="WideTable" style="font-size: small;">'; 213 214 $TableColumns = array( 215 array('Name' => 'Name', 'Title' => 'Jméno'), 216 array('Name' => 'Creator', 'Title' => 'Tvůrce'), 217 array('Name' => 'Version', 'Title' => 'Verze'), 218 array('Name' => 'License', 'Title' => 'Licence'), 219 array('Name' => 'Installed', 'Title' => 'Instalováno'), 220 array('Name' => 'Enabled', 'Title' => 'Povoleno'), 221 array('Name' => 'Description', 'Title' => 'Popis'), 222 array('Name' => 'Dependencies', 'Title' => 'Závislosti'), 223 array('Name' => '', 'Title' => 'Akce'), 224 ); 225 $Order = GetOrderTableHeader($TableColumns, 'Name', 0); 226 $Output .= $Order['Output']; 227 209 210 $Pageing = new Pageing(); 211 $Pageing->TotalCount = count($this->System->ModuleManager->Modules); 212 $Table = new Table(); 213 $Table->SetColumns(array( 214 array('Name' => 'Name', 'Title' => 'Jméno'), 215 array('Name' => 'Creator', 'Title' => 'Tvůrce'), 216 array('Name' => 'Version', 'Title' => 'Verze'), 217 array('Name' => 'License', 'Title' => 'Licence'), 218 array('Name' => 'Installed', 'Title' => 'Instalováno'), 219 array('Name' => 'Enabled', 'Title' => 'Povoleno'), 220 array('Name' => 'Description', 'Title' => 'Popis'), 221 array('Name' => 'Dependencies', 'Title' => 'Závislosti'), 222 array('Name' => '', 'Title' => 'Akce'), 223 )); 228 224 foreach($this->System->ModuleManager->Modules as $Module) 229 225 { … … 239 235 } else $Actions .= ' <a href="?action=modules&op=install&name='.$Module->Name.'">Instalovat</a>'; 240 236 241 $Output .= '<tr><td>'.$Module->Name.'</td>'. 242 '<td>'.$Module->Creator.'</td>'. 243 '<td>'.$Module->Version.'</td>'. 244 '<td>'.$Module->License.'</td>'. 245 '<td>'.$YesNo[$Module->Installed].'</td>'. 246 '<td>'.$YesNo[$Module->Enabled].'</td>'. 247 '<td>'.$Module->Description.'</td>'. 248 '<td>'.$Dependencies.'</td>'. 249 '<td>'.$Actions.'</td></tr>'; 250 } 251 $Output .= '</table>'; 252 $Output .= $PageList['Output']; 237 $Table->Cells[] = array($Module->Name, 238 $Module->Creator, $Module->Version, 239 $Module->License, $YesNo[$Module->Installed], 240 $YesNo[$Module->Enabled], $Module->Description, 241 $Dependencies, $Actions); 242 } 243 $Output .= $Pageing->Show(); 244 $Output .= $Table->Show(); 245 $Output .= $Pageing->Show(); 253 246 //$Output .= '<p><a href="?A=SaveToDb">Uložit do databáze</a></p>'; 254 247 return($Output); -
trunk/Common/UTF8.php
r548 r635 31 31 */ 32 32 33 $CharTable = array( 33 class Encoding 34 { 35 function __construct() 36 { 37 $this->CharTable = array( 34 38 'iso2' => array( 35 39 0x80=>"\xc2\x80", … … 520 524 ), 521 525 ); 522 523 524 function ToUTF8($String, $Charset = 'iso2') 525 { 526 global $CharTable; 527 528 $Result = ''; 529 for($I = 0; $I < strlen($String); $I++) 526 } 527 528 function ToUTF8($String, $Charset = 'iso2') 530 529 { 531 if(ord($String[$I]) < 128) $Result .= $String[$I]; 532 else if(ord($String[$I]) > 127) 533 { 534 $Result .= $CharTable[$Charset][ord($String[$I])]; 535 } 530 $Result = ''; 531 for($I = 0; $I < strlen($String); $I++) 532 { 533 if(ord($String[$I]) < 128) $Result .= $String[$I]; 534 else if(ord($String[$I]) > 127) 535 { 536 $Result .= $this->CharTable[$Charset][ord($String[$I])]; 537 } 538 } 539 return($Result); 536 540 } 537 return($Result); 541 542 function FromUTF8($String, $Charset = 'iso2') 543 { 544 $Result = ''; 545 $UTFPrefix = ''; 546 for($I = 0; $I < strlen($String); $I++) 547 { 548 if(ord($String{$I}) & 0x80) // UTF control character 549 { 550 if(ord($String{$I}) & 0x40) // First 551 { 552 if($UTFPrefix != '') $Result .= chr(array_search($UTFPrefix, $this->CharTable[$Charset])); 553 $UTFPrefix = $String{$I}; 554 } 555 else $UTFPrefix .= $String{$I}; // Next 556 } else 557 { 558 if($UTFPrefix != '') $Result .= chr(array_search($UTFPrefix, $this->CharTable[$Charset])); 559 $UTFPrefix = ''; 560 $Result .= $String{$I}; 561 } 562 } 563 return($Result); 564 } 538 565 } 539 540 function FromUTF8($String, $Charset = 'iso2')541 {542 global $CharTable;543 544 $Result = '';545 $UTFPrefix = '';546 for($I = 0; $I < strlen($String); $I++)547 {548 if(ord($String{$I}) & 0x80) // UTF control character549 {550 if(ord($String{$I}) & 0x40) // First551 {552 if($UTFPrefix != '') $Result .= chr(array_search($UTFPrefix, $CharTable[$Charset]));553 $UTFPrefix = $String{$I};554 }555 else $UTFPrefix .= $String{$I}; // Next556 } else557 {558 if($UTFPrefix != '') $Result .= chr(array_search($UTFPrefix, $CharTable[$Charset]));559 $UTFPrefix = '';560 $Result .= $String{$I};561 }562 }563 return($Result);564 } -
trunk/Modules/Finance/Bill.php
r627 r635 20 20 function HtmlToPdf($HtmlCode) 21 21 { 22 $Output = shell_exec('echo "'.addslashes(FromUTF8($HtmlCode)). 22 $Encoding = new Encoding(); 23 $Output = shell_exec('echo "'.addslashes($Encoding->FromUTF8($HtmlCode)). 23 24 '"|htmldoc --no-numbered --webpage --no-embedfonts --charset 8859-2 -t pdf -'); 24 25 return($Output); -
trunk/Modules/News/ImportObecHovezi.php
r622 r635 41 41 42 42 /* 43 //$Content = addslashes(ToUTF8(file_get_contents($SourceURL), 'win1250')); 43 //$Encoding = new Encoding(); 44 //$Content = addslashes($Encoding->ToUTF8(file_get_contents($SourceURL), 'win1250')); 44 45 $Content = file_get_contents($SourceURL); 45 46 while(strpos($Content, $StartText) !== false) -
trunk/Modules/News/ImportTvBeskyd.php
r622 r635 14 14 $Author = 'Automat'; 15 15 16 //$Content = addslashes(ToUTF8(file_get_contents($SourceURL), 'win1250')); 16 //$Encoding = new Encoding(); 17 //$Content = addslashes($Encoding->ToUTF8(file_get_contents($SourceURL), 'win1250')); 17 18 $Content = file_get_contents($SourceURL); 18 19 while(strpos($Content, $StartText) !== false)
Note:
See TracChangeset
for help on using the changeset viewer.