Ignore:
Timestamp:
May 31, 2014, 12:08:52 AM (10 years ago)
Author:
chronos
Message:
  • Přidáno: Nyní lze v definici formulářových struktůr vybrat výchozí směr řazení.
  • Opraveno: V typu TimeDiff nezobrazovat nulový údaj pokud je hodnota null.
File:
1 edited

Legend:

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

    r614 r660  
    33include_once(dirname(__FILE__).'/NewsPage.php');
    44
    5 function CategoryItemCompare($Item1, $Item2) 
     5function CategoryItemCompare($Item1, $Item2)
    66{
    77  if ($Item1['Index'] == $Item2['Index']) return(0);
     
    2525    $this->SupportedModules = array('Search');
    2626  }
    27  
     27
    2828  function DoInstall()
    2929  {
     
    3232  function DoUnInstall()
    3333  {
    34   } 
    35  
     34  }
     35
    3636  function DoStart()
    3737  {
     
    4040      'Title' => 'Aktualita',
    4141      'Table' => 'News',
     42      'DefaultSortColumn' => 'Date',
     43      'DefaultSortOrder' => 1,
    4244      'Items' => array(
    4345        'Category' => array('Type' => 'TNewsCategory', 'Caption' => 'Kategorie', 'Default' => 0),
     
    6769    {
    6870      $this->System->ModuleManager->Modules['Search']->RegisterSearch('Novinky', 'News', array('Title', 'Content'));
    69     } 
    70   }
    71  
     71    }
     72  }
     73
    7274  function ShowNews($Category, $ItemCount, $DaysAgo)
    7375  {
     
    7678    $DbResult = $this->Database->select('NewsCategory', '*', 'Id='.$Category);
    7779    $Row = $DbResult->fetch_array();
    78     $Output = '<div class="NewsPanel"><div class="Title">'.$Row['Caption'];     
     80    $Output = '<div class="NewsPanel"><div class="Title">'.$Row['Caption'];
    7981    $Output .= '<div class="Action"><a href="aktuality/?category='.$Category.'">Zobrazit</a>';
    8082    if($this->System->User->CheckPermission('News', 'Insert', 'Group', $Category))
     
    100102
    101103        if($Row['Enclosure'] != '')
    102         { 
     104        {
    103105          $Output .= '<br />Přílohy: ';
    104106          $Enclosures = explode(';', $Row['Enclosure']);
    105107          foreach($Enclosures as $Enclosure)
    106108          {
    107             if(file_exists($this->UploadedFilesFolder.$Enclosure)) 
     109            if(file_exists($this->UploadedFilesFolder.$Enclosure))
    108110              $Output .= ' <a href="'.$this->UploadedFilesFolder.$Enclosure.'">'.$Enclosure.'</a>';
    109111          }
    110112        }
    111113        $Output .= '</div></td></tr>';
    112         $Index = $Index + 1;   
     114        $Index = $Index + 1;
    113115        $FontSize = $FontSize - 1;
    114116      }
     
    127129    while($NewsCategory = $DbResult->fetch_array())
    128130    {
    129       $this->NewsSetting[] = array('CategoryId' => $NewsCategory['Id'], 'Index' => $I, 'Enabled' => 1, 
     131      $this->NewsSetting[] = array('CategoryId' => $NewsCategory['Id'], 'Index' => $I, 'Enabled' => 1,
    130132        'ItemCount' => $this->System->Config['Web']['News']['Count'], 'DaysAgo' => $this->System->Config['Web']['News']['DaysAgo'], 'Group' => $NewsCategory['Group']);
    131133      $I++;
     
    166168      $Output .= '<td style="vertical-align: top; width: '.round(100 / $ColumnCount).'%;">';
    167169      foreach($this->NewsSetting as $SettingItem)
    168         if(($SettingItem['Enabled'] == 1) and ($SettingItem['Group'] == $Column)) 
     170        if(($SettingItem['Enabled'] == 1) and ($SettingItem['Group'] == $Column))
    169171          $Output .= $this->ShowNews($SettingItem['CategoryId'], $SettingItem['ItemCount'], $SettingItem['DaysAgo']);
    170172      $Output .= '</td>';
     
    175177    $Output .= '</div>';
    176178    return($Output);
    177   } 
     179  }
    178180
    179181  function ShowCustomizeMenu()
     
    188190      $NewsCategory = $DbResult->fetch_array();
    189191      $Output .= '<tr><td>'.$NewsCategory['Caption'].'</td><td align="center"><input type="text" size="2" name="NewsCategoryIndex'.$I.'" value="'.$SettingItem['Index'].'" /></td><td align="center"><input type="checkbox" name="NewsCategoryEnabled'.$I.'"';
    190       if($SettingItem['Enabled'] == 1) $Output .= ' checked="checked"'; 
     192      if($SettingItem['Enabled'] == 1) $Output .= ' checked="checked"';
    191193      $Output .= ' /></td>'.
    192194      '<td align="center"><input type="text" size="2" name="NewsCategoryCount'.$I.'" value="'.$SettingItem['ItemCount'].'" />'.
     
    224226    setcookie('NewsSetting', $_COOKIE['NewsSetting'], time() + 60 * 60 * 24 * 365);
    225227  }
    226  
     228
    227229  function ModifyContent($Content)
    228230  {
    229231    $Result = '';
    230  
     232
    231233    // Make HTML link from URL
    232234    $I = 0;
     
    251253    $Result .= $Content;
    252254    return($Result);
    253   } 
     255  }
    254256}
Note: See TracChangeset for help on using the changeset viewer.