From ea626742ce4f552ebb072de4dd419379baa03495 Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Tue, 16 Jan 2007 21:18:04 +0000 Subject: [PATCH] Allow \t in xml sent by lists.rpc Update banana support to allow css based html rendering git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1348 839d8a87-29fc-0310-9880-83ba4fa771e5 --- bin/lists.rpc.py | 4 ++-- classes/platalpage.php | 10 ++++++++++ classes/plmailer.php | 2 -- include/banana/ml.inc.php | 2 +- include/banana/moderate.inc.php | 3 ++- modules/banana.php | 3 ++- modules/lists.php | 2 ++ templates/skin/common.header.tpl | 5 +++++ 8 files changed, 24 insertions(+), 7 deletions(-) diff --git a/bin/lists.rpc.py b/bin/lists.rpc.py index ed311c9..671b365 100755 --- a/bin/lists.rpc.py +++ b/bin/lists.rpc.py @@ -171,7 +171,7 @@ def quote(s, is_header=False): h = Utils.oneline(s, 'iso-8859-1') else: h = s - h = str('').join(re.split('[\x00-\x09\x0B-\x1f]+', h)) + h = str('').join(re.split('[\x00-\x08\x0B-\x1f]+', h)) return Utils.uquote(h.replace('&', '&').replace('>', '>').replace('<', '<')) def to_forlife(email): @@ -576,7 +576,7 @@ def get_pending_mail(userdesc, perms, vhost, listname, id, raw=0): mlist.Unlock() if raw: - return str(msg) + return quote(str(msg)) results_plain = [] results_html = [] for part in typed_subpart_iterator(msg, 'text', 'plain'): diff --git a/classes/platalpage.php b/classes/platalpage.php index 25112c2..ee56a9d 100644 --- a/classes/platalpage.php +++ b/classes/platalpage.php @@ -184,6 +184,16 @@ class PlatalPage extends Smarty } // }}} + // {{{ function addCssInline + + function addCssInline($css) + { + if (!empty($css)) { + $this->append('xorg_inline_css', $css); + } + } + + // }}} // {{{ function setRssLink function setRssLink($title, $path) diff --git a/classes/plmailer.php b/classes/plmailer.php index dd5f81d..151df42 100644 --- a/classes/plmailer.php +++ b/classes/plmailer.php @@ -21,8 +21,6 @@ require_once('smarty/libs/Smarty.class.php'); -// {{{ class PlMail - /** Classe de mail avec corps en templates. */ class PlMail extends Smarty diff --git a/include/banana/ml.inc.php b/include/banana/ml.inc.php index 97e43aa..00301d9 100644 --- a/include/banana/ml.inc.php +++ b/include/banana/ml.inc.php @@ -39,7 +39,7 @@ class MLBanana extends Banana Banana::$spool_boxlist = false; Banana::$msgedit_canattach = true; array_push(Banana::$msgparse_headers, 'x-org-id', 'x-org-mail'); - + MLBanana::$listname = $params['listname']; MLBanana::$domain = $params['domain']; $params['group'] = $params['listname'] . '@' . $params['domain']; diff --git a/include/banana/moderate.inc.php b/include/banana/moderate.inc.php index d2d077c..4458662 100644 --- a/include/banana/moderate.inc.php +++ b/include/banana/moderate.inc.php @@ -66,6 +66,7 @@ class ModerationBanana extends Banana Banana::$spool_boxlist = false; Banana::$msgshow_withthread = false; Banana::$withtabs = false; + Banana::$msgshow_externalimages = false; array_push(Banana::$msgparse_headers, 'x-org-id', 'x-org-mail'); parent::__construct($params, 'MLInterface', 'ModerationPage'); } @@ -143,7 +144,7 @@ class BananaMLInterface implements BananaProtocoleInterface $message = null; $msg = ModerationBanana::$client->get_pending_mail(ModerationBanana::$listname, $id, 1); if ($msg) { - $message = new BananaMessage($msg); + $message = new BananaMessage(html_entity_decode($msg)); } return $message; } diff --git a/modules/banana.php b/modules/banana.php index efa90c0..ea857c5 100644 --- a/modules/banana.php +++ b/modules/banana.php @@ -144,7 +144,6 @@ class BananaModule extends PLModule static function run_banana(&$page, $params = null) { $page->changeTpl('banana/index.tpl'); - $page->addCssLink('banana.css'); $page->assign('xorg_title','Polytechnique.org - Forums & PA'); require_once 'banana/forum.inc.php'; @@ -153,6 +152,8 @@ class BananaModule extends PLModule $res = $banana->run(); $page->assign_by_ref('banana', $banana); $page->assign('banana_res', $res); + $page->addCssInline($banana->css()); + $page->addCssLink('banana.css'); } } diff --git a/modules/lists.php b/modules/lists.php index 31c6965..38cc4cb 100644 --- a/modules/lists.php +++ b/modules/lists.php @@ -361,6 +361,7 @@ class ListsModule extends PLModule require_once('banana/ml.inc.php'); $banana = new MLBanana($get); $page->assign('banana', $banana->run()); + $page->addCssInline($banana->css()); $page->addCssLink('banana.css'); } else { $page->kill("La liste n'existe pas ou tu n'as pas le droit de la consulter"); @@ -443,6 +444,7 @@ class ListsModule extends PLModule $params = array('listname' => $liste, 'domain' => $domain, 'artid' => Get::i('mid'), 'part' => Get::v('part')); $banana = new ModerationBanana($params, $this->client); $res = $banana->run(); + $page->addCssInline($banana->css()); $msg = file_get_contents('/etc/mailman/fr/refuse.txt'); $msg = str_replace("%(adminaddr)s", "$liste-owner@{$domain}", $msg); diff --git a/templates/skin/common.header.tpl b/templates/skin/common.header.tpl index a2bbd6e..4a3a278 100644 --- a/templates/skin/common.header.tpl +++ b/templates/skin/common.header.tpl @@ -39,6 +39,11 @@ {foreach from=$xorg_css item=css} {/foreach} + {foreach from=$xorg_inline_css item=css} + + {/foreach} {foreach from=$xorg_js item=js} -- 2.1.4