You are here

function system_patterns in Patterns 7.2

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 patterns_components/components/system.inc \system_patterns()

Implements hook_patterns().

Parameters

string $data:

File

patterns_components/components/system.inc, line 17

Code

function system_patterns($data) {
  $files = array(
    'modules/system/system.admin.inc',
  );

  //Function not run through form.
  $actions['module'] = array(
    'descr' => t('Enable/Disable Modules'),
    PATTERNS_CREATE => array(
      'modules_enable',
    ),
    PATTERNS_DELETE => array(
      'modules_disable',
    ),
    PATTERNS_EXPORT => array(
      PATTERNS_EXPORT_ALL => 'system_patterns_export_all_modules',
    ),
    PATTERNS_FILES => $files,
  );

  //Function not run through form.
  $actions['theme'] = array(
    'descr' => t('Enable (and set default)/Disable Themes'),
    PATTERNS_MODIFY => array(
      'set_theme_properties',
    ),
    PATTERNS_EXPORT => array(
      PATTERNS_EXPORT_ALL => 'system_patterns_export_all_themes',
    ),
    PATTERNS_FILES => $files,
  );

  // 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,
  );

  //Function not run through form.
  $actions['call_php_func'] = array(
    'descr' => t('Call PHP Functions'),
    PATTERNS_CREATE => array(
      'call_php_func_form',
    ),
  );

  //Function not run through form.
  $actions['variables'] = array(
    'descr' => t('Set/Modify/Delete System Variables'),
    PATTERNS_MODIFY => array(
      'variables_execute',
    ),
    PATTERNS_EXPORT => array(
      PATTERNS_EXPORT_ALL => 'system_patterns_export_all_variables',
    ),
  );
  return $actions;
}