phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] news_admin/inc class.uinews.inc.php,1.34


From: skwashd
Subject: [Phpgroupware-cvs] news_admin/inc class.uinews.inc.php,1.34
Date: Wed, 16 Nov 2005 15:27:00 +0100

Update of news_admin/inc

Modified Files:
     Branch: MAIN
            class.uinews.inc.php lines: +36 -30

Log Message:
more fixes

====================================================
Index: news_admin/inc/class.uinews.inc.php
diff -u news_admin/inc/class.uinews.inc.php:1.33 
news_admin/inc/class.uinews.inc.php:1.34
--- news_admin/inc/class.uinews.inc.php:1.33    Sat Oct  8 00:50:24 2005
+++ news_admin/inc/class.uinews.inc.php Wed Nov 16 14:27:01 2005
@@ -347,7 +347,7 @@
                                if (!is_array($errors))
                                {
                                        $this->news_data['date'] = time();
-                                       
$this->bo->set_dates($_POST['from'],$_POST['until'],$this->news_data);
+                                       $this->bo->set_dates($_POST['from'], 
$_POST['until'], $this->news_data);
                                        $this->news_id = 
$this->bo->add($this->news_data);
                                        $this->message = lang('Message has been 
added');
                                        //after having added, we must switch to 
edit mode instead of stay in add
@@ -417,12 +417,12 @@
                        $this->news_id          = (isset($_GET['news_id']) ? 
$_GET['news_id']
                                                                                
: $_POST['news']['id']);

-                       if ( isset($_POST['cancel']) )
+                       if ( isset($_POST['cancel']) && $_POST['cancel'] )
                        {
                                Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uinews.write_news'));
                                return;
                        }
-                       if ( is_array($this->news_data) )
+                       if ( $_SERVER['REQUEST_METHOD'] == 'POST' )
                        {
                                if(! $this->news_data['subject'])
                                {
@@ -459,6 +459,11 @@
                                        $this->message = $errors;
                                }
                        }
+                       else
+                       {
+                               $this->news_data = 
$this->bo->get_news($this->news_id, True);
+                       }
+
                        $this->_modify();
                }

@@ -476,7 +481,11 @@
                        {
                                if ( isset($_POST['send']) && $_POST['send'] )
                                {
-                                       $content = 
stripslashes(str_replace(array('<script','</script'), 
array('&lt;script','&lt;/script'), preg_replace("' on(.*?)=\"(.*?)\"'i", '', 
get_var('nl_content', array('POST') ) ) ) );
+                                       if ( !isset($GLOBALS['data_cleaner']) 
|| !is_object($GLOBALS['data_cleaner']) )
+                                       {
+                                               $GLOBALS['data_cleaner'] = 
createObject('phpgwapi.data_cleaner');
+                                       }
+                                       $content = 
stripslashes($GLOBALS['data_cleaner']->clean($GLOBALS['RAW_REQUEST']['nl_content'],
 false));
                                        $html2text = 
createObject('news_admin.html2text', $content);
                                        $content_txt = $html2text->get_text();
                                        unset($html2text);
@@ -488,14 +497,18 @@
                                        
$smtp->AddAddress($config->config_data['newsletter_to']);
                                        $smtp->Subject = get_var('subject', 
array('POST'));

-                                       if ( isset($_POST['bcc_recipients']) && 
is_array($_POST['bcc_recipients']) )
+                                       if ( isset($_POST['cc_recipients']) && 
is_array($_POST['cc_recipients']) )
                                        {
-                                               $bcc_recips = 
get_var('bcc_recipients', array('POST') );
-                                               foreach ( $bcc_reips as $bcc )
+                                               foreach ( 
$_POST['cc_recipients'] as $cc )
                                                {
-                                                       $smtp->AddBCC($bcc);
+                                                       $smtp->AddCC($cc);
                                                }
                                        }
+                                       else if ( 
isset($_POST['cc_recipients']) && $_POST['cc_recipients'])
+                                       {
+
+                                               
$smtp->AddCC($_POST['cc_recipients']);
+                                       }

                                        if ( 
$config->config_data['force_plain'] )
                                        {
@@ -504,7 +517,7 @@
                                                $smtp->Body = $content_txt;
                                        }
                                        else
-               {
+                                       {
                                                $smtp->IsHTML(true);
                                                $smtp->Body = $content;
                                                $smtp->AltBody = $content_txt;
@@ -526,16 +539,9 @@

                        if ( !$content )
                        {
-                               $content = str_replace(
-                                               array('<script','</script'),
-                                               
array('&lt;script','&lt;/script'),
-                                               preg_replace("' 
on(.*?)=\"(.*?)\"'i",
-                                                       '',
-                                                       
$config->config_data['newsletter_header_html']
-                                                               . "\n"
-                                                               . 
$config->config_data['newsletter_footer_html']
-                                               )
-                                       );
+                               $content = 
$config->config_data['newsletter_header_html']
+                                               . "<div id=\"news\"></div>\n"
+                                               . 
$config->config_data['newsletter_footer_html'];
                        }

                        if ( !is_object($GLOBALS['phpgw']->js) )
@@ -552,14 +558,14 @@
                                        //Global scope
                                        var oTabs;
                                        var strLinkURL = \'' . 
$config->config_data['more_link_url'] . '\';
-                               window.onload = function()
-                               {
-                                               var oFCKEditor = new 
FCKeditor(\'nl_content\');
-                                               oFCKEditor.BasePath = "' . 
$GLOBALS['phpgw_info']['server']['webserver_url'] . '/news_admin/js/fckeditor/";
-                                               oFCKEditor.SpellChecker = \'' . 
(extension_loaded('pspell') ? 'SpellerPages' : 'ieSpell') . '\'
-                                               oFCKEditor.ReplaceTextarea();
-                                               setTimeout("nlbLoaded()", 
2000); //stops FCK FCKing up
-                               }
+                                       window.onload = function()
+                                       {
+                                                       var oFCKEditor = new 
FCKeditor(\'nl_content\');
+                                                       oFCKEditor.BasePath = 
"' . $GLOBALS['phpgw_info']['server']['webserver_url'] . 
'/news_admin/js/fckeditor/";
+                                                       oFCKEditor.SpellChecker 
= \'' . (extension_loaded('pspell') ? 'SpellerPages' : 'ieSpell') . '\'
+                                                       
oFCKEditor.ReplaceTextarea();
+                                                       
setTimeout("nlbLoaded()", 2000); //stops FCK FCKing up
+                                       }

                                        oLang = {
                                                        read_more: "' . 
lang('read more') . ' >>"
@@ -596,7 +602,7 @@
                                                                'img_send'      
        => $GLOBALS['phpgw']->common->find_image('news_admin', 'send'),
                                                                'lang_add'      
        => lang('add'),
                                                                
'lang_all_changes_will_be_lost' => lang('all changes will be lost'),
-                                                               
'lang_bcc_recipients'   => lang('bcc recipients'),
+                                                               
'lang_cc_recipients'    => lang('cc recipients'),
                                                                'lang_articles' 
        => lang('articles'),
                                                                'lang_author'   
        => lang('author'),
                                                                'lang_cancel'   
        => lang('cancel'),
@@ -824,7 +830,7 @@
                                <!--
                                        window.onload = function()
                                        {
-                                               var oFCKeditor = new 
FCKeditor(\'news[content]\');
+                                               var oFCKeditor = new 
FCKeditor(\'exec[text]\');
                                                oFCKeditor.BasePath = "' . 
$GLOBALS['phpgw_info']['server']['webserver_url'] . '/news_admin/js/fckeditor/";
                                                oFCKeditor.ReplaceTextarea();
                                                toggle();






reply via email to

[Prev in Thread] Current Thread [Next in Thread]