You are here

function asset_admin_settings in Asset 6

Same name and namespace in other branches
  1. 5 asset.module \asset_admin_settings()

Admin Settings

1 string reference to 'asset_admin_settings'
asset_menu in ./asset.module
Implementation of hook_menu()

File

inc/asset.admin.inc, line 5

Code

function asset_admin_settings() {
  global $__asset_path;
  $form['asset_access_option'] = array(
    '#type' => 'radios',
    '#title' => t('Visibility Options'),
    '#default_value' => variable_get('asset_access_option', 1),
    '#options' => array(
      t('Show on every page except the listed pages.'),
      t('Show on only the listed pages.'),
      t('Show if the following PHP code returns <code>TRUE</code> (PHP-mode, experts only).'),
    ),
  );
  $form['asset_access_pages'] = array(
    '#type' => 'textarea',
    '#title' => t('Pages'),
    '#default_value' => variable_get('asset_access_pages', "node/add/*\r\nnode/*/edit"),
    '#description' => t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are 'blog' for the blog page and blog/* for every personal blog. <front> is the front page.If the PHP-mode is chosen, enter PHP code between <?php ?>. Note that executing incorrect PHP-code can break your Drupal site. Also note that if you are using a WYSIWYG editor, the asset button may be available in that editor regardless of this setting."),
  );
  $form['asset_wizard_theme'] = array(
    '#type' => 'fieldset',
    '#title' => t('Wizard theme'),
    '#theme' => 'asset_wizard_theme_form',
  );
  $paths = array(
    $__asset_path . '/misc/themes',
    drupal_get_path('theme', variable_get('theme_default', 'garland')),
  );
  foreach ($paths as $path) {
    $files = file_scan_directory($path, 'asset_wizard\\.css$');
    foreach ($files as $filename => $file) {
      $form['asset_wizard_theme'][$filename] = array(
        '#type' => 'radio',
        '#return_value' => $filename,
        '#default_value' => variable_get('asset_wizard_theme', drupal_get_path('module', 'asset') . '/themes/default/asset_wizard.css'),
        '#parents' => array(
          'asset_wizard_theme',
        ),
      );
    }
  }
  return system_settings_form($form);
}