Exemple #1
0
 public function admin_settingsSubpage($params)
 {
     if (isset($params["option"])) {
         $this->saveOption($params["option"]);
     }
     $field = new Services\Fields("init");
     $field->Title("Paramètres de configuration");
     $field->text(["value" => Models\Options::get("app_title"), "slug" => "app_title", "id" => "app_title", "label" => "Titre de l'application"]);
     $field->text(["value" => Models\Options::get("main_text"), "slug" => "main_text", "id" => "main_text", "label" => "Texte Principale"]);
     $field->text(["value" => Models\Options::get("sub_text"), "slug" => "sub_text", "id" => "sub_text", "label" => "Texte Secondaire"]);
     $field->color(["value" => Models\Options::get("main_color") ? Models\Options::get("main_color") : null, "slug" => "main_color", "id" => "main_color", "label" => "Couleur principale"]);
     $field->color(["value" => Models\Options::get("sub_color") ? Models\Options::get("sub_color") : null, "slug" => "sub_color", "id" => "sub_color", "label" => "Couleur secondaire"]);
     $field->color(["value" => Models\Options::get("text_color") ? Models\Options::get("text_color") : null, "slug" => "text_color", "id" => "text_color", "label" => "Couleur du texte"]);
     $field->color(["value" => Models\Options::get("backgroud_color") ? Models\Options::get("backgroud_color") : null, "slug" => "backgroud_color", "id" => "backgroud_color", "label" => "Couleur du fond"]);
     $field->submit(["text" => "Valider", "datas" => ["container" => ".admin-content"]]);
     return $this->content_page = $field->render();
 }