Changeset 839 for trunk/Modules/News/NewsPage.php
- Timestamp:
- Sep 18, 2016, 6:41:49 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/News/NewsPage.php
r790 r839 66 66 if($this->System->User->CheckPermission('News', 'Insert', 'Group', $Category['Id'])) 67 67 { 68 $this->System->PageHeaders[] = array($this, 'GetPageHeader'); 68 69 $Output = '<strong>Vložení nové aktuality:</strong><br />'; 69 70 // TODO: Static reference to dynamic category item … … 121 122 $Enclosures = substr($Enclosures, 1); 122 123 123 $_POST['content'] = str_replace("\n",'<br />',$_POST['content']);124 124 $this->Database->insert('News', array('Category' => $Category['Id'], 'Title' => $_POST['title'], 125 125 'Content' => $_POST['content'], 'Date' => 'NOW()', 'IP' => $RemoteAddr, … … 133 133 } 134 134 135 function GetPageHeader() 136 { 137 return('<script src="'.$this->System->Link('/Packages/TinyMCE/tinymce.min.js').'"></script>'. 138 "<script>tinymce.init({ 139 selector: 'textarea', 140 force_p_newlines : false, 141 force_br_newlines : true, 142 convert_newlines_to_brs : false, 143 remove_linebreaks : true, 144 plugins: [ 145 'advlist autolink lists link image charmap print preview anchor', 146 'searchreplace visualblocks code fullscreen', 147 'insertdatetime media table contextmenu paste code' 148 ], 149 toolbar: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image', 150 language: 'cs_CZ', 151 });</script>"); 152 } 153 135 154 function ShowEdit() 136 155 { … … 143 162 if(($this->System->User->User['Id'] == $Row['User'])) 144 163 { 145 $ Row['Content'] = str_replace('<br />', '', $Row['Content']);164 $this->System->PageHeaders[] = array($this, 'GetPageHeader'); 146 165 $Output .= '<strong>Editace aktuality v kategorii '.$Category['Caption'].':</strong><br />'; 147 166 $Output .= '<form action="?action=update" method="post">'. 148 167 '<input type="hidden" value="'.$_GET['id'].'" name="id">'. 149 168 'Nadpis:<br /><input type="text" size="54" name="title" value="'.$Row['Title'].'"><br />'. 150 'Obsah:<br /><textarea name="content" rows="20" cols="40" >'.$Row['Content'].'</textarea><br />'.169 'Obsah:<br /><textarea name="content" rows="20" cols="40" style="width: 50%">'.$Row['Content'].'</textarea><br />'. 151 170 'Odkaz:<br /><input type="text" size="54" name="link" value="'.$Row['Link'].'"><br />'. 152 171 '<input type="hidden" name="category" value="'.$Category['Id'].'"><br />'. … … 172 191 if($this->System->User->User['Id'] == $Row['User']) 173 192 { 174 $_POST['content'] = str_replace("\n", '<br />', $_POST['content']);175 193 $this->Database->update('News', 'Id='.$_POST['id'], array('Title' => $_POST['title'], 176 194 'Content' => $_POST['content'], 'Link' => $_POST['link']));
Note:
See TracChangeset
for help on using the changeset viewer.