コード例 #1
0
 function get_menu()
 {
     $incoming_app = $GLOBALS['phpgw_info']['flags']['currentapp'];
     $GLOBALS['phpgw_info']['flags']['currentapp'] = 'frontend';
     $menus = array();
     if ($GLOBALS['phpgw']->acl->check('run', phpgwapi_acl::READ, 'admin') || $GLOBALS['phpgw']->acl->check('admin', phpgwapi_acl::ADD, 'frontend')) {
         $menus['admin'] = array('index' => array('text' => lang('Configuration'), 'url' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uiconfig.index', 'appname' => 'frontend'))), 'acl' => array('text' => lang('Configure Access Permissions'), 'url' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'preferences.uiadmin_acl.list_acl', 'acl_app' => 'frontend'))), 'documents' => array('text' => lang('upload_userdoc'), 'url' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'frontend.uidocumentupload.index', 'appname' => 'frontend'))));
     }
     $menus['navbar'] = array('frontend' => array('text' => lang('frontend'), 'url' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'frontend.uifrontend.index')), 'image' => array('frontend', 'navbar'), 'order' => 35, 'group' => 'office'));
     $menus['navigation'] = array();
     $locations = frontend_bofrontend::get_sections();
     $tabs = array();
     foreach ($locations as $key => $entry) {
         $name = $entry['name'];
         $location = $entry['location'];
         if ($GLOBALS['phpgw']->acl->check($location, PHPGW_ACL_READ, 'frontend')) {
             $location_id = $GLOBALS['phpgw']->locations->get_id('frontend', $location);
             $menus['navigation'][$location_id] = array('text' => lang($name), 'url' => $GLOBALS['phpgw']->link('/', array('menuaction' => "frontend.ui{$name}.index", 'type' => $location_id, 'noframework' => $noframework)));
         }
     }
     $GLOBALS['phpgw_info']['flags']['currentapp'] = $incoming_app;
     return $menus;
 }
コード例 #2
0
 function get_tabs()
 {
     // Get tabs from location hierarchy
     // tabs [location identidier] = {label => ..., link => ...}
     $locations = frontend_bofrontend::get_sections();
     $tabs = array();
     foreach ($locations as $key => $entry) {
         $name = $entry['name'];
         $location = $entry['location'];
         if ($GLOBALS['phpgw']->acl->check($location, PHPGW_ACL_READ, 'frontend')) {
             $location_id = $GLOBALS['phpgw']->locations->get_id('frontend', $location);
             $tabs[$location_id] = array('label' => lang($name), 'link' => $GLOBALS['phpgw']->link('/', array('menuaction' => "frontend.ui{$name}.index", 'location_id' => $location_id, 'noframework' => $noframework)));
         }
         unset($location);
     }
     // this one is for generic entitysupport from the app 'property'
     $entity_frontend = isset($this->config->config_data['entity_frontend']) && $this->config->config_data['entity_frontend'] ? $this->config->config_data['entity_frontend'] : array();
     if ($entity_frontend) {
         $entity = CreateObject('property.soadmin_entity');
     }
     foreach ($entity_frontend as $location) {
         if ($GLOBALS['phpgw']->acl->check($location, PHPGW_ACL_READ, 'property')) {
             $location_id = $GLOBALS['phpgw']->locations->get_id('property', $location);
             $location_arr = explode('.', $location);
             $category = $entity->read_single_category($location_arr[2], $location_arr[3]);
             $tabs[$location_id] = array('label' => $category['name'], 'link' => $GLOBALS['phpgw']->link('/', array('menuaction' => "frontend.uientity.index", 'location_id' => $location_id, 'noframework' => $noframework)));
         }
     }
     $extra_tabs = phpgwapi_cache::session_get('frontend', 'extra_tabs');
     if (isset($extra_tabs)) {
         $tabs = array_merge($extra_tabs, $tabs);
     }
     phpgwapi_cache::session_clear('frontend', 'extra_tabs');
     return $tabs;
 }