You are here

function textimage_theme in Textimage 7.2

Same name and namespace in other branches
  1. 8.4 textimage.module \textimage_theme()
  2. 8.3 textimage.module \textimage_theme()
  3. 6.2 textimage.module \textimage_theme()
  4. 7.3 textimage.module \textimage_theme()

Implements hook_theme().

File

./textimage.module, line 100
Provides text to image manipulations.

Code

function textimage_theme() {
  $theme = array(
    'textimage_image' => array(
      'variables' => array(
        'preset' => '',
        'text' => '',
        'additional_text' => array(),
        'format' => 'png',
        'file_path' => '',
        'alt' => '',
        'title' => '',
        'attributes' => array(),
        'getsize' => TRUE,
        'image' => TRUE,
      ),
    ),
    'textimage_preset_edit' => array(
      'variables' => array(
        'form' => array(),
      ),
    ),
  );
  foreach (textimage_get_presets() as $preset) {
    $theme['textimage_formatter_textimage_' . $preset->name] = array(
      'variables' => array(
        // Selected preset name.
        'preset' => $preset->name,
        // Selected preset ID.
        'pid' => $preset->pid,
        // Image object.
        'image' => new stdClass(),
        // Text for new creation of textimage.
        'text' => NULL,
        // Additional text for new creation of textimage.
        'additional_text' => array(),
      ),
      'function' => 'textimage_preset_formatter',
    );
  }
  return $theme;
}