1 | <?php |
---|
2 | |
---|
3 | /** |
---|
4 | * @file |
---|
5 | * Administrative page for configuring workflow extensions. |
---|
6 | */ |
---|
7 | |
---|
8 | /** |
---|
9 | * Menu callback for admin settings. |
---|
10 | */ |
---|
11 | function workflow_extensions_admin_configure() { |
---|
12 | // Form styles |
---|
13 | $form['workflow_extensions_forms'] = array( |
---|
14 | '#type' => 'fieldset', |
---|
15 | '#title' => t('Workflow form styles'), |
---|
16 | '#description' => t('') |
---|
17 | ); |
---|
18 | $radio_options = array( |
---|
19 | WORKFLOW_EXTENSIONS_UI_RADIOS => t('Radio buttons (classic style)'), |
---|
20 | WORKFLOW_EXTENSIONS_UI_BUTTONS => t('Single-action buttons'), |
---|
21 | WORKFLOW_EXTENSIONS_UI_DROPDOWN => t('Dropdown selector') |
---|
22 | ); |
---|
23 | $form['workflow_extensions_forms']['workflow_extensions_ui_style'] = array( |
---|
24 | '#type' => 'radios', |
---|
25 | '#title' => t("Select the form style you'd like to use for changing workflow states"), |
---|
26 | '#options' => $radio_options, |
---|
27 | '#default_value' => variable_get('workflow_extensions_ui_style', WORKFLOW_EXTENSIONS_UI_BUTTONS), |
---|
28 | '#description' => t('') |
---|
29 | ); |
---|
30 | // Buttons |
---|
31 | $form['workflow_extensions_buttons'] = array( |
---|
32 | '#type' => 'fieldset', |
---|
33 | '#title' => t('Workflow labels'), |
---|
34 | '#description' => t('Define fixed-text or tokenized labels to appear on the workflow state change form.') |
---|
35 | ); |
---|
36 | $form['workflow_extensions_buttons']['workflow_extensions_change_state_form_title'] = array( |
---|
37 | '#type' => 'textfield', |
---|
38 | '#title' => t('Title to appear above the state change radio buttons or dropdown selector'), |
---|
39 | '#default_value' => variable_get('workflow_extensions_change_state_form_title', ''), |
---|
40 | '#description' => t('Use <em><none></em> to have no title. If left blank the title is of the format <em><strong>Change [workflow-name] state:</strong></em>. Your text may contain replacement tokens. Tokens require the <strong>Token</strong> module to be enabled.') |
---|
41 | ); |
---|
42 | $form['workflow_extensions_buttons']['workflow_extensions_default_save_button_label'] = array( |
---|
43 | '#type' => 'textfield', |
---|
44 | '#title' => t('Label for the button on the edit form that saves content without changing the workflow state'), |
---|
45 | '#default_value' => variable_get('workflow_extensions_default_save_button_label', ''), |
---|
46 | '#description' => t('Applies only when <strong>Single-action buttons</strong> is selected above. Example: <em>Save, don\'t change state</em>. If left blank, the label will be the <strong>Workflow</strong> module default, i.e. <em>Save</em>. Your text may contain replacement tokens, e.g. <em>Save "[title]" to drafts</em>. Tokens require the <strong>Token</strong> module to be enabled.') |
---|
47 | ); |
---|
48 | $form['workflow_extensions_buttons']['workflow_extensions_change_state_button_label'] = array( |
---|
49 | '#type' => 'textfield', |
---|
50 | '#title' => t('Label pattern for button (or buttons) for transitioning workflow state'), |
---|
51 | '#default_value' => variable_get('workflow_extensions_change_state_button_label', ''), |
---|
52 | '#description' => t('Example: <em>Update [workflow-name] state</em>. If <strong>Single-action buttons</strong> is selected above, use replacement tokens or leave blank. When left blank in single-action mode, the pattern applied is <em>Move to "[workflow-new-state-name]"</em>. For the others styles the default is <em>Submit</em>. Other useful tokens you may want to use are <em>[workflow-name]</em>, <em>[workflow-current-state-name]</em> and <em>[author-name]</em>. Note that your entry applies only to transitions for which no label is already supplied via module <strong>Workflow Named Transitions</strong>, if enabled.') |
---|
53 | ); |
---|
54 | // Comments |
---|
55 | $form['workflow_extensions_comments'] = array( |
---|
56 | '#type' => 'fieldset', |
---|
57 | '#title' => t('Workflow comments'), |
---|
58 | '#description' => t('') |
---|
59 | ); |
---|
60 | $form['workflow_extensions_comments']['workflow_extensions_allow_blank_comments'] = array( |
---|
61 | '#type' => 'checkbox', |
---|
62 | '#title' => t('Allow blank workflow log comments (ticked is the default)'), |
---|
63 | '#default_value' => variable_get('workflow_extensions_allow_blank_comments', TRUE), |
---|
64 | '#description' => t('If ticked and no comment is entered when transitioning state, a blank comment will be attached by default.') |
---|
65 | ); |
---|
66 | // Schedule |
---|
67 | $form['workflow_extensions_schedule'] = array( |
---|
68 | '#type' => 'fieldset', |
---|
69 | '#title' => t('Workflow schedule'), |
---|
70 | '#description' => t('') |
---|
71 | ); |
---|
72 | $form['workflow_extensions_schedule']['workflow_extensions_display_schedule_toggle'] = array( |
---|
73 | '#type' => 'checkbox', |
---|
74 | '#title' => t('Show the form for scheduling workflow transitions only upon selection by the user'), |
---|
75 | '#default_value' => variable_get('workflow_extensions_display_schedule_toggle', TRUE), |
---|
76 | '#description' => t('This prevents users from entering scheduled dates and times and then forgetting to activate the form. Only applies when the user has the "schedule workflow transition" permission.') |
---|
77 | ); |
---|
78 | return system_settings_form($form); |
---|
79 | } |
---|