fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [6551] preferences: new function: get_locations


From: Sigurd Nes
Subject: [Fmsystem-commits] [6551] preferences: new function: get_locations
Date: Mon, 08 Nov 2010 11:59:24 +0000

Revision: 6551
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6551
Author:   sigurdne
Date:     2010-11-08 11:59:24 +0000 (Mon, 08 Nov 2010)
Log Message:
-----------
preferences: new function: get_locations

Modified Paths:
--------------
    trunk/preferences/inc/class.boadmin_acl.inc.php

Modified: trunk/preferences/inc/class.boadmin_acl.inc.php
===================================================================
--- trunk/preferences/inc/class.boadmin_acl.inc.php     2010-11-08 11:51:57 UTC 
(rev 6550)
+++ trunk/preferences/inc/class.boadmin_acl.inc.php     2010-11-08 11:59:24 UTC 
(rev 6551)
@@ -170,6 +170,30 @@
                        return $location_list;
                }
 
+               function get_locations($data = array())
+               {
+                       $location_list = array();
+       
+                       $grant          = isset($data['grant']) && 
$data['grant'] ? $data['grant'] : false;
+                       $grant          = isset($data['allow_c_attrib']) && 
$data['allow_c_attrib'] ? $data['allow_c_attrib'] : false;
+                       $acl_app        = isset($data['acl_app']) && 
$data['acl_app'] ? $data['acl_app'] : 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+                       $selected       = isset($data['selected']) && 
$data['selected'] ? $data['selected'] : '';
+
+                       $locations = 
$GLOBALS['phpgw']->locations->get_locations($grant, $acl_app, $allow_c_attrib);
+
+                       foreach ( $locations as $loc_id => $loc_descr )
+                       {
+                               $location_list[] = array
+                               (
+                                       'id'            => $loc_id,
+                                       'name'          => "{$loc_id} 
[{$loc_descr}]",
+                                       'selected'      => $loc_id == $selected 
? 1 : 0
+                               );
+
+                       }
+                       return $location_list;
+               }
+
                function select_category_list($format='',$selected='')
                {
                        switch($format)




reply via email to

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