function textimage_preset_list in Textimage 7.2
Same name and namespace in other branches
- 5.2 textimage_admin.inc \textimage_preset_list()
- 5 textimage.module \textimage_preset_list()
- 6.2 textimage_admin.inc \textimage_preset_list()
Todo.
1 string reference to 'textimage_preset_list'
- textimage_menu in ./
textimage.module - Implements hook_menu().
File
- ./
textimage.admin.inc, line 498 - Textimage admin page callback
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/config/media/textimage/preset/' . $preset->pid . '/edit'),
l(t('delete'), 'admin/config/media/textimage/preset/' . $preset->pid . '/delete'),
l(t('flush cache'), 'admin/config/media/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/config/media/textimage/preset/new'),
)),
'colspan' => '6',
'class' => 'message',
),
);
}
return theme('table', array(
'header' => $header,
'rows' => $rows,
));
}