You are here

function system_patterns in Patterns 7

Same name and namespace in other branches
  1. 5 components/system.inc \system_patterns()
  2. 6.2 components/system.inc \system_patterns()
  3. 6 components/system.inc \system_patterns()
  4. 7.2 patterns_components/components/system.inc \system_patterns()
1 call to system_patterns()
system_patterns_callbacks in patterns_components/components/system.inc

File

patterns_components/components/system.inc, line 9

Code

function system_patterns($data) {
  $files = array(
    'modules/system/system.admin.inc',
  );
  $actions['modules'] = array(
    'descr' => t('Enable/Disable Modules'),
    PATTERNS_CREATE => array(),
    PATTERNS_DELETE => array(),
    PATTERNS_FILES => $files,
  );

  // Drupal7.x changed the theme setting form, so we use a custom one
  $actions['theme'] = array(
    'descr' => t('Enable (and set default)/Disable Themes'),
    PATTERNS_CREATE => array(
      'set_active_theme',
    ),
    PATTERNS_DELETE => array(
      'set_active_theme',
    ),
    PATTERNS_FILES => $files,
  );

  // TODO: Don't run through form.
  // Determine necessary forms for action 'form' based on the data.
  $forms = array();
  if ($data) {
    if ($data['tag'] == 'form' && isset($data['form_id'])) {
      $forms[] = $data['form_id'];
    }
  }
  $actions['form'] = array(
    'descr' => t('Submit Custom Forms'),
    PATTERNS_CREATE => $forms,
    PATTERNS_FILES => $files,
  );
  $actions['call_php_func'] = array(
    'descr' => t('Call PHP Functions'),
    PATTERNS_CREATE => array(
      'call_php_func_form',
    ),
  );

  // TODO: Don't run through form.
  $actions['variables'] = array(
    'descr' => t('Set/Modify/Delete System Variables'),
    PATTERNS_CREATE => array(),
    PATTERNS_MODIFY => array(),
    // TODO: ??
    PATTERNS_DELETE => array(),
  );

  //  $actions['variable'] = $actions['variables']; // Alias, not available any more

  /* $actions['date'] = array('descr' => t('Create/edit/delete types of date and time'),
      PATTERNS_CREATE => array('system_configure_date_formats_form','system_add_date_format_type_form'),
      PATTERNS_MODIFY => array('system_configure_date_formats_form','system_date_time_settings'),
      PATTERNS_DELETE => array('system_delete_date_format_type_form'),
      PATTERNS_FILES =>$files
    );*/
  return $actions;
}