You are here

function skinr_rules in Skinr 6.2

Menu callback; displays the skinr rules listing.

4 string references to 'skinr_rules'
page_skinr_form_index_handler in modules/skinr.skinr.inc
Skinr form index handler.
skinr_rule_save in ./skinr.module
Save a skinr page rule object.
skinr_ui_menu in ./skinr_ui.module
Implementation of hook_menu().
skinr_update_6001 in ./skinr.install
Install new rule table and add some additional fields to the skinr table.

File

./skinr_ui.rules.inc, line 11
Admin page callbacks for the skinr module.

Code

function skinr_rules() {
  $output = '';
  $headers = array(
    t('Title'),
    t('Skinr ID'),
    array(
      'data' => t('Operations'),
      'colspan' => 2,
    ),
  );
  $rules = skinr_rule_load();
  $rows = array();
  foreach ($rules as $rule) {
    $row = array(
      check_plain($rule->title),
      check_plain($rule->rid),
      l(t('edit'), 'admin/build/skinr/rules/edit/' . $rule->rid),
      l(t('delete'), 'admin/build/skinr/rules/delete/' . $rule->rid),
    );
    $rows[] = $row;
  }
  $link = l(t('Create a new rule'), 'admin/build/skinr/rules/add');
  $row = array();
  if (empty($rows)) {
    $row[] = array(
      'data' => t('No rules have been set up yet. !url.', array(
        '!url' => $link,
      )),
      'colspan' => 3,
    );
  }
  else {
    $row[] = array(
      'data' => t('!url.', array(
        '!url' => $link,
      )),
      'colspan' => 3,
    );
  }
  $rows[] = $row;
  $output .= theme('table', $headers, $rows);
  $output .= drupal_render($form);
  return $output;
}