diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-12-28 11:28:50 -0500 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-12-28 11:28:50 -0500 |
commit | 34d7450d3c13342715e90ec21bceaa13e1baa876 (patch) | |
tree | a2d8f2f22ad3fe9b56f01fe2db0357f9b963e660 /app/Template/config | |
parent | 88d84073aecbe8bdc5f10825b6d7ca6b81c5f7b1 (diff) |
Template helpers refactoring
Diffstat (limited to 'app/Template/config')
-rw-r--r-- | app/Template/config/about.php | 8 | ||||
-rw-r--r-- | app/Template/config/api.php | 6 | ||||
-rw-r--r-- | app/Template/config/application.php | 20 | ||||
-rw-r--r-- | app/Template/config/board.php | 20 | ||||
-rw-r--r-- | app/Template/config/layout.php | 2 | ||||
-rw-r--r-- | app/Template/config/sidebar.php | 10 | ||||
-rw-r--r-- | app/Template/config/webhook.php | 18 |
7 files changed, 42 insertions, 42 deletions
diff --git a/app/Template/config/about.php b/app/Template/config/about.php index 3f34f802..d96e6bdd 100644 --- a/app/Template/config/about.php +++ b/app/Template/config/about.php @@ -21,19 +21,19 @@ <ul> <li> <?= t('Database driver:') ?> - <strong><?= Helper\escape(DB_DRIVER) ?></strong> + <strong><?= $this->e(DB_DRIVER) ?></strong> </li> <?php if (DB_DRIVER === 'sqlite'): ?> <li> <?= t('Database size:') ?> - <strong><?= Helper\format_bytes($db_size) ?></strong> + <strong><?= $this->formatBytes($db_size) ?></strong> </li> <li> - <?= Helper\a(t('Download the database'), 'config', 'downloadDb', array(), true) ?> + <?= $this->a(t('Download the database'), 'config', 'downloadDb', array(), true) ?> <?= t('(Gzip compressed Sqlite file)') ?> </li> <li> - <?= Helper\a(t('Optimize the database'), 'config', 'optimizeDb', array(), true) ?> + <?= $this->a(t('Optimize the database'), 'config', 'optimizeDb', array(), true) ?> <?= t('(VACUUM command)') ?> </li> <?php endif ?> diff --git a/app/Template/config/api.php b/app/Template/config/api.php index 20a02340..0df90835 100644 --- a/app/Template/config/api.php +++ b/app/Template/config/api.php @@ -5,14 +5,14 @@ <ul> <li> <?= t('API token:') ?> - <strong><?= Helper\escape($values['api_token']) ?></strong> + <strong><?= $this->e($values['api_token']) ?></strong> </li> <li> <?= t('API endpoint:') ?> - <input type="text" class="auto-select" readonly="readonly" value="<?= Helper\get_current_base_url().'jsonrpc.php' ?>"> + <input type="text" class="auto-select" readonly="readonly" value="<?= $this->getCurrentBaseUrl().'jsonrpc.php' ?>"> </li> <li> - <?= Helper\a(t('Reset token'), 'config', 'token', array('type' => 'api'), true) ?> + <?= $this->a(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 c92975bc..26f3743e 100644 --- a/app/Template/config/application.php +++ b/app/Template/config/application.php @@ -2,22 +2,22 @@ <h2><?= t('Application settings') ?></h2> </div> <section> -<form method="post" action="<?= Helper\u('config', 'application') ?>" autocomplete="off"> +<form method="post" action="<?= $this->u('config', 'application') ?>" autocomplete="off"> - <?= Helper\form_csrf() ?> + <?= $this->formCsrf() ?> - <?= Helper\form_label(t('Application URL'), 'application_url') ?> - <?= Helper\form_text('application_url', $values, $errors, array('placeholder="http://example.kanboard.net/"')) ?><br/> + <?= $this->formLabel(t('Application URL'), 'application_url') ?> + <?= $this->formText('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> - <?= Helper\form_label(t('Language'), 'application_language') ?> - <?= Helper\form_select('application_language', $languages, $values, $errors) ?><br/> + <?= $this->formLabel(t('Language'), 'application_language') ?> + <?= $this->formSelect('application_language', $languages, $values, $errors) ?><br/> - <?= Helper\form_label(t('Timezone'), 'application_timezone') ?> - <?= Helper\form_select('application_timezone', $timezones, $values, $errors) ?><br/> + <?= $this->formLabel(t('Timezone'), 'application_timezone') ?> + <?= $this->formSelect('application_timezone', $timezones, $values, $errors) ?><br/> - <?= Helper\form_label(t('Date format'), 'application_date_format') ?> - <?= Helper\form_select('application_date_format', $date_formats, $values, $errors) ?><br/> + <?= $this->formLabel(t('Date format'), 'application_date_format') ?> + <?= $this->formSelect('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> <div class="form-actions"> diff --git a/app/Template/config/board.php b/app/Template/config/board.php index f260d084..3bd4ecbd 100644 --- a/app/Template/config/board.php +++ b/app/Template/config/board.php @@ -2,24 +2,24 @@ <h2><?= t('Board settings') ?></h2> </div> <section> -<form method="post" action="<?= Helper\u('config', 'board') ?>" autocomplete="off"> +<form method="post" action="<?= $this->u('config', 'board') ?>" autocomplete="off"> - <?= Helper\form_csrf() ?> + <?= $this->formCsrf() ?> - <?= Helper\form_label(t('Task highlight period'), 'board_highlight_period') ?> - <?= Helper\form_number('board_highlight_period', $values, $errors) ?><br/> + <?= $this->formLabel(t('Task highlight period'), 'board_highlight_period') ?> + <?= $this->formNumber('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> - <?= Helper\form_label(t('Refresh interval for public board'), 'board_public_refresh_interval') ?> - <?= Helper\form_number('board_public_refresh_interval', $values, $errors) ?><br/> + <?= $this->formLabel(t('Refresh interval for public board'), 'board_public_refresh_interval') ?> + <?= $this->formNumber('board_public_refresh_interval', $values, $errors) ?><br/> <p class="form-help"><?= t('Frequency in second (60 seconds by default)') ?></p> - <?= Helper\form_label(t('Refresh interval for private board'), 'board_private_refresh_interval') ?> - <?= Helper\form_number('board_private_refresh_interval', $values, $errors) ?><br/> + <?= $this->formLabel(t('Refresh interval for private board'), 'board_private_refresh_interval') ?> + <?= $this->formNumber('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> - <?= Helper\form_label(t('Default columns for new projects (Comma-separated)'), 'board_columns') ?> - <?= Helper\form_text('board_columns', $values, $errors) ?><br/> + <?= $this->formLabel(t('Default columns for new projects (Comma-separated)'), 'board_columns') ?> + <?= $this->formText('board_columns', $values, $errors) ?><br/> <p class="form-help"><?= t('Default values are "%s"', $default_columns) ?></p> <div class="form-actions"> diff --git a/app/Template/config/layout.php b/app/Template/config/layout.php index e0ac2fa8..028f138c 100644 --- a/app/Template/config/layout.php +++ b/app/Template/config/layout.php @@ -1,7 +1,7 @@ <section id="main"> <section class="sidebar-container" id="config-section"> - <?= Helper\template('config/sidebar') ?> + <?= $this->render('config/sidebar') ?> <div class="sidebar-content"> <?= $config_content_for_layout ?> diff --git a/app/Template/config/sidebar.php b/app/Template/config/sidebar.php index 5870ca81..8e6fa379 100644 --- a/app/Template/config/sidebar.php +++ b/app/Template/config/sidebar.php @@ -2,19 +2,19 @@ <h2><?= t('Actions') ?></h2> <ul> <li> - <?= Helper\a(t('About'), 'config', 'index') ?> + <?= $this->a(t('About'), 'config', 'index') ?> </li> <li> - <?= Helper\a(t('Application settings'), 'config', 'application') ?> + <?= $this->a(t('Application settings'), 'config', 'application') ?> </li> <li> - <?= Helper\a(t('Board settings'), 'config', 'board') ?> + <?= $this->a(t('Board settings'), 'config', 'board') ?> </li> <li> - <?= Helper\a(t('Webhooks'), 'config', 'webhook') ?> + <?= $this->a(t('Webhooks'), 'config', 'webhook') ?> </li> <li> - <?= Helper\a(t('API'), 'config', 'api') ?> + <?= $this->a(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 abd8da5f..d4f06d3f 100644 --- a/app/Template/config/webhook.php +++ b/app/Template/config/webhook.php @@ -2,15 +2,15 @@ <h2><?= t('Webhook settings') ?></h2> </div> <section> -<form method="post" action="<?= Helper\u('config', 'webhook') ?>" autocomplete="off"> +<form method="post" action="<?= $this->u('config', 'webhook') ?>" autocomplete="off"> - <?= Helper\form_csrf() ?> + <?= $this->formCsrf() ?> - <?= Helper\form_label(t('Webhook URL for task creation'), 'webhook_url_task_creation') ?> - <?= Helper\form_text('webhook_url_task_creation', $values, $errors) ?><br/> + <?= $this->formLabel(t('Webhook URL for task creation'), 'webhook_url_task_creation') ?> + <?= $this->formText('webhook_url_task_creation', $values, $errors) ?><br/> - <?= Helper\form_label(t('Webhook URL for task modification'), 'webhook_url_task_modification') ?> - <?= Helper\form_text('webhook_url_task_modification', $values, $errors) ?><br/> + <?= $this->formLabel(t('Webhook URL for task modification'), 'webhook_url_task_modification') ?> + <?= $this->formText('webhook_url_task_modification', $values, $errors) ?><br/> <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> @@ -25,14 +25,14 @@ <ul> <li> <?= t('Webhook token:') ?> - <strong><?= Helper\escape($values['webhook_token']) ?></strong> + <strong><?= $this->e($values['webhook_token']) ?></strong> </li> <li> <?= t('URL for task creation:') ?> - <input type="text" class="auto-select" readonly="readonly" value="<?= Helper\get_current_base_url().Helper\u('webhook', 'task', array('token' => $values['webhook_token'])) ?>"> + <input type="text" class="auto-select" readonly="readonly" value="<?= $this->getCurrentBaseUrl().$this->u('webhook', 'task', array('token' => $values['webhook_token'])) ?>"> </li> <li> - <?= Helper\a(t('Reset token'), 'config', 'token', array('type' => 'webhook'), true) ?> + <?= $this->a(t('Reset token'), 'config', 'token', array('type' => 'webhook'), true) ?> </li> </ul> </section>
\ No newline at end of file |