phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] api class.account_mgr.php, 1.1.2.25, 1.1.2.26 class.a


From: Joseph Engo <address@hidden>
Subject: [Phpgroupware-cvs] api class.account_mgr.php, 1.1.2.25, 1.1.2.26 class.admin.php, 1.1.2.12, 1.1.2.13 class.phpgw.php, 1.1.1.1.2.35, 1.1.1.1.2.36
Date: Tue, 18 Nov 2003 15:53:58 +0000

Update of /cvsroot/phpgroupware/api
In directory subversions:/tmp/cvs-serv23479/api

Modified Files:
      Tag: proposal-branch
        class.account_mgr.php class.admin.php class.phpgw.php 
Log Message:
- Added new function phpgw->add_appmenu() which will create application menus.
  This new function also supports creating multiable application menus.  Which 
could be, tabs, simple bar, boxes, js menus, etc.  Its up to the skin to deside.


Index: class.account_mgr.php
===================================================================
RCS file: /cvsroot/phpgroupware/api/Attic/class.account_mgr.php,v
retrieving revision 1.1.2.25
retrieving revision 1.1.2.26
diff -C2 -d -r1.1.2.25 -r1.1.2.26
*** class.account_mgr.php       17 Nov 2003 23:39:05 -0000      1.1.2.25
--- class.account_mgr.php       18 Nov 2003 15:53:54 -0000      1.1.2.26
***************
*** 105,125 ****
                        if (! $GLOBALS['api_account_mgr_menus_loaded'])
                        {
!                               $appmenu[] = array(
!                                       'title' => 'Add User',
!                                       'op'    => 'api.account_mgr.create',
!                               );
!                               $appmenu[] = array(
!                                       'title' => 'Show Users',
!                                       'op'    => 'api.account_mgr.show',
!                               );
!                               $appmenu[] = array(
!                                       'title' => 'Add Group',
!                                       'op'    => 'api.group_mgr.create',
!                               );
!                               $appmenu[] = array(
!                                       'title' => 'Show Groups',
!                                       'op'    => 'api.group_mgr.show',
!                               );
!                               
$GLOBALS['phpgw_xml_apinode']->add_node($appmenu,'appmenu');
                                $GLOBALS['phpgw']->add_xsl('api.account_mgr');
                                $GLOBALS['api_account_mgr_menus_loaded'] = True;
--- 105,113 ----
                        if (! $GLOBALS['api_account_mgr_menus_loaded'])
                        {
!                               $GLOBALS['phpgw']->add_appmenu('Admin 
menu','Add user','api.account_mgr.create');
!                               $GLOBALS['phpgw']->add_appmenu('Admin 
menu','Show users','api.account_mgr.show');
!                               $GLOBALS['phpgw']->add_appmenu('Admin 
menu','Add group','api.group_mgr.create');
!                               $GLOBALS['phpgw']->add_appmenu('Admin 
menu','Show groups','api.group_mgr.show');
! 
                                $GLOBALS['phpgw']->add_xsl('api.account_mgr');
                                $GLOBALS['api_account_mgr_menus_loaded'] = True;
***************
*** 127,130 ****
--- 115,129 ----
                }
  
+               function menu_for_this_user()
+               {
+                       $args = new safe_args();
+                       $args->set('account_id', '##REQUIRED##', 'int');
+                       $args = $args->get(func_get_args(),__LINE__,__FILE__);
+ 
+                       $GLOBALS['phpgw']->add_appmenu('Maintain user','Edit 
this user','api.account_mgr.edit&account_id=' . $args['account_id']);
+                       $GLOBALS['phpgw']->add_appmenu('Maintain user','Delete 
this user','api.account_mgr.delete&account_id=' . $args['account_id']);
+                       $GLOBALS['phpgw']->add_appmenu('Maintain user','View 
login history','api.account_mgr.login_history&account_id=' . 
$args['account_id']);
+               }
+ 
                function account_status()
                {
***************
*** 268,271 ****
--- 267,271 ----
  
                        $GLOBALS['phpgw_xml_apinode']->add_node('Edit user 
account','title');
+                       $this->menu_for_this_user($args['account_id']);
                        
                        if (! 
$GLOBALS['phpgw']->accounts->cross_reference((int)$args['account_id']))
***************
*** 382,385 ****
--- 382,387 ----
                        $GLOBALS['phpgw']->add_xsl('api.acl_mgr');
  
+                       $this->menu_for_this_user($args['account_id']);
+ 
                        $args['account']        = $args['account_id'];
                        $accounts               = 
CreateObject('api_accounts',$args);
***************
*** 469,472 ****
--- 471,476 ----
  
                        $GLOBALS['phpgw_xml_apinode']->add_node(lang('Login 
history for 
%s',$GLOBALS['phpgw']->accounts->cross_reference((int)$args['account_id'])),'title');
+                       $this->menu_for_this_user($args['account_id']);
+ 
                        $history                = createObject('api_history');
                        $history->actions       = array(

Index: class.admin.php
===================================================================
RCS file: /cvsroot/phpgroupware/api/Attic/class.admin.php,v
retrieving revision 1.1.2.12
retrieving revision 1.1.2.13
diff -C2 -d -r1.1.2.12 -r1.1.2.13
*** class.admin.php     17 Nov 2003 23:39:06 -0000      1.1.2.12
--- class.admin.php     18 Nov 2003 15:53:55 -0000      1.1.2.13
***************
*** 54,82 ****
                        $GLOBALS['phpgw']->add_xsl('api.admin');
  
!                       $appmenu[] = array(
!                               'title' => 'Add User',
!                               'op'    => 'api.account_mgr.create',
!                       );
!                       $appmenu[] = array(
!                               'title' => 'Show Users',
!                               'op'    => 'api.account_mgr.show',
!                       );
!                       $appmenu[] = array(
!                               'title' => 'Add Group',
!                               'op'    => 'api.group_mgr.create',
!                       );
!                       $appmenu[] = array(
!                               'title' => 'Show Groups',
!                               'op'    => 'api.group_mgr.show',
!                       );
!                       $appmenu[] = array(
!                               'title' => 'Current Users',
!                               'op'    => 'api.admin.current_users',
!                       );
!                       $appmenu[] = array(
!                               'title' => 'Setup',
!                               'op'    => 'api.setup.start',
!                       );
!                       
$GLOBALS['phpgw_xml_apinode']->add_node($appmenu,'appmenu');
                }
  
--- 54,63 ----
                        $GLOBALS['phpgw']->add_xsl('api.admin');
  
!                       $GLOBALS['phpgw']->add_appmenu('Admin menu','Add 
user','api.account_mgr.create');
!                       $GLOBALS['phpgw']->add_appmenu('Admin menu','Show 
users','api.account_mgr.show');
!                       $GLOBALS['phpgw']->add_appmenu('Admin menu','Add 
group','api.group_mgr.create');
!                       $GLOBALS['phpgw']->add_appmenu('Admin menu','Show 
groups','api.group_mgr.show');
!                       $GLOBALS['phpgw']->add_appmenu('Admin menu','Current 
users','api.admin.current_users');
!                       $GLOBALS['phpgw']->add_appmenu('Admin 
menu','Setup','api.setup.start');
                }
  

Index: class.phpgw.php
===================================================================
RCS file: /cvsroot/phpgroupware/api/class.phpgw.php,v
retrieving revision 1.1.1.1.2.35
retrieving revision 1.1.1.1.2.36
diff -C2 -d -r1.1.1.1.2.35 -r1.1.1.1.2.36
*** class.phpgw.php     15 Nov 2003 04:09:06 -0000      1.1.1.1.2.35
--- class.phpgw.php     18 Nov 2003 15:53:55 -0000      1.1.1.1.2.36
***************
*** 48,51 ****
--- 48,53 ----
                var $js_files  = array();
  
+               var $app_menus = array();
+ 
                var $base_classes_loaded = False;
  
***************
*** 266,269 ****
--- 268,309 ----
                }
  
+               function add_appmenu()
+               {
+                       $args = new safe_args();
+                       // Yes, I know its spelled wrong, but its like that due 
to bug in safe_args (jengo)
+                       $args->set('title', '##REQUIRD##', 'string');
+                       $args->set('item_title','##REQUIRD##', 'string');
+                       $args->set('item_op','##REQUIRD##', 'string');
+                       $args = $args->get(func_get_args(),__LINE__,__FILE__);
+ 
+                       $this->app_menus[$args['title']][] = array(
+                               'title' => lang($args['item_title']),
+                               'op'    => $args['item_op']
+                       );
+               }
+ 
+               function finish_appmenus()
+               {
+                       foreach ($this->app_menus as $key => $values)
+                       {
+                               unset($r);
+ 
+                               foreach ($values as $value)
+                               {
+                                       $r[] = array(
+                                               'title' => 
lang($value['title']),
+                                               'op'    => $value['op']
+                                       );
+                               }
+ 
+                               $result[] = array(
+                                       'title' => lang($key),
+                                       'links' => $r
+                               );
+                       }
+ 
+                       return $result;
+               }
+ 
                /*!
                @function finish
***************
*** 388,391 ****
--- 428,432 ----
                                }
  
+                               
$GLOBALS['phpgw_xml_apinode']->add_node($this->finish_appmenus(),'appmenus');
                                
$GLOBALS['phpgw_xml_apinode']->add_node($this->apimenu(),'apimenu');
                        }





reply via email to

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