You are here

function crumbs_admin_form_submit in Crumbs, the Breadcrumbs suite 6

Same name and namespace in other branches
  1. 6.2 crumbs.admin.inc \crumbs_admin_form_submit()
  2. 7 admin/crumbs.admin.inc \crumbs_admin_form_submit()

File

./crumbs.admin.inc, line 79

Code

function crumbs_admin_form_submit($form, &$form_state) {
  $x = _crumbs_load_plugin_data();
  $available_lines = _crumbs_get_available_rule_lines($x);
  $m = array();
  $text = $form_state['values']['settings'];
  $lines = explode("\n", $text);
  $order = array();
  $enabled = TRUE;
  foreach ($lines as $line) {
    $line = trim($line);
    list($key, $title) = explode(' ', $line, 2);
    if (isset($available_lines[$key])) {
      $order[$key] = $enabled;
    }
    else {
      if (preg_match('/^-/', $line)) {
        if ($enabled) {
          $enabled = FALSE;
        }
        else {
          break;
        }
      }
    }
  }
  variable_set('crumbs', $order);
}