Skip to content

Commit

Permalink
Finish webdav experimental module
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jul 10, 2018
1 parent 44626a3 commit f3de1af
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
7 changes: 6 additions & 1 deletion htdocs/admin/dav.php
Expand Up @@ -35,7 +35,10 @@
$action = GETPOST('action', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');

$arrayofparameters=array('DAV_ALLOW_PUBLIC_DIR'=>array('css'=>'minwidth200'));
$arrayofparameters=array(
'DAV_ALLOW_PUBLIC_DIR'=>array('css'=>'minwidth200', 'enabled'=>1),
'DAV_ALLOW_ECM_DIR'=>array('css'=>'minwidth200', 'enabled'=>$conf->ecm->enabled)
);


/*
Expand Down Expand Up @@ -76,6 +79,8 @@

foreach($arrayofparameters as $key => $val)
{
if (isset($val['enabled']) && empty($val['enabled'])) continue;

print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip'));
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css'])?'minwidth200':$val['css']).'" value="' . $conf->global->$key . '"></td></tr>';
Expand Down
15 changes: 13 additions & 2 deletions htdocs/dav/fileserver.php
Expand Up @@ -98,9 +98,20 @@
$nodes = array();

// Enable directories and features according to DAV setup
// / Public docs
if (!empty($conf->global->DAV_ALLOW_PUBLIC_DIR)) $nodes[] = new \Sabre\DAV\FS\Directory($dolibarr_main_data_root. '/dav/public');
// Public dir
if (!empty($conf->global->DAV_ALLOW_PUBLIC_DIR))
{
$nodes[] = new \Sabre\DAV\FS\Directory($dolibarr_main_data_root. '/dav/public');
}
// Private dir
$nodes[] = new \Sabre\DAV\FS\Directory($dolibarr_main_data_root. '/dav/private');
// ECM dir
if (! empty($conf->ecm->enabled) && ! empty($conf->global->DAV_ALLOW_ECM_DIR))
{
$nodes[] = new \Sabre\DAV\FS\Directory($dolibarr_main_data_root. '/ecm');
}



// Principals Backend
//$principalBackend = new \Sabre\DAVACL\PrincipalBackend\Dolibarr($user,$db);
Expand Down
7 changes: 6 additions & 1 deletion htdocs/modulebuilder/template/admin/setup.php
Expand Up @@ -53,7 +53,10 @@
$action = GETPOST('action', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');

$arrayofparameters=array('MYMODULE_MYPARAM1'=>array('css'=>'minwidth200'), 'MYMODULE_MYPARAM2'=>array('css'=>'minwidth500'));
$arrayofparameters=array(
'MYMODULE_MYPARAM1'=>array('css'=>'minwidth200','enabled'=>1),
'MYMODULE_MYPARAM2'=>array('css'=>'minwidth500','enabled'=>1)
);


/*
Expand Down Expand Up @@ -96,6 +99,8 @@

foreach($arrayofparameters as $key => $val)
{
if (isset($val['enabled']) && empty($val['enabled'])) continue;

print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans($key),$langs->trans($key.'Tooltip'));
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css'])?'minwidth200':$val['css']).'" value="' . $conf->global->$key . '"></td></tr>';
Expand Down

0 comments on commit f3de1af

Please sign in to comment.