add(self::TYPE_WARNING, $message); } public function addConf($message) { $this->add(self::TYPE_CONFIRM, $message); } public function getMessages() { return $this->messages; } private function add($typeId, $message) { $this->messages[] = array( 'type' => '', 'typeId' => $typeId, 'message' => $message, 'cssClass' => $this->getMessageStyle($typeId), ); } private function getMessageStyle($type) { switch ($type) { case self::TYPE_WARNING: if (_PS_VERSION_ >= '1.6') { return 'alert alert-warning'; } return 'warning warn'; case self::TYPE_CONFIRM: if (_PS_VERSION_ >= '1.6') { return 'alert alert-success'; } return 'conf confirm'; } return 'warning warn'; } }