2011-03-01 17:20:16 -05:00
|
|
|
<?php
|
2024-05-23 03:26:56 -04:00
|
|
|
|
2011-03-01 17:20:16 -05:00
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2011-03-13 12:25:34 -04:00
|
|
|
*/
|
2025-11-17 09:32:54 -05:00
|
|
|
use OC\Template\Template;
|
2025-02-25 12:44:02 -05:00
|
|
|
use OCP\Server;
|
|
|
|
|
use OCP\Template\ITemplateManager;
|
2016-04-12 06:49:11 -04:00
|
|
|
|
2011-03-02 16:28:32 -05:00
|
|
|
/**
|
2013-07-17 17:27:25 -04:00
|
|
|
* This class provides the templates for ownCloud.
|
2025-02-25 12:44:02 -05:00
|
|
|
* @deprecated 32.0.0 Use \OCP\Template\ITemplateManager instead
|
2011-03-02 16:28:32 -05:00
|
|
|
*/
|
2025-11-17 09:32:54 -05:00
|
|
|
class OC_Template extends Template {
|
2011-03-01 17:20:16 -05:00
|
|
|
/**
|
2014-05-19 11:50:53 -04:00
|
|
|
* Shortcut to print a simple page for guests
|
2012-09-22 20:39:11 -04:00
|
|
|
* @param string $application The application we render the template for
|
|
|
|
|
* @param string $name Name of the template
|
2025-02-27 05:59:44 -05:00
|
|
|
* @param array $parameters Parameters for the template
|
2012-09-22 20:39:11 -04:00
|
|
|
* @return bool
|
2025-02-25 12:44:02 -05:00
|
|
|
* @deprecated 32.0.0 Use \OCP\Template\ITemplateManager instead
|
2011-03-01 17:20:16 -05:00
|
|
|
*/
|
2020-04-09 07:53:40 -04:00
|
|
|
public static function printGuestPage($application, $name, $parameters = []) {
|
2025-02-25 12:44:02 -05:00
|
|
|
Server::get(ITemplateManager::class)->printGuestPage($application, $name, $parameters);
|
|
|
|
|
return true;
|
2011-03-01 17:20:16 -05:00
|
|
|
}
|
2012-11-24 12:07:26 -05:00
|
|
|
|
2012-12-03 17:53:06 -05:00
|
|
|
/**
|
2017-07-19 13:44:10 -04:00
|
|
|
* Print a fatal error page and terminates the script
|
|
|
|
|
* @param string $error_msg The error message to show
|
|
|
|
|
* @param string $hint An optional hint message - needs to be properly escape
|
2018-06-26 04:27:43 -04:00
|
|
|
* @param int $statusCode
|
2025-02-25 12:44:02 -05:00
|
|
|
* @return never
|
|
|
|
|
* @deprecated 32.0.0 Use \OCP\Template\ITemplateManager instead
|
2017-07-19 13:44:10 -04:00
|
|
|
*/
|
2020-04-09 07:53:40 -04:00
|
|
|
public static function printErrorPage($error_msg, $hint = '', $statusCode = 500) {
|
2025-02-25 12:44:02 -05:00
|
|
|
Server::get(ITemplateManager::class)->printErrorPage($error_msg, $hint, $statusCode);
|
2012-12-03 17:53:06 -05:00
|
|
|
}
|
2014-05-19 11:50:53 -04:00
|
|
|
|
2013-06-10 06:56:45 -04:00
|
|
|
/**
|
|
|
|
|
* print error page using Exception details
|
2017-07-19 09:48:58 -04:00
|
|
|
* @param Exception|Throwable $exception
|
2018-06-26 04:27:43 -04:00
|
|
|
* @param int $statusCode
|
2025-02-25 12:44:02 -05:00
|
|
|
* @return never
|
|
|
|
|
* @deprecated 32.0.0 Use \OCP\Template\ITemplateManager instead
|
2013-06-10 06:56:45 -04:00
|
|
|
*/
|
2018-06-26 04:27:43 -04:00
|
|
|
public static function printExceptionErrorPage($exception, $statusCode = 503) {
|
2025-02-25 12:44:02 -05:00
|
|
|
Server::get(ITemplateManager::class)->printExceptionErrorPage($exception, $statusCode);
|
2023-12-05 15:45:58 -05:00
|
|
|
}
|
2011-03-01 17:20:16 -05:00
|
|
|
}
|