add custom sabredev browser view

This commit is contained in:
Ivymaster
2026-06-30 14:17:10 +02:00
parent 5499c522cb
commit 790d0d99ec
2 changed files with 31 additions and 1 deletions
@@ -0,0 +1,29 @@
<?php
/**
* Browser plugin variant that keeps SabreDAV's HTML overview but hides the
* verbose WebDAV properties table.
*/
class MySabre_DAV_Browser_NoProperties extends \Sabre\DAV\Browser\Plugin
{
public function generateDirectoryIndex($path)
{
$html = parent::generateDirectoryIndex($path);
$cleanHtml = preg_replace(
'#<section><h1>Properties</h1>.*?</section>#s',
'',
$html,
1
);
$cleanHtml = preg_replace(
'#<section><h1>Actions</h1>.*?</section>#s',
'',
$cleanHtml,
1
);
return $cleanHtml === null ? $html : $cleanHtml;
}
}
+2 -1
View File
@@ -5,6 +5,7 @@ require_once dirname(__DIR__).'/vendor/autoload.php';
require_once 'auth.class.php';
require_once 'Caldav_Backend.php';
require_once('Principal.php');
require_once 'MySabre_DAV_Browser_NoProperties.php';
/*
//PHP Error To Exception
function exception_error_handler($errno, $errstr, $errfile, $errline ) {
@@ -45,7 +46,7 @@ $aclPlugin = new \Sabre\DAVACL\Plugin();
$server->addPlugin($aclPlugin);
// Support for html frontend
$browser = new \Sabre\DAV\Browser\Plugin();
$browser = new MySabre_DAV_Browser_NoProperties();
$server->addPlugin($browser);
// And off we go!