Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/issuetemplate.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Detail.php')
-rw-r--r--lib/Detail.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/Detail.php b/lib/Detail.php
index 23b2555..935ed3f 100644
--- a/lib/Detail.php
+++ b/lib/Detail.php
@@ -23,15 +23,22 @@
namespace OCA\IssueTemplate;
+use OCP\IRequest;
+
class Detail implements IDetail {
private $section;
+ private $identifier;
private $title;
private $information;
private $type;
- public function __construct($section, $title, $information, $type) {
+ public function __construct($section, $title, $information, $type, $identifier = '') {
$this->section = $section;
+ $this->identifier = $identifier;
+ if ($identifier === '') {
+ $this->identifier = md5($title);
+ }
$this->title = $title;
$this->information = $information;
$this->type = $type;
@@ -46,10 +53,19 @@ class Detail implements IDetail {
}
public function getInformation() {
+ /** @var IRequest $request */
+ $request = \OC::$server->query(IRequest::class);
+ if ($request->getParam('details')) {
+ return $request->getParam('details')[$this->getSection()][$this->getIdentifier()];
+ }
return $this->information;
}
public function getSection() {
return $this->section;
}
+
+ public function getIdentifier() {
+ return $this->identifier;
+ }
} \ No newline at end of file