diff options
Diffstat (limited to 'src/view')
-rw-r--r-- | src/view/MainBuilder.php | 9 | ||||
-rw-r--r-- | src/view/NewsBlockBuilder.php | 2 | ||||
-rw-r--r-- | src/view/PostBlockBuilder.php | 2 | ||||
-rw-r--r-- | src/view/templates/modify_block.php | 6 |
4 files changed, 8 insertions, 11 deletions
diff --git a/src/view/MainBuilder.php b/src/view/MainBuilder.php index 8a40d82..2510b08 100644 --- a/src/view/MainBuilder.php +++ b/src/view/MainBuilder.php | |||
@@ -55,14 +55,11 @@ class MainBuilder extends AbstractBuilder | |||
55 | // mode modification de page uniquement | 55 | // mode modification de page uniquement |
56 | private function viewEditBlocks($node): void | 56 | private function viewEditBlocks($node): void |
57 | { | 57 | { |
58 | $blocks = Blocks::getTypeNamePairs(); | ||
59 | |||
60 | $options = ''; | 58 | $options = ''; |
61 | for($i = 0; $i < count($blocks); $i++){ | 59 | foreach(Blocks::$blocks as $key => $value){ |
62 | $options .= '<option value= "' . $blocks[$i]['type'] . '">' . $blocks[$i]['name'] . "</option>\n"; | 60 | $options .= '<option value= "' . $key . '">' . $value . "</option>\n"; |
63 | } | 61 | } |
64 | 62 | ||
65 | //$page_id = Director::$page_path->getLast()->getId(); | ||
66 | $head_node = null; | 63 | $head_node = null; |
67 | foreach(ViewController::$root_node->getChildren() as $first_level_node){ | 64 | foreach(ViewController::$root_node->getChildren() as $first_level_node){ |
68 | if($first_level_node->getName() === 'head'){ | 65 | if($first_level_node->getName() === 'head'){ |
@@ -88,7 +85,7 @@ class MainBuilder extends AbstractBuilder | |||
88 | private function makePresentationOptions(string $presentation): string | 85 | private function makePresentationOptions(string $presentation): string |
89 | { | 86 | { |
90 | $options = ''; | 87 | $options = ''; |
91 | foreach(Presentation::$option_list as $key => $value){ | 88 | foreach(Blocks::$presentations as $key => $value){ |
92 | $options .= '<option value="' . $key . '" ' . ($presentation === $key ? 'selected' : '') . '>' . $value . '</option>'; | 89 | $options .= '<option value="' . $key . '" ' . ($presentation === $key ? 'selected' : '') . '>' . $value . '</option>'; |
93 | } | 90 | } |
94 | return $options; | 91 | return $options; |
diff --git a/src/view/NewsBlockBuilder.php b/src/view/NewsBlockBuilder.php index e7bbec9..963afe6 100644 --- a/src/view/NewsBlockBuilder.php +++ b/src/view/NewsBlockBuilder.php | |||
@@ -22,7 +22,7 @@ class NewsBlockBuilder extends AbstractBuilder | |||
22 | } | 22 | } |
23 | 23 | ||
24 | // stratégie d'affichage du contenu (utilisation de méthodes ou de classe List, GridPresentation, etc) | 24 | // stratégie d'affichage du contenu (utilisation de méthodes ou de classe List, GridPresentation, etc) |
25 | $section_class = $node->getNodeData()->getPresentation()->getName(); // = list, grid , mosaic ou carousel | 25 | $section_class = $node->getNodeData()->getPresentation(); // = list, grid , mosaic ou carousel |
26 | $cols_min_width = ''; | 26 | $cols_min_width = ''; |
27 | if($section_class === 'grid'){ | 27 | if($section_class === 'grid'){ |
28 | $min_width = $node->getNodeData()->getColsMinWidth(); | 28 | $min_width = $node->getNodeData()->getColsMinWidth(); |
diff --git a/src/view/PostBlockBuilder.php b/src/view/PostBlockBuilder.php index dca4fbd..ba54901 100644 --- a/src/view/PostBlockBuilder.php +++ b/src/view/PostBlockBuilder.php | |||
@@ -22,7 +22,7 @@ class PostBlockBuilder extends AbstractBuilder | |||
22 | } | 22 | } |
23 | 23 | ||
24 | // stratégie d'affichage du contenu (utilisation de méthodes ou de classe List, GridPresentation, etc) | 24 | // stratégie d'affichage du contenu (utilisation de méthodes ou de classe List, GridPresentation, etc) |
25 | $section_class = $node->getNodeData()->getPresentation()->getName(); // = list, grid , mosaic ou carousel | 25 | $section_class = $node->getNodeData()->getPresentation(); // = list, grid , mosaic ou carousel |
26 | $cols_min_width = ''; | 26 | $cols_min_width = ''; |
27 | if($section_class === 'grid'){ | 27 | if($section_class === 'grid'){ |
28 | $min_width = $node->getNodeData()->getColsMinWidth(); | 28 | $min_width = $node->getNodeData()->getColsMinWidth(); |
diff --git a/src/view/templates/modify_block.php b/src/view/templates/modify_block.php index 2514085..22a2932 100644 --- a/src/view/templates/modify_block.php +++ b/src/view/templates/modify_block.php | |||
@@ -1,6 +1,6 @@ | |||
1 | <div class="modify_one_block" id="bloc_edit_<?= $child_node->getId() ?>"> | 1 | <div class="modify_one_block" id="bloc_edit_<?= $child_node->getId() ?>"> |
2 | <div class="block_options"> | 2 | <div class="block_options"> |
3 | <label for="bloc_rename_<?= $child_node->getId() ?>">Type <b><?= Blocks::getNameFromType($child_node->getName()) ?></b> | 3 | <label for="bloc_rename_<?= $child_node->getId() ?>">Type <b><?= Blocks::$blocks[$child_node->getName()] ?></b> |
4 | </label> | 4 | </label> |
5 | <p> | 5 | <p> |
6 | <input type="text" id="bloc_rename_<?= $child_node->getId() ?>" name="bloc_rename_title" value="<?= $child_node->getNodeData()->getdata()['title'] ?>" required> | 6 | <input type="text" id="bloc_rename_<?= $child_node->getId() ?>" name="bloc_rename_title" value="<?= $child_node->getNodeData()->getdata()['title'] ?>" required> |
@@ -24,9 +24,9 @@ if($child_node->getNodeData()->getPresentation() !== null){ | |||
24 | <div class="grid_options"><p> | 24 | <div class="grid_options"><p> |
25 | <label for="presentation_select_<?= $child_node->getId() ?>">Présentation</label> | 25 | <label for="presentation_select_<?= $child_node->getId() ?>">Présentation</label> |
26 | <select id="presentation_select_<?= $child_node->getId() ?>" onchange="changePresentation(<?= $child_node->getId() ?>)"> | 26 | <select id="presentation_select_<?= $child_node->getId() ?>" onchange="changePresentation(<?= $child_node->getId() ?>)"> |
27 | <?= $this->makePresentationOptions($child_node->getNodeData()->getPresentation()->getName()) ?> | 27 | <?= $this->makePresentationOptions($child_node->getNodeData()->getPresentation()) ?> |
28 | </select> | 28 | </select> |
29 | <div id="cols_min_width_edit_<?= $child_node->getId() ?>" class="<?= ($child_node->getNodeData()->getPresentation()->getName() === 'grid' ? '' : 'hidden') ?>"> | 29 | <div id="cols_min_width_edit_<?= $child_node->getId() ?>" class="<?= ($child_node->getNodeData()->getPresentation() === 'grid' ? '' : 'hidden') ?>"> |
30 | <label for="cols_min_width_select_<?= $child_node->getId() ?>">Largeur minimum </label> | 30 | <label for="cols_min_width_select_<?= $child_node->getId() ?>">Largeur minimum </label> |
31 | <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 | 31 | <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 |
32 | </div> | 32 | </div> |