[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <?php 2 /**************************************************************************\ 3 * eGroupWare - Admin * 4 * http://www.egroupware.org * 5 * Written by Miles Lott <milosch@phpwhere.org> * 6 * -------------------------------------------- * 7 * This program is free software; you can redistribute it and/or modify it * 8 * under the terms of the GNU General Public License as published by the * 9 * Free Software Foundation; either version 2 of the License, or (at your * 10 * option) any later version. * 11 \**************************************************************************/ 12 13 /* $Id: class.boserver.inc.php 20295 2006-02-15 12:31:25Z $ */ 14 15 class boserver 16 { 17 var $public_functions = array( 18 'list_servers' => True, 19 'read' => True, 20 'edit' => True, 21 'delete' => True 22 ); 23 24 var $xml_functions = array(); 25 var $soap_functions = array(); 26 27 var $debug = False; 28 29 var $so = ''; 30 var $start = 0; 31 var $limit = 0; 32 var $query = ''; 33 var $sort = ''; 34 var $order = ''; 35 var $total = 0; 36 37 var $use_session = False; 38 39 function boserver($session=False) 40 { 41 $this->so =& CreateObject('admin.soserver'); 42 43 if($session) 44 { 45 $this->read_sessiondata(); 46 $this->use_session = True; 47 } 48 49 $start = $GLOBALS['start']; 50 $query = $GLOBALS['query']; 51 $sort = $GLOBALS['sort']; 52 $order = $GLOBALS['order']; 53 54 if(!empty($start) || ($start == '0') || ($start == 0)) 55 { 56 if($this->debug) { echo '<br>overriding start: "' . $this->start . '" now "' . $start . '"'; } 57 $this->start = $start; 58 } 59 60 if((empty($query) && !empty($this->query)) || !empty($query)) 61 { 62 $this->query = $query; 63 } 64 65 if($limit) { $this->limit = $limit; } 66 if(isset($sort)) { $this->sort = $sort; } 67 if(isset($order)) { $this->order = $order; } 68 } 69 70 function save_sessiondata($data) 71 { 72 if ($this->use_session) 73 { 74 if($this->debug) { echo '<br>Save:'; _debug_array($data); } 75 $GLOBALS['egw']->session->appsession('session_data','admin_servers',$data); 76 } 77 } 78 79 function read_sessiondata() 80 { 81 $data = $GLOBALS['egw']->session->appsession('session_data','admin_servers'); 82 if($this->debug) { echo '<br>Read:'; _debug_array($data); } 83 84 $this->start = $data['start']; 85 $this->limit = $data['limit']; 86 $this->query = $data['query']; 87 $this->sort = $data['sort']; 88 $this->order = $data['order']; 89 } 90 91 function list_servers() 92 { 93 return $this->so->list_servers(array($this->start,$this->sort,$this->order,$this->query,$this->limit),$this->total); 94 } 95 96 function read($id) 97 { 98 if(is_array($id)) 99 { 100 $id = $id['server_id']; 101 } 102 return $this->so->read($id); 103 } 104 105 function edit($server_info) 106 { 107 if(!is_array($server_info)) 108 { 109 return False; 110 } 111 112 if($server_info['server_id']) 113 { 114 return $this->so->update($server_info); 115 } 116 else 117 { 118 return $this->so->add($server_info); 119 } 120 } 121 122 function delete($id) 123 { 124 if(is_array($id)) 125 { 126 $id = $id['server_id']; 127 } 128 return $this->so->delete($id); 129 } 130 }
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 |