You are here

function om_system in OM Tools 8

Same name and namespace in other branches
  1. 6 tools/system/system.inc \om_system()
  2. 7 tools/system/system.inc \om_system()

OM Tools System Utility Settings

File

tools/system/system.inc, line 11
System Utility

Code

function om_system(&$form) {
  drupal_add_js(drupal_get_path('module', 'om_tools') . '/tools/system/js/system.js', 'file');
  $maxsizes = '1600, 1440, 1280, 1120, 960, 800, 640, 480';
  $theme_path = path_to_theme();
  $form['system_forms'] = array(
    '#type' => 'fieldset',
    '#title' => t('System Forms'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );

  // Reset Node Form
  if (variable_get('om_tools_mediaqueries_reset', 0)) {
    variable_set('om_tools_mediaqueries_maxsizes', $maxsizes);
    variable_set('om_tools_mediaqueries_reset', 0);
  }

  // Media Queries Form
  $form['system_forms']['mediaqueries_form'] = array(
    '#type' => 'fieldset',
    '#title' => t('Media Queries'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['system_forms']['mediaqueries_form']['mediaqueries_switch'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable Media Queries'),
    '#default_value' => variable_get('om_tools_mediaqueries_switch', 0),
    '#description' => t(''),
  );
  $form['system_forms']['mediaqueries_form']['mediaqueries'] = array(
    '#type' => 'fieldset',
    '#attributes' => array(
      'id' => 'om-group-mediaqueries-settings',
    ),
    '#title' => t('Media Queries Stylesheet Settings for desktop, tablet, mobile devices.'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#description' => t('Add all desired maximum widths, separated by comma, ex. 960, 800. Then create the stylesheets, ex style960.css, style.800.css, each stylesheet will then be activated depending on the size of browser\'s viewport.'),
  );
  $form['system_forms']['mediaqueries_form']['mediaqueries']['mediaqueries_maxsizes'] = array(
    '#type' => 'textarea',
    '#title' => t('Add all max-width for this site.'),
    '#default_value' => variable_get('om_tools_mediaqueries_maxsizes', $maxsizes),
    '#rows' => 5,
    '#description' => t('Standard sizes: 1600, 1440, 1280, 1120, 960, 800, 640, 480'),
  );
  $form['system_forms']['mediaqueries_form']['mediaqueries']['mediaqueries_path'] = array(
    '#type' => 'textfield',
    '#title' => t('Stylesheets path'),
    '#default_value' => variable_get('om_tools_mediaqueries_path', $theme_path),
    '#width' => 30,
    '#description' => t('Where do your media stylesheets located? ex. sites/default/themes/mytheme/css'),
  );
  $form['system_forms']['mediaqueries_form']['mediaqueries_reset'] = array(
    '#type' => 'checkbox',
    '#title' => t('Reset to default values.'),
    '#default_value' => variable_get('om_tools_mediaqueries_reset', 0),
    '#description' => t(''),
  );
  return $form;
}