Added account public note to the general settings

This commit is contained in:
Pierre 2018-05-05 11:13:40 +02:00
parent 0309d4f880
commit fe10052629
3 changed files with 19 additions and 1 deletions

View File

@ -77,6 +77,7 @@ class SettingsController {
$settings->set_personnalWebsite(postString("personnalWebsite", 0)); $settings->set_personnalWebsite(postString("personnalWebsite", 0));
$settings->set_virtualDirectory($virtualDirectory); $settings->set_virtualDirectory($virtualDirectory);
$settings->set_allowComunicMails(postBool("allow_comunic_mails")); $settings->set_allowComunicMails(postBool("allow_comunic_mails"));
$settings->set_publicNote(removeHTMLnodes(postString("publicNote", 0)));
//Check personnal webiste //Check personnal webiste
if($settings->has_personnalWebsite()){ if($settings->has_personnalWebsite()){
@ -305,6 +306,7 @@ class SettingsController {
$data["public_friends_list"] = $settings->is_friendsListPublic(); $data["public_friends_list"] = $settings->is_friendsListPublic();
$data["virtual_directory"] = $settings->get_virtualDirectory(); $data["virtual_directory"] = $settings->get_virtualDirectory();
$data["personnal_website"] = $settings->get_personnalWebsite(); $data["personnal_website"] = $settings->get_personnalWebsite();
$data["publicNote"] = $settings->get_publicNote();
return $data; return $data;
} }

View File

@ -164,6 +164,7 @@ class SettingsComponents {
$obj->set_friendsListPublic($entry['liste_amis_publique']); $obj->set_friendsListPublic($entry['liste_amis_publique']);
$obj->set_virtualDirectory($entry['sous_repertoire'] == null ? "" : $entry['sous_repertoire']); $obj->set_virtualDirectory($entry['sous_repertoire'] == null ? "" : $entry['sous_repertoire']);
$obj->set_personnalWebsite($entry['site_web'] == null ? "" : $entry['site_web']); $obj->set_personnalWebsite($entry['site_web'] == null ? "" : $entry['site_web']);
$obj->set_publicNote($entry['public_note'] == null ? "" : $entry['public_note']);
return $obj; return $obj;
@ -189,6 +190,7 @@ class SettingsComponents {
$data["liste_amis_publique"] = $settings->is_friendsListPublic() ? 1 : 0; $data["liste_amis_publique"] = $settings->is_friendsListPublic() ? 1 : 0;
$data["sous_repertoire"] = $settings->has_virtualDirectory() ? $settings->get_virtualDirectory() : ""; $data["sous_repertoire"] = $settings->has_virtualDirectory() ? $settings->get_virtualDirectory() : "";
$data["site_web"] = $settings->has_personnalWebsite() ? $settings->get_personnalWebsite() : ""; $data["site_web"] = $settings->has_personnalWebsite() ? $settings->get_personnalWebsite() : "";
$data["public_note"] = $settings->has_publicNote() ? $settings->get_publicNote() : "";
return $data; return $data;
} }

View File

@ -19,6 +19,7 @@ class GeneralSettings extends BaseUserModel {
private $friendsListPublic; private $friendsListPublic;
private $virtualDirectory; private $virtualDirectory;
private $personnalWebsite; private $personnalWebsite;
private $publicNote;
//Set and get the email address of the user //Set and get the email address of the user
public function set_email(string $email){ public function set_email(string $email){
@ -140,4 +141,17 @@ class GeneralSettings extends BaseUserModel {
public function get_personnalWebsite() : string { public function get_personnalWebsite() : string {
return $this->personnalWebsite != null ? $this->personnalWebsite : "null"; return $this->personnalWebsite != null ? $this->personnalWebsite : "null";
} }
//Set and get public acccount note
public function set_publicNote(string $publicNote){
$this->publicNote = $publicNote == "" ? null : $publicNote;
}
public function has_publicNote() : bool {
return $this->publicNote != null;
}
public function get_publicNote() : string {
return $this->publicNote != null ? $this->publicNote : "null";
}
} }