source: trunk/news_admin/inc/hook_home.inc.php @ 45

Revision 45, 3.3 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        $showevents = (int)$GLOBALS['phpgw_info']['user']['preferences']['news_admin']['homeShowLatest'];
18        if($showevents > 0)
19        {
20                $GLOBALS['phpgw']->translation->add_app('news_admin');
21                $title = lang('News Admin');
22                $portalbox = CreateObject('phpgwapi.listbox',array(
23                        'title'     => $title,
24                        'primary'   => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
25                        'secondary' => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
26                        'tertiary'  => $GLOBALS['phpgw_info']['theme']['navbar_bg'],
27                        'width'     => '100%',
28                        'outerborderwidth' => '0',
29                        'header_background_image' => $GLOBALS['phpgw']->common->image('phpgwapi/templates/default','bg_filler')
30                ));
31
32                $latestcount = (int)$GLOBALS['phpgw_info']['user']['preferences']['news_admin']['homeShowLatestCount'];
33                if($latestcount<=0)
34                {
35                        $latestcount = 10;
36                }
37                print_debug("showing $latestcount news items");
38                $app_id = $GLOBALS['phpgw']->applications->name2id('news_admin');
39                $GLOBALS['portal_order'][] = $app_id;
40
41                $news = CreateObject('news_admin.uinews');
42
43                $newslist = $news->bo->get_newslist('all',0,'','',$latestcount,True);
44
45                $image_path = $GLOBALS['phpgw']->common->get_image_path('news_admin');
46
47                if(is_array($newslist))
48                {
49                        foreach($newslist as $newsitem)
50                        {
51                                $text = $newsitem['subject'];
52                                if($showevents == 1)
53                                {
54                                        $text .= ' - ' . lang('Submitted by') . ' ' . $GLOBALS['phpgw']->common->grab_owner_name($newsitem['submittedby']) . ' ' . lang('on') . ' ' . $GLOBALS['phpgw']->common->show_date($newsitem['date']);
55                                }
56                                $portalbox->data[] = array(
57                                        'text' => $text,
58                                        'link' => $GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uinews.read_news&news_id=' . $newsitem['id'])
59                                );
60                        }
61                        unset($text);
62                }
63                else
64                {
65                        $portalbox->data[] = array('text' => lang('no news'));
66                }
67
68                $GLOBALS['portal_order'][] = $app_id;
69                $var = Array(
70                                'up'    => Array('url'  => '/set_box.php', 'app'        => $app_id),
71                                'down'  => Array('url'  => '/set_box.php', 'app'        => $app_id),
72                                'close' => Array('url'  => '/set_box.php', 'app'        => $app_id),
73                                'question'      => Array('url'  => '/set_box.php', 'app'        => $app_id),
74                                'edit'  => Array('url'  => '/set_box.php', 'app'        => $app_id)
75                );
76
77                while(list($key,$value) = each($var))
78                {
79                        $portalbox->set_controls($key,$value);
80                }
81
82                $tmp = "\r\n"
83                        . '<!-- start News Admin -->' . "\r\n"
84                        . $portalbox->draw()
85                        . '<!-- end News Admin -->'. "\r\n";
86                print $tmp;
87        }
88?>
Note: See TracBrowser for help on using the repository browser.