You are here

function textimage_preset_list in Textimage 6.2

Same name and namespace in other branches
  1. 5.2 textimage_admin.inc \textimage_preset_list()
  2. 5 textimage.module \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_admin.inc, line 575

Code

function textimage_preset_list() {
  $fonts_path = variable_get('textimage_fonts_path', drupal_get_path('module', 'textimage') . '/fonts');
  $presets = textimage_get_presets();
  $header = array(
    t('Name'),
    t('Summary'),
    t('Description'),
    array(
      'data' => t('Operations'),
      'colspan' => '3',
    ),
  );
  $rows = array();
  foreach ($presets as $preset) {
    $font = _textimage_font_name($fonts_path . '/' . $preset->settings['font']['file']);
    $rows[] = array(
      $preset->name,
      $font['name'] . ' ' . $preset->settings['font']['size'] . t('px'),
      $preset->description,
      l(t('edit'), 'admin/build/textimage/preset/' . $preset->pid . '/edit'),
      l(t('delete'), 'admin/build/textimage/preset/' . $preset->pid . '/delete'),
      l(t('flush cache'), 'admin/build/textimage/preset/' . $preset->pid . '/flush'),
    );
  }
  if (empty($rows)) {
    $rows[] = array(
      array(
        'data' => t('No presets defined. <a href="!url">Create a new preset</a>.', array(
          '!url' => url('admin/build/textimage/preset/new'),
        )),
        'colspan' => '6',
        'class' => 'message',
      ),
    );
  }
  return theme('table', $header, $rows);
}