From eeac2329baab1fdae7cbf6c707ed2ffd8beb4c1b Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 24 May 2015 16:02:25 -0400 Subject: Helpers refactoring --- app/Template/config/about.php | 6 ++-- app/Template/config/api.php | 4 +-- app/Template/config/application.php | 24 +++++++-------- app/Template/config/board.php | 16 +++++----- app/Template/config/calendar.php | 12 ++++---- app/Template/config/integrations.php | 58 ++++++++++++++++++------------------ app/Template/config/project.php | 16 +++++----- app/Template/config/sidebar.php | 20 ++++++------- app/Template/config/webhook.php | 12 ++++---- 9 files changed, 84 insertions(+), 84 deletions(-) (limited to 'app/Template/config') 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 @@
  • - formatBytes($db_size) ?> + text->bytes($db_size) ?>
  • - a(t('Download the database'), 'config', 'downloadDb', array(), true) ?>  + url->link(t('Download the database'), 'config', 'downloadDb', array(), true) ?> 
  • - a(t('Optimize the database'), 'config', 'optimizeDb', array(), true) ?>  + url->link(t('Optimize the database'), 'config', 'optimizeDb', array(), true) ?> 
  • 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 @@
  • - +
  • - a(t('Reset token'), 'config', 'token', array('type' => 'api'), true) ?> + url->link(t('Reset token'), 'config', 'token', array('type' => 'api'), true) ?>
  • \ 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 @@

    -
    + - formCsrf() ?> + form->csrf() ?> - formLabel(t('Application URL'), 'application_url') ?> - formText('application_url', $values, $errors, array('placeholder="http://example.kanboard.net/"')) ?>
    + form->label(t('Application URL'), 'application_url') ?> + form->text('application_url', $values, $errors, array('placeholder="http://example.kanboard.net/"')) ?>

    - formLabel(t('Language'), 'application_language') ?> - formSelect('application_language', $languages, $values, $errors) ?>
    + form->label(t('Language'), 'application_language') ?> + form->select('application_language', $languages, $values, $errors) ?>
    - formLabel(t('Timezone'), 'application_timezone') ?> - formSelect('application_timezone', $timezones, $values, $errors) ?>
    + form->label(t('Timezone'), 'application_timezone') ?> + form->select('application_timezone', $timezones, $values, $errors) ?>
    - formLabel(t('Date format'), 'application_date_format') ?> - formSelect('application_date_format', $date_formats, $values, $errors) ?>
    + form->label(t('Date format'), 'application_date_format') ?> + form->select('application_date_format', $date_formats, $values, $errors) ?>

    - formLabel(t('Custom Stylesheet'), 'application_stylesheet') ?> - formTextarea('application_stylesheet', $values, $errors) ?>
    + form->label(t('Custom Stylesheet'), 'application_stylesheet') ?> + form->textarea('application_stylesheet', $values, $errors) ?>
    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 @@

    - + - formCsrf() ?> + form->csrf() ?> - formLabel(t('Task highlight period'), 'board_highlight_period') ?> - formNumber('board_highlight_period', $values, $errors) ?>
    + form->label(t('Task highlight period'), 'board_highlight_period') ?> + form->number('board_highlight_period', $values, $errors) ?>

    - formLabel(t('Refresh interval for public board'), 'board_public_refresh_interval') ?> - formNumber('board_public_refresh_interval', $values, $errors) ?>
    + form->label(t('Refresh interval for public board'), 'board_public_refresh_interval') ?> + form->number('board_public_refresh_interval', $values, $errors) ?>

    - formLabel(t('Refresh interval for private board'), 'board_private_refresh_interval') ?> - formNumber('board_private_refresh_interval', $values, $errors) ?>
    + form->label(t('Refresh interval for private board'), 'board_private_refresh_interval') ?> + form->number('board_private_refresh_interval', $values, $errors) ?>

    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 @@

    - + - formCsrf() ?> + form->csrf() ?>

    - formRadios('calendar_project_tasks', array( + 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 @@

    - formRadios('calendar_user_tasks', array( + 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) ?>

    - formCheckbox('calendar_user_subtasks_time_tracking', t('Show subtasks based on the time tracking'), 1, $values['calendar_user_subtasks_time_tracking'] == 1) ?> - formCheckbox('calendar_user_subtasks_forecast', t('Show subtask estimates (forecast of future work)'), 1, $values['calendar_user_subtasks_forecast'] == 1) ?> + form->checkbox('calendar_user_subtasks_time_tracking', t('Show subtasks based on the time tracking'), 1, $values['calendar_user_subtasks_time_tracking'] == 1) ?> + form->checkbox('calendar_user_subtasks_forecast', t('Show subtask estimates (forecast of future work)'), 1, $values['calendar_user_subtasks_forecast'] == 1) ?>
    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 @@

    - + - formCsrf() ?> + form->csrf() ?>

     

    -
    +

     

    -
    +

     

    -
    +

     

    - formCheckbox('integration_gravatar', t('Enable Gravatar images'), 1, $values['integration_gravatar'] == 1) ?> + form->checkbox('integration_gravatar', t('Enable Gravatar images'), 1, $values['integration_gravatar'] == 1) ?>

    - formCheckbox('integration_jabber', t('Send notifications to Jabber'), 1, $values['integration_jabber'] == 1) ?> + form->checkbox('integration_jabber', t('Send notifications to Jabber'), 1, $values['integration_jabber'] == 1) ?> - formLabel(t('XMPP server address'), 'integration_jabber_server') ?> - formText('integration_jabber_server', $values, $errors, array('placeholder="tcp://myserver:5222"')) ?> + form->label(t('XMPP server address'), 'integration_jabber_server') ?> + form->text('integration_jabber_server', $values, $errors, array('placeholder="tcp://myserver:5222"')) ?>

    - formLabel(t('Jabber domain'), 'integration_jabber_domain') ?> - formText('integration_jabber_domain', $values, $errors, array('placeholder="example.com"')) ?> + form->label(t('Jabber domain'), 'integration_jabber_domain') ?> + form->text('integration_jabber_domain', $values, $errors, array('placeholder="example.com"')) ?> - formLabel(t('Username'), 'integration_jabber_username') ?> - formText('integration_jabber_username', $values, $errors) ?> + form->label(t('Username'), 'integration_jabber_username') ?> + form->text('integration_jabber_username', $values, $errors) ?> - formLabel(t('Password'), 'integration_jabber_password') ?> - formPassword('integration_jabber_password', $values, $errors) ?> + form->label(t('Password'), 'integration_jabber_password') ?> + form->password('integration_jabber_password', $values, $errors) ?> - formLabel(t('Jabber nickname'), 'integration_jabber_nickname') ?> - formText('integration_jabber_nickname', $values, $errors) ?> + form->label(t('Jabber nickname'), 'integration_jabber_nickname') ?> + form->text('integration_jabber_nickname', $values, $errors) ?> - formLabel(t('Multi-user chat room'), 'integration_jabber_room') ?> - formText('integration_jabber_room', $values, $errors, array('placeholder="myroom@conference.example.com"')) ?> + form->label(t('Multi-user chat room'), 'integration_jabber_room') ?> + form->text('integration_jabber_room', $values, $errors, array('placeholder="myroom@conference.example.com"')) ?>

    - formCheckbox('integration_hipchat', t('Send notifications to Hipchat'), 1, $values['integration_hipchat'] == 1) ?> + form->checkbox('integration_hipchat', t('Send notifications to Hipchat'), 1, $values['integration_hipchat'] == 1) ?> - formLabel(t('API URL'), 'integration_hipchat_api_url') ?> - formText('integration_hipchat_api_url', $values, $errors) ?> + form->label(t('API URL'), 'integration_hipchat_api_url') ?> + form->text('integration_hipchat_api_url', $values, $errors) ?> - formLabel(t('Room API ID or name'), 'integration_hipchat_room_id') ?> - formText('integration_hipchat_room_id', $values, $errors) ?> + form->label(t('Room API ID or name'), 'integration_hipchat_room_id') ?> + form->text('integration_hipchat_room_id', $values, $errors) ?> - formLabel(t('Room notification token'), 'integration_hipchat_room_token') ?> - formText('integration_hipchat_room_token', $values, $errors) ?> + form->label(t('Room notification token'), 'integration_hipchat_room_token') ?> + form->text('integration_hipchat_room_token', $values, $errors) ?>

     

    - formCheckbox('integration_slack_webhook', t('Send notifications to a Slack channel'), 1, $values['integration_slack_webhook'] == 1) ?> + form->checkbox('integration_slack_webhook', t('Send notifications to a Slack channel'), 1, $values['integration_slack_webhook'] == 1) ?> - formLabel(t('Webhook URL'), 'integration_slack_webhook_url') ?> - formText('integration_slack_webhook_url', $values, $errors) ?> + form->label(t('Webhook URL'), 'integration_slack_webhook_url') ?> + form->text('integration_slack_webhook_url', $values, $errors) ?>

    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 @@

    - + - formCsrf() ?> + form->csrf() ?> - formLabel(t('Default columns for new projects (Comma-separated)'), 'board_columns') ?> - formText('board_columns', $values, $errors) ?>
    + form->label(t('Default columns for new projects (Comma-separated)'), 'board_columns') ?> + form->text('board_columns', $values, $errors) ?>

    - formLabel(t('Default categories for new projects (Comma-separated)'), 'project_categories') ?> - formText('project_categories', $values, $errors) ?>
    + form->label(t('Default categories for new projects (Comma-separated)'), 'project_categories') ?> + form->text('project_categories', $values, $errors) ?>

    - formCheckbox('subtask_restriction', t('Allow only one subtask in progress at the same time for a user'), 1, $values['subtask_restriction'] == 1) ?> - formCheckbox('subtask_time_tracking', t('Enable time tracking for subtasks'), 1, $values['subtask_time_tracking'] == 1) ?> + form->checkbox('subtask_restriction', t('Allow only one subtask in progress at the same time for a user'), 1, $values['subtask_restriction'] == 1) ?> + form->checkbox('subtask_time_tracking', t('Enable time tracking for subtasks'), 1, $values['subtask_time_tracking'] == 1) ?>
    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 @@

    • - a(t('About'), 'config', 'index') ?> + url->link(t('About'), 'config', 'index') ?>
    • - a(t('Application settings'), 'config', 'application') ?> + url->link(t('Application settings'), 'config', 'application') ?>
    • - a(t('Project settings'), 'config', 'project') ?> + url->link(t('Project settings'), 'config', 'project') ?>
    • - a(t('Board settings'), 'config', 'board') ?> + url->link(t('Board settings'), 'config', 'board') ?>
    • - a(t('Calendar settings'), 'config', 'calendar') ?> + url->link(t('Calendar settings'), 'config', 'calendar') ?>
    • - a(t('Link settings'), 'link', 'index') ?> + url->link(t('Link settings'), 'link', 'index') ?>
    • - a(t('Currency rates'), 'currency', 'index') ?> + url->link(t('Currency rates'), 'currency', 'index') ?>
    • - a(t('Integrations'), 'config', 'integrations') ?> + url->link(t('Integrations'), 'config', 'integrations') ?>
    • - a(t('Webhooks'), 'config', 'webhook') ?> + url->link(t('Webhooks'), 'config', 'webhook') ?>
    • - a(t('API'), 'config', 'api') ?> + url->link(t('API'), 'config', 'api') ?>
    \ 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 @@

    - + - formCsrf() ?> + form->csrf() ?> - formLabel(t('Webhook URL'), 'webhook_url') ?> - formText('webhook_url', $values, $errors) ?> + form->label(t('Webhook URL'), 'webhook_url') ?> + form->text('webhook_url', $values, $errors) ?>
    @@ -26,10 +26,10 @@
  • - +
  • - a(t('Reset token'), 'config', 'token', array('type' => 'webhook'), true) ?> + url->link(t('Reset token'), 'config', 'token', array('type' => 'webhook'), true) ?>
  • \ No newline at end of file -- cgit v1.2.3