Changeset 896 for trunk/Application/Core.php
- Timestamp:
- Jan 14, 2021, 7:38:26 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Core.php
r895 r896 85 85 { 86 86 return $this->RootURLFolder.$Target; 87 }88 89 function ShowAction(string $Id): string90 {91 $Output = '';92 $DbResult = $this->Database->query('SELECT *, `ActionIcon`.`Name` AS `Icon` FROM `Action` '.93 'LEFT JOIN `ActionIcon` ON `ActionIcon`.`Id` = `Action`.`Icon` '.94 'WHERE (`Action`.`Id`='.$Id.')');95 if ($DbResult->num_rows > 0)96 {97 $Action = $DbResult->fetch_assoc();98 if ($Action['Icon'] == '') $Action['Icon'] = 'clear.png';99 if (substr($Action['URL'], 0, 4) != 'http') $Action['URL'] = $this->Link($Action['URL']);100 if (!defined('NEW_PERMISSION') or ModuleUser::Cast($this->System->GetModule('User'))->User->CheckPermission('System', 'Read', 'Item', $Id))101 $Output .= '<img alt="'.$Action['Title'].'" src="'.$this->Link('/images/favicons/'.$Action['Icon']).102 '" width="16" height="16" /> <a href="'.$Action['URL'].'">'.$Action['Title'].'</a>';103 }104 return $Output;105 87 } 106 88 … … 233 215 unset($this->PageHeaders[$Name]); 234 216 } 217 218 static function Cast(System $System): Core 219 { 220 if ($System instanceof Core) 221 { 222 return $System; 223 } 224 throw new Exception('Expected ModuleSetup type but '.gettype($System)); 225 } 235 226 } 236 227
Note:
See TracChangeset
for help on using the changeset viewer.