dolibarr/htdocs/dav/dav.lib.php

73 lines
2.1 KiB
PHP
Raw Permalink Normal View History

2018-03-27 16:50:01 +02:00
<?php
/* Copyright (C) 2018 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
2018-03-27 16:50:01 +02:00
*
* 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 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2019-09-23 21:55:30 +02:00
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2018-03-27 16:50:01 +02:00
*/
/**
* \file htdocs/dav/dav.lib.php
* \ingroup dav
* \brief Server DAV
*/
// define CDAV_CONTACT_TAG if not
if (!defined('CDAV_CONTACT_TAG')) {
2024-01-05 04:18:53 +01:00
if (getDolGlobalString('CDAV_CONTACT_TAG')) {
define('CDAV_CONTACT_TAG', getDolGlobalString('CDAV_CONTACT_TAG'));
} else {
define('CDAV_CONTACT_TAG', '');
}
2018-03-27 16:50:01 +02:00
}
// define CDAV_URI_KEY if not
if (!defined('CDAV_URI_KEY')) {
2024-01-05 03:41:22 +01:00
if (getDolGlobalString('CDAV_URI_KEY')) {
define('CDAV_URI_KEY', getDolGlobalString('CDAV_URI_KEY'));
} else {
define('CDAV_URI_KEY', substr(md5($_SERVER['HTTP_HOST']), 0, 8));
}
2018-03-27 16:50:01 +02:00
}
2018-04-07 19:12:29 +02:00
/**
* Prepare array with list of tabs
*
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
2018-04-07 19:12:29 +02:00
*/
function dav_admin_prepare_head()
{
global $db, $langs, $conf;
$h = 0;
$head = array();
2023-02-08 12:18:46 +01:00
$head[$h][0] = DOL_URL_ROOT.'/admin/dav.php';
2018-04-07 19:12:29 +02:00
$head[$h][1] = $langs->trans("WebDAV");
$head[$h][2] = 'webdav';
$h++;
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
2019-09-05 14:24:13 +02:00
complete_head_from_modules($conf, $langs, null, $head, $h, 'admindav');
2018-04-07 19:12:29 +02:00
2019-09-05 14:24:13 +02:00
complete_head_from_modules($conf, $langs, null, $head, $h, 'admindav', 'remove');
2018-04-07 19:12:29 +02:00
return $head;
}