Changeset 45 for trunk/news_admin/inc/class.uinews.inc.php
- Timestamp:
- 08/06/07 08:53:24 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/news_admin/inc/class.uinews.inc.php
r2 r45 13 13 \**************************************************************************/ 14 14 15 /* $Id$ */ 15 16 16 17 class uinews … … 278 279 if($_POST['submitit']) 279 280 { 281 $_POST['news']['is_html'] = '1'; 280 282 $this->news_data = $_POST['news']; 281 283 if(!$this->news_data['subject']) 282 284 { 283 $errors[] = lang('The subject is missing ');285 $errors[] = lang('The subject is missing.'); 284 286 } 285 287 if(!$this->news_data['content']) 286 288 { 287 $errors[] = lang('The news content is missing ');289 $errors[] = lang('The news content is missing.'); 288 290 } 289 291 if(!is_array($errors)) 290 292 { 291 293 $this->news_data['date'] = time(); 292 $this->news_data['content'] = @htmlentities($this->news_data['content']);294 293 295 $this->bo->set_dates($_POST['from'],$_POST['until'],$this->news_data); 294 296 $this->news_id = $this->bo->add($this->news_data); … … 383 385 if(!is_array($errors)) 384 386 { 385 $this->news_data['content'] = @htmlentities($this->news_data['content']);386 387 $this->bo->set_dates($_POST['from'],$_POST['until'],$this->news_data); 387 388 $this->bo->edit($this->news_data); … … 405 406 function modify($type = 'edit') 406 407 { 408 include_once("fckeditor.php"); 409 407 410 $options = $this->bo->get_options($this->news_data); 408 411 $GLOBALS['phpgw']->common->phpgw_header(); … … 423 426 424 427 $category_list = $this->selectlist('write', (int)$this->news_data['category']); 428 429 if ($category_list == '') 430 $this->deny(); 425 431 426 432 $this->template->set_var('lang_header',lang($type . ' news item')); … … 431 437 ) 432 438 ); 439 440 $oFCKeditor = new FCKeditor('news[content]') ; 441 $oFCKeditor->BasePath = 'news_admin/templates/celepar/fckeditor/'; 442 $oFCKeditor->ToolbarSet = 'ExpressoLivre'; 443 $oFCKeditor->Value = $this->news_data['content']; 444 433 445 $this->template->set_var(array( 434 446 'form_button' => '<input type="submit" name="submitit" value="' . lang('save') . '">', … … 436 448 'done_button' => '<input type="submit" name="cancel" value="' . lang('Done') . '">', 437 449 'label_subject' => lang('subject') . ':', 438 'value_subject' => '<input name="news[subject]" size="60" value="' . @htmlspecialchars($this->news_data['subject'],ENT_COMPAT,$GLOBALS['phpgw']->translation->charset()) . '">',450 'value_subject' => '<input name="news[subject]" autocomplete="off" size="60" value="' . @htmlspecialchars($this->news_data['subject'],ENT_COMPAT,$GLOBALS['phpgw']->translation->charset()) . '">', 439 451 'label_teaser' => lang('teaser') . ':', 440 'value_teaser' => '<input name="news[teaser]" size="60" value="' . @htmlspecialchars($this->news_data['teaser'],ENT_COMPAT,$GLOBALS['phpgw']->translation->charset()) . '" maxLength="100">',452 'value_teaser' => '<input name="news[teaser]" autocomplete="off" size="60" value="' . @htmlspecialchars($this->news_data['teaser'],ENT_COMPAT,$GLOBALS['phpgw']->translation->charset()) . '" maxLength="100">', 441 453 'label_content' => lang('Content') . ':', 442 'value_content' => '<textarea cols="60" rows="6" name="news[content]" wrap="virtual">' . $this->news_data['content'] . '</textarea>', 454 //'value_content' => '<textarea cols="60" rows="6" name="news[content]" wrap="virtual">' . $this->news_data['content'] . '</textarea>', 455 'value_content' => $oFCKeditor->Create(), 443 456 'label_category' => lang('Category') . ':', 444 457 'value_category' => '<select name="news[category]">' . $this->selectlist('write', (int)$this->news_data['category']) . '</select>', … … 453 466 'value_end_y' => $this->sbox->getYears('news[end_y]',date('Y',$this->news_data['end']),date('Y')), 454 467 'label_is_html' => lang('Contains HTML'), 455 'value_is_html' => '<input type="checkbox" value="1" name="news[is_html] "' . ($this->news_data['is_html'] ? ' checked="1"' : '') .'>',468 'value_is_html' => '<input type="checkbox" value="1" name="news[is_html] checked="1""' . ($this->news_data['is_html'] ? ' checked="1"' : '') .'>', 456 469 )); 457 470 … … 470 483 $GLOBALS['phpgw']->common->phpgw_header(); 471 484 echo parse_navbar(); 485 486 $category_list = $this->selectlist('write', (int)$this->news_data['category']); 487 if ($category_list == '') 488 $this->deny(); 489 472 490 $this->template->set_block('main','category'); 473 491 $var['lang_read'] = lang('Read'); … … 536 554 $this->template->pfp('out','list'); 537 555 } 556 557 function deny() 558 { 559 echo '<p><center><b>'.lang('Access not permitted').'</b></center>'; 560 $GLOBALS['phpgw']->common->phpgw_exit(True); 561 } 562 538 563 } 539 564 ?>
Note: See TracChangeset
for help on using the changeset viewer.