You are here

public function StylesDefault::unshift_effect in Styles 6

Same name and namespace in other branches
  1. 6.2 includes/Styles.inc \StylesDefault::unshift_effect()

File

includes/Styles.inc, line 103
Styles.inc Base class for Styles.

Class

StylesDefault
@file Styles.inc Base class for Styles.

Code

public function unshift_effect($effect) {
  $effect_name = $effect['name'];
  if (method_exists($this, $effect_name)) {
    $effects = $this
      ->get_effects();
    array_unshift($effects, $effect);
    return $this
      ->set_effects($effects);
  }
  else {
    watchdog('styles', 'Effect %effect_name not found for %style_name display formatter style of the %class_name class.', array(
      '%effect_name' => $effect_name,
      '%style_name' => $this
        ->get_name(),
      '%class_name' => $this
        ->get_class_name(),
    ), WATCHDOG_WARNING);
  }
}