Changeset 526 for trunk/Modules/Portal


Ignore:
Timestamp:
Apr 21, 2013, 10:23:56 PM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Tabulka HyperLink přejmenována na obecnější název Action. Odkazy na názvy ikony přepracovány na samostatnou tabulku.
  • Upraveno: Funkce týkající se fronty mailů odděleny do samostatného souboru.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Portal/Portal.php

    r524 r526  
    88  var $ShortTitle = 'Rozcestník';
    99 
    10   function ShowLinks($HyperlinkGroup)
     10  function ShowActions($ActionGroup)
    1111  {
    1212    $Output = '';
    13     $DbResult = $this->Database->query('SELECT * FROM `Hyperlink` WHERE (`Group`='.$HyperlinkGroup['Id'].') AND (`Enable` = 1)');
    14     while($HyperLink = $DbResult->fetch_assoc())
    15     {
    16       if($HyperLink['IconFile'] == '') $HyperLink['IconFile'] = 'clear.png';
    17         if(substr($HyperLink['URL'], 0, 4) != 'http') $HyperLink['URL'] = $this->System->Config['Web']['RootFolder'].$HyperLink['URL'];
    18         if(($HyperLink['PermissionModule'] == '') or (($HyperLink['PermissionModule'] != '') and $this->System->User->User->CheckPermission($HyperLink['PermissionModule'], $HyperLink['PermissionOperation'])))       
    19         $Output .= '<img alt="'.$HyperLink['Name'].'" src="images/favicons/'.$HyperLink['IconFile'].'" width="16" height="16" /> <a href="'.$HyperLink['URL'].'">'.$HyperLink['Name'].'</a><br />';
    20     }
    21     return($this->Panel($HyperlinkGroup['Name'], $Output));
     13    $DbResult = $this->Database->query('SELECT *, `ActionIcon`.`Name` AS `Icon` FROM `Action` LEFT JOIN `ActionIcon` ON `ActionIcon`.`Id` = `Action`.`Icon` '.
     14      'WHERE (`Group`='.$ActionGroup['Id'].') AND (`Enable` = 1)');
     15    while($Action = $DbResult->fetch_assoc())
     16    {
     17      if($Action['Icon'] == '') $Action['Icon'] = 'clear.png';
     18        if(substr($Action['URL'], 0, 4) != 'http') $Action['URL'] = $this->System->Link($Action['URL']);
     19        if(($Action['PermissionModule'] == '') or (($Action['PermissionModule'] != '') and $this->System->User->User->CheckPermission($Action['PermissionModule'], $Action['PermissionOperation'])))       
     20        $Output .= '<img alt="'.$Action['Title'].'" src="images/favicons/'.$Action['Icon'].'" width="16" height="16" /> <a href="'.$Action['URL'].'">'.$Action['Title'].'</a><br />';
     21    }
     22    return($this->Panel($ActionGroup['Name'], $Output));
    2223  }
    2324
     
    305306    }
    306307
    307     $DbResult = $this->Database->query('SELECT * FROM `HyperlinkGroup`');
     308    $DbResult = $this->Database->query('SELECT * FROM `ActionGroup`');
    308309    while($DbRow = $DbResult->fetch_assoc())
    309       $HyperlinkGroups[$DbRow['Id']] = $DbRow;
     310      $ActionGroups[$DbRow['Id']] = $DbRow;
    310311
    311312    // Show pannels
     
    322323      while($Panel = $DbResult2->fetch_assoc())
    323324      {
    324         if($Panel['Module'] == 'HyperlinkGroup') $Output .= $this->ShowLinks($HyperlinkGroups[$Panel['Parameters']]);
     325        if($Panel['Module'] == 'ActionGroup') $Output .= $this->ShowActions($ActionGroups[$Panel['Parameters']]);
    325326        else if($Panel['Module'] == 'OnlineHostList') $Output .= $this->Panel('Online počítače', $this->OnlineHostList());
    326327        else if($Panel['Module'] == 'UserOptions')
Note: See TracChangeset for help on using the changeset viewer.