Changeset 660 for trunk/Modules/News/News.php
- Timestamp:
- May 31, 2014, 12:08:52 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/News/News.php
r614 r660 3 3 include_once(dirname(__FILE__).'/NewsPage.php'); 4 4 5 function CategoryItemCompare($Item1, $Item2) 5 function CategoryItemCompare($Item1, $Item2) 6 6 { 7 7 if ($Item1['Index'] == $Item2['Index']) return(0); … … 25 25 $this->SupportedModules = array('Search'); 26 26 } 27 27 28 28 function DoInstall() 29 29 { … … 32 32 function DoUnInstall() 33 33 { 34 } 35 34 } 35 36 36 function DoStart() 37 37 { … … 40 40 'Title' => 'Aktualita', 41 41 'Table' => 'News', 42 'DefaultSortColumn' => 'Date', 43 'DefaultSortOrder' => 1, 42 44 'Items' => array( 43 45 'Category' => array('Type' => 'TNewsCategory', 'Caption' => 'Kategorie', 'Default' => 0), … … 67 69 { 68 70 $this->System->ModuleManager->Modules['Search']->RegisterSearch('Novinky', 'News', array('Title', 'Content')); 69 } 70 } 71 71 } 72 } 73 72 74 function ShowNews($Category, $ItemCount, $DaysAgo) 73 75 { … … 76 78 $DbResult = $this->Database->select('NewsCategory', '*', 'Id='.$Category); 77 79 $Row = $DbResult->fetch_array(); 78 $Output = '<div class="NewsPanel"><div class="Title">'.$Row['Caption']; 80 $Output = '<div class="NewsPanel"><div class="Title">'.$Row['Caption']; 79 81 $Output .= '<div class="Action"><a href="aktuality/?category='.$Category.'">Zobrazit</a>'; 80 82 if($this->System->User->CheckPermission('News', 'Insert', 'Group', $Category)) … … 100 102 101 103 if($Row['Enclosure'] != '') 102 { 104 { 103 105 $Output .= '<br />Přílohy: '; 104 106 $Enclosures = explode(';', $Row['Enclosure']); 105 107 foreach($Enclosures as $Enclosure) 106 108 { 107 if(file_exists($this->UploadedFilesFolder.$Enclosure)) 109 if(file_exists($this->UploadedFilesFolder.$Enclosure)) 108 110 $Output .= ' <a href="'.$this->UploadedFilesFolder.$Enclosure.'">'.$Enclosure.'</a>'; 109 111 } 110 112 } 111 113 $Output .= '</div></td></tr>'; 112 $Index = $Index + 1; 114 $Index = $Index + 1; 113 115 $FontSize = $FontSize - 1; 114 116 } … … 127 129 while($NewsCategory = $DbResult->fetch_array()) 128 130 { 129 $this->NewsSetting[] = array('CategoryId' => $NewsCategory['Id'], 'Index' => $I, 'Enabled' => 1, 131 $this->NewsSetting[] = array('CategoryId' => $NewsCategory['Id'], 'Index' => $I, 'Enabled' => 1, 130 132 'ItemCount' => $this->System->Config['Web']['News']['Count'], 'DaysAgo' => $this->System->Config['Web']['News']['DaysAgo'], 'Group' => $NewsCategory['Group']); 131 133 $I++; … … 166 168 $Output .= '<td style="vertical-align: top; width: '.round(100 / $ColumnCount).'%;">'; 167 169 foreach($this->NewsSetting as $SettingItem) 168 if(($SettingItem['Enabled'] == 1) and ($SettingItem['Group'] == $Column)) 170 if(($SettingItem['Enabled'] == 1) and ($SettingItem['Group'] == $Column)) 169 171 $Output .= $this->ShowNews($SettingItem['CategoryId'], $SettingItem['ItemCount'], $SettingItem['DaysAgo']); 170 172 $Output .= '</td>'; … … 175 177 $Output .= '</div>'; 176 178 return($Output); 177 } 179 } 178 180 179 181 function ShowCustomizeMenu() … … 188 190 $NewsCategory = $DbResult->fetch_array(); 189 191 $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"'; 191 193 $Output .= ' /></td>'. 192 194 '<td align="center"><input type="text" size="2" name="NewsCategoryCount'.$I.'" value="'.$SettingItem['ItemCount'].'" />'. … … 224 226 setcookie('NewsSetting', $_COOKIE['NewsSetting'], time() + 60 * 60 * 24 * 365); 225 227 } 226 228 227 229 function ModifyContent($Content) 228 230 { 229 231 $Result = ''; 230 232 231 233 // Make HTML link from URL 232 234 $I = 0; … … 251 253 $Result .= $Content; 252 254 return($Result); 253 } 255 } 254 256 }
Note:
See TracChangeset
for help on using the changeset viewer.