You are here

function flashnode_admin_settings in Flash Node 5.6

Same name and namespace in other branches
  1. 5.2 flashnode.module \flashnode_admin_settings()
  2. 5.3 flashnode.module \flashnode_admin_settings()
  3. 6.3 flashnode.admin.inc \flashnode_admin_settings()
  4. 6.2 flashnode.admin.inc \flashnode_admin_settings()

Settings callback

1 string reference to 'flashnode_admin_settings'
flashnode_menu in ./flashnode.module
Implementation of hook_menu

File

./flashnode.module, line 771

Code

function flashnode_admin_settings() {

  // Check for folders, create if necessary
  _flashnode_check_settings();

  //Reset the cache to ensure any pages using filters are updated

  // Necessary to ensure macro content regenerated in case the user modifies max_height or max_width settings
  cache_clear_all('*', 'cache_filter', true);
  $form['flashnode_updated'] = array(
    '#type' => 'hidden',
    '#value' => time(),
  );
  $form['flashnode_default_path'] = array(
    '#type' => 'textfield',
    '#title' => t('Default flash path'),
    '#default_value' => variable_get('flashnode_default_path', 'flash'),
    '#description' => t('Subdirectory in the directory "%dir" where Flash files will be stored. Do not include a leading or trailing slash.', array(
      '%dir' => variable_get('file_directory_path', 'files'),
    )),
  );
  $form['flashnode_allowable_types'] = array(
    '#type' => 'textfield',
    '#title' => t('Allowable file types'),
    '#default_value' => variable_get('flashnode_allowable_types', 'swf flv mp3'),
    '#description' => t('You can limit the types of file that users are able to upload by entering a list of allowable file extensions separated by spaces. Do not include the leading dot.'),
  );
  $form['flashnode_default_display'] = array(
    '#type' => 'radios',
    '#title' => t('Default display setting'),
    '#default_value' => variable_get('flashnode_default_display', 0),
    '#description' => t('The default display setting that will be used when a new flash node is created.'),
    '#options' => array(
      0 => t('Teaser and body'),
      1 => t('Teaser only'),
      2 => t('Body only'),
      3 => t('Do not display'),
    ),
  );
  $form['flashnode_default_html_alt'] = array(
    '#type' => 'textarea',
    '#rows' => 5,
    '#title' => t('Default substitution content'),
    '#default_value' => variable_get('flashnode_default_html_alt', 'You are missing some Flash content that should appear here! Perhaps your browser cannot display it, or maybe it did not initialise correctly.'),
    '#description' => t('If you are using a javascript method to embed flash then this is the content that users will see if they are unable to, or choose not to, display the flash content. Use this content in a node by entering %default in the substitution field when creating a flash node. Note that this content is NOT filtered when it is displayed in a node so you may use mark-up that would not otherwise be allowed.', array(
      '%default' => '!default',
    )),
  );
  $form['flashnode_default_base'] = array(
    '#type' => 'textfield',
    '#title' => t('Default base parameter'),
    '#default_value' => variable_get('flashnode_default_base', base_path() . file_directory_path()),
    '#description' => t('If you use the ActionScript command %loadmovie or similar then you may need to use this setting to tell the Flash player where to find supporting movies. The base path is used for any relative paths that occur in the movie file. If you upload files using Drupal\'s upload module then the default setting of %base should be used. Only change it if you are uploading files to a different directory using something like FTP. This setting can be over-ridden when a node is created.', array(
      '%loadmovie' => 'loadMovie()',
      '%base' => base_path() . file_directory_path(),
    )),
  );
  $form['flashnode_max_width'] = array(
    '#type' => 'textfield',
    '#title' => t('Maximum displayed width'),
    '#default_value' => variable_get('flashnode_max_width', 0),
    '#description' => t('The maximum displayed width of a flash movie can be limited by entering a non-zero value here. If the movie width is greater than this width then the movie will be scaled down when it is displayed. A value of zero means that no scaling will occur. This setting can be useful to ensure that the page layout is not disrupted by a large flash movie.'),
  );
  $form['flashnode_max_height'] = array(
    '#type' => 'textfield',
    '#title' => t('Maximum displayed height'),
    '#default_value' => variable_get('flashnode_max_height', 0),
    '#description' => t('The maximum displayed height of a flash movie can be limited by entering a non-zero value here. If the movie height is greater than this height then the movie will be scaled down when it is displayed. A value of zero means that no scaling will occur. This setting can be useful to ensure that the page layout is not disrupted by a large flash movie.'),
  );
  return system_settings_form($form);
}