You are here

public function Textimage::styleByName in Textimage 7.3

Set the image style, from the style name.

Parameters

string $image_style_name: the name of the image style to be used to derive the Textimage

Return value

self this object

1 call to Textimage::styleByName()
Textimage::load in classes/Textimage.inc
Load Textimage metadata from store.

File

classes/Textimage.inc, line 173
Textimage - Textimage class.

Class

Textimage
@file Textimage - Textimage class.

Code

public function styleByName($image_style_name) {
  if ($image_style_name) {

    // Retrieve Textimage style.
    if ($image_style = TextimageStyles::get($image_style_name)) {
      $this
        ->set('style', $image_style);
      $this
        ->set('effects', TextimageStyles::getEffectsOutline($this->style));
    }
    else {
      _textimage_diag(t("Textimage could not find image style '@style'.", array(
        '@style' => $image_style_name,
      )), WATCHDOG_ERROR, NULL, $this->userMessages);
    }
  }
  else {
    _textimage_diag(t("Image style not specified while processing a Textimage."), WATCHDOG_ERROR, NULL, $this->userMessages);
  }
  return $this;
}