Ignore:
Timestamp:
Nov 22, 2013, 10:37:47 PM (11 years ago)
Author:
chronos
Message:
  • Přidáno: Akce zobrazovat přes sjednocenou funkci ShowAction.
  • Přidáno: Chybějící tabulka Model pro seznam modelů.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/System.php

    r595 r597  
    113113  }
    114114 
     115  function ShowAction($Id)
     116  {
     117        $Output = '';
     118    $DbResult = $this->Database->query('SELECT *, `ActionIcon`.`Name` AS `Icon` FROM `Action` '.
     119      'LEFT JOIN `ActionIcon` ON `ActionIcon`.`Id` = `Action`.`Icon` '.
     120      'WHERE (`Action`.`Id`='.$Id.')');
     121    if($DbResult->num_rows > 0)
     122    {
     123      $Action = $DbResult->fetch_assoc();
     124      if($Action['Icon'] == '') $Action['Icon'] = 'clear.png';
     125      if(substr($Action['URL'], 0, 4) != 'http') $Action['URL'] = $this->Link($Action['URL']);
     126      if($this->User->CheckPermission('System', 'Read', 'Item', $Id))
     127        $Output .= '<img alt="'.$Action['Title'].'" src="'.$this->Link('/images/favicons/'.$Action['Icon']).
     128        '" width="16" height="16" /> <a href="'.$Action['URL'].'">'.$Action['Title'].'</a>';
     129    }
     130    return($Output);
     131  }
     132
    115133  function Run()
    116134  {
Note: See TracChangeset for help on using the changeset viewer.