forked from extern/egroupware
missing file from Klaus commit and removing the obsolete files, you need to run Admin >> register all hooks
This commit is contained in:
parent
0969f08ee5
commit
cd2ad088bf
151
filemanager/inc/class.filemanager_hooks.inc.php
Normal file
151
filemanager/inc/class.filemanager_hooks.inc.php
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* eGroupWare - Hooks for admin, preferences and sidebox-menus
|
||||||
|
*
|
||||||
|
* @link http://www.egroupware.org
|
||||||
|
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||||
|
* @package filemanager
|
||||||
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||||
|
* @version $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class containing admin, preferences and sidebox-menus (used as hooks)
|
||||||
|
*/
|
||||||
|
class filemanager_hooks
|
||||||
|
{
|
||||||
|
function all_hooks($args)
|
||||||
|
{
|
||||||
|
$appname = 'filemanager';
|
||||||
|
$location = is_array($args) ? $args['location'] : $args;
|
||||||
|
//echo "<p>admin_prefs_sidebox_hooks::all_hooks(".print_r($args,True).") appname='$appname', location='$location'</p>\n";
|
||||||
|
|
||||||
|
if ($location == 'sidebox_menu')
|
||||||
|
{
|
||||||
|
$title = $GLOBALS['egw_info']['apps'][$appname]['title'] . ' '. lang('Menu');
|
||||||
|
$file = Array(
|
||||||
|
array(
|
||||||
|
'Search',
|
||||||
|
'text' => 'Search',
|
||||||
|
'link' => $GLOBALS['egw']->link('/index.php',array('menuaction'=>'filemanager.uifilemanager.index', 'action'=>'search')),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
display_sidebox($appname,$title,$file);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($GLOBALS['egw_info']['user']['apps']['preferences'] && $location != 'admin')
|
||||||
|
{
|
||||||
|
$file = array(
|
||||||
|
'Filemanager Preferences' => $GLOBALS['egw']->link('/index.php','menuaction=preferences.uisettings.index&appname='.$appname),
|
||||||
|
'Grant Access' => $GLOBALS['egw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname),
|
||||||
|
);
|
||||||
|
if ($location == 'preferences')
|
||||||
|
{
|
||||||
|
display_section($appname,$file);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
display_sidebox($appname,lang('Preferences'),$file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($GLOBALS['egw_info']['user']['apps']['admin'] && $location != 'preferences')
|
||||||
|
{
|
||||||
|
$file = Array(
|
||||||
|
'Grant Access' => $GLOBALS['egw']->link('/index.php','menuaction=preferences.uiaclprefs.index&acl_app='.$appname),
|
||||||
|
);
|
||||||
|
if ($location == 'admin')
|
||||||
|
{
|
||||||
|
display_section($appname,$file);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
display_sidebox($appname,lang('Admin'),$file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function settings($args)
|
||||||
|
{
|
||||||
|
settype($GLOBALS['settings'],'array');
|
||||||
|
|
||||||
|
$GLOBALS['settings']['display_attrs'] = array(
|
||||||
|
'type' => 'section',
|
||||||
|
'title' => 'Display attributes',
|
||||||
|
'name' => 'display_attrs',
|
||||||
|
'xmlrpc' => True,
|
||||||
|
'admin' => False
|
||||||
|
);
|
||||||
|
|
||||||
|
$file_attributes = Array(
|
||||||
|
'name' => 'File Name',
|
||||||
|
'mime_type' => 'MIME Type',
|
||||||
|
'size' => 'Size',
|
||||||
|
'created' => 'Created',
|
||||||
|
'modified' => 'Modified',
|
||||||
|
'owner' => 'Owner',
|
||||||
|
'createdby_id' => 'Created by',
|
||||||
|
'modifiedby_id' => 'Created by',
|
||||||
|
'modifiedby_id' => 'Modified by',
|
||||||
|
'app' => 'Application',
|
||||||
|
'comment' => 'Comment',
|
||||||
|
'version' => 'Version'
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach($file_attributes as $key => $value)
|
||||||
|
{
|
||||||
|
$GLOBALS['settings'][$key] = array(
|
||||||
|
'type' => 'check',
|
||||||
|
'label' => "$value",
|
||||||
|
'name' => $key,
|
||||||
|
'xmlrpc' => True,
|
||||||
|
'admin' => False
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$GLOBALS['settings']['other_settings'] = array(
|
||||||
|
'type' => 'section',
|
||||||
|
'title' => 'Other settings',
|
||||||
|
'name' => 'other_settings',
|
||||||
|
'xmlrpc' => True,
|
||||||
|
'admin' => False
|
||||||
|
);
|
||||||
|
|
||||||
|
$other_checkboxes = array (
|
||||||
|
"viewinnewwin" => "View documents in new window",
|
||||||
|
"viewonserver" => "View documents on server (if available)",
|
||||||
|
"viewtextplain" => "Unknown MIME-type defaults to text/plain when viewing",
|
||||||
|
"dotdot" => "Show ..",
|
||||||
|
"dotfiles" => "Show .files",
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach($other_checkboxes as $key => $value)
|
||||||
|
{
|
||||||
|
$GLOBALS['settings'][$key] = array(
|
||||||
|
'type' => 'check',
|
||||||
|
'label' => "$value",
|
||||||
|
'name' => $key,
|
||||||
|
'xmlrpc' => True,
|
||||||
|
'admin' => False
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$upload_boxes = array(
|
||||||
|
'1' => '1',
|
||||||
|
'5' => '5',
|
||||||
|
'10' => '10',
|
||||||
|
'20' => '20',
|
||||||
|
'30' => '30'
|
||||||
|
);
|
||||||
|
|
||||||
|
$GLOBALS['settings']['show_upload_boxes'] = array(
|
||||||
|
'label' => 'Default number of upload fields to show',
|
||||||
|
'name' => 'show_upload_boxes',
|
||||||
|
'values' => $upload_boxes,
|
||||||
|
'xmlrpc' => True,
|
||||||
|
'admin' => False
|
||||||
|
);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**************************************************************************\
|
|
||||||
* eGroupWare *
|
|
||||||
* http://www.egroupware.org *
|
|
||||||
* -------------------------------------------- *
|
|
||||||
* This program is free software; you can redistribute it and/or modify it *
|
|
||||||
* under the terms of the GNU General Public License as published by the *
|
|
||||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
|
||||||
* option) any later version. *
|
|
||||||
\**************************************************************************/
|
|
||||||
/* $Id$ */
|
|
||||||
/*
|
|
||||||
|
|
||||||
global $account_id;
|
|
||||||
*/
|
|
||||||
/* NOTE: This is untested */
|
|
||||||
/* WIP: it should get all files owned by $account_id, not just in /home/account_id */
|
|
||||||
/* Should also be capable of transfering files to another user */
|
|
||||||
|
|
||||||
/*
|
|
||||||
$GLOBALS['egw']->vfs->working_id = $account_id;
|
|
||||||
$ls_array = $GLOBALS['egw']->vfs->ls ($GLOBALS['egw']->vfs->fakebase . "/" . $account_id, array (RELATIVE_NONE));
|
|
||||||
while (list ($num, $entry) = each ($ls_array))
|
|
||||||
{
|
|
||||||
$GLOBALS['egw']->vfs->rm ($entry["dir"] . "/" . $entry["name"], array (RELATIVE_NONE));
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
?>
|
|
@ -1,23 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**************************************************************************\
|
|
||||||
* eGroupWare *
|
|
||||||
* http://www.egroupware.org *
|
|
||||||
* Written by Joseph Engo <jengo@phpgroupware.org> *
|
|
||||||
* -------------------------------------------- *
|
|
||||||
* This program is free software; you can redistribute it and/or modify it *
|
|
||||||
* under the terms of the GNU General Public License as published by the *
|
|
||||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
|
||||||
* option) any later version. *
|
|
||||||
\**************************************************************************/
|
|
||||||
|
|
||||||
/* $Id$ */
|
|
||||||
{
|
|
||||||
// Only Modify the $file and $title variables.....
|
|
||||||
$title = $appname;
|
|
||||||
$file = Array(
|
|
||||||
'Preferences' => $GLOBALS['egw']->link('/index.php','menuaction=preferences.uisettings.index&appname=' . $appname)
|
|
||||||
);
|
|
||||||
//Do not modify below this line
|
|
||||||
display_section($appname,$title,$file);
|
|
||||||
}
|
|
||||||
?>
|
|
@ -1,99 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**************************************************************************\
|
|
||||||
* eGroupWare - Filemanager Preferences *
|
|
||||||
* http://egroupware.org *
|
|
||||||
* Modified by Pim Snel <pim@egroupware.org> *
|
|
||||||
* -------------------------------------------- *
|
|
||||||
* This program is free software; you can redistribute it and/or modify it *
|
|
||||||
* under the terms of the GNU General Public License as published by the *
|
|
||||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
|
||||||
* option) *
|
|
||||||
\**************************************************************************/
|
|
||||||
|
|
||||||
/* $Id$ */
|
|
||||||
|
|
||||||
//ExecMethod('filemanager.bofilemanager.check_set_default_prefs');
|
|
||||||
|
|
||||||
/*create_section('TESTING');
|
|
||||||
|
|
||||||
create_check_box('Use new experimental Filemanager?','experimental_new_code','The future filemanager, now for TESTING PURPOSES ONLY, please send bugreports');
|
|
||||||
|
|
||||||
*/
|
|
||||||
settype($GLOBALS['settings'],'array');
|
|
||||||
|
|
||||||
$GLOBALS['settings']['display_attrs'] = array(
|
|
||||||
'type' => 'section',
|
|
||||||
'title' => 'Display attributes',
|
|
||||||
'name' => 'display_attrs',
|
|
||||||
'xmlrpc' => True,
|
|
||||||
'admin' => False
|
|
||||||
);
|
|
||||||
|
|
||||||
$file_attributes = Array(
|
|
||||||
'name' => 'File Name',
|
|
||||||
'mime_type' => 'MIME Type',
|
|
||||||
'size' => 'Size',
|
|
||||||
'created' => 'Created',
|
|
||||||
'modified' => 'Modified',
|
|
||||||
'owner' => 'Owner',
|
|
||||||
'createdby_id' => 'Created by',
|
|
||||||
'modifiedby_id' => 'Created by',
|
|
||||||
'modifiedby_id' => 'Modified by',
|
|
||||||
'app' => 'Application',
|
|
||||||
'comment' => 'Comment',
|
|
||||||
'version' => 'Version'
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach($file_attributes as $key => $value)
|
|
||||||
{
|
|
||||||
$GLOBALS['settings'][$key] = array(
|
|
||||||
'type' => 'check',
|
|
||||||
'label' => "$value",
|
|
||||||
'name' => $key,
|
|
||||||
'xmlrpc' => True,
|
|
||||||
'admin' => False
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$GLOBALS['settings']['other_settings'] = array(
|
|
||||||
'type' => 'section',
|
|
||||||
'title' => 'Other settings',
|
|
||||||
'name' => 'other_settings',
|
|
||||||
'xmlrpc' => True,
|
|
||||||
'admin' => False
|
|
||||||
);
|
|
||||||
|
|
||||||
$other_checkboxes = array (
|
|
||||||
"viewinnewwin" => "View documents in new window",
|
|
||||||
"viewonserver" => "View documents on server (if available)",
|
|
||||||
"viewtextplain" => "Unknown MIME-type defaults to text/plain when viewing",
|
|
||||||
"dotdot" => "Show ..",
|
|
||||||
"dotfiles" => "Show .files",
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach($other_checkboxes as $key => $value)
|
|
||||||
{
|
|
||||||
$GLOBALS['settings'][$key] = array(
|
|
||||||
'type' => 'check',
|
|
||||||
'label' => "$value",
|
|
||||||
'name' => $key,
|
|
||||||
'xmlrpc' => True,
|
|
||||||
'admin' => False
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$upload_boxes = array(
|
|
||||||
'1' => '1',
|
|
||||||
'5' => '5',
|
|
||||||
'10' => '10',
|
|
||||||
'20' => '20',
|
|
||||||
'30' => '30'
|
|
||||||
);
|
|
||||||
|
|
||||||
$GLOBALS['settings']['show_upload_boxes'] = array(
|
|
||||||
'label' => 'Default number of upload fields to show',
|
|
||||||
'name' => 'show_upload_boxes',
|
|
||||||
'values' => $upload_boxes,
|
|
||||||
'xmlrpc' => True,
|
|
||||||
'admin' => False
|
|
||||||
);
|
|
@ -1,41 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**************************************************************************\
|
|
||||||
* eGroupWare - Filemanager Sidebox-Menu for idots-template *
|
|
||||||
* http://www.egroupware.org *
|
|
||||||
* Written by Pim Snel <pim@lingewoud.nl> *
|
|
||||||
* -------------------------------------------- *
|
|
||||||
* This program is free software; you can redistribute it and/or modify it *
|
|
||||||
* under the terms of the GNU General Public License as published by the *
|
|
||||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
|
||||||
* option) any later version. *
|
|
||||||
\**************************************************************************/
|
|
||||||
|
|
||||||
/* $Id$ */
|
|
||||||
{
|
|
||||||
|
|
||||||
/*
|
|
||||||
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
|
|
||||||
*/
|
|
||||||
|
|
||||||
$menu_title = $GLOBALS['egw_info']['apps'][$appname]['title'] . ' '. lang('Menu');
|
|
||||||
$file = Array(
|
|
||||||
array(
|
|
||||||
'Preferences',
|
|
||||||
'text' => 'Filemanager Preferences',
|
|
||||||
'link' => $GLOBALS['egw']->link('/index.php','menuaction=preferences.uisettings.index&appname=filemanager'),
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'Search',
|
|
||||||
'text' => 'Search',
|
|
||||||
'link' => $GLOBALS['egw']->link('/index.php',array('menuaction'=>'filemanager.uifilemanager.index', 'action'=>'search')),
|
|
||||||
)
|
|
||||||
);
|
|
||||||
display_sidebox($appname,$menu_title,$file);
|
|
||||||
}
|
|
||||||
?>
|
|
@ -13,16 +13,15 @@
|
|||||||
|
|
||||||
$setup_info['filemanager']['name'] = 'filemanager';
|
$setup_info['filemanager']['name'] = 'filemanager';
|
||||||
$setup_info['filemanager']['title'] = 'Filemanager';
|
$setup_info['filemanager']['title'] = 'Filemanager';
|
||||||
$setup_info['filemanager']['version'] = '1.5';
|
$setup_info['filemanager']['version'] = '1.4';
|
||||||
$setup_info['filemanager']['app_order'] = 6;
|
$setup_info['filemanager']['app_order'] = 6;
|
||||||
$setup_info['filemanager']['enable'] = 1;
|
$setup_info['filemanager']['enable'] = 1;
|
||||||
$setup_info['filemanager']['tables'] =array('egw_vfs');
|
|
||||||
|
|
||||||
/* The hooks this app includes, needed for hooks registration */
|
/* The hooks this app includes, needed for hooks registration */
|
||||||
$setup_info['filemanager']['hooks']['preferences'] = 'filemanager.admin_prefs_sidebox_hooks.all_hooks';
|
$setup_info['filemanager']['hooks']['preferences'] = 'filemanager.filemanager_hooks.all_hooks';
|
||||||
$setup_info['filemanager']['hooks']['deleteaccount'] = 'filemanager.admin_prefs_sidebox_hooks.all_hooks';
|
$setup_info['filemanager']['hooks']['deleteaccount'] = 'filemanager.filemanager_hooks.all_hooks';
|
||||||
$setup_info['filemanager']['hooks'][] = 'settings';
|
$setup_info['filemanager']['hooks']['settings'] = 'filemanager.filemanager_hooks.settings';
|
||||||
$setup_info['filemanager']['hooks']['sidebox_menu'] = 'filemanager.admin_prefs_sidebox_hooks.all_hooks';
|
$setup_info['filemanager']['hooks']['sidebox_menu'] = 'filemanager.filemanager_hooks.all_hooks';
|
||||||
|
|
||||||
|
|
||||||
/* Dependencies for this app to work */
|
/* Dependencies for this app to work */
|
||||||
|
Loading…
Reference in New Issue
Block a user