source: trunk/news_admin/inc/hook_sidebox_menu.inc.php @ 2900

Revision 2900, 3.0 KB checked in by valmir.sena, 14 years ago (diff)

Ticket #1098 - Ajustando menu do modulo de Boletins internos

  • 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{
16
17 /*
18        This hookfile is for generating an app-specific side menu used in the idots
19        template set.
20
21        $menu_title speaks for itself
22        $file is the array with link to app functions
23
24        display_sidebox can be called as much as you like
25 */
26        $bo   = CreateObject('news_admin.bonews',True);
27        $right = PHPGW_ACL_ADD;
28        $permited_add = false;
29       
30        foreach($bo->cats as $cat)
31        {
32                if($bo->acl->is_permitted($cat['id'],$right))
33                {
34                        $permited_add = true;
35                        break;
36                }
37        }
38               
39        $menu_title = $GLOBALS['phpgw_info']['apps'][$appname]['title'] . ' '. lang('Menu');   
40        if( $permited_add ) {
41                $file = Array( 'read news' => $GLOBALS['phpgw']->link('/news_admin/index.php'),
42                                                'Add New Article' => $GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uinews.add')
43                );
44               
45        } else {
46                $file = Array(
47                'read news' => $GLOBALS['phpgw']->link('/news_admin/index.php')         
48                );
49        }
50        display_sidebox($appname,$menu_title,$file);
51 
52       
53        $title = lang('Preferences');
54        $file = array(
55                'Preferences'     => $GLOBALS['phpgw']->link('/preferences/preferences.php','appname='.$appname),
56        );
57        display_sidebox($appname,$title,$file);
58       
59        if ($GLOBALS['phpgw_info']['user']['apps']['admin'])
60        {
61        $title = lang('Administration');
62        $file = Array(
63                'News Administration'  => $GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uinews.write_news'),
64                'global categories' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname=' . $appname),
65                'configure access permissions' => $GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiacl.acllist'),
66                'configure rss exports' => $GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiexport.exportlist')
67        );             
68                display_sidebox($appname,$title,$file);
69        } else if($permited_add){
70                 $title = lang('Administration');
71             $file = Array(
72                        'News Administration'  => $GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uinews.write_news')
73             );
74             display_sidebox($appname,$title,$file);
75        }
76       
77        unset($title);
78        unset($file);
79        unset($bo);
80}
81?>
Note: See TracBrowser for help on using the repository browser.