summaryrefslogtreecommitdiff
path: root/app/Helper
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-01-31 20:14:51 -0500
committerFrederic Guillot <fred@kanboard.net>2016-01-31 20:14:51 -0500
commit271543431e999032d6e91197633119309fa6c622 (patch)
tree93c84f80092b6b463dcb643ee6bd0302c18fdf47 /app/Helper
parent0bc51620c731e7cfd10db5e064fc04693205b21c (diff)
Make project creation form a inline popup
Diffstat (limited to 'app/Helper')
-rw-r--r--app/Helper/Layout.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/app/Helper/Layout.php b/app/Helper/Layout.php
new file mode 100644
index 00000000..685c7b84
--- /dev/null
+++ b/app/Helper/Layout.php
@@ -0,0 +1,32 @@
+<?php
+
+namespace Kanboard\Helper;
+
+use Kanboard\Core\Base;
+
+/**
+ * Layout helpers
+ *
+ * @package helper
+ * @author Frederic Guillot
+ */
+class Layout extends Base
+{
+ /**
+ * Render a template without the layout if Ajax request
+ *
+ * @access public
+ * @param string $template Template name
+ * @param array $params Template parameters
+ * @return string
+ */
+ public function app($template, array $params = array())
+ {
+ if ($this->request->isAjax()) {
+ return $this->template->render($template, $params);
+ }
+
+ $params['board_selector'] = $this->projectUserRole->getActiveProjectsByUser($this->userSession->getId());
+ return $this->template->layout($template, $params);
+ }
+}