Changeset 430 for trunk/is/index.php
- Timestamp:
- Oct 11, 2012, 7:16:33 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/is/index.php
r429 r430 14 14 global $FormClasses; 15 15 16 //if(!$this->System->Modules['User']->CheckPermission('IS', 'Manage'))17 //return('Nemáte oprávnění');16 if(!$this->System->Modules['User']->CheckPermission('IS', 'Manage')) 17 return('Nemáte oprávnění'); 18 18 19 19 $DbResult = $this->Database->select('ISMenuItem', '*'); … … 24 24 25 25 $Output = '<table style="width: 100%"><tr><td style="width: 20%; vertical-align: top;">'; 26 $Output .= $this->ShowMenuItem('');26 $Output .= '<strong>Nabídka:</strong><br/>'.$this->ShowMenuItem(''); 27 27 $Output .= '</td><td style="width: 80%; vertical-align: top;">'; 28 if(array_key_exists('t', $_GET)) 28 29 if(array_key_exists('t', $_GET)) $_SESSION['Table'] = $_GET['t']; 30 if(array_key_exists('a', $_GET)) $_SESSION['Action'] = $_GET['a']; 31 if(array_key_exists('id', $_GET)) $_SESSION['Id'] = $_GET['id']; 32 33 if($_SESSION['Action'] == 'list') 29 34 { 30 $DbResult = $this->Database->select('ISMenuItem', '*', 'Id='.$_GET['t'] * 1); 31 $MenuItem = $DbResult->fetch_assoc(); 32 $Output .= $this->ShowTable($FormClasses[$MenuItem['Table']]); 35 if(array_key_exists('Table', $_SESSION)) 36 $Output .= $this->ShowTable($FormClasses[$_SESSION['Table']]); 37 } else 38 if($_SESSION['Action'] == 'edit') 39 { 40 $Form = new Form($_SESSION['Table']); 41 $Form->LoadValuesFromDatabase($_SESSION['Id']); 42 $Form->OnSubmit = '?a=view'; 43 $Output .= $Form->ShowEditForm(); 44 } else 45 if($_SESSION['Action'] == 'view') 46 { 47 48 } else 49 if($_SESSION['Action'] == 'delete') 50 { 51 33 52 } 34 53 $Output .= '</td></tr></table>'; … … 50 69 foreach($FormClass['Items'] as $ItemIndex => $FormItem) 51 70 $TableColumns[] = array('Name' => $ItemIndex, 'Title' => $FormItem['Caption']); 71 $TableColumns[] = array('Name' => '', 'Title' => 'Akce'); 52 72 $Order = GetOrderTableHeader($TableColumns, 'Name', 0); 53 73 $Output .= $Order['Output']; 54 74 55 75 $Query = 'SELECT * FROM `'.$FormClass['Table'].'` '.$Order['SQL'].$PageList['SQLLimit']; 56 76 57 77 $DbResult = $this->Database->query($Query); 58 78 while($Row = $DbResult->fetch_assoc()) … … 63 83 //$Output .= '<td>'.$Row[$ItemIndex].'</td>'; 64 84 if(array_key_exists($FormItem['Type'], $FormTypes)) 65 $Output .= '<td>'.$Type->ExecuteTypeEvent('OneToMany', 'OnView', 85 { 86 if(!array_key_exists($FormItem['Type'], $this->System->Type->TypeDefinitionList)) 87 $this->System->Type->RegisterType($FormItem['Type'], '', 88 $FormTypes[$FormItem['Type']]); 89 $Output .= '<td>'.$this->System->Type->ExecuteTypeEvent('OneToMany', 'OnView', 66 90 array('Value' => $Row[$ItemIndex], 'Name' => $ItemIndex, 67 'Type' => array('Parameters' => array($FormTypes[$FormItem['Type']]))).'</td>';68 else $Output .= '<td>'.$Type->ExecuteTypeEvent($FormItem['Type'], 'OnView',91 'Type' => $FormItem['Type'])).'</td>'; 92 } else $Output .= '<td>'.$this->System->Type->ExecuteTypeEvent($FormItem['Type'], 'OnView', 69 93 array('Value' => $Row[$ItemIndex], 'Name' => $ItemIndex)).'</td>'; 70 94 } 95 $Output .= '<td><a href="?a=view&id='.$Row['Id'].'"><img alt="Ukázat" title="Ukázat" src="'. 96 $this->System->Link('/images/view.png').'"/></a>'. 97 '<a href="?a=edit&id='.$Row['Id'].'"><img alt="Upravit" title="Upravit" src="'. 98 $this->System->Link('/images/edit.png').'"/></a>'. 99 '<a href="?a=delete&id='.$Row['Id'].'"><img alt="Smazat" title="Smazat" src="'. 100 $this->System->Link('/images/delete.png').'"/></a></td>'; 71 101 $Output .= '</tr>'; 72 102 } 73 103 $Output .= '</table>'; 74 104 $Output .= $PageList['Output']; 105 $Output .= '<br/><div style="text-align: center;"><a href="?a=add"><img alt="Přidat" title="Přidat" src="'. 106 $this->System->Link('/images/add.png').'"/></a></div>'; 75 107 return($Output); 76 108 } … … 78 110 function ShowMenuItem($Parent) 79 111 { 80 $Output = '<ul >';112 $Output = '<ul style="list-style: none; margin-left:1em; padding-left:0em;">'; 81 113 foreach($this->MenuItems as $MenuItem) 82 114 if($MenuItem['Parent'] == $Parent) 83 115 { 84 116 $LinkTitle = $MenuItem['Name']; 85 if($MenuItem['Table'] != '') $LinkTitle = MakeLink('?t='.$MenuItem[' Id'], $LinkTitle);117 if($MenuItem['Table'] != '') $LinkTitle = MakeLink('?t='.$MenuItem['Table'].'&a=list', $LinkTitle); 86 118 $Output .= '<li>'.$LinkTitle.'</li>'; 87 119 $Output .= $this->ShowMenuItem($MenuItem['Id']);
Note:
See TracChangeset
for help on using the changeset viewer.