summaryrefslogtreecommitdiff
path: root/app/Template/config
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-05-24 16:02:25 -0400
committerFrederic Guillot <fred@kanboard.net>2015-05-24 16:02:25 -0400
commiteeac2329baab1fdae7cbf6c707ed2ffd8beb4c1b (patch)
tree511c2fe47f8fbb1ea90e59e7a7a7f5e3530aa9ed /app/Template/config
parent65e9e5d1bed9f88ecfd43eb2c1e780a7c22c151f (diff)
Helpers refactoring
Diffstat (limited to 'app/Template/config')
-rw-r--r--app/Template/config/about.php6
-rw-r--r--app/Template/config/api.php4
-rw-r--r--app/Template/config/application.php24
-rw-r--r--app/Template/config/board.php16
-rw-r--r--app/Template/config/calendar.php12
-rw-r--r--app/Template/config/integrations.php58
-rw-r--r--app/Template/config/project.php16
-rw-r--r--app/Template/config/sidebar.php20
-rw-r--r--app/Template/config/webhook.php12
9 files changed, 84 insertions, 84 deletions
diff --git a/app/Template/config/about.php b/app/Template/config/about.php
index b6ed43e5..a7098c1b 100644
--- a/app/Template/config/about.php
+++ b/app/Template/config/about.php
@@ -25,14 +25,14 @@
<?php if (DB_DRIVER === 'sqlite'): ?>
<li>
<?= t('Database size:') ?>
- <strong><?= $this->formatBytes($db_size) ?></strong>
+ <strong><?= $this->text->bytes($db_size) ?></strong>
</li>
<li>
- <?= $this->a(t('Download the database'), 'config', 'downloadDb', array(), true) ?>&nbsp;
+ <?= $this->url->link(t('Download the database'), 'config', 'downloadDb', array(), true) ?>&nbsp;
<?= t('(Gzip compressed Sqlite file)') ?>
</li>
<li>
- <?= $this->a(t('Optimize the database'), 'config', 'optimizeDb', array(), true) ?>&nbsp;
+ <?= $this->url->link(t('Optimize the database'), 'config', 'optimizeDb', array(), true) ?>&nbsp;
<?= t('(VACUUM command)') ?>
</li>
<?php endif ?>
diff --git a/app/Template/config/api.php b/app/Template/config/api.php
index 0df90835..489f1968 100644
--- a/app/Template/config/api.php
+++ b/app/Template/config/api.php
@@ -9,10 +9,10 @@
</li>
<li>
<?= t('API endpoint:') ?>
- <input type="text" class="auto-select" readonly="readonly" value="<?= $this->getCurrentBaseUrl().'jsonrpc.php' ?>">
+ <input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->base().'jsonrpc.php' ?>">
</li>
<li>
- <?= $this->a(t('Reset token'), 'config', 'token', array('type' => 'api'), true) ?>
+ <?= $this->url->link(t('Reset token'), 'config', 'token', array('type' => 'api'), true) ?>
</li>
</ul>
</section> \ No newline at end of file
diff --git a/app/Template/config/application.php b/app/Template/config/application.php
index f6c9db94..7d4c811d 100644
--- a/app/Template/config/application.php
+++ b/app/Template/config/application.php
@@ -2,26 +2,26 @@
<h2><?= t('Application settings') ?></h2>
</div>
<section>
-<form method="post" action="<?= $this->u('config', 'application') ?>" autocomplete="off">
+<form method="post" action="<?= $this->url->href('config', 'application') ?>" autocomplete="off">
- <?= $this->formCsrf() ?>
+ <?= $this->form->csrf() ?>
- <?= $this->formLabel(t('Application URL'), 'application_url') ?>
- <?= $this->formText('application_url', $values, $errors, array('placeholder="http://example.kanboard.net/"')) ?><br/>
+ <?= $this->form->label(t('Application URL'), 'application_url') ?>
+ <?= $this->form->text('application_url', $values, $errors, array('placeholder="http://example.kanboard.net/"')) ?><br/>
<p class="form-help"><?= t('Example: http://example.kanboard.net/ (used by email notifications)') ?></p>
- <?= $this->formLabel(t('Language'), 'application_language') ?>
- <?= $this->formSelect('application_language', $languages, $values, $errors) ?><br/>
+ <?= $this->form->label(t('Language'), 'application_language') ?>
+ <?= $this->form->select('application_language', $languages, $values, $errors) ?><br/>
- <?= $this->formLabel(t('Timezone'), 'application_timezone') ?>
- <?= $this->formSelect('application_timezone', $timezones, $values, $errors) ?><br/>
+ <?= $this->form->label(t('Timezone'), 'application_timezone') ?>
+ <?= $this->form->select('application_timezone', $timezones, $values, $errors) ?><br/>
- <?= $this->formLabel(t('Date format'), 'application_date_format') ?>
- <?= $this->formSelect('application_date_format', $date_formats, $values, $errors) ?><br/>
+ <?= $this->form->label(t('Date format'), 'application_date_format') ?>
+ <?= $this->form->select('application_date_format', $date_formats, $values, $errors) ?><br/>
<p class="form-help"><?= t('ISO format is always accepted, example: "%s" and "%s"', date('Y-m-d'), date('Y_m_d')) ?></p>
- <?= $this->formLabel(t('Custom Stylesheet'), 'application_stylesheet') ?>
- <?= $this->formTextarea('application_stylesheet', $values, $errors) ?><br/>
+ <?= $this->form->label(t('Custom Stylesheet'), 'application_stylesheet') ?>
+ <?= $this->form->textarea('application_stylesheet', $values, $errors) ?><br/>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
diff --git a/app/Template/config/board.php b/app/Template/config/board.php
index c55003de..19a4bcd7 100644
--- a/app/Template/config/board.php
+++ b/app/Template/config/board.php
@@ -2,20 +2,20 @@
<h2><?= t('Board settings') ?></h2>
</div>
<section>
-<form method="post" action="<?= $this->u('config', 'board') ?>" autocomplete="off">
+<form method="post" action="<?= $this->url->href('config', 'board') ?>" autocomplete="off">
- <?= $this->formCsrf() ?>
+ <?= $this->form->csrf() ?>
- <?= $this->formLabel(t('Task highlight period'), 'board_highlight_period') ?>
- <?= $this->formNumber('board_highlight_period', $values, $errors) ?><br/>
+ <?= $this->form->label(t('Task highlight period'), 'board_highlight_period') ?>
+ <?= $this->form->number('board_highlight_period', $values, $errors) ?><br/>
<p class="form-help"><?= t('Period (in second) to consider a task was modified recently (0 to disable, 2 days by default)') ?></p>
- <?= $this->formLabel(t('Refresh interval for public board'), 'board_public_refresh_interval') ?>
- <?= $this->formNumber('board_public_refresh_interval', $values, $errors) ?><br/>
+ <?= $this->form->label(t('Refresh interval for public board'), 'board_public_refresh_interval') ?>
+ <?= $this->form->number('board_public_refresh_interval', $values, $errors) ?><br/>
<p class="form-help"><?= t('Frequency in second (60 seconds by default)') ?></p>
- <?= $this->formLabel(t('Refresh interval for private board'), 'board_private_refresh_interval') ?>
- <?= $this->formNumber('board_private_refresh_interval', $values, $errors) ?><br/>
+ <?= $this->form->label(t('Refresh interval for private board'), 'board_private_refresh_interval') ?>
+ <?= $this->form->number('board_private_refresh_interval', $values, $errors) ?><br/>
<p class="form-help"><?= t('Frequency in second (0 to disable this feature, 10 seconds by default)') ?></p>
<div class="form-actions">
diff --git a/app/Template/config/calendar.php b/app/Template/config/calendar.php
index 300d3419..1cc985c8 100644
--- a/app/Template/config/calendar.php
+++ b/app/Template/config/calendar.php
@@ -2,13 +2,13 @@
<h2><?= t('Calendar settings') ?></h2>
</div>
<section>
-<form method="post" action="<?= $this->u('config', 'calendar') ?>" autocomplete="off">
+<form method="post" action="<?= $this->url->href('config', 'calendar') ?>" autocomplete="off">
- <?= $this->formCsrf() ?>
+ <?= $this->form->csrf() ?>
<h3><?= t('Project calendar view') ?></h3>
<div class="listing">
- <?= $this->formRadios('calendar_project_tasks', array(
+ <?= $this->form->radios('calendar_project_tasks', array(
'date_creation' => t('Show tasks based on the creation date'),
'date_started' => t('Show tasks based on the start date'),
), $values) ?>
@@ -16,14 +16,14 @@
<h3><?= t('User calendar view') ?></h3>
<div class="listing">
- <?= $this->formRadios('calendar_user_tasks', array(
+ <?= $this->form->radios('calendar_user_tasks', array(
'date_creation' => t('Show tasks based on the creation date'),
'date_started' => t('Show tasks based on the start date'),
), $values) ?>
<h4><?= t('Subtasks time tracking') ?></h4>
- <?= $this->formCheckbox('calendar_user_subtasks_time_tracking', t('Show subtasks based on the time tracking'), 1, $values['calendar_user_subtasks_time_tracking'] == 1) ?>
- <?= $this->formCheckbox('calendar_user_subtasks_forecast', t('Show subtask estimates (forecast of future work)'), 1, $values['calendar_user_subtasks_forecast'] == 1) ?>
+ <?= $this->form->checkbox('calendar_user_subtasks_time_tracking', t('Show subtasks based on the time tracking'), 1, $values['calendar_user_subtasks_time_tracking'] == 1) ?>
+ <?= $this->form->checkbox('calendar_user_subtasks_forecast', t('Show subtask estimates (forecast of future work)'), 1, $values['calendar_user_subtasks_forecast'] == 1) ?>
</div>
<div class="form-actions">
diff --git a/app/Template/config/integrations.php b/app/Template/config/integrations.php
index f9e7f537..a1299806 100644
--- a/app/Template/config/integrations.php
+++ b/app/Template/config/integrations.php
@@ -2,81 +2,81 @@
<h2><?= t('Integration with third-party services') ?></h2>
</div>
-<form method="post" action="<?= $this->u('config', 'integrations') ?>" autocomplete="off">
+<form method="post" action="<?= $this->url->href('config', 'integrations') ?>" autocomplete="off">
- <?= $this->formCsrf() ?>
+ <?= $this->form->csrf() ?>
<h3><img src="assets/img/mailgun-icon.png"/>&nbsp;<?= t('Mailgun (incoming emails)') ?></h3>
<div class="listing">
- <input type="text" class="auto-select" readonly="readonly" value="<?= $this->getCurrentBaseUrl().$this->u('webhook', 'mailgun', array('token' => $values['webhook_token'])) ?>"/><br/>
+ <input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->base().$this->url->href('webhook', 'mailgun', array('token' => $values['webhook_token'])) ?>"/><br/>
<p class="form-help"><a href="http://kanboard.net/documentation/mailgun" target="_blank"><?= t('Help on Mailgun integration') ?></a></p>
</div>
<h3><img src="assets/img/sendgrid-icon.png"/>&nbsp;<?= t('Sendgrid (incoming emails)') ?></h3>
<div class="listing">
- <input type="text" class="auto-select" readonly="readonly" value="<?= $this->getCurrentBaseUrl().$this->u('webhook', 'sendgrid', array('token' => $values['webhook_token'])) ?>"/><br/>
+ <input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->base().$this->url->href('webhook', 'sendgrid', array('token' => $values['webhook_token'])) ?>"/><br/>
<p class="form-help"><a href="http://kanboard.net/documentation/sendgrid" target="_blank"><?= t('Help on Sendgrid integration') ?></a></p>
</div>
<h3><img src="assets/img/postmark-icon.png"/>&nbsp;<?= t('Postmark (incoming emails)') ?></h3>
<div class="listing">
- <input type="text" class="auto-select" readonly="readonly" value="<?= $this->getCurrentBaseUrl().$this->u('webhook', 'postmark', array('token' => $values['webhook_token'])) ?>"/><br/>
+ <input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->base().$this->url->href('webhook', 'postmark', array('token' => $values['webhook_token'])) ?>"/><br/>
<p class="form-help"><a href="http://kanboard.net/documentation/postmark" target="_blank"><?= t('Help on Postmark integration') ?></a></p>
</div>
<h3><img src="assets/img/gravatar-icon.png"/>&nbsp;<?= t('Gravatar') ?></h3>
<div class="listing">
- <?= $this->formCheckbox('integration_gravatar', t('Enable Gravatar images'), 1, $values['integration_gravatar'] == 1) ?>
+ <?= $this->form->checkbox('integration_gravatar', t('Enable Gravatar images'), 1, $values['integration_gravatar'] == 1) ?>
</div>
<h3><img src="assets/img/jabber-icon.png"/> <?= t('Jabber (XMPP)') ?></h3>
<div class="listing">
- <?= $this->formCheckbox('integration_jabber', t('Send notifications to Jabber'), 1, $values['integration_jabber'] == 1) ?>
+ <?= $this->form->checkbox('integration_jabber', t('Send notifications to Jabber'), 1, $values['integration_jabber'] == 1) ?>
- <?= $this->formLabel(t('XMPP server address'), 'integration_jabber_server') ?>
- <?= $this->formText('integration_jabber_server', $values, $errors, array('placeholder="tcp://myserver:5222"')) ?>
+ <?= $this->form->label(t('XMPP server address'), 'integration_jabber_server') ?>
+ <?= $this->form->text('integration_jabber_server', $values, $errors, array('placeholder="tcp://myserver:5222"')) ?>
<p class="form-help"><?= t('The server address must use this format: "tcp://hostname:5222"') ?></p>
- <?= $this->formLabel(t('Jabber domain'), 'integration_jabber_domain') ?>
- <?= $this->formText('integration_jabber_domain', $values, $errors, array('placeholder="example.com"')) ?>
+ <?= $this->form->label(t('Jabber domain'), 'integration_jabber_domain') ?>
+ <?= $this->form->text('integration_jabber_domain', $values, $errors, array('placeholder="example.com"')) ?>
- <?= $this->formLabel(t('Username'), 'integration_jabber_username') ?>
- <?= $this->formText('integration_jabber_username', $values, $errors) ?>
+ <?= $this->form->label(t('Username'), 'integration_jabber_username') ?>
+ <?= $this->form->text('integration_jabber_username', $values, $errors) ?>
- <?= $this->formLabel(t('Password'), 'integration_jabber_password') ?>
- <?= $this->formPassword('integration_jabber_password', $values, $errors) ?>
+ <?= $this->form->label(t('Password'), 'integration_jabber_password') ?>
+ <?= $this->form->password('integration_jabber_password', $values, $errors) ?>
- <?= $this->formLabel(t('Jabber nickname'), 'integration_jabber_nickname') ?>
- <?= $this->formText('integration_jabber_nickname', $values, $errors) ?>
+ <?= $this->form->label(t('Jabber nickname'), 'integration_jabber_nickname') ?>
+ <?= $this->form->text('integration_jabber_nickname', $values, $errors) ?>
- <?= $this->formLabel(t('Multi-user chat room'), 'integration_jabber_room') ?>
- <?= $this->formText('integration_jabber_room', $values, $errors, array('placeholder="myroom@conference.example.com"')) ?>
+ <?= $this->form->label(t('Multi-user chat room'), 'integration_jabber_room') ?>
+ <?= $this->form->text('integration_jabber_room', $values, $errors, array('placeholder="myroom@conference.example.com"')) ?>
<p class="form-help"><a href="http://kanboard.net/documentation/jabber" target="_blank"><?= t('Help on Jabber integration') ?></a></p>
</div>
<h3><img src="assets/img/hipchat-icon.png"/> <?= t('Hipchat') ?></h3>
<div class="listing">
- <?= $this->formCheckbox('integration_hipchat', t('Send notifications to Hipchat'), 1, $values['integration_hipchat'] == 1) ?>
+ <?= $this->form->checkbox('integration_hipchat', t('Send notifications to Hipchat'), 1, $values['integration_hipchat'] == 1) ?>
- <?= $this->formLabel(t('API URL'), 'integration_hipchat_api_url') ?>
- <?= $this->formText('integration_hipchat_api_url', $values, $errors) ?>
+ <?= $this->form->label(t('API URL'), 'integration_hipchat_api_url') ?>
+ <?= $this->form->text('integration_hipchat_api_url', $values, $errors) ?>
- <?= $this->formLabel(t('Room API ID or name'), 'integration_hipchat_room_id') ?>
- <?= $this->formText('integration_hipchat_room_id', $values, $errors) ?>
+ <?= $this->form->label(t('Room API ID or name'), 'integration_hipchat_room_id') ?>
+ <?= $this->form->text('integration_hipchat_room_id', $values, $errors) ?>
- <?= $this->formLabel(t('Room notification token'), 'integration_hipchat_room_token') ?>
- <?= $this->formText('integration_hipchat_room_token', $values, $errors) ?>
+ <?= $this->form->label(t('Room notification token'), 'integration_hipchat_room_token') ?>
+ <?= $this->form->text('integration_hipchat_room_token', $values, $errors) ?>
<p class="form-help"><a href="http://kanboard.net/documentation/hipchat" target="_blank"><?= t('Help on Hipchat integration') ?></a></p>
</div>
<h3><i class="fa fa-slack fa-fw"></i>&nbsp;<?= t('Slack') ?></h3>
<div class="listing">
- <?= $this->formCheckbox('integration_slack_webhook', t('Send notifications to a Slack channel'), 1, $values['integration_slack_webhook'] == 1) ?>
+ <?= $this->form->checkbox('integration_slack_webhook', t('Send notifications to a Slack channel'), 1, $values['integration_slack_webhook'] == 1) ?>
- <?= $this->formLabel(t('Webhook URL'), 'integration_slack_webhook_url') ?>
- <?= $this->formText('integration_slack_webhook_url', $values, $errors) ?>
+ <?= $this->form->label(t('Webhook URL'), 'integration_slack_webhook_url') ?>
+ <?= $this->form->text('integration_slack_webhook_url', $values, $errors) ?>
<p class="form-help"><a href="http://kanboard.net/documentation/slack" target="_blank"><?= t('Help on Slack integration') ?></a></p>
</div>
diff --git a/app/Template/config/project.php b/app/Template/config/project.php
index b559d632..90dd9c8e 100644
--- a/app/Template/config/project.php
+++ b/app/Template/config/project.php
@@ -2,20 +2,20 @@
<h2><?= t('Project settings') ?></h2>
</div>
<section>
-<form method="post" action="<?= $this->u('config', 'project') ?>" autocomplete="off">
+<form method="post" action="<?= $this->url->href('config', 'project') ?>" autocomplete="off">
- <?= $this->formCsrf() ?>
+ <?= $this->form->csrf() ?>
- <?= $this->formLabel(t('Default columns for new projects (Comma-separated)'), 'board_columns') ?>
- <?= $this->formText('board_columns', $values, $errors) ?><br/>
+ <?= $this->form->label(t('Default columns for new projects (Comma-separated)'), 'board_columns') ?>
+ <?= $this->form->text('board_columns', $values, $errors) ?><br/>
<p class="form-help"><?= t('Default values are "%s"', $default_columns) ?></p>
- <?= $this->formLabel(t('Default categories for new projects (Comma-separated)'), 'project_categories') ?>
- <?= $this->formText('project_categories', $values, $errors) ?><br/>
+ <?= $this->form->label(t('Default categories for new projects (Comma-separated)'), 'project_categories') ?>
+ <?= $this->form->text('project_categories', $values, $errors) ?><br/>
<p class="form-help"><?= t('Example: "Bug, Feature Request, Improvement"') ?></p>
- <?= $this->formCheckbox('subtask_restriction', t('Allow only one subtask in progress at the same time for a user'), 1, $values['subtask_restriction'] == 1) ?>
- <?= $this->formCheckbox('subtask_time_tracking', t('Enable time tracking for subtasks'), 1, $values['subtask_time_tracking'] == 1) ?>
+ <?= $this->form->checkbox('subtask_restriction', t('Allow only one subtask in progress at the same time for a user'), 1, $values['subtask_restriction'] == 1) ?>
+ <?= $this->form->checkbox('subtask_time_tracking', t('Enable time tracking for subtasks'), 1, $values['subtask_time_tracking'] == 1) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
diff --git a/app/Template/config/sidebar.php b/app/Template/config/sidebar.php
index 4bae9e2e..7f946dee 100644
--- a/app/Template/config/sidebar.php
+++ b/app/Template/config/sidebar.php
@@ -2,34 +2,34 @@
<h2><?= t('Actions') ?></h2>
<ul>
<li>
- <?= $this->a(t('About'), 'config', 'index') ?>
+ <?= $this->url->link(t('About'), 'config', 'index') ?>
</li>
<li>
- <?= $this->a(t('Application settings'), 'config', 'application') ?>
+ <?= $this->url->link(t('Application settings'), 'config', 'application') ?>
</li>
<li>
- <?= $this->a(t('Project settings'), 'config', 'project') ?>
+ <?= $this->url->link(t('Project settings'), 'config', 'project') ?>
</li>
<li>
- <?= $this->a(t('Board settings'), 'config', 'board') ?>
+ <?= $this->url->link(t('Board settings'), 'config', 'board') ?>
</li>
<li>
- <?= $this->a(t('Calendar settings'), 'config', 'calendar') ?>
+ <?= $this->url->link(t('Calendar settings'), 'config', 'calendar') ?>
</li>
<li>
- <?= $this->a(t('Link settings'), 'link', 'index') ?>
+ <?= $this->url->link(t('Link settings'), 'link', 'index') ?>
</li>
<li>
- <?= $this->a(t('Currency rates'), 'currency', 'index') ?>
+ <?= $this->url->link(t('Currency rates'), 'currency', 'index') ?>
</li>
<li>
- <?= $this->a(t('Integrations'), 'config', 'integrations') ?>
+ <?= $this->url->link(t('Integrations'), 'config', 'integrations') ?>
</li>
<li>
- <?= $this->a(t('Webhooks'), 'config', 'webhook') ?>
+ <?= $this->url->link(t('Webhooks'), 'config', 'webhook') ?>
</li>
<li>
- <?= $this->a(t('API'), 'config', 'api') ?>
+ <?= $this->url->link(t('API'), 'config', 'api') ?>
</li>
</ul>
</div> \ No newline at end of file
diff --git a/app/Template/config/webhook.php b/app/Template/config/webhook.php
index 06f7870b..73ca3598 100644
--- a/app/Template/config/webhook.php
+++ b/app/Template/config/webhook.php
@@ -2,12 +2,12 @@
<h2><?= t('Webhook settings') ?></h2>
</div>
<section>
-<form method="post" action="<?= $this->u('config', 'webhook') ?>" autocomplete="off">
+<form method="post" action="<?= $this->url->href('config', 'webhook') ?>" autocomplete="off">
- <?= $this->formCsrf() ?>
+ <?= $this->form->csrf() ?>
- <?= $this->formLabel(t('Webhook URL'), 'webhook_url') ?>
- <?= $this->formText('webhook_url', $values, $errors) ?>
+ <?= $this->form->label(t('Webhook URL'), 'webhook_url') ?>
+ <?= $this->form->text('webhook_url', $values, $errors) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
@@ -26,10 +26,10 @@
</li>
<li>
<?= t('URL for task creation:') ?>
- <input type="text" class="auto-select" readonly="readonly" value="<?= $this->getCurrentBaseUrl().$this->u('webhook', 'task', array('token' => $values['webhook_token'])) ?>">
+ <input type="text" class="auto-select" readonly="readonly" value="<?= $this->url->base().$this->url->href('webhook', 'task', array('token' => $values['webhook_token'])) ?>">
</li>
<li>
- <?= $this->a(t('Reset token'), 'config', 'token', array('type' => 'webhook'), true) ?>
+ <?= $this->url->link(t('Reset token'), 'config', 'token', array('type' => 'webhook'), true) ?>
</li>
</ul>
</section> \ No newline at end of file