[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7118] filemanager: menues
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [7118] filemanager: menues |
Date: |
Mon, 14 Mar 2011 15:14:28 +0000 |
Revision: 7118
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7118
Author: sigurdne
Date: 2011-03-14 15:14:27 +0000 (Mon, 14 Mar 2011)
Log Message:
-----------
filemanager: menues
Modified Paths:
--------------
trunk/filemanager/setup/setup.inc.php
Added Paths:
-----------
trunk/filemanager/inc/class.menu.inc.php
Removed Paths:
-------------
trunk/filemanager/inc/hook_admin.inc.php
trunk/filemanager/inc/hook_preferences.inc.php
trunk/filemanager/inc/hook_sidebox_menu.inc.php
Added: trunk/filemanager/inc/class.menu.inc.php
===================================================================
--- trunk/filemanager/inc/class.menu.inc.php (rev 0)
+++ trunk/filemanager/inc/class.menu.inc.php 2011-03-14 15:14:27 UTC (rev
7118)
@@ -0,0 +1,148 @@
+<?php
+ /**
+ * phpGroupWare - filemanager
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2011 Free Software Foundation, Inc.
http://www.fsf.org/
+ * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
+ * @internal Development of this application was funded by
http://www.bergen.kommune.no/bbb_/ekstern/
+ * @package filemanager
+ * @subpackage core
+ * @version $Id$
+ */
+
+ /**
+ * Description
+ * @package filemanager
+ */
+
+ class filemanager_menu
+ {
+ var $sub;
+
+ var $public_functions = array
+ (
+ 'links' => true,
+ );
+
+ function filemanager_menu($sub='')
+ {
+ $this->sub = $sub;
+ }
+
+ /**
+ * Get the menus for the filemanager
+ *
+ * @return array available menus for the current user
+ */
+ public function get_menu()
+ {
+ $incoming_app =
$GLOBALS['phpgw_info']['flags']['currentapp'];
+ $GLOBALS['phpgw_info']['flags']['currentapp'] =
'filemanager';
+
+
+ $menus['navbar'] = array
+ (
+ 'filemanager' => array
+ (
+ 'text' => lang('filemanager'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
"filemanager.uifilemanager.index") ),
+ 'image' => array('filemanager',
'navbar'),
+ 'order' => 35,
+ 'group' => 'uifilemanager'
+ ),
+ );
+
+ $menus['toolbar'] = array();
+
+ if ( $GLOBALS['phpgw']->acl->check('run',
phpgwapi_acl::READ, 'admin')
+ || $GLOBALS['phpgw']->acl->check('admin',
phpgwapi_acl::ADD, 'filemanager'))
+ {
+ $menus['admin'] = array
+ (
+ 'site_configuration' => array
+ (
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('site configuration', array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'filemanager.uifilemanager.admin') ),
+ ),
+ 'edit_user_menu_actions' => array
+ (
+ 'text' => lang('edit user menu
actions'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'filemanager.uifilemanager.edit_actions') )
+ )
+ );
+ }
+
+ if (
isset($GLOBALS['phpgw_info']['user']['apps']['preferences']) )
+ {
+ $menus['preferences'] = array
+ (
+ array
+ (
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('Preferences', array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'filemanager.uifilemanager.preferences') )
+ )
+ );
+
+ $menus['toolbar'][] = array
+ (
+ 'text' =>
$GLOBALS['phpgw']->translation->translate('Preferences', array(), true),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'filemanager.uifilemanager.preferences') ),
+ 'image' => array('filemanager',
'preferences')
+ );
+ }
+/*
+ $menus['navigation'] = array
+ (
+ 'filemanager' => array
+ (
+ 'text' => lang('filemanager'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
"filemanager.uifilemanager.index") ),
+ )
+ );
+*/
+ $GLOBALS['phpgw_info']['flags']['currentapp'] =
$incoming_app;
+ return $menus;
+ }
+
+ function links()
+ {
+
if(!isset($GLOBALS['phpgw_info']['user']['preferences']['filemanager']['horisontal_menus'])
||
$GLOBALS['phpgw_info']['user']['preferences']['filemanager']['horisontal_menus']
== 'no')
+ {
+ return;
+ }
+ $GLOBALS['phpgw']->xslttpl->add_file(array('menu'));
+ $menu_brutto = execMethod('filemanager.menu.get_menu');
+ $selection =
explode('::',$GLOBALS['phpgw_info']['flags']['menu_selection']);
+ $level=0;
+ $menu['navigation'] =
$this->get_sub_menu($menu_brutto['navigation'],$selection,$level);
+ return $menu;
+ }
+
+ function get_sub_menu($children = array(),
$selection=array(),$level='')
+ {
+ $level++;
+ $i=0;
+ foreach($children as $key => $vals)
+ {
+ $menu[] = $vals;
+ if($key == $selection[$level])
+ {
+ $menu[$i]['this'] = true;
+ if(isset($menu[$i]['children']))
+ {
+ $menu[$i]['children'] =
$this->get_sub_menu($menu[$i]['children'],$selection,$level);
+ }
+ }
+ else
+ {
+ if(isset($menu[$i]['children']))
+ {
+ unset($menu[$i]['children']);
+ }
+ }
+ $i++;
+ }
+ return $menu;
+ }
+ }
Property changes on: trunk/filemanager/inc/class.menu.inc.php
___________________________________________________________________
Added: svn:keywords
+ Id Revision
Added: svn:eol-style
+ native
Deleted: trunk/filemanager/inc/hook_admin.inc.php
===================================================================
--- trunk/filemanager/inc/hook_admin.inc.php 2011-03-14 09:40:50 UTC (rev
7117)
+++ trunk/filemanager/inc/hook_admin.inc.php 2011-03-14 15:14:27 UTC (rev
7118)
@@ -1,21 +0,0 @@
-<?php
- /***
- * Filemanager admin hook
- * @author Bettina Gille <address@hidden>
- * @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc
http://www.fsf.org/
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @package filemanager
- * @version $Id$
- */
-
- {
-// Only Modify the $file and $title variables.....
- $file = array
- (
- 'site configuration' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'filemanager.uifilemanager.admin') ),
- 'edit user menu actions' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'filemanager.uifilemanager.edit_actions') )
- );
-// Do not modify below this line
- $GLOBALS['phpgw']->common->display_mainscreen($appname,$file);
- }
-?>
Deleted: trunk/filemanager/inc/hook_preferences.inc.php
===================================================================
--- trunk/filemanager/inc/hook_preferences.inc.php 2011-03-14 09:40:50 UTC
(rev 7117)
+++ trunk/filemanager/inc/hook_preferences.inc.php 2011-03-14 15:14:27 UTC
(rev 7118)
@@ -1,17 +0,0 @@
-<?php
- /***
- * Filemanager preferencest hook
- * @author Bettina Gille <address@hidden>
- * @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc
http://www.fsf.org/
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @package filemanager
- * @version $Id$
- */
-
- {
- $file = array('Preferences' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'filemanager.uifilemanager.preferences')));
- //'Grant Access' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'preferences.uiaclprefs.index', 'acl_app' => $appname)));
- //Do not modify below this line
- display_section($appname,$file);
- }
-?>
Deleted: trunk/filemanager/inc/hook_sidebox_menu.inc.php
===================================================================
--- trunk/filemanager/inc/hook_sidebox_menu.inc.php 2011-03-14 09:40:50 UTC
(rev 7117)
+++ trunk/filemanager/inc/hook_sidebox_menu.inc.php 2011-03-14 15:14:27 UTC
(rev 7118)
@@ -1,28 +0,0 @@
-<?php
- /**
- * Filemanager - Sidebox-Menu for iDots Template
- *
- * This hookfile is for generating an app-specific side menu used in the
idots template set.
- * $menu_title speaks for itself
- * $file is the array with link to app functions
- * display_sidebox can be called as much as you like
- * @author Bettina Gille address@hidden
- * @author Pim Snel <address@hidden>
- * @copyright Copyright (C) 2003-2005 Free Software Foundation, Inc.
http://www.fsf.org/
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @package filemanager
- * @version $Id$
- * @internal $Source$
- */
-
-
- {
- $appname = 'filemanager';
- $menu_title = $GLOBALS['phpgw_info']['apps'][$appname]['title']
. ' '. lang('Menu');
-
- $file[] = array('text' => 'Preferences',
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'filemanager.uifilemanager.preferences')));
-
- display_sidebox($appname,$menu_title,$file);
- }
-?>
Modified: trunk/filemanager/setup/setup.inc.php
===================================================================
--- trunk/filemanager/setup/setup.inc.php 2011-03-14 09:40:50 UTC (rev
7117)
+++ trunk/filemanager/setup/setup.inc.php 2011-03-14 15:14:27 UTC (rev
7118)
@@ -25,10 +25,11 @@
'hooks' => array
(
'add_def_pref',
- 'admin',
+// 'admin',
'deleteaccount',
- 'preferences',
- 'sidebox_menu'
+// 'preferences',
+// 'sidebox_menu'
+ 'menu' => 'filemanager.menu.get_menu'
));
/* Dependencies for this app to work */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7118] filemanager: menues,
Sigurd Nes <=