diff options
| author | polo <ordipolo@gmx.fr> | 2025-10-20 01:57:21 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2025-10-20 01:57:21 +0200 |
| commit | 1e2cee519264f9ab2660540723915aec72bc2116 (patch) | |
| tree | 1b773307463589f8506ffb0a439976a40e3e7bac /src/model/entities/Node.php | |
| parent | fb3bb6a42f5a8de6d446bc7566e3b766c7f64ce7 (diff) | |
| download | cms-1e2cee519264f9ab2660540723915aec72bc2116.zip | |
noeud "head" unique, noms fichiers CSS et JSS dans page, nombreux changements en conséquences
Diffstat (limited to 'src/model/entities/Node.php')
| -rw-r--r-- | src/model/entities/Node.php | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/model/entities/Node.php b/src/model/entities/Node.php index db081e4..fe3a1e5 100644 --- a/src/model/entities/Node.php +++ b/src/model/entities/Node.php | |||
| @@ -22,9 +22,6 @@ class Node | |||
| 22 | #[ORM\Column(type: "string", length: 255)] | 22 | #[ORM\Column(type: "string", length: 255)] |
| 23 | private string $name_node; | 23 | private string $name_node; |
| 24 | 24 | ||
| 25 | #[ORM\Column(type: "json", nullable: true)] // type: "json" crée un longtext avec mariadb | ||
| 26 | private ?array $attributes = null; | ||
| 27 | |||
| 28 | #[ORM\Column(type: "integer")] | 25 | #[ORM\Column(type: "integer")] |
| 29 | private int $position; | 26 | private int $position; |
| 30 | 27 | ||
| @@ -52,12 +49,10 @@ class Node | |||
| 52 | // attributs non destinés à doctrine | 49 | // attributs non destinés à doctrine |
| 53 | private array $children = []; // tableau de Node | 50 | private array $children = []; // tableau de Node |
| 54 | private ?self $adopted = null; // = "new" est un enfant de "main" lorsque la page est "article" | 51 | private ?self $adopted = null; // = "new" est un enfant de "main" lorsque la page est "article" |
| 55 | static private array $default_attributes = ['css_array' => ['body', 'head', 'nav', 'foot'],'js_array' => ['main']]; | ||
| 56 | 52 | ||
| 57 | public function __construct(string $name = '', array $attributes = [], int $position = 0, ?self $parent = null, ?Page $page = null, ?Article $article = null) | 53 | public function __construct(string $name = '', int $position = 0, ?self $parent = null, ?Page $page = null, ?Article $article = null) |
| 58 | { | 54 | { |
| 59 | $this->name_node = $name; | 55 | $this->name_node = $name; |
| 60 | $this->attributes = $attributes; | ||
| 61 | $this->position = $position; | 56 | $this->position = $position; |
| 62 | $this->parent = $parent; | 57 | $this->parent = $parent; |
| 63 | $this->page = $page; | 58 | $this->page = $page; |
| @@ -77,7 +72,8 @@ class Node | |||
| 77 | { | 72 | { |
| 78 | $this->name_node = $name; | 73 | $this->name_node = $name; |
| 79 | }*/ | 74 | }*/ |
| 80 | public function getAttributes(): array | 75 | |
| 76 | /*public function getAttributes(): array | ||
| 81 | { | 77 | { |
| 82 | return $this->attributes; | 78 | return $this->attributes; |
| 83 | } | 79 | } |
| @@ -97,7 +93,7 @@ class Node | |||
| 97 | if(!in_array($value, $this->attributes[$key])){ | 93 | if(!in_array($value, $this->attributes[$key])){ |
| 98 | $this->attributes[$key][] = $value; | 94 | $this->attributes[$key][] = $value; |
| 99 | } | 95 | } |
| 100 | } | 96 | }*/ |
| 101 | /*public function removeAttribute(string $key, string $value): void | 97 | /*public function removeAttribute(string $key, string $value): void |
| 102 | { | 98 | { |
| 103 | if(isset($this->attributes[$key])) // sécurité $key inexistante | 99 | if(isset($this->attributes[$key])) // sécurité $key inexistante |
