You are here

function textimage_preset_list in Textimage 5

Same name and namespace in other branches
  1. 5.2 textimage_admin.inc \textimage_preset_list()
  2. 6.2 textimage_admin.inc \textimage_preset_list()
  3. 7.2 textimage.admin.inc \textimage_preset_list()
1 string reference to 'textimage_preset_list'
textimage_menu in ./textimage.module
Implementation of hook_menu().

File

./textimage.module, line 538

Code

function textimage_preset_list() {
  $presets = textimage_get_presets();
  $header = array(
    t('Name'),
    t('Summary'),
    t('Description'),
    array(
      'data' => t('Operations'),
      'colspan' => '2',
    ),
  );
  $rows = array();
  foreach ($presets as $name => $preset) {
    $row = array();
    $row[] = $name;
    $row[] = $preset['settings']['text']['font'] . ' ' . $preset['settings']['text']['size'] . t('px');
    $row[] = $preset['settings']['description'];
    $row[] = l(t('edit'), 'admin/settings/textimage/preset/' . $preset['pid']);
    $row[] = l(t('delete'), 'admin/settings/textimage/preset/' . $preset['pid'] . '/delete');
    $row[] = l(t('flush cache'), 'admin/settings/textimage/preset/' . $preset['pid'] . '/flush');
    $rows[] = $row;
  }
  if (empty($rows)) {
    $rows[] = array(
      array(
        'data' => t('No presets defined. <a href="!url">Create a new preset</a>.', array(
          '!url' => url('admin/settings/textimage/new'),
        )),
        'colspan' => '5',
        'class' => 'message',
      ),
    );
  }
  return theme('table', $header, $rows);
}