You are here

function smileys_admin_form in Smileys 5

Same name and namespace in other branches
  1. 6 smileys.admin.inc \smileys_admin_form()
1 string reference to 'smileys_admin_form'
smileys_admin_add in ./smileys.module

File

./smileys.module, line 390

Code

function smileys_admin_form($edit = array()) {
  $form = array();
  if ($edit['id']) {
    $form['id'] = array(
      '#type' => 'hidden',
      '#value' => $edit['id'],
    );
  }
  $form['acronyms'] = array(
    '#type' => 'textfield',
    '#title' => t('Acronyms'),
    '#default_value' => $edit['acronyms'],
    '#size' => 16,
    '#maxlength' => 255,
    '#description' => t('Enter a list of shorthands for the smiley you wish to add, separated by spaces. E.g. \':) ;) :smile:\''),
  );
  $form['image'] = array(
    '#type' => 'textfield',
    '#title' => t('Image URL'),
    '#default_value' => $edit['image'],
    '#size' => 50,
    '#maxlength' => 255,
    '#description' => t('Enter the URL of the smiley-image relative to the root of your Drupal site. E.g. \'images/smileys/happy.png\'.'),
  );
  $form['description'] = array(
    '#type' => 'textfield',
    '#title' => t('Description'),
    '#default_value' => $edit['description'],
    '#size' => 50,
    '#maxlength' => 64,
    '#description' => t('A short description of the emotion depicted to be used as tooltip for the image. E.g. \'Laughing out loud\'.'),
  );
  $form['standalone'] = array(
    '#type' => 'checkbox',
    '#title' => t('Stand-alone'),
    '#default_value' => $edit['standalone'],
    '#description' => t('When checked, the smiley will only be inserted when an acronym is found as a separate word. This is useful for preventing accidental smileys with short acronyms.'),
  );
  $form['promote_to_box'] = array(
    '#type' => 'checkbox',
    '#title' => t('Promote to select box'),
    '#default_value' => $edit['promote_to_box'],
    '#description' => t('When checked, the smiley will be shown on the <em>Smiley Select Box</em> in node and comment forms. Unchecked Smileys will be usable only in "<em>more...</em>" pop-up widget.'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save Smiley'),
  );
  if ($edit['id']) {
    $form['delete'] = array(
      '#type' => 'submit',
      '#value' => t('Delete Smiley'),
    );
  }
  return $form;
}