Ignore:
Timestamp:
Jan 30, 2011, 12:13:45 PM (14 years ago)
Author:
george
Message:
  • Upraveno: Aktuality zobrazovány nyní jako dva sloupce v jednom panelu.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/aktuality/news.php

    r302 r305  
    9797    while($NewsCategory = $DbResult->fetch_array())
    9898    {
    99       $this->NewsSetting[] = array('CategoryId' => $NewsCategory['Id'], 'Index' => $I, 'Enabled' => 1, 'ItemCount' => $this->System->Config['Web']['News']['Count'], 'DaysAgo' => $this->System->Config['Web']['News']['DaysAgo']);
     99      $this->NewsSetting[] = array('CategoryId' => $NewsCategory['Id'], 'Index' => $I, 'Enabled' => 1, 'ItemCount' => $this->System->Config['Web']['News']['Count'], 'DaysAgo' => $this->System->Config['Web']['News']['DaysAgo'], 'Group' => $NewsCategory['Group']);
    100100      $I++;
    101101    }
     
    130130    $Output .= '<div onmouseout="skryj(predchozi)">';
    131131
    132     foreach($this->NewsSetting as $SettingItem)
    133       if($SettingItem['Enabled'] == 1) $Output .= $this->ShowNews($SettingItem['CategoryId'], $SettingItem['ItemCount'], $SettingItem['DaysAgo']);
     132    $ColumnCount = 2;
     133    $Output .= '<table style="width: 100%"><tr>';
     134    for($Column = 1; $Column <= $ColumnCount; $Column++)
     135    {
     136      $Output .= '<td style="vertical-align: top; width: '.round(100 / $ColumnCount).'%;">';
     137      foreach($this->NewsSetting as $SettingItem)
     138        if(($SettingItem['Enabled'] == 1) and ($SettingItem['Group'] == $Column))
     139          $Output .= $this->ShowNews($SettingItem['CategoryId'], $SettingItem['ItemCount'], $SettingItem['DaysAgo']);
     140      $Output .= '</td>';
     141    }
     142    $Output .= '</tr></table>';
    134143
    135144    $Output .= '<a href="aktuality/subscription.php"><img class="RSSIcon" src="images/rss20.png" alt="Aktuality přes RSS" /></a>  <a href="aktuality/subscription.php">Automatické sledování novinek</a>';
     
    142151    $Output = '<form action="?Action=CustomizeNewsSave" method="post">';
    143152    $Output .= '<table width="100%" cellspacing="0" border="1"><tr><td><table cellspacing="0" width="100%">';
    144     $Output .= '<tr><th>Kategorie</th><th>Pozice</th><th>Zobrazit</th><th>Max. počet</th><th>Posledních dnů</th></tr>';
     153    $Output .= '<tr><th>Kategorie</th><th>Pozice</th><th>Zobrazit</th><th>Max. počet</th><th>Posledních dnů</th><th>Sloupec</th></tr>';
    145154    $I = 0;
    146155    foreach($this->NewsSetting as $SettingItem)
     
    153162      '<td align="center"><input type="text" size="2" name="NewsCategoryCount'.$I.'" value="'.$SettingItem['ItemCount'].'" />'.
    154163      '<input type="hidden" name="NewsCategoryId'.$I.'" value="'.$SettingItem['CategoryId'].'" /></td>'.
    155     '<td align="center"><input type="text" size="3" name="NewsCategoryDaysAgo'.$I.'" value="'.$SettingItem['DaysAgo'].'" /></td></tr>';
     164      '<td align="center"><input type="text" size="3" name="NewsCategoryDaysAgo'.$I.'" value="'.$SettingItem['DaysAgo'].'" /></td>'.
     165      '<td><input type="text" size="3" name="NewsColumn'.$I.'" value="'.$SettingItem['Group'].'"/></td></tr>';
    156166      $I++;
    157167    }
     
    169179      if(($_POST['NewsCategoryDaysAgo'.$I] * 1) < 0) $_POST['NewsCategoryIndex'.$I] = 0;
    170180      if(($_POST['NewsCategoryCount'.$I] * 1) < 0) $_POST['NewsCategoryCount'.$I] = 0;
     181      if(($_POST['NewsColumn'.$I] * 1) < 1) $_POST['NewsColumn'.$I] = 1;
    171182      if(!array_key_exists('NewsCategoryEnabled'.$I, $_POST)) $_POST['NewsCategoryEnabled'.$I] = '';
    172       $Setting[] = array('CategoryId' => $_POST['NewsCategoryId'.$I], 'Enabled' => $Checkbox[$_POST['NewsCategoryEnabled'.$I]], 'ItemCount' => ($_POST['NewsCategoryCount'.$I]*1), 'DaysAgo' => ($_POST['NewsCategoryDaysAgo'.$I]*1), 'Index' => ($_POST['NewsCategoryIndex'.$I]*1));
     183      $Setting[] = array('CategoryId' => $_POST['NewsCategoryId'.$I], 'Enabled' => $Checkbox[$_POST['NewsCategoryEnabled'.$I]], 'ItemCount' => ($_POST['NewsCategoryCount'.$I]*1), 'DaysAgo' => ($_POST['NewsCategoryDaysAgo'.$I]*1), 'Index' => ($_POST['NewsCategoryIndex'.$I]*1),
     184      'Group' => $_POST['NewsColumn'.$I]);
    173185    }
    174186    // Sort indexes
Note: See TracChangeset for help on using the changeset viewer.