You are here

function uc_notify_settings_overview in Ubercart 5

Display the notification settings overview page.

1 string reference to 'uc_notify_settings_overview'
uc_notify_menu in uc_notify/uc_notify.module
Implementation of hook_menu().

File

uc_notify/uc_notify.module, line 140
Handles configuration and execution of email notifications.

Code

function uc_notify_settings_overview() {
  $help_page = variable_get('uc_notify_store_help_page', '');
  $sections[] = array(
    'edit' => 'admin/store/settings/notify/edit',
    'title' => t('General settings'),
    'items' => array(
      t('Store help page is !page.', array(
        '!page' => empty($help_page) ? t('not set') : t('set to !link', array(
          '!link' => l($help_page, $help_page),
        )),
      )),
    ),
  );
  $emails = preg_split('/\\s+/', variable_get('uc_notify_admin_checkout_emails', variable_get('uc_store_email', '')));
  $cust_template = variable_get('uc_notify_cust_checkout_template', 'customer');
  $admin_template = variable_get('uc_notify_admin_checkout_template', 'admin');
  $sections[] = array(
    'edit' => 'admin/store/settings/notify/edit/checkout',
    'title' => t('Checkout notifications'),
    'items' => array(
      t('Customer checkout notifications are !status.', array(
        '!status' => variable_get('uc_notify_cust_checkout_enabled', TRUE) ? t('enabled') : t('disabled'),
      )),
      t('Customer e-mail template: !template', array(
        '!template' => $cust_template == '0' ? t('custom') : $cust_template,
      )),
      t('Admin checkout notifications are !status.', array(
        '!status' => variable_get('uc_notify_admin_checkout_enabled', FALSE) ? t('enabled') : t('disabled'),
      )),
      t('Admin e-mail template: !template', array(
        '!template' => $admin_template == '0' ? t('custom') : $admin_template,
      )),
      t('Admin e-mails are sent to:') . theme('item_list', $emails),
    ),
  );
  if (trim(variable_get('uc_notify_order_update_subject', 'subject')) == '' || trim(variable_get('uc_notify_order_update_body', 'body')) == '') {
    $message = t('<b>Warning:</b> your current settings are incomplete.');
  }
  else {
    $message = t('Click to review your current settings.');
  }
  $sections[] = array(
    'edit' => 'admin/store/settings/notify/edit/update',
    'title' => t('Order update notifications'),
    'items' => array(
      t('Order update notifications are !status.', array(
        '!status' => variable_get('uc_notify_order_update_enabled', TRUE) ? t('enabled') : t('disabled'),
      )),
      $message,
    ),
  );
  $output = theme('uc_settings_overview', $sections);
  return $output;
}