Changeset 533 for trunk/Modules/News/NewsPage.php
- Timestamp:
- Apr 24, 2013, 10:10:33 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/News/NewsPage.php
r532 r533 36 36 else $Author = $Row['Name']; 37 37 $Output .= '<div class="Panel"><div class="Title">'.$Row['Title'].' ('.HumanDate($Row['Date']).', '.$Author.')'; 38 if( $this->System->User->User['Id'] == $Row['User'])38 if(($this->System->User->User['Id'] == $Row['User']) and ($this->System->User->CheckPermission('News', 'Insert', 'Group', $Category['Id']))) 39 39 { 40 40 $Output .= '<div class="Action">'; … … 63 63 function ShowAdd() 64 64 { 65 $Output = ''; 65 66 $Category = $this->GetCategory(); 66 67 if($this->System->User->CheckPermission('News', 'Insert', 'Group', $Category['Id'])) … … 148 149 'Nadpis:<br /><input type="text" size="54" name="title" value="'.$Row['Title'].'"><br />'. 149 150 'Obsah:<br /><textarea name="content" rows="20" cols="40">'.$Row['Content'].'</textarea><br />'. 150 'Odkaz:<br /><input type="text" size="54" name="link" ><br />'.151 'Odkaz:<br /><input type="text" size="54" name="link" value="'.$Row['Link'].'"><br />'. 151 152 '<input type="hidden" name="category" value="'.$Category['Id'].'"><br />'. 152 153 '<input type="submit" value="Uložit">'. … … 258 259 function GetCategory() 259 260 { 260 $Category = 1; // Default category261 if(array_key_exists('category', $_GET)) $Category = $_GET['category'] * 1;262 if(array_key_exists('category', $_POST)) $Category = $_POST['category'] * 1;263 if(is_null($Category)) throw new Exception('Kategorie neurčena');261 $Category = array('Id' => 1); // Default category 262 if(array_key_exists('category', $_GET)) $Category['Id'] = $_GET['category'] * 1; 263 if(array_key_exists('category', $_POST)) $Category['Id'] = $_POST['category'] * 1; 264 //if(is_null($Category)) throw new Exception('Kategorie neurčena'); 264 265 else 265 266 { 266 $DbResult = $this->Database->select('NewsCategory', '*', '`Id`='.$Category .' ORDER BY `Sequence`');267 $DbResult = $this->Database->select('NewsCategory', '*', '`Id`='.$Category['Id'].' ORDER BY `Sequence`'); 267 268 if($DbResult->num_rows > 0) $Category = $DbResult->fetch_array(); 268 else throw new Exception('Kategorie nenalezena');269 else $Category = array('Id' => 0); //throw new Exception('Kategorie nenalezena'); 269 270 } 270 271 return($Category);
Note:
See TracChangeset
for help on using the changeset viewer.