forked from extern/egroupware
moved fsck to filemanager_admin and get cancel button working with CSP
This commit is contained in:
parent
e25799927d
commit
2a959eb0d2
@ -22,6 +22,7 @@ class filemanager_admin extends filemanager_ui
|
|||||||
*/
|
*/
|
||||||
public $public_functions = array(
|
public $public_functions = array(
|
||||||
'index' => true,
|
'index' => true,
|
||||||
|
'fsck' => true,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -194,4 +195,28 @@ class filemanager_admin extends filemanager_ui
|
|||||||
$GLOBALS['egw_info']['flags']['app_header'] = lang('VFS mounts and versioning');
|
$GLOBALS['egw_info']['flags']['app_header'] = lang('VFS mounts and versioning');
|
||||||
$tpl->exec('filemanager.filemanager_admin.index',$content,$sel_options,$readonlys);
|
$tpl->exec('filemanager.filemanager_admin.index',$content,$sel_options,$readonlys);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run fsck on sqlfs
|
||||||
|
*/
|
||||||
|
function fsck()
|
||||||
|
{
|
||||||
|
if ($_POST['cancel'])
|
||||||
|
{
|
||||||
|
egw_framework::redirect_link('/admin/index.php', null, 'admin');
|
||||||
|
}
|
||||||
|
$check_only = !isset($_POST['fix']);
|
||||||
|
|
||||||
|
if (!($msgs = sqlfs_utils::fsck($check_only)))
|
||||||
|
{
|
||||||
|
$msgs = lang('Filesystem check reported no problems.');
|
||||||
|
}
|
||||||
|
$content = '<p>'.implode("</p>\n<p>", (array)$msgs)."</p>\n";
|
||||||
|
|
||||||
|
$content .= html::form('<p>'.($check_only&&is_array($msgs)?html::submit_button('fix', lang('Fix reported problems')):'').
|
||||||
|
html::submit_button('cancel', lang('Cancel')).'</p>',
|
||||||
|
'','/index.php',array('menuaction'=>'filemanager.filemanager_admin.fsck'));
|
||||||
|
|
||||||
|
$GLOBALS['egw']->framework->render($content, lang('Admin').' - '.lang('Check virtual filesystem'), true);
|
||||||
|
}
|
||||||
}
|
}
|
@ -14,15 +14,6 @@
|
|||||||
*/
|
*/
|
||||||
class filemanager_hooks
|
class filemanager_hooks
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* Functions callable via menuaction
|
|
||||||
*
|
|
||||||
* @var unknown_type
|
|
||||||
*/
|
|
||||||
var $public_functions = array(
|
|
||||||
'fsck' => true,
|
|
||||||
);
|
|
||||||
|
|
||||||
static $appname = 'filemanager';
|
static $appname = 'filemanager';
|
||||||
static $foldercount = 1;
|
static $foldercount = 1;
|
||||||
|
|
||||||
@ -116,7 +107,7 @@ class filemanager_hooks
|
|||||||
$file = Array(
|
$file = Array(
|
||||||
'Site Configuration' => egw::link('/index.php','menuaction=admin.uiconfig.index&appname='.self::$appname),
|
'Site Configuration' => egw::link('/index.php','menuaction=admin.uiconfig.index&appname='.self::$appname),
|
||||||
'Custom fields' => egw::link('/index.php','menuaction=admin.customfields.edit&appname='.self::$appname),
|
'Custom fields' => egw::link('/index.php','menuaction=admin.customfields.edit&appname='.self::$appname),
|
||||||
'Check virtual filesystem' => egw::link('/index.php','menuaction=filemanager.filemanager_hooks.fsck'),
|
'Check virtual filesystem' => egw::link('/index.php','menuaction=filemanager.filemanager_admin.fsck'),
|
||||||
'VFS mounts and versioning' => egw::link('/index.php', 'menuaction=filemanager.filemanager_admin.index'),
|
'VFS mounts and versioning' => egw::link('/index.php', 'menuaction=filemanager.filemanager_admin.index'),
|
||||||
);
|
);
|
||||||
if ($location == 'admin')
|
if ($location == 'admin')
|
||||||
@ -265,30 +256,6 @@ class filemanager_hooks
|
|||||||
return $settings;
|
return $settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Run fsck on sqlfs
|
|
||||||
*/
|
|
||||||
function fsck()
|
|
||||||
{
|
|
||||||
if (!isset($GLOBALS['egw_info']['user']['apps']['admin']))
|
|
||||||
{
|
|
||||||
throw new egw_exception_no_permission_admin();
|
|
||||||
}
|
|
||||||
$check_only = !isset($_POST['fix']);
|
|
||||||
|
|
||||||
if (!($msgs = sqlfs_utils::fsck($check_only)))
|
|
||||||
{
|
|
||||||
$msgs = lang('Filesystem check reported no problems.');
|
|
||||||
}
|
|
||||||
$content = '<p>'.implode("</p>\n<p>", (array)$msgs)."</p>\n";
|
|
||||||
|
|
||||||
$content .= html::form('<p>'.($check_only&&is_array($msgs)?html::submit_button('fix', lang('Fix reported problems')):'').
|
|
||||||
html::submit_button('cancel', lang('Cancel'), "window.location.href='".egw::link('/admin/index.php')."'; return false;").'</p>',
|
|
||||||
'','/index.php',array('menuaction'=>'filemanager.filemanager_hooks.fsck'));
|
|
||||||
|
|
||||||
$GLOBALS['egw']->framework->render($content, lang('Admin').' - '.lang('Check virtual filesystem'), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register filemanager as handler for directories
|
* Register filemanager as handler for directories
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user