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 | |
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')
-rw-r--r-- | src/controller/ArticleController.php | 4 | ||||
-rw-r--r-- | src/controller/MenuAndPathsController.php | 2 | ||||
-rw-r--r-- | src/controller/PageManagementController.php | 38 | ||||
-rw-r--r-- | src/installation.php | 46 | ||||
-rw-r--r-- | src/model/entities/Node.php | 12 | ||||
-rw-r--r-- | src/model/entities/Page.php | 41 | ||||
-rw-r--r-- | src/view/HeadBuilder.php | 9 | ||||
-rw-r--r-- | src/view/HeaderBuilder.php | 6 | ||||
-rw-r--r-- | src/view/MainBuilder.php | 2 | ||||
-rw-r--r-- | src/view/NewBuilder.php | 6 | ||||
-rw-r--r-- | src/view/PostBuilder.php | 6 | ||||
-rw-r--r-- | src/view/templates/modify_block.php | 6 |
12 files changed, 74 insertions, 104 deletions
diff --git a/src/controller/ArticleController.php b/src/controller/ArticleController.php index 06562e7..7061897 100644 --- a/src/controller/ArticleController.php +++ b/src/controller/ArticleController.php | |||
@@ -92,7 +92,7 @@ class ArticleController | |||
92 | 92 | ||
93 | $date = new \DateTime($content['d'] . ':' . (new \DateTime)->format('s')); // l'input type="datetime-local" ne donne pas les secondes, on les ajoute: 'hh:mm' . ':ss' | 93 | $date = new \DateTime($content['d'] . ':' . (new \DateTime)->format('s')); // l'input type="datetime-local" ne donne pas les secondes, on les ajoute: 'hh:mm' . ':ss' |
94 | $article = new Article($content['i'], $date, $content['t'], $content['p']); | 94 | $article = new Article($content['i'], $date, $content['t'], $content['p']); |
95 | $article_node = new Node('new', [], count($node->getChildren()) + 1, $node, $node->getPage(), $article); | 95 | $article_node = new Node('new', count($node->getChildren()) + 1, $node, $node->getPage(), $article); |
96 | } | 96 | } |
97 | else{ // autres cas | 97 | else{ // autres cas |
98 | $timestamp = time(); | 98 | $timestamp = time(); |
@@ -101,7 +101,7 @@ class ArticleController | |||
101 | 101 | ||
102 | $article = new Article($content, $date); // le "current" timestamp est obtenu par la BDD | 102 | $article = new Article($content, $date); // le "current" timestamp est obtenu par la BDD |
103 | $placement = $json['placement'] === 'first' ? 0 : count($node->getChildren()) + 1; // | 103 | $placement = $json['placement'] === 'first' ? 0 : count($node->getChildren()) + 1; // |
104 | $article_node = new Node('post', [], $placement, $node, $node->getPage(), $article); | 104 | $article_node = new Node('post', $placement, $node, $node->getPage(), $article); |
105 | 105 | ||
106 | if($json['placement'] === 'first'){ | 106 | if($json['placement'] === 'first'){ |
107 | $node->addChild($article_node); | 107 | $node->addChild($article_node); |
diff --git a/src/controller/MenuAndPathsController.php b/src/controller/MenuAndPathsController.php index f0553ad..a32b210 100644 --- a/src/controller/MenuAndPathsController.php +++ b/src/controller/MenuAndPathsController.php | |||
@@ -22,7 +22,7 @@ class MenuAndPathsController | |||
22 | 22 | ||
23 | $page = new Page( | 23 | $page = new Page( |
24 | trim(htmlspecialchars($_POST["label_input"])), | 24 | trim(htmlspecialchars($_POST["label_input"])), |
25 | $url_input, | 25 | $url_input, '', |
26 | true, true, false, | 26 | true, true, false, |
27 | $previous_page->getPosition(), | 27 | $previous_page->getPosition(), |
28 | $parent); // peut et DOIT être null si on est au 1er niveau | 28 | $parent); // peut et DOIT être null si on est au 1er niveau |
diff --git a/src/controller/PageManagementController.php b/src/controller/PageManagementController.php index 9dce952..c45f3f3 100644 --- a/src/controller/PageManagementController.php +++ b/src/controller/PageManagementController.php | |||
@@ -68,6 +68,8 @@ class PageManagementController | |||
68 | true, true, false, | 68 | true, true, false, |
69 | $previous_page->getPosition(), | 69 | $previous_page->getPosition(), |
70 | $parent); // peut et DOIT être null si on est au 1er niveau | 70 | $parent); // peut et DOIT être null si on est au 1er niveau |
71 | $page->useDefaultCSS(); | ||
72 | $page->useDefaultJS(); | ||
71 | 73 | ||
72 | // on a donné à la nouvelle entrée la même position qu'à la précédente, | 74 | // on a donné à la nouvelle entrée la même position qu'à la précédente, |
73 | // addChild l'ajoute à la fin du tableau "children" puis on trie | 75 | // addChild l'ajoute à la fin du tableau "children" puis on trie |
@@ -80,24 +82,7 @@ class PageManagementController | |||
80 | 82 | ||
81 | $page->setPagePath(ltrim($parent->getPagePath() . '/' . $page->getEndOfPath(), '/')); | 83 | $page->setPagePath(ltrim($parent->getPagePath() . '/' . $page->getEndOfPath(), '/')); |
82 | 84 | ||
83 | // noeud "head" | ||
84 | $node = new Node('head', [], | ||
85 | 1, // position d'un head = 1 | ||
86 | null, // pas de parent | ||
87 | $page); | ||
88 | $node->useDefaultAttributes(); // fichiers CSS et JS | ||
89 | |||
90 | $data = new NodeData([], $node); | ||
91 | |||
92 | $bulk_data = $entityManager | ||
93 | ->createQuery('SELECT n FROM App\Entity\Image n WHERE n.file_name LIKE :name') | ||
94 | ->setParameter('name', '%favicon%') | ||
95 | ->getResult(); | ||
96 | $data->setImages(new ArrayCollection($bulk_data)); | ||
97 | |||
98 | $entityManager->persist($page); | 85 | $entityManager->persist($page); |
99 | $entityManager->persist($node); | ||
100 | $entityManager->persist($data); | ||
101 | $entityManager->flush(); | 86 | $entityManager->flush(); |
102 | 87 | ||
103 | // page créée, direction la page en mode modification pour ajouter des blocs | 88 | // page créée, direction la page en mode modification pour ajouter des blocs |
@@ -142,26 +127,15 @@ class PageManagementController | |||
142 | } | 127 | } |
143 | 128 | ||
144 | if($_POST["bloc_select"] === 'calendar' || $_POST["bloc_select"] === 'form'){ | 129 | if($_POST["bloc_select"] === 'calendar' || $_POST["bloc_select"] === 'form'){ |
145 | $dql = 'SELECT n FROM App\Entity\Node n WHERE n.page = :page AND n.name_node = :name'; // noeud 'head' de la page | 130 | $page->setCSS(array_merge($page->getCSS(), [$_POST["bloc_select"]])); |
146 | $bulk_data = $entityManager | ||
147 | ->createQuery($dql) | ||
148 | ->setParameter('page', $page) | ||
149 | ->setParameter('name', 'head') | ||
150 | ->getResult(); | ||
151 | |||
152 | if(count($bulk_data) != 1){ // 1 head par page | ||
153 | header("Location: " . new URL(['page' => $_GET['page'], 'error' => 'head_node_not_found'])); | ||
154 | die; | ||
155 | } | ||
156 | 131 | ||
157 | $bulk_data[0]->addAttribute('css_array', $_POST["bloc_select"]); | ||
158 | if($_POST["bloc_select"] === 'form'){ | 132 | if($_POST["bloc_select"] === 'form'){ |
159 | $bulk_data[0]->addAttribute('js_array', $_POST["bloc_select"]); | 133 | $page->setJS(array_merge($page->getJS(), [$_POST["bloc_select"]])); |
160 | } | 134 | } |
161 | $entityManager->persist($bulk_data[0]); | 135 | $entityManager->persist($page); |
162 | } | 136 | } |
163 | 137 | ||
164 | $block = new Node($_POST["bloc_select"], [], $position, $main, $page); | 138 | $block = new Node($_POST["bloc_select"], $position, $main, $page); |
165 | $data = new NodeData(['title' => trim(htmlspecialchars($_POST["bloc_title"]))], $block); | 139 | $data = new NodeData(['title' => trim(htmlspecialchars($_POST["bloc_title"]))], $block); |
166 | 140 | ||
167 | // valeurs par défaut | 141 | // valeurs par défaut |
diff --git a/src/installation.php b/src/installation.php index 7fff5f7..df0f851 100644 --- a/src/installation.php +++ b/src/installation.php | |||
@@ -100,21 +100,16 @@ function makeStartPage(EntityManager $entityManager){ | |||
100 | 100 | ||
101 | /* -- table node -- */ | 101 | /* -- table node -- */ |
102 | // paramètres: name_node, article_timestamp, attributes, position, parent, page, article | 102 | // paramètres: name_node, article_timestamp, attributes, position, parent, page, article |
103 | $head_accueil = new Node('head', ['css_array' => ['body', 'head', 'nav', 'foot'], 'js_array' => ['main']], 1, NULL, $accueil, NULL); | 103 | $head = new Node('head', 1, NULL, NULL, NULL); |
104 | $head_article = new Node('head', ['css_array' => ['body', 'head', 'nav', 'foot'], 'js_array' => ['main']], 1, NULL, $article, NULL); | 104 | $header = new Node('header', 2, NULL, NULL, NULL); |
105 | $header = new Node('header', [], 2, NULL, NULL, NULL); | 105 | $nav = new Node('nav', 1, $header, NULL, NULL); |
106 | $nav = new Node('nav', [], 1, $header, NULL, NULL); | 106 | $main = new Node('main', 3, NULL, NULL, NULL); |
107 | $main = new Node('main', [], 3, NULL, NULL, NULL); | 107 | $footer = new Node('footer', 4, NULL, NULL, NULL); |
108 | $footer = new Node('footer', [], 4, NULL, NULL, NULL); | 108 | $breadcrumb = new Node('breadcrumb', 2, $header, NULL, NULL); |
109 | $breadcrumb = new Node('breadcrumb', [], 2, $header, NULL, NULL); | 109 | $login = new Node('login', 1, $main, $connection, NULL); |
110 | $head_login = new Node('head', ["stop" => true, 'css_array' => ['body'], 'js_array' => ['main']], 1, NULL, $connection, NULL); | 110 | $user_edit = new Node('user_edit', 1, $main, $my_account, NULL); |
111 | $login = new Node('login', [], 1, $main, $connection, NULL); | 111 | $bloc_edit_menu = new Node('menu', 1, $main, $menu_paths, NULL); |
112 | $head_my_account = new Node('head', ["stop" => true, 'css_array' => ['body'], 'js_array' => ['main']], 1, NULL, $my_account, NULL); | 112 | $bloc_new_page = new Node('new_page', 1, $main, $new_page, NULL); |
113 | $user_edit = new Node('user_edit', [], 1, $main, $my_account, NULL); | ||
114 | $head_edit_menu = new Node('head', ['css_array' => ['body', 'head', 'nav', 'menu', 'foot'], 'js_array' => ['main', 'menu']], 1, NULL, $menu_paths, NULL); | ||
115 | $bloc_edit_menu = new Node('menu', [], 1, $main, $menu_paths, NULL); | ||
116 | $head_new_page = new Node('head', ['css_array' => ['body', 'head', 'nav', 'new_page', 'foot'], 'js_array' => ['main', 'new_page']], 1, NULL, $new_page, NULL); | ||
117 | $bloc_new_page = new Node('new_page', [], 1, $main, $new_page, NULL); | ||
118 | 113 | ||
119 | /* -- table asset -- */ | 114 | /* -- table asset -- */ |
120 | // paramètres: file_name, file_path, file_path_mini, mime_type, alt | 115 | // paramètres: file_name, file_path, file_path_mini, mime_type, alt |
@@ -128,12 +123,7 @@ function makeStartPage(EntityManager $entityManager){ | |||
128 | 123 | ||
129 | /* -- table node_data -- */ | 124 | /* -- table node_data -- */ |
130 | // paramètres: data, node, images | 125 | // paramètres: data, node, images |
131 | $head_accueil_data = new NodeData([], $head_accueil, new ArrayCollection([$favicon])); | 126 | $head_data = new NodeData([], $head, new ArrayCollection([$favicon])); |
132 | $head_login_data = new NodeData([], $head_login, new ArrayCollection([$favicon])); | ||
133 | $head_my_account_data = new NodeData([], $head_my_account, new ArrayCollection([$favicon])); | ||
134 | $head_article_data = new NodeData([], $head_article, new ArrayCollection([$favicon])); | ||
135 | $head_edit_menu_data = new NodeData([], $head_edit_menu, new ArrayCollection([$favicon])); | ||
136 | $head_new_page_data = new NodeData([], $head_new_page, new ArrayCollection([$favicon])); | ||
137 | $header_data = new NodeData(["title" => "Titre", "description" => "Sous-titre", "header_logo" => "assets/logo-nb-et-ffn.png", "header_background" => "assets/fond-piscine.jpg", | 127 | $header_data = new NodeData(["title" => "Titre", "description" => "Sous-titre", "header_logo" => "assets/logo-nb-et-ffn.png", "header_background" => "assets/fond-piscine.jpg", |
138 | "social" => ["facebook" => "https://www.facebook.com", "instagram" => "https://www.instagram.com", "linkedin" => "https://www.linkedin.com"]], | 128 | "social" => ["facebook" => "https://www.facebook.com", "instagram" => "https://www.instagram.com", "linkedin" => "https://www.linkedin.com"]], |
139 | $header, new ArrayCollection([$facebook, $instagram, $linkedin, $github])); | 129 | $header, new ArrayCollection([$facebook, $instagram, $linkedin, $github])); |
@@ -149,20 +139,15 @@ function makeStartPage(EntityManager $entityManager){ | |||
149 | $entityManager->persist($new_page); | 139 | $entityManager->persist($new_page); |
150 | 140 | ||
151 | /* -- table node -- */ | 141 | /* -- table node -- */ |
152 | $entityManager->persist($head_accueil); | 142 | $entityManager->persist($head); |
153 | $entityManager->persist($header); | 143 | $entityManager->persist($header); |
154 | $entityManager->persist($nav); | 144 | $entityManager->persist($nav); |
155 | $entityManager->persist($main); | 145 | $entityManager->persist($main); |
156 | $entityManager->persist($footer); | 146 | $entityManager->persist($footer); |
157 | $entityManager->persist($breadcrumb); | 147 | $entityManager->persist($breadcrumb); |
158 | $entityManager->persist($head_login); | ||
159 | $entityManager->persist($login); | 148 | $entityManager->persist($login); |
160 | $entityManager->persist($head_my_account); | ||
161 | $entityManager->persist($user_edit); | 149 | $entityManager->persist($user_edit); |
162 | $entityManager->persist($head_article); | ||
163 | $entityManager->persist($head_edit_menu); | ||
164 | $entityManager->persist($bloc_edit_menu); | 150 | $entityManager->persist($bloc_edit_menu); |
165 | $entityManager->persist($head_new_page); | ||
166 | $entityManager->persist($bloc_new_page); | 151 | $entityManager->persist($bloc_new_page); |
167 | 152 | ||
168 | /* -- table image -- */ | 153 | /* -- table image -- */ |
@@ -173,14 +158,9 @@ function makeStartPage(EntityManager $entityManager){ | |||
173 | $entityManager->persist($github); | 158 | $entityManager->persist($github); |
174 | 159 | ||
175 | /* -- table node_data -- */ | 160 | /* -- table node_data -- */ |
176 | $entityManager->persist($head_accueil_data); | 161 | $entityManager->persist($head_data); |
177 | $entityManager->persist($header_data); | 162 | $entityManager->persist($header_data); |
178 | $entityManager->persist($footer_data); | 163 | $entityManager->persist($footer_data); |
179 | $entityManager->persist($head_login_data); | ||
180 | $entityManager->persist($head_my_account_data); | ||
181 | $entityManager->persist($head_article_data); | ||
182 | $entityManager->persist($head_edit_menu_data); | ||
183 | $entityManager->persist($head_new_page_data); | ||
184 | 164 | ||
185 | $entityManager->flush(); | 165 | $entityManager->flush(); |
186 | header('Location: ' . new URL); | 166 | header('Location: ' . new URL); |
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 |
diff --git a/src/model/entities/Page.php b/src/model/entities/Page.php index 5b54ae6..3e90dbc 100644 --- a/src/model/entities/Page.php +++ b/src/model/entities/Page.php | |||
@@ -31,6 +31,23 @@ class Page | |||
31 | #[ORM\Column(type: "text")] | 31 | #[ORM\Column(type: "text")] |
32 | private string $description; | 32 | private string $description; |
33 | 33 | ||
34 | #[ORM\Column(type: "json", nullable: true)] | ||
35 | private ?array $css = null; | ||
36 | |||
37 | #[ORM\Column(type: "json", nullable: true)] | ||
38 | private ?array $js = null; | ||
39 | |||
40 | static private array $default_css = ['body', 'head', 'nav', 'foot']; | ||
41 | static private array $default_js = ['main']; | ||
42 | |||
43 | /* remplissage | ||
44 | UPDATE nb_page | ||
45 | JOIN nb_node ON nb_node.page_id = nb_page.id_page | ||
46 | SET nb_page.css = JSON_EXTRACT(nb_node.attributes, '$.css_array'); | ||
47 | UPDATE nb_page | ||
48 | JOIN nb_node ON nb_node.page_id = nb_page.id_page | ||
49 | SET nb_page.js = JSON_EXTRACT(nb_node.attributes, '$.js_array'); */ | ||
50 | |||
34 | #[ORM\Column(type: "boolean")] | 51 | #[ORM\Column(type: "boolean")] |
35 | private bool $reachable; | 52 | private bool $reachable; |
36 | 53 | ||
@@ -103,6 +120,30 @@ class Page | |||
103 | { | 120 | { |
104 | $this->description = $description; | 121 | $this->description = $description; |
105 | } | 122 | } |
123 | public function getCSS(): array | ||
124 | { | ||
125 | return $this->css; | ||
126 | } | ||
127 | public function useDefaultCSS(): void | ||
128 | { | ||
129 | $this->css = self::$default_css; | ||
130 | } | ||
131 | public function setCSS(array $css): void | ||
132 | { | ||
133 | $this->css = $css; | ||
134 | } | ||
135 | public function getJS(): array | ||
136 | { | ||
137 | return $this->js; | ||
138 | } | ||
139 | public function useDefaultJS(): void | ||
140 | { | ||
141 | $this->js = self::$default_js; | ||
142 | } | ||
143 | public function setJS(array $js): void | ||
144 | { | ||
145 | $this->js = $js; | ||
146 | } | ||
106 | public function isReachable(): bool | 147 | public function isReachable(): bool |
107 | { | 148 | { |
108 | return $this->reachable; | 149 | return $this->reachable; |
diff --git a/src/view/HeadBuilder.php b/src/view/HeadBuilder.php index 4fe86ef..b1dfacb 100644 --- a/src/view/HeadBuilder.php +++ b/src/view/HeadBuilder.php | |||
@@ -14,19 +14,16 @@ class HeadBuilder extends AbstractBuilder | |||
14 | if(file_exists($viewFile)) | 14 | if(file_exists($viewFile)) |
15 | { | 15 | { |
16 | // css et js | 16 | // css et js |
17 | if(!empty($node->getAttributes())) | 17 | $page = Model::$page_path->getLast(); |
18 | { | ||
19 | extract($node->getAttributes()); | ||
20 | } | ||
21 | 18 | ||
22 | $css = ''; | 19 | $css = ''; |
23 | foreach($css_array as $name) | 20 | foreach($page->getCSS() as $name) |
24 | { | 21 | { |
25 | $css .= '<link rel="stylesheet" href="' . self::versionedFileURL('css', $name) . '">' . "\n"; | 22 | $css .= '<link rel="stylesheet" href="' . self::versionedFileURL('css', $name) . '">' . "\n"; |
26 | } | 23 | } |
27 | 24 | ||
28 | $js = ''; | 25 | $js = ''; |
29 | foreach($js_array as $name) | 26 | foreach($page->getJS() as $name) |
30 | { | 27 | { |
31 | $js .= '<script src="' . self::versionedFileURL('js', $name) . '"></script>' . "\n"; | 28 | $js .= '<script src="' . self::versionedFileURL('js', $name) . '"></script>' . "\n"; |
32 | } | 29 | } |
diff --git a/src/view/HeaderBuilder.php b/src/view/HeaderBuilder.php index 1b60bc9..dc4aec4 100644 --- a/src/view/HeaderBuilder.php +++ b/src/view/HeaderBuilder.php | |||
@@ -41,12 +41,6 @@ class HeaderBuilder extends AbstractBuilder | |||
41 | extract($node->getNodeData()->getData()); | 41 | extract($node->getNodeData()->getData()); |
42 | } | 42 | } |
43 | 43 | ||
44 | // attributs, aucun pour l'instant | ||
45 | if(!empty($node->getAttributes())) | ||
46 | { | ||
47 | extract($node->getAttributes()); | ||
48 | } | ||
49 | |||
50 | // réseaux sociaux + logo dans l'entête | 44 | // réseaux sociaux + logo dans l'entête |
51 | $keys = array_keys($social); | 45 | $keys = array_keys($social); |
52 | $social_networks = ''; | 46 | $social_networks = ''; |
diff --git a/src/view/MainBuilder.php b/src/view/MainBuilder.php index a920eb4..332efa5 100644 --- a/src/view/MainBuilder.php +++ b/src/view/MainBuilder.php | |||
@@ -27,7 +27,7 @@ class MainBuilder extends AbstractBuilder | |||
27 | if($node->getAdoptedChild() == null){ | 27 | if($node->getAdoptedChild() == null){ |
28 | $date = new \DateTime; | 28 | $date = new \DateTime; |
29 | $article = new Article('', $date); | 29 | $article = new Article('', $date); |
30 | $new = new Node('new', [], 0, null, null, $article); | 30 | $new = new Node('new', 0, null, null, $article); |
31 | } | 31 | } |
32 | // modification | 32 | // modification |
33 | else{ | 33 | else{ |
diff --git a/src/view/NewBuilder.php b/src/view/NewBuilder.php index ec48541..a31a1c4 100644 --- a/src/view/NewBuilder.php +++ b/src/view/NewBuilder.php | |||
@@ -33,12 +33,6 @@ class NewBuilder extends AbstractBuilder | |||
33 | else{ | 33 | else{ |
34 | $id = (string)$node->getId(); | 34 | $id = (string)$node->getId(); |
35 | 35 | ||
36 | // id (timestamp) | ||
37 | if(!empty($node->getAttributes())) | ||
38 | { | ||
39 | extract($node->getAttributes()); | ||
40 | } | ||
41 | |||
42 | // html, date | 36 | // html, date |
43 | $title = $node->getArticle()->getTitle(); | 37 | $title = $node->getArticle()->getTitle(); |
44 | $preview = $node->getArticle()->getPreview(); | 38 | $preview = $node->getArticle()->getPreview(); |
diff --git a/src/view/PostBuilder.php b/src/view/PostBuilder.php index 70a2d77..de7a818 100644 --- a/src/view/PostBuilder.php +++ b/src/view/PostBuilder.php | |||
@@ -13,12 +13,6 @@ class PostBuilder extends AbstractBuilder | |||
13 | 13 | ||
14 | if(file_exists($viewFile)) | 14 | if(file_exists($viewFile)) |
15 | { | 15 | { |
16 | // id (timestamp) | ||
17 | if(!empty($node->getAttributes())) | ||
18 | { | ||
19 | extract($node->getAttributes()); | ||
20 | } | ||
21 | |||
22 | // html | 16 | // html |
23 | $title = $node->getArticle()->getTitle(); | 17 | $title = $node->getArticle()->getTitle(); |
24 | $html = $node->getArticle()->getContent(); | 18 | $html = $node->getArticle()->getContent(); |
diff --git a/src/view/templates/modify_block.php b/src/view/templates/modify_block.php index 75cb218..6b7ceb0 100644 --- a/src/view/templates/modify_block.php +++ b/src/view/templates/modify_block.php | |||
@@ -44,9 +44,6 @@ if(Blocks::hasPresentation($child_node->getName())){ | |||
44 | <input type="number" id="cols_min_width_select_<?= $child_node->getId() ?>" onchange="changeColsMinWidth(<?= $child_node->getId() ?>)" min="150" max="400" value="<?= $child_node->getNodeData()->getColsMinWidth() ?>"> pixels | 44 | <input type="number" id="cols_min_width_select_<?= $child_node->getId() ?>" onchange="changeColsMinWidth(<?= $child_node->getId() ?>)" min="150" max="400" value="<?= $child_node->getNodeData()->getColsMinWidth() ?>"> pixels |
45 | </div> | 45 | </div> |
46 | </div> | 46 | </div> |
47 | <?php | ||
48 | } | ||
49 | ?> | ||
50 | <div class="pagination_limit"> | 47 | <div class="pagination_limit"> |
51 | <label for="pagination_limit_<?= $child_node->getId() ?>"> | 48 | <label for="pagination_limit_<?= $child_node->getId() ?>"> |
52 | Nombre max d'articles affichés | 49 | Nombre max d'articles affichés |
@@ -54,4 +51,7 @@ if(Blocks::hasPresentation($child_node->getName())){ | |||
54 | <i>(mettre 0 désactive la pagination)</i> | 51 | <i>(mettre 0 désactive la pagination)</i> |
55 | </label> | 52 | </label> |
56 | </div> | 53 | </div> |
54 | <?php | ||
55 | } | ||
56 | ?> | ||
57 | </div> \ No newline at end of file | 57 | </div> \ No newline at end of file |