You are here

function smiley_import_page in Smiley 6

Menu callback; Present the page for operations on Smiley packs.

1 string reference to 'smiley_import_page'
smiley_import_menu in ./smiley_import.module
Implementation of hook_menu().

File

./smiley_import.module, line 50

Code

function smiley_import_page() {
  $header = array(
    t('Smiley Packs'),
    t('Operations'),
  );
  $rows = array();
  $packs = smiley_import_packs();
  foreach ($packs as $pack) {
    $smileyp = db_fetch_array(db_query("SELECT * FROM {smiley} WHERE package = '%s'", $pack->name));
    $option_link = $smileyp ? l(t('Uninstall'), 'admin/settings/smiley/import/delete/' . $pack->name) : l(t('Install'), 'admin/settings/smiley/import/add/' . $pack->name);
    $rows[] = array(
      '<strong>' . check_plain($pack->name) . '</strong>',
      $option_link,
    );
  }
  $output = theme('table', $header, $rows);
  if (empty($rows)) {
    drupal_set_message(t('No smiley packs found.'));
    $output = '';
  }
  return $output;
}