summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-02-09 09:41:04 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2018-02-27 12:25:53 +0100
commit038aad73c77468244ed3b50d2d82e9a263dead0e (patch)
tree45daa11a7b01d30b5d726ce373c86f4e9a985a23 /lib/public
parent4f83462f6788b863bdeaa1e29c344dfc7550698c (diff)
downloadnextcloud-server-038aad73c77468244ed3b50d2d82e9a263dead0e.tar.gz
nextcloud-server-038aad73c77468244ed3b50d2d82e9a263dead0e.zip
Add missing phpdoc for public API
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/AppFramework/Http/Template/PublicTemplateResponse.php52
-rw-r--r--lib/public/AppFramework/Http/Template/SimpleMenuAction.php14
2 files changed, 65 insertions, 1 deletions
diff --git a/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php b/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php
index 2a209c88b9f..2f2d47d7bca 100644
--- a/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php
+++ b/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php
@@ -25,33 +25,67 @@ namespace OCP\AppFramework\Http\Template;
use OCP\AppFramework\Http\TemplateResponse;
+/**
+ * Class PublicTemplateResponse
+ *
+ * @package OCP\AppFramework\Http\Template
+ * @since 14.0.0
+ */
class PublicTemplateResponse extends TemplateResponse {
private $headerTitle = '';
private $headerDetails = '';
private $headerActions = [];
+ /**
+ * PublicTemplateResponse constructor.
+ *
+ * @param string $appName
+ * @param string $templateName
+ * @param array $params
+ * @since 14.0.0
+ */
public function __construct(string $appName, string $templateName, array $params = array()) {
parent::__construct($appName, $templateName, $params, 'public');
\OC_Util::addScript('core', 'public/publicpage');
}
+ /**
+ * @param string $title
+ * @since 14.0.0
+ */
public function setHeaderTitle(string $title) {
$this->headerTitle = $title;
}
+ /**
+ * @return string
+ * @since 14.0.0
+ */
public function getHeaderTitle(): string {
return $this->headerTitle;
}
+ /**
+ * @param string $details
+ * @since 14.0.0
+ */
public function setHeaderDetails(string $details) {
$this->headerDetails = $details;
}
+ /**
+ * @return string
+ * @since 14.0.0
+ */
public function getHeaderDetails(): string {
return $this->headerDetails;
}
+ /**
+ * @param array $actions
+ * @since 14.0.0
+ */
public function setHeaderActions(array $actions) {
foreach ($actions as $action) {
if ($actions instanceof IMenuAction) {
@@ -61,10 +95,18 @@ class PublicTemplateResponse extends TemplateResponse {
}
}
+ /**
+ * @param IMenuAction $action
+ * @since 14.0.0
+ */
public function addAction(IMenuAction $action) {
$this->headerActions[] = $action;
}
+ /**
+ * @return IMenuAction
+ * @since 14.0.0
+ */
public function getPrimaryAction(): IMenuAction {
$lowest = null;
foreach ($this->headerActions as $action) {
@@ -75,12 +117,17 @@ class PublicTemplateResponse extends TemplateResponse {
return $lowest;
}
+ /**
+ * @return int
+ * @since 14.0.0
+ */
public function getActionCount(): int {
return count($this->headerActions);
}
/**
* @return IMenuAction[]
+ * @since 14.0.0
*/
public function getOtherActions(): array {
$list = [];
@@ -93,7 +140,10 @@ class PublicTemplateResponse extends TemplateResponse {
return $list;
}
-
+ /**
+ * @return string
+ * @since 14.0.0
+ */
public function render() {
$params = array_merge($this->getParams(), [
'template' => $this,
diff --git a/lib/public/AppFramework/Http/Template/SimpleMenuAction.php b/lib/public/AppFramework/Http/Template/SimpleMenuAction.php
index 087887eed51..b81403c7a53 100644
--- a/lib/public/AppFramework/Http/Template/SimpleMenuAction.php
+++ b/lib/public/AppFramework/Http/Template/SimpleMenuAction.php
@@ -29,6 +29,7 @@ use OCP\Util;
* Class SimpleMenuAction
*
* @package OCP\AppFramework\Http\Template
+ * @since 14.0.0
*/
class SimpleMenuAction implements IMenuAction {
@@ -59,6 +60,7 @@ class SimpleMenuAction implements IMenuAction {
* @param string $link
* @param int $priority
* @param string $detail
+ * @since 14.0.0
*/
public function __construct(string $id, string $label, string $icon, string $link = '', int $priority = 100, string $detail = '') {
$this->id = $id;
@@ -71,6 +73,7 @@ class SimpleMenuAction implements IMenuAction {
/**
* @param string $id
+ * @since 14.0.0
*/
public function setId(string $id) {
$this->id = $id;
@@ -78,6 +81,7 @@ class SimpleMenuAction implements IMenuAction {
/**
* @param string $label
+ * @since 14.0.0
*/
public function setLabel(string $label) {
$this->label = $label;
@@ -85,6 +89,7 @@ class SimpleMenuAction implements IMenuAction {
/**
* @param string $detail
+ * @since 14.0.0
*/
public function setDetail(string $detail) {
$this->detail = $detail;
@@ -92,6 +97,7 @@ class SimpleMenuAction implements IMenuAction {
/**
* @param string $icon
+ * @since 14.0.0
*/
public function setIcon(string $icon) {
$this->icon = $icon;
@@ -99,6 +105,7 @@ class SimpleMenuAction implements IMenuAction {
/**
* @param string $link
+ * @since 14.0.0
*/
public function setLink(string $link) {
$this->link = $link;
@@ -106,6 +113,7 @@ class SimpleMenuAction implements IMenuAction {
/**
* @param int $priority
+ * @since 14.0.0
*/
public function setPriority(int $priority) {
$this->priority = $priority;
@@ -113,6 +121,7 @@ class SimpleMenuAction implements IMenuAction {
/**
* @return string
+ * @since 14.0.0
*/
public function getId(): string {
return $this->id;
@@ -120,6 +129,7 @@ class SimpleMenuAction implements IMenuAction {
/**
* @return string
+ * @since 14.0.0
*/
public function getLabel(): string {
return $this->label;
@@ -127,6 +137,7 @@ class SimpleMenuAction implements IMenuAction {
/**
* @return string
+ * @since 14.0.0
*/
public function getIcon(): string {
return $this->icon;
@@ -134,6 +145,7 @@ class SimpleMenuAction implements IMenuAction {
/**
* @return string
+ * @since 14.0.0
*/
public function getLink(): string {
return $this->link;
@@ -141,6 +153,7 @@ class SimpleMenuAction implements IMenuAction {
/**
* @return int
+ * @since 14.0.0
*/
public function getPriority(): int {
return $this->priority;
@@ -148,6 +161,7 @@ class SimpleMenuAction implements IMenuAction {
/**
* @return string
+ * @since 14.0.0
*/
public function render(): string {
$detailContent = ($this->detail !== '') ? '&nbsp;<span class="download-size">(' . Util::sanitizeHTML($this->detail) . ')</span>' : '';