You are here

function fusion_apply_rules in Fusion Accelerator 7.2

Same name and namespace in other branches
  1. 7 fusion_apply/fusion_apply_ui.rules.inc \fusion_apply_rules()
  2. 7 fusion_apply/fusion_apply_rules.inc \fusion_apply_rules()

Menu callback; displays the Fusion Apply rules listing.

8 string references to 'fusion_apply_rules'
FusionApplyRulesApiTestCase::setUp in fusion_apply/tests/fusion_apply.test
Sets up a Drupal site for running functional and integration tests.
FusionApplyUIAdminTestCase::setUp in fusion_apply/tests/fusion_apply_ui.test
Sets up a Drupal site for running functional and integration tests.
FusionApplyUIPluginPanelsTestCase::setUp in fusion_apply/tests/fusion_apply_ui.test
Sets up a Drupal site for running functional and integration tests.
FusionApplyUIPluginTestCase::setUp in fusion_apply/tests/fusion_apply_ui.test
Sets up a Drupal site for running functional and integration tests.
FusionApplyUITestCase::setUp in fusion_apply/tests/fusion_apply_ui.test
Sets up a Drupal site for running functional and integration tests.

... See full list

File

fusion_apply/fusion_apply_ui.rules.inc, line 11
Admin page callbacks for Fusion Apply skin rules.

Code

function fusion_apply_rules() {
  $output = '';
  $headers = array(
    array(
      'data' => t('Title'),
      'field' => 'title',
    ),
    array(
      'data' => t('Type'),
      'field' => 'type',
    ),
    array(
      'data' => t('Operations'),
      'colspan' => 2,
    ),
  );
  $rules = fusion_apply_rule_load_multiple();
  $rows = array();
  foreach ($rules as $rule) {
    $row = array(
      check_plain($rule->title),
      check_plain($rule->rule_type),
      l(t('edit'), 'admin/appearance/fusion/rules/edit/' . $rule->rid),
      l(t('delete'), 'admin/appearance/fusion/rules/delete/' . $rule->rid),
    );
    $rows[] = $row;
  }
  $link = l(t('Create a new rule'), 'admin/appearance/fusion/rules/add');
  $row = array();
  if (empty($rows)) {
    $row[] = array(
      'data' => t('No rules have been set up yet. !url.', array(
        '!url' => $link,
      )),
      'colspan' => 4,
    );
  }
  else {
    $row[] = array(
      'data' => t('!url.', array(
        '!url' => $link,
      )),
      'colspan' => 4,
    );
  }
  $rows[] = $row;
  $output .= theme('table', array(
    'header' => $headers,
    'rows' => $rows,
  ));
  $output .= drupal_render($form);
  return $output;
}