You are here

function theme_elysia_cron_settings_form in Elysia Cron 7.2

Same name and namespace in other branches
  1. 5.2 elysia_cron.admin.inc \theme_elysia_cron_settings_form()
  2. 5 elysia_cron.admin.inc \theme_elysia_cron_settings_form()
  3. 6.2 elysia_cron.admin.inc \theme_elysia_cron_settings_form()
  4. 6 elysia_cron.admin.inc \theme_elysia_cron_settings_form()
  5. 7 elysia_cron.admin.inc \theme_elysia_cron_settings_form()

Theme function for general settings form.

Parameters

array $variables: Theme vars.

Return value

string Ready for print HTML.

File

./elysia_cron.admin.inc, line 556
Admin page callbacks for the elysia cron module.

Code

function theme_elysia_cron_settings_form(array &$variables) {
  $form =& $variables['form'];
  $coutput = '<table>';
  $i = 0;
  foreach (element_children($form['single_job']) as $c) {
    $key = substr($c, 12);
    if ($i++ == 0) {
      $coutput .= '<tr>' . '<th>' . $form['single_job'][$c]['_elysia_cron_job_disabled_' . $key]['#title'] . '</th>' . '<th>' . $form['single_job'][$c]['_elysia_cron_job_rule_' . $key]['#title'] . '</th>' . '<th colspan="2">' . $form['single_job'][$c]['_elysia_cron_job_weight_' . $key]['#title'] . '</th>' . '<th>' . $form['single_job'][$c]['_elysia_cron_job_channel_' . $key]['#title'] . '</th>' . '</tr>';
    }
    $def_weight = $form['single_job'][$c]['_elysia_cron_job_weight_' . $key]['#description'];
    $posted_key = $form['single_job'][$c]['_elysia_cron_seljob_rule_' . $key]['#name'];
    $posted_val = !empty($_REQUEST[$posted_key]) ? $_REQUEST[$posted_key] : FALSE;
    $form['single_job'][$c]['_elysia_cron_job_rule_' . $key]['#prefix'] = '<span id="_ec_custom_' . $key . '" style="' . ($posted_val != 'custom' ? 'display: none;' : '') . '">';
    $form['single_job'][$c]['_elysia_cron_job_rule_' . $key]['#suffix'] = '</span>';
    $form['single_job'][$c]['_elysia_cron_job_rule_' . $key]['#title'] = NULL;
    $form['single_job'][$c]['_elysia_cron_job_rule_' . $key]['#description'] = NULL;
    $form['single_job'][$c]['_elysia_cron_seljob_rule_' . $key]['#prefix'] = '<span id="_ec_select_' . $key . '" style="' . ($posted_val == 'custom' ? 'display: none;' : '') . '">';
    $form['single_job'][$c]['_elysia_cron_seljob_rule_' . $key]['#suffix'] = '</span>';
    $form['single_job'][$c]['_elysia_cron_seljob_rule_' . $key]['#title'] = NULL;
    $form['single_job'][$c]['_elysia_cron_seljob_rule_' . $key]['#description'] = NULL;
    $form['single_job'][$c]['_elysia_cron_seljob_rule_' . $key]['#attributes']['class'][] = 'ec-select';
    $form['single_job'][$c]['_elysia_cron_seljob_rule_' . $key]['#attributes']['data-key'] = $key;
    $form['single_job'][$c]['_elysia_cron_job_weight_' . $key]['#title'] = NULL;
    $form['single_job'][$c]['_elysia_cron_job_weight_' . $key]['#description'] = NULL;
    $form['single_job'][$c]['_elysia_cron_job_weight_' . $key]['#attributes']['style'] = 'margin: 0';
    $form['single_job'][$c]['_elysia_cron_job_disabled_' . $key]['#title'] = NULL;
    $form['single_job'][$c]['_elysia_cron_job_disabled_' . $key]['#attributes']['style'] = 'margin: 0';
    $form['single_job'][$c]['_elysia_cron_job_channel_' . $key]['#title'] = NULL;
    $form['single_job'][$c]['_elysia_cron_job_channel_' . $key]['#attributes']['style'] = 'margin: 0';
    $coutput .= '<tr><td colspan="6"><b>' . $form['single_job'][$c]['#title'] . '</b>' . (($d = $form['single_job'][$c]['#description']) && $d != '-' ? ' <i>(' . $d . ')</i>' : '') . '</td></tr>';
    $coutput .= '<tr>' . '<td align="center">' . drupal_render($form['single_job'][$c]['_elysia_cron_job_disabled_' . $key]) . '</td>' . '<td>' . drupal_render($form['single_job'][$c]['_elysia_cron_seljob_rule_' . $key]) . drupal_render($form['single_job'][$c]['_elysia_cron_job_rule_' . $key]) . '</td>' . '<td>' . drupal_render($form['single_job'][$c]['_elysia_cron_job_weight_' . $key]) . '</td><td><small>' . $def_weight . '</small></td>' . '<td>' . drupal_render($form['single_job'][$c]['_elysia_cron_job_channel_' . $key]) . '</td>' . '</tr>';
    drupal_render($form['single_job'][$c]);
  }
  $coutput .= '</table>';
  $form['single_job']['#children'] = $coutput;
  $coutput = '<table>';
  $i = 0;
  foreach (element_children($form['channels']) as $c) {
    $key = substr($c, 15);
    if ($i++ == 0) {
      $coutput .= '<tr>' . '<th>' . t('Name') . '</th>' . '<th>' . $form['channels'][$c]['_elysia_cron_ch_disabled_' . $key]['#title'] . '</th>' . '<th>' . $form['channels'][$c]['_elysia_cron_ch_rule_' . $key]['#title'] . '</th>' . '</tr>';
    }
    $form['channels'][$c]['_elysia_cron_ch_disabled_' . $key]['#title'] = NULL;
    $form['channels'][$c]['_elysia_cron_ch_disabled_' . $key]['#attributes']['style'] = 'margin: 0';
    $form['channels'][$c]['_elysia_cron_ch_rule_' . $key]['#title'] = NULL;
    $form['channels'][$c]['_elysia_cron_ch_rule_' . $key]['#attributes']['style'] = 'margin: 0';
    $coutput .= '<tr>' . '<td><b>' . $form['channels'][$c]['#title'] . '</b></td>' . '<td>' . drupal_render($form['channels'][$c]['_elysia_cron_ch_disabled_' . $key]) . '</td>' . '<td>' . drupal_render($form['channels'][$c]['_elysia_cron_ch_rule_' . $key]) . '</td>' . '</tr>';
    drupal_render($form['channels'][$c]);
  }
  $coutput .= '</table>';
  $form['channels']['#children'] = $coutput;
  return drupal_render_children($form);
}