getImagePath())) { $image = self::DEFAULT_IMAGE; } $style = (array) $doc->getBodyAttrib('style'); $style[] = sprintf($item->getConfig('styleAttribute'), htmlspecialchars($image)); $doc->setBodyAttrib('style', implode('; ', $style)); } } public static function getEnabled() { if (null === static::$_enabled) { static::$_enabled = (bool) static::getConfig('enabled'); } return static::$_enabled; } public static function setEnabled($flag = true) { static::$_enabled = (bool) $flag; } public static function getConfig($field = null, $default = null) { if (null === static::$_config) { static::$_config = Qs_Application::getConfig('backgroundImage'); } if (null === $field) { return static::$_config; } return static::$_config->get($field, $default); } public function getImagePath() { if (($image = Model::getRandomImage())) { $config = $this->getConfig('image')->toArray(); return Qs_ImageFs::get( $image, $config['width'], $config['height'], $config['resizeMethodAlias'] ); } return null; } }