mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-30 18:39:28 +00:00
add custom sabredev browser view
This commit is contained in:
@@ -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
@@ -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!
|
||||
|
||||
Reference in New Issue
Block a user