function textimage_get_presets in Textimage 7.2
Same name and namespace in other branches
- 5.2 textimage_admin.inc \textimage_get_presets()
- 5 textimage.module \textimage_get_presets()
- 6.2 textimage_admin.inc \textimage_get_presets()
Todo.
7 calls to textimage_get_presets()
- textimage_build_image in ./
textimage.module - Todo.
- textimage_ctools_export_list in includes/
ctools.inc - Implements hook_ctools_export_list().
- textimage_field_formatter_info in ./
textimage.module - Implements hook_field_formatter_info().
- textimage_preset_edit in ./
textimage.admin.inc - Todo.
- textimage_preset_list in ./
textimage.admin.inc - Todo.
File
- ./
textimage.module, line 877 - Provides text to image manipulations.
Code
function textimage_get_presets() {
$presets =& drupal_static(__FUNCTION__);
if (!isset($presets)) {
if (module_exists('ctools')) {
module_load_include('inc', 'ctools', 'includes/export');
foreach (ctools_export_load_object('textimage_preset') as $preset) {
if (isset($preset->in_code_only) && $preset->in_code_only) {
module_load_include('inc', 'textimage', 'textimage.admin');
_textimage_preset_create($preset->name, $preset->description, $preset->settings);
}
}
}
unset($preset);
$result = db_query('SELECT pid, name, description, settings FROM {textimage_preset} ORDER BY name');
$presets = array();
foreach ($result as $preset) {
$preset->settings = unserialize($preset->settings);
$presets[$preset->name] = $preset;
}
}
return $presets;
}