source: trunk/news_admin/website/export.php @ 45

Revision 45, 2.6 KB checked in by niltonneto, 17 years ago (diff)

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

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2  /**************************************************************************\
3  * eGroupWare - Webpage news admin                                          *
4  * http://www.egroupware.org                                                *
5  * --------------------------------------------                             *
6  *  This program is free software; you can redistribute it and/or modify it *
7  *  under the terms of the GNU General Public License as published by the   *
8  *  Free Software Foundation; either version 2 of the License, or (at your  *
9  *  option) any later version.                                              *
10  * --------------------------------------------                             *
11  * This program was sponsered by Golden Glair productions                   *
12  * http://www.goldenglair.com                                               *
13  \**************************************************************************/
14
15  /* $Id$ */
16
17        include('setup.inc.php');
18
19        $cat_id = (int)$_GET['cat_id'];
20//      $format = (isset($_GET['format']) ? strtolower(trim($_GET['format'])) : 'rss');
21        $limit  = (isset($_GET['limit']) ? trim($_GET['limit']) : 5);
22//      $all    = (isset($_GET['all']) ? True : False);
23
24        $site = $export_obj->readconfig($cat_id);
25
26        //TODO allow override of configured value by a configurable flag
27        //validate format
28
29//      $available_formats = array('rss'        => True, //RSS 0.91
30//                              'rdf-chan'      => True, //RDF 1.0
31//                              'rdf2'          => True, //RDF/RSS 2.0
32//                              );
33
34//      if(!$available_formats[$format])
35//      {
36//              $format = 'rss';
37//      }
38
39        if(!$site['type'])
40        {
41                echo "THIS CATEGORY IS NOT PUBLICLY ACCESSIBLE";
42                die();
43        }
44
45        $formats = array(1 => 'rss091', 2 => 'rss1', 3 => 'rss2');
46        $itemsyntaxs = array(
47                0 => '?item=',
48                1 => '&item=',
49                2 => '?news%5Bitem%5D=',
50                3 => '&news%5Bitem%5D='
51        );
52        $format = $formats[$site['type']];
53        $itemsyntax = $itemsyntaxs[$site['itemsyntax']];
54
55        $tpl->set_file(array('news' => $format . '.tpl'));
56        $tpl->set_block('news', 'item', 'items');
57        if($format == 'rss1')
58        {
59                $tpl->set_block('news', 'seq', 'seqs');
60        }
61
62        $tpl->set_var($site);
63
64//      if($all)
65//      {
66//              $news = $news_obj->get_all_public_news($limit);
67//      }
68//      else
69//      {
70                $news = $news_obj->get_newslist($cat_id, 0,'','',$limit,True);
71//      }
72
73        if(is_array($news))
74        {
75                foreach($news as $news_id => $news_data)
76                {
77                        $tpl->set_var($news_data);
78
79                        $tpl->set_var('item_link', $site['link'] . $itemsyntax . $news_id);
80                        if($format == 'rss1')
81                        {
82                                $tpl->parse('seqs','seq',True);
83                        }
84   
85                        $tpl->parse('items','item',True);
86                }
87        }
88        else
89        {
90                $tpl->set_var('items', '');
91        }
92        $tpl->pparse('out','news');
93?>
Note: See TracBrowser for help on using the repository browser.