Changeset 684 for trunk/Modules/IS/IS.php
- Timestamp:
- Aug 13, 2014, 10:34:27 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/IS/IS.php
r678 r684 9 9 var $ParentClass = 'PagePortal'; 10 10 var $MenuItems; 11 var $HideMenu = false; 11 var $HideMenu; 12 var $ShowActionName; 13 14 function __construct($System) 15 { 16 parent::__construct($System); 17 $this->MenuItems = array(); 18 $this->HideMenu = false; 19 $this->ShowActionName = false; 20 } 12 21 13 22 function Show() … … 141 150 $Output .= $Form->ShowEditForm(); 142 151 $Output .= '<ul class="ActionMenu">'; 143 $Output .= '<li> <a href="?a=view&t='.$Table.'&i='.$Id.'"><img alt="Prohlížet" title="Prohlížet" src="'.144 $this->System->Link('/images/view.png') .'"/>Prohlížet</a></li>';145 $Output .= '<li> <a href="?a=list&t='.$Table.'"><img alt="Seznam" title="Seznam" src="'.146 $this->System->Link('/images/list.png') .'"/>Seznam</a></li>';147 $Output .= '<li> <a href="?a=delete&t='.$Table.'&i='.$Id.'" onclick="return confirmAction(\'Opravdu smazat položku?\');"><img alt="Odstranit" title="Odstranit" src="'.148 $this->System->Link('/images/delete.png') .'"/>Odstranit</a></li>';152 $Output .= '<li>'.$this->ShowAction('Prohlížet', '?a=view&t='.$Table.'&i='.$Id, 153 $this->System->Link('/images/view.png')); 154 $Output .= '<li>'.$this->ShowAction('Seznam', '?a=list&t='.$Table, 155 $this->System->Link('/images/list.png')); 156 $Output .= '<li>'.$this->ShowAction('Odstranit', '?a=delete&t='.$Table.'&i='.$Id, 157 $this->System->Link('/images/delete.png'), 'Opravdu smazat položku'); 149 158 $Output .= '</ul>'; 150 159 } … … 159 168 $Output .= $Form->ShowEditForm(); 160 169 $Output .= '<ul class="ActionMenu">'; 161 $Output .= '<li> <a href="?a=view&t='.$Table.'&i='.$Id.'"><img alt="Prohlížet" title="Prohlížet" src="'.162 $this->System->Link('/images/view.png').'"/>Prohlížet</a></li>';163 $Output .= '<li> <a href="?a=list&t='.$Table.'"><img alt="Seznam" title="Seznam" src="'.164 $this->System->Link('/images/list.png') .'"/>Seznam</a></li>';165 $Output .= '<li> <a href="?a=delete&t='.$Table.'&i='.$Id.'" onclick="return confirmAction(\'Opravdu smazat položku?\');"><img alt="Odstranit" title="Odstranit" src="'.166 $this->System->Link('/images/delete.png') .'"/>Odstranit</a></li>';170 $Output .= '<li>'.$this->ShowAction('Prohlížet', '?a=view&t='.$Table.'&i='.$Id, 171 $this->System->Link('/images/view.png')); 172 $Output .= '<li>'.$this->ShowAction('Seznam', '?a=list&t='.$Table, 173 $this->System->Link('/images/list.png')); 174 $Output .= '<li>'.$this->ShowAction('Odstranit', '?a=delete&t='.$Table.'&i='.$Id, 175 $this->System->Link('/images/delete.png'), 'Opravdu smazat položku?'); 167 176 $Output .= '</ul>'; 168 177 } … … 269 278 $Form->OnSubmit = '?a='.$_GET['a'].'&t='.$Table.'&o=save'.$URL; 270 279 $Output .= $Form->ShowEditForm(); 271 $Actions[] = '<a href="?a=list&t='.$Table.'"><img alt="Seznam" title="Seznam" src="'.272 $this->System->Link('/images/list.png') .'"/>Seznam</a>';280 $Actions[] = $this->ShowAction('Seznam', '?a=list&t='.$Table, 281 $this->System->Link('/images/list.png')); 273 282 } 274 283 $Output .= '<ul class="ActionMenu">'; … … 307 316 { 308 317 $Actions = array( 309 '<a href="?a=edit&t='.$Table.'&i='.$Id.'"><img alt="Upravit" title="Upravit" src="'. 310 $this->System->Link('/images/edit.png').'"/>Upravit</a>', 311 '<a href="?a=list&t='.$Table.'"><img alt="Seznam" title="Seznam" src="'. 312 $this->System->Link('/images/list.png').'"/>Seznam</a>', 313 '<a href="?a=delete&t='.$Table.'&i='.$Id.'" onclick="return confirmAction(\'Opravdu smazat položku?\');"><img alt="Odstranit" title="Odstranit" src="'. 314 $this->System->Link('/images/delete.png').'" />Odstranit</a>', 315 '<a href="?a=add&t='.$Table.'"><img alt="Přidat" title="Přidat" src="'. 316 $this->System->Link('/images/add.png').'"/>Přidat</a>'); 318 $this->ShowAction('Upravit', '?a=edit&t='.$Table.'&i='.$Id, 319 $this->System->Link('/images/edit.png')), 320 $this->ShowAction('Seznam', '?a=list&t='.$Table, 321 $this->System->Link('/images/list.png')), 322 $this->ShowAction('Odstranit', '?a=delete&t='.$Table.'&i='.$Id, 323 $this->System->Link('/images/delete.png'), 'Opravdu smazat položku?'), 324 $this->ShowAction('Přidat', '?a=add&t='.$Table, 325 $this->System->Link('/images/add.png')) 326 ); 317 327 if(array_key_exists('ItemActions', $FormClass)) 318 328 { … … 323 333 else if((substr($URL, -5, 5) !== '&') and (substr($URL, -1, 1) !== '?')) $URL .= '&'; 324 334 $URL .= 'i='.$Id; 325 $Actions[] = '<a href="'.$URL.'"><img alt="'.$Action['Caption'].'" title="'.$Action['Caption'].'" src="'.326 $this->System->Link('/images/action.png').'"/>'.$Action['Caption'].'</a>';335 $Actions[] = $this->ShowAction($Action['Caption'], $URL, 336 $this->System->Link('/images/action.png')); 327 337 } 328 338 } … … 442 452 $PageList = GetPageList($TotalFilteredCount); 443 453 444 $Output = '<div style="text-align: center;">'.$FormClass['Title'].'</div>'; 445 $Output .= $PageList['Output']; 454 $Output = $PageList['Output']; 446 455 $Output .= '<table class="WideTable" style="font-size: small;">'; 447 456 … … 548 557 function ShowList($Table, $Filter = '', $Title = '', $ExcludeColumn = '', $ExcludeValue = '') 549 558 { 559 $Output = ''; 550 560 if(defined('NEW_PERMISSION') and !$this->System->User->CheckPermission($this->TableToModule($Table), 'Read')) 551 561 return('Nemáte oprávnění'); … … 571 581 } 572 582 } 573 $Output = $this->ShowTable($Table, $Filter, $Title, $RowActions, $ExcludeColumn);583 $Output .= '<div style="text-align: center;">'.$FormClass['Title'].'</div>'; 574 584 $Output .= '<ul class="ActionMenu">'; 575 $Output .= '<li><a href="?a=add&t='.$Table.'&preset'.$ExcludeColumn.'='.$ExcludeValue.'"><img alt="Přidat" title="Přidat" src="'. 576 $this->System->Link('/images/add.png').'"/>Přidat</a></li>'; 577 $Output .= '<li><a href="?a=list&t='.$Table.'"><img alt="Seznam" title="Seznam" src="'. 578 $this->System->Link('/images/list.png').'"/>Seznam</a></li>'; 585 $Output .= '<li>'.$this->ShowAction('Přidat', '?a=add&t='.$Table.'&preset'.$ExcludeColumn.'='.$ExcludeValue, $this->System->Link('/images/add.png')).'</li>'; 586 $Output .= '<li>'.$this->ShowAction('Seznam', '?a=list&t='.$Table, $this->System->Link('/images/list.png')).'</li>'; 579 587 $MI = 0; 580 588 if(array_key_exists('mi', $_GET)) … … 585 593 $DbRow = $DbResult->fetch_assoc(); 586 594 $Fav = $DbRow['Id']; 587 $Output .= '<li> <a href="?a=fav_del&t='.$Table.'&i='.$_GET['mi'].'&mi='.$_GET['mi'].'"><img alt="Odebrat z oblíbených" title="Odebrat z oblíbených" src="'.588 $this->System->Link('/images/Favorite-Del.png') .'"/>Odebrat z oblíbených</a></li>';589 } else $Output .= '<li> <a href="?a=fav_add&t='.$Table.'&i='.$_GET['mi'].'&mi='.$_GET['mi'].'"><img alt="Přidat do oblíbených" title="Přidat do oblíbených" src="'.590 $this->System->Link('/images/Favorite-Add.png') .'"/>Přidat do oblíbených</a></li>';595 $Output .= '<li>'.$this->ShowAction('Odebrat z oblíbených', '?a=fav_del&t='.$Table.'&i='.$_GET['mi'].'&mi='.$_GET['mi'], 596 $this->System->Link('/images/Favorite-Del.png')).'</li>'; 597 } else $Output .= '<li>'.$this->ShowAction('Přidat do oblíbených', '?a=fav_add&t='.$Table.'&i='.$_GET['mi'].'&mi='.$_GET['mi'], 598 $this->System->Link('/images/Favorite-Add.png')).'</li>'; 591 599 } 592 600 if(array_key_exists('Actions', $FormClass)) 593 601 { 594 602 foreach($FormClass['Actions'] as $Action) 595 $Output .= '<li> <a href="'.$this->System->Link($Action['URL']).'"><img alt="'.$Action['Caption'].'" title="'.$Action['Caption'].'" src="'.596 $this->System->Link('/images/action.png') .'"/>'.$Action['Caption'].'</a></li>';603 $Output .= '<li>'.$this->ShowAction($Action['Caption'], $this->System->Link($Action['URL']), 604 $this->System->Link('/images/action.png')).'</li>'; 597 605 } 598 606 $Output .= '</ul>'; 607 $Output .= $this->ShowTable($Table, $Filter, $Title, $RowActions, $ExcludeColumn); 599 608 return($Output); 600 609 } … … 665 674 return($DbRow['Name']); 666 675 } else return(''); 676 } 677 678 function ShowAction($Name, $Target, $Icon, $Confirm = '') 679 { 680 $Output = '<img alt="'.$Name.'" title="'.$Name.'" src="'. 681 $Icon.'"/>'; 682 if($this->ShowActionName) $Output .= $Name; 683 if($Confirm != '') 684 $Confirm = ' onclick="return confirmAction(\''.$Confirm.'\');"'; 685 $Output = '<a href="'.$Target.'"'.$Confirm.'>'.$Output.'</a>'; 686 return($Output); 667 687 } 668 688 }
Note:
See TracChangeset
for help on using the changeset viewer.