/**
  * Sets the `statusMessage` content block to a rendered HTML status message.
  * <p>Override to define a different template or rendering mechanism.
  *
  * @param int    $status
  * @param string $message
  */
 protected function renderFlashMessage($status, $message)
 {
     if (!is_null($status)) {
         $class = get(self::$FLASH_CLASSES, $status);
         $class = $class ? " alert-{$class}" : '';
         $msg = "<div id=status class='alert{$class}' role=alert><div>{$message}</div></div>";
         $this->blocksService->getBlock('statusMessage')->set($msg);
         $this->assetsService->addInlineScript('setTimeout(function(){$("#status").fadeOut()},5000)');
     }
 }
Exemplo n.º 2
0
 /**
  * Sets main form's `enctype` to `multipart/form-data`, allowing file upload fields.
  *
  * > <p>This can be called multiple times.
  */
 public function enableFileUpload()
 {
     $FORM_ID = self::FORM_ID;
     $this->assetsService->addInlineScript("\$('#{$FORM_ID}').attr('enctype','multipart/form-data');", 'setEncType');
 }