[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <?php 2 /**************************************************************************\ 3 * eGroupWare - Administration * 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 12 /* $Id: class.uimenuclass.inc.php 20295 2006-02-15 12:31:25Z $ */ 13 14 class uimenuclass 15 { 16 var $t; 17 var $rowColor = Array(); 18 19 function uimenuclass() 20 { 21 $this->t =& CreateObject('phpgwapi.Template',$GLOBALS['egw']->common->get_tpl_dir('admin')); 22 23 $this->t->set_file(array('menurow' => 'menurow.tpl')); 24 $this->t->set_block('menurow','menu_links','menu_links'); 25 $this->t->set_block('menurow','link_row','link_row'); 26 27 $this->rowColor[0] = $GLOBALS['egw_info']['theme']['row_on']; 28 $this->rowColor[1] = $GLOBALS['egw_info']['theme']['row_off']; 29 } 30 31 function section_item($pref_link='',$pref_text='', $class) 32 { 33 $this->t->set_var('row_link',$pref_link); 34 $this->t->set_var('row_text',$pref_text); 35 $this->t->set_var('class',$class); 36 $this->t->parse('all_rows','link_row',True); 37 } 38 39 // $file must be in the following format: 40 // $file = array( 41 // 'Login History' => array('/index.php','menuaction=admin.uiaccess_history.list') 42 // ); 43 // This allows extra data to be sent along 44 function display_section($_menuData) 45 { 46 $i=0; 47 48 // reset the value of all_rows 49 $this->t->set_var('all_rows',''); 50 51 while(list($key,$value) = each($_menuData)) 52 { 53 if (!empty($value['extradata'])) 54 { 55 $link = $GLOBALS['egw']->link($value['url'],'account_id=' . get_var('account_id',array('GET','POST')) . '&' . $value['extradata']); 56 } 57 else 58 { 59 $link = $GLOBALS['egw']->link($value['url'],'account_id=' . get_var('account_id',array('GET','POST'))); 60 } 61 $this->section_item($link,lang($value['description']),($i%2) ? "row_on": "row_off"); 62 $i++; 63 } 64 65 if(strpos($_menuData[0]['extradata'],'user')) 66 { 67 $destination = 'users'; 68 } 69 else 70 { 71 $destination = 'groups'; 72 } 73 $this->t->set_var('link_done',$GLOBALS['egw']->link('/index.php','menuaction=admin.uiaccounts.list_'.$destination)); 74 $this->t->set_var('lang_done',lang('Back')); 75 76 $this->t->set_var('row_on',$this->rowColor[0]); 77 78 $this->t->parse('out','menu_links'); 79 80 return $this->t->get('out','menu_links'); 81 } 82 83 // create the html code for the menu 84 function createHTMLCode($_hookname) 85 { 86 switch ($_hookname) 87 { 88 case 'edit_user': 89 $GLOBALS['menuData'][] = array( 90 'description' => 'User Data', 91 'url' => '/index.php', 92 'extradata' => 'menuaction=admin.uiaccounts.edit_user' 93 ); 94 break; 95 case 'view_user': 96 $GLOBALS['menuData'][] = array( 97 'description' => 'User Data', 98 'url' => '/index.php', 99 'extradata' => 'menuaction=admin.uiaccounts.view_user' 100 ); 101 break; 102 case 'edit_group': 103 $GLOBALS['menuData'][] = array( 104 'description' => 'Edit Group', 105 'url' => '/index.php', 106 'extradata' => 'menuaction=admin.uiaccounts.edit_group' 107 ); 108 break; 109 case 'group_manager': 110 $GLOBALS['menuData'][] = array( 111 'description' => 'Group Manager', 112 'url' => '/index.php', 113 'extradata' => 'menuaction=admin.uiaccounts.group_manager' 114 ); 115 break; 116 } 117 118 $GLOBALS['egw']->hooks->process($_hookname); 119 if (count($GLOBALS['menuData']) >= 1) 120 { 121 $result = $this->display_section($GLOBALS['menuData']); 122 //clear $menuData 123 $GLOBALS['menuData'] = ''; 124 return $result; 125 } 126 else 127 { 128 // clear $menuData 129 $GLOBALS['menuData'] = ''; 130 return ''; 131 } 132 } 133 } 134 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |