Legend:
- Unmodified
- Added
- Removed
-
base.php
r26 r27 11 11 } 12 12 13 if($Title == '') $Output = '<div>'.$List['Title'].'</div>';14 else $Output = '<div>'.$Title.'</div>';13 if($Title == '') $Output .= '<div>'.$List['Title'].'</div>'; 14 else $Output .= '<div>'.$Title.'</div>'; 15 15 $Output .= '<table class="WideTable"><tr>'; 16 16 foreach($List['Items'] as $Item) … … 80 80 if(strlen($PageList) != 0) $Output .= $PageList.'<br />'; 81 81 if(CheckPermission('Write', $List['ItemId'])) $Output .= ' <a href="?Action=AddItem&Table='.$List['ItemId'].$ColumnSelection.'">Přidat</a> '.$FullListLink; 82 if(CheckPermission('Read', $List['ItemId'])) $Output .= ' <a href="?Action=ShowSearch&Table='.$List['ItemId'].$ColumnSelection.'">Hledat</a> '.$FullListLink; 82 83 return($Output); 83 84 } … … 374 375 } 375 376 377 function ShowSearch($List) 378 { 379 global $Database; 380 381 if(!CheckPermission('Read', $List['ItemId'])) return(SystemMessage('Řízení přístupu', 'Nemáte dostatečná oprávnění')); 382 $DefinitionItems = array(); 383 $AfterTableOutput = ''; 384 foreach($List['Items'] as $Item) 385 { 386 //echo($Item['Name'].','); 387 $Type = GetTypeDefinition($Item['Type']); 388 if(($Type['BaseType'] != 'PointerOneToMany') and ($Item['Name'] != $Column)) 389 { 390 if($Item['Editable'] == 1) 391 $DefinitionItems[] = array('Name' => $Item['Name'], 'Type' => $Item['Type'], 'Caption' => $Item['TextBefore'], 'Value' => '', 'SourceTable' => $List['ItemId'], 'SourceItemId' => 0); 392 } else 393 if($Item['Name'] == $Column) 394 { 395 $DefinitionItems[] = array('Name' => $Column, 'Type' => TypeHiddenId, 'Caption' => '', 'Value' => $ColumnValue); 396 } 397 } 398 $DefinitionItems[] = array('Name' => 'Column', 'Type' => TypeHiddenId, 'Caption' => '', 'Value' => $Column); 399 400 $Form = new Form(); 401 $Form->Definition = array 402 ( 403 'Title' => 'Hledání', 404 'SubmitBuffonText' => 'Vyhledat', 405 'Items' => $DefinitionItems, 406 ); 407 $Form->OnSubmit = '?Action=Search'; 408 $Output .= $Form->ShowEditForm(); 409 return($Output); 410 } 411 412 function Search($List) 413 { 414 global $Database, $System, $LogActionType; 415 416 if(!CheckPermission('Write', $List['ItemId'])) return(SystemMessage('Řízení přístupu', 'Nemáte dostatečná oprávnění')); 417 $System->Modules['Log']->Add($List['ItemId'], $Id, $LogActionType['Delete']); 418 $System->Modules['DatabaseList']->DeleteItem($List['ItemId'], $Id); 419 $Output = 'Položka smazána.'; 420 $Output .= ShowList($List, $_SESSION['Column'], $_SESSION['ColumnValue']).'<br /><br />'; 421 ExecuteListEvent($List['ItemId'], 'OnDelete', $Id); 422 return($Output); 423 424 $Output = ShowList($List); 425 return($Output); 426 } 427 376 428 function ShowMenu() 377 429 { … … 395 447 return($Output); 396 448 } 449 397 450 398 451 function Output() … … 419 472 switch($_SESSION['Action']) 420 473 { 474 case 'ShowSearch': 475 $Output = ShowSearch($List); 476 break; 421 477 case 'EditItem': 422 478 $Output = ShowEditItem($List, $_SESSION['Item']);
Note:
See TracChangeset
for help on using the changeset viewer.