summaryrefslogtreecommitdiff
path: root/plugins/Calendar/Formatter/ProjectApiFormatter.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Calendar/Formatter/ProjectApiFormatter.php')
-rw-r--r--plugins/Calendar/Formatter/ProjectApiFormatter.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/plugins/Calendar/Formatter/ProjectApiFormatter.php b/plugins/Calendar/Formatter/ProjectApiFormatter.php
new file mode 100644
index 00000000..5520801c
--- /dev/null
+++ b/plugins/Calendar/Formatter/ProjectApiFormatter.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace Kanboard\Plugin\Calendar\Formatter;
+
+/**
+ * Class ProjectApiFormatter
+ *
+ * @package Kanboard\Plugin\Calendar\Formatter
+ */
+class ProjectApiFormatter extends \Kanboard\Formatter\ProjectApiFormatter
+{
+ public function format()
+ {
+ $project = parent::format();
+
+ if (! empty($project)) {
+ $project['url']['calendar'] = $this->helper->url->to('CalendarController', 'project', array('project_id' => $project['id'], 'plugin' => 'Calendar'), '', true);
+ }
+
+ return $project;
+ }
+}