Changeset 45


Ignore:
Timestamp:
08/06/07 08:53:24 (17 years ago)
Author:
niltonneto
Message:

Implementação do FCKEDITOR na edição de artigos no news_admin, para permitir texto rico.

Location:
trunk/news_admin
Files:
569 added
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/news_admin/admin_edit.php

    r2 r45  
    1313  \**************************************************************************/ 
    1414 
     15  /* $Id$ */ 
    1516 
    1617        $phpgw_info = array(); 
  • trunk/news_admin/inc/class.boacl.inc.php

    r2 r45  
    1111        \**************************************************************************/ 
    1212 
     13        /* $Id$ */ 
    1314 
    1415        class boacl 
  • trunk/news_admin/inc/class.boexport.inc.php

    r2 r45  
    1111        \**************************************************************************/ 
    1212 
     13        /* $Id$ */ 
    1314 
    1415        class boexport 
  • trunk/news_admin/inc/class.bonews.inc.php

    r2 r45  
    1313        \**************************************************************************/ 
    1414 
     15        /* $Id$ */ 
    1516 
    1617        class bonews 
     
    140141                function add($news) 
    141142                { 
     143                        $enc = preg_replace('!\015\012|\015|\012!','',$news['content']); 
     144                        $news['content'] = $enc; 
    142145                        return $this->acl->is_writeable($news['category']) ? 
    143146                                $this->sonews->add($news) : 
     
    147150                function edit($news) 
    148151                { 
     152                        $enc = preg_replace('!\015\012|\015|\012!','',$news['content']); 
     153                        $news['content'] = $enc; 
    149154                        $oldnews = $this->sonews->get_news($news['id']); 
    150155                        return ($this->acl->is_writeable($oldnews['category']) &&  
  • trunk/news_admin/inc/class.soacl.inc.php

    r2 r45  
    1111        \**************************************************************************/ 
    1212 
     13        /* $Id$ */ 
    1314 
    1415        class soacl 
  • trunk/news_admin/inc/class.soexport.inc.php

    r2 r45  
    1111        \**************************************************************************/ 
    1212 
     13        /* $Id$ */ 
    1314 
    1415        class soexport 
  • trunk/news_admin/inc/class.sonews.inc.php

    r2 r45  
    1313        \**************************************************************************/ 
    1414 
     15        /* $Id$ */ 
    1516 
    1617        class sonews 
  • trunk/news_admin/inc/class.uiacl.inc.php

    r2 r45  
    1111        \**************************************************************************/ 
    1212 
     13        /* $Id$ */ 
    1314 
    1415        class uiacl 
  • trunk/news_admin/inc/class.uiexport.inc.php

    r2 r45  
    1111        \**************************************************************************/ 
    1212 
     13        /* $Id$ */ 
    1314 
    1415        class uiexport 
  • trunk/news_admin/inc/class.uinews.inc.php

    r2 r45  
    1313        \**************************************************************************/ 
    1414 
     15        /* $Id$ */ 
    1516 
    1617        class uinews 
     
    278279                        if($_POST['submitit']) 
    279280                        { 
     281                                $_POST['news']['is_html'] = '1'; 
    280282                                $this->news_data = $_POST['news']; 
    281283                                if(!$this->news_data['subject']) 
    282284                                { 
    283                                         $errors[] = lang('The subject is missing'); 
     285                                        $errors[] = lang('The subject is missing.'); 
    284286                                } 
    285287                                if(!$this->news_data['content']) 
    286288                                { 
    287                                         $errors[] = lang('The news content is missing'); 
     289                                        $errors[] = lang('The news content is missing.'); 
    288290                                } 
    289291                                if(!is_array($errors)) 
    290292                                { 
    291293                                        $this->news_data['date'] = time(); 
    292                                         $this->news_data['content'] = @htmlentities($this->news_data['content']); 
     294                                         
    293295                                        $this->bo->set_dates($_POST['from'],$_POST['until'],$this->news_data); 
    294296                                        $this->news_id = $this->bo->add($this->news_data); 
     
    383385                                if(!is_array($errors)) 
    384386                                { 
    385                                         $this->news_data['content'] = @htmlentities($this->news_data['content']); 
    386387                                        $this->bo->set_dates($_POST['from'],$_POST['until'],$this->news_data); 
    387388                                        $this->bo->edit($this->news_data); 
     
    405406                function modify($type = 'edit') 
    406407                { 
     408                        include_once("fckeditor.php"); 
     409                         
    407410                        $options = $this->bo->get_options($this->news_data); 
    408411                        $GLOBALS['phpgw']->common->phpgw_header(); 
     
    423426 
    424427                        $category_list = $this->selectlist('write', (int)$this->news_data['category']); 
     428                         
     429                        if ($category_list == '') 
     430                                $this->deny(); 
    425431 
    426432                        $this->template->set_var('lang_header',lang($type . ' news item')); 
     
    431437                                ) 
    432438                        ); 
     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                         
    433445                        $this->template->set_var(array( 
    434446                                'form_button' => '<input type="submit" name="submitit" value="' . lang('save') . '">', 
     
    436448                                'done_button' => '<input type="submit" name="cancel" value="' . lang('Done') . '">', 
    437449                                '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()) . '">', 
    439451                                '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">', 
    441453                                '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(), 
    443456                                'label_category' => lang('Category') . ':', 
    444457                                'value_category' => '<select name="news[category]">' . $this->selectlist('write', (int)$this->news_data['category']) . '</select>', 
     
    453466                                'value_end_y' =>  $this->sbox->getYears('news[end_y]',date('Y',$this->news_data['end']),date('Y')), 
    454467                                '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"' : '') .'>', 
    456469                        )); 
    457470                         
     
    470483                        $GLOBALS['phpgw']->common->phpgw_header(); 
    471484                        echo parse_navbar(); 
     485 
     486                        $category_list = $this->selectlist('write', (int)$this->news_data['category']); 
     487                        if ($category_list == '') 
     488                                $this->deny(); 
     489 
    472490                        $this->template->set_block('main','category'); 
    473491                        $var['lang_read'] = lang('Read'); 
     
    536554                        $this->template->pfp('out','list'); 
    537555                } 
     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 
    538563        } 
    539564?> 
  • trunk/news_admin/inc/hook_admin.inc.php

    r2 r45  
    1010  *  option) any later version.                                              * 
    1111  \**************************************************************************/ 
     12  /* $Id$ */ 
    1213        { 
    1314                $file = Array 
  • trunk/news_admin/inc/hook_home.inc.php

    r2 r45  
    1313        \**************************************************************************/ 
    1414 
     15        /* $Id$ */ 
    1516 
    1617        $showevents = (int)$GLOBALS['phpgw_info']['user']['preferences']['news_admin']['homeShowLatest']; 
  • trunk/news_admin/inc/hook_preferences.inc.php

    r2 r45  
    1313        \**************************************************************************/ 
    1414 
     15  /* $Id$ */ 
    1516{ 
    1617// Only Modify the $file and $title variables..... 
  • trunk/news_admin/inc/hook_settings.inc.php

    r2 r45  
    1313        \**************************************************************************/ 
    1414 
     15        /* $Id$ */ 
    1516 
    1617        $show_entries = array( 
  • trunk/news_admin/inc/hook_sidebox_menu.inc.php

    r2 r45  
    1313        \**************************************************************************/ 
    1414 
     15  /* $Id$ */ 
    1516{ 
    1617 
  • trunk/news_admin/index.php

    r2 r45  
    1313        \**************************************************************************/ 
    1414 
     15        /* $Id$ */ 
    1516 
    1617        $phpgw_info = array(); 
  • trunk/news_admin/setup/default_records.inc.php

    r2 r45  
    1010  \**************************************************************************/ 
    1111 
     12  /* $Id$ */ 
    1213 
    1314//      $oProc->query("DELETE FROM phpgw_news"); 
  • trunk/news_admin/setup/setup.inc.php

    r2 r45  
    1010        \**************************************************************************/ 
    1111 
     12        /* $Id$ */ 
    1213 
    1314        /* Basic information about this app */ 
  • trunk/news_admin/setup/tables_baseline.inc.php

    r2 r45  
    1313        \**************************************************************************/ 
    1414 
     15        /* $Id$ */ 
    1516 
    1617   // table array for news_admin 
  • trunk/news_admin/setup/tables_current.inc.php

    r2 r45  
    1414  \**************************************************************************/ 
    1515 
     16  /* $Id$ */ 
    1617 
    1718  // table array for news_admin 
  • trunk/news_admin/setup/tables_update.inc.php

    r2 r45  
    1313        \**************************************************************************/ 
    1414 
     15        /* $Id$ */ 
    1516 
    1617        $test[] = '0.0.1'; 
  • trunk/news_admin/website/export.php

    r2 r45  
    1313  \**************************************************************************/ 
    1414 
     15  /* $Id$ */ 
    1516 
    1617        include('setup.inc.php'); 
  • trunk/news_admin/website/index.php

    r2 r45  
    1414  \**************************************************************************/ 
    1515 
     16  /* $Id$ */ 
    1617   
    1718  include("news.inc.php"); 
  • trunk/news_admin/website/news.inc.php

    r2 r45  
    1212        * http://www.goldenglair.com                                               * 
    1313        \**************************************************************************/ 
     14        /* $Id$ */ 
    1415 
    1516        include('setup.inc.php'); 
  • trunk/news_admin/website/setup.inc.php

    r2 r45  
    1313  \**************************************************************************/ 
    1414 
     15  /* $Id$ */ 
    1516 
    1617        $path_to_header = '../../'; 
Note: See TracChangeset for help on using the changeset viewer.