Ejemplo n.º 1
0
 /**
  * Get this modal dialogue as a HTML string
  * @since Version 3.10.0
  * @return string
  */
 public function __toString()
 {
     $Smarty = AppCore::GetSmarty();
     $tpl = $Smarty->ResolveTemplate("template.modal");
     // Add a default "ok" action to the dialogue
     if (empty($this->actions)) {
         $this->addButtonAction("Close", "btn btn-primary", "button", ["data-dismiss" => "modal"]);
     }
     $modal = ["id" => "globalModal", "class" => "modal hide", "hide" => true, "header" => $this->header, "body" => function_exists("wpautop") ? wpautop($this->body) : $this->body, "formaction" => $this->formaction, "actions" => $this->actions];
     $Smarty->Assign("modal", $modal);
     return $Smarty->Fetch($tpl);
 }