diff --git a/core/core.php b/core/core.php index c5d29407..5309c0f6 100644 --- a/core/core.php +++ b/core/core.php @@ -1449,6 +1449,28 @@ class common { } $this->setData(['core', 'dataVersion', 10304]); } + // Version 10.3.06 + if ($this->getData(['core', 'dataVersion']) < 10306) { + // Mettre à jour les données des blogs + $pageList = array(); + foreach ($this->getHierarchy(null,null,null) as $parentKey=>$parentValue) { + $pageList [] = $parentKey; + foreach ($parentValue as $childKey) { + $pageList [] = $childKey; + } + } + foreach ($pageList as $parentKey => $parent) { + //La page a une galerie + if ($this->getData(['page',$parent,'moduleId']) === 'blog' ) { + foreach ( $this->getData(['module', $parent]) as $blogKey => $blogItem) { + $data = $this->getdata(['module',$parent,$blogKey]); + $this->deleteData(['module',$parent, $blogKey]); + $this->setData([ 'module', $parent, 'posts', $blogKey, $data ]); + } + } + } + $this->setData(['core', 'dataVersion', 10306]); + } } } diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index 6fc1fbf5..c23d116b 100644 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -644,49 +644,55 @@ class init extends common { ], 'module' => [ 'blog' => [ - 'mon-premier-article' => [ - 'closeComment' => false, - 'comment' => [ - '58e11d09e5aff' => [ - 'author' => 'Rémi', - 'content' => 'Article bien rédigé et très pertinent, bravo !', - 'createdOn' => 1421748000, - 'userId' => '' - ] + 'config' => [ + 'feeds' => true, + 'feedsLabel' => "Syndication RSS" + ], + 'posts' => [ + 'mon-premier-article' => [ + 'closeComment' => false, + 'comment' => [ + '58e11d09e5aff' => [ + 'author' => 'Rémi', + 'content' => 'Article bien rédigé et très pertinent, bravo !', + 'createdOn' => 1421748000, + 'userId' => '' + ] + ], + 'content' => '

Et eodem impetu Domitianum praecipitem per scalas itidem funibus constrinxerunt, eosque coniunctos per ampla spatia civitatis acri raptavere discursu. iamque artuum et membrorum divulsa conpage superscandentes corpora mortuorum ad ultimam truncata deformitatem velut exsaturati mox abiecerunt in flumen.

Ex his quidam aeternitati se commendari posse per statuas aestimantes eas ardenter adfectant quasi plus praemii de figmentis aereis sensu carentibus adepturi, quam ex conscientia honeste recteque factorum, easque auro curant inbracteari, quod Acilio Glabrioni delatum est primo, cum consiliis armisque regem superasset Antiochum. quam autem sit pulchrum exigua haec spernentem et minima ad ascensus verae gloriae tendere longos et arduos, ut memorat vates Ascraeus, Censorius Cato monstravit. qui interrogatus quam ob rem inter multos... statuam non haberet malo inquit ambigere bonos quam ob rem id non meruerim, quam quod est gravius cur inpetraverim mussitare.

Latius iam disseminata licentia onerosus bonis omnibus Caesar nullum post haec adhibens modum orientis latera cuncta vexabat nec honoratis parcens nec urbium primatibus nec plebeiis.

', + 'picture' => 'galerie/landscape/meadow.jpg', + 'hidePicture' => false, + 'pictureSize' => 20, + 'publishedOn' => 1548790902, + 'state' => true, + 'title' => 'Mon premier article', + 'userId' => '' // Géré au moment de l'installation + ], + 'mon-deuxieme-article' => [ + 'closeComment' => false, + 'comment' => [], + 'content' => '

Et prima post Osdroenam quam, ut dictum est, ab hac descriptione discrevimus, Commagena, nunc Euphratensis, clementer adsurgit, Hierapoli, vetere Nino et Samosata civitatibus amplis inlustris.

Ob haec et huius modi multa, quae cernebantur in paucis, omnibus timeri sunt coepta. et ne tot malis dissimulatis paulatimque serpentibus acervi crescerent aerumnarum, nobilitatis decreto legati mittuntur: Praetextatus ex urbi praefecto et ex vicario Venustus et ex consulari Minervius oraturi, ne delictis supplicia sint grandiora, neve senator quisquam inusitato et inlicito more tormentis exponeretur.

Sed ut tum ad senem senex de senectute, sic hoc libro ad amicum amicissimus scripsi de amicitia. Tum est Cato locutus, quo erat nemo fere senior temporibus illis, nemo prudentior; nunc Laelius et sapiens (sic enim est habitus) et amicitiae gloria excellens de amicitia loquetur. Tu velim a me animum parumper avertas, Laelium loqui ipsum putes. C. Fannius et Q. Mucius ad socerum veniunt post mortem Africani; ab his sermo oritur, respondet Laelius, cuius tota disputatio est de amicitia, quam legens te ipse cognosces.

', + 'picture' => 'galerie/landscape/desert.jpg', + 'hidePicture' => false, + 'pictureSize' => 40, + 'publishedOn' => 1550432502, + 'state' => true, + 'title' => 'Mon deuxième article', + 'userId' => '' // Géré au moment de l'installation + ], + 'mon-troisieme-article' => [ + 'closeComment' => true, + 'comment' => [], + 'content' => '

Rogatus ad ultimum admissusque in consistorium ambage nulla praegressa inconsiderate et leviter proficiscere inquit ut praeceptum est, Caesar sciens quod si cessaveris, et tuas et palatii tui auferri iubebo prope diem annonas. hocque solo contumaciter dicto subiratus abscessit nec in conspectum eius postea venit saepius arcessitus.

Proinde concepta rabie saeviore, quam desperatio incendebat et fames, amplificatis viribus ardore incohibili in excidium urbium matris Seleuciae efferebantur, quam comes tuebatur Castricius tresque legiones bellicis sudoribus induratae.

Inter has ruinarum varietates a Nisibi quam tuebatur accitus Vrsicinus, cui nos obsecuturos iunxerat imperiale praeceptum, dispicere litis exitialis certamina cogebatur abnuens et reclamans, adulatorum oblatrantibus turmis, bellicosus sane milesque semper et militum ductor sed forensibus iurgiis longe discretus, qui metu sui discriminis anxius cum accusatores quaesitoresque subditivos sibi consociatos ex isdem foveis cerneret emergentes, quae clam palamve agitabantur, occultis Constantium litteris edocebat inplorans subsidia, quorum metu tumor notissimus Caesaris exhalaret.

', + 'picture' => 'galerie/landscape/iceberg.jpg', + 'hidePicture' => false, + 'pictureSize' => 100, + 'publishedOn' => 1550864502, + 'state' => true, + 'title' => 'Mon troisième article', + 'userId' => '' // Géré au moment de l'installation ], - 'content' => '

Et eodem impetu Domitianum praecipitem per scalas itidem funibus constrinxerunt, eosque coniunctos per ampla spatia civitatis acri raptavere discursu. iamque artuum et membrorum divulsa conpage superscandentes corpora mortuorum ad ultimam truncata deformitatem velut exsaturati mox abiecerunt in flumen.

Ex his quidam aeternitati se commendari posse per statuas aestimantes eas ardenter adfectant quasi plus praemii de figmentis aereis sensu carentibus adepturi, quam ex conscientia honeste recteque factorum, easque auro curant inbracteari, quod Acilio Glabrioni delatum est primo, cum consiliis armisque regem superasset Antiochum. quam autem sit pulchrum exigua haec spernentem et minima ad ascensus verae gloriae tendere longos et arduos, ut memorat vates Ascraeus, Censorius Cato monstravit. qui interrogatus quam ob rem inter multos... statuam non haberet malo inquit ambigere bonos quam ob rem id non meruerim, quam quod est gravius cur inpetraverim mussitare.

Latius iam disseminata licentia onerosus bonis omnibus Caesar nullum post haec adhibens modum orientis latera cuncta vexabat nec honoratis parcens nec urbium primatibus nec plebeiis.

', - 'picture' => 'galerie/landscape/meadow.jpg', - 'hidePicture' => false, - 'pictureSize' => 20, - 'publishedOn' => 1548790902, - 'state' => true, - 'title' => 'Mon premier article', - 'userId' => '' // Géré au moment de l'installation ], - 'mon-deuxieme-article' => [ - 'closeComment' => false, - 'comment' => [], - 'content' => '

Et prima post Osdroenam quam, ut dictum est, ab hac descriptione discrevimus, Commagena, nunc Euphratensis, clementer adsurgit, Hierapoli, vetere Nino et Samosata civitatibus amplis inlustris.

Ob haec et huius modi multa, quae cernebantur in paucis, omnibus timeri sunt coepta. et ne tot malis dissimulatis paulatimque serpentibus acervi crescerent aerumnarum, nobilitatis decreto legati mittuntur: Praetextatus ex urbi praefecto et ex vicario Venustus et ex consulari Minervius oraturi, ne delictis supplicia sint grandiora, neve senator quisquam inusitato et inlicito more tormentis exponeretur.

Sed ut tum ad senem senex de senectute, sic hoc libro ad amicum amicissimus scripsi de amicitia. Tum est Cato locutus, quo erat nemo fere senior temporibus illis, nemo prudentior; nunc Laelius et sapiens (sic enim est habitus) et amicitiae gloria excellens de amicitia loquetur. Tu velim a me animum parumper avertas, Laelium loqui ipsum putes. C. Fannius et Q. Mucius ad socerum veniunt post mortem Africani; ab his sermo oritur, respondet Laelius, cuius tota disputatio est de amicitia, quam legens te ipse cognosces.

', - 'picture' => 'galerie/landscape/desert.jpg', - 'hidePicture' => false, - 'pictureSize' => 40, - 'publishedOn' => 1550432502, - 'state' => true, - 'title' => 'Mon deuxième article', - 'userId' => '' // Géré au moment de l'installation - ], - 'mon-troisieme-article' => [ - 'closeComment' => true, - 'comment' => [], - 'content' => '

Rogatus ad ultimum admissusque in consistorium ambage nulla praegressa inconsiderate et leviter proficiscere inquit ut praeceptum est, Caesar sciens quod si cessaveris, et tuas et palatii tui auferri iubebo prope diem annonas. hocque solo contumaciter dicto subiratus abscessit nec in conspectum eius postea venit saepius arcessitus.

Proinde concepta rabie saeviore, quam desperatio incendebat et fames, amplificatis viribus ardore incohibili in excidium urbium matris Seleuciae efferebantur, quam comes tuebatur Castricius tresque legiones bellicis sudoribus induratae.

Inter has ruinarum varietates a Nisibi quam tuebatur accitus Vrsicinus, cui nos obsecuturos iunxerat imperiale praeceptum, dispicere litis exitialis certamina cogebatur abnuens et reclamans, adulatorum oblatrantibus turmis, bellicosus sane milesque semper et militum ductor sed forensibus iurgiis longe discretus, qui metu sui discriminis anxius cum accusatores quaesitoresque subditivos sibi consociatos ex isdem foveis cerneret emergentes, quae clam palamve agitabantur, occultis Constantium litteris edocebat inplorans subsidia, quorum metu tumor notissimus Caesaris exhalaret.

', - 'picture' => 'galerie/landscape/iceberg.jpg', - 'hidePicture' => false, - 'pictureSize' => 100, - 'publishedOn' => 1550864502, - 'state' => true, - 'title' => 'Mon troisième article', - 'userId' => '' // Géré au moment de l'installation - ] ], 'galeries' => [ 'beaux-paysages' => [ diff --git a/module/blog/blog.php b/module/blog/blog.php index 1573db45..18720558 100644 --- a/module/blog/blog.php +++ b/module/blog/blog.php @@ -33,6 +33,8 @@ class blog extends common { public static $rssUrl; + public static $rssLabel; + public static $states = [ false => 'Brouillon', true => 'Publié' @@ -73,9 +75,9 @@ class blog extends common { $feeds = new \FeedWriter\RSS2(); // En-tête - $feeds->setTitle($this->getData (['page', $this->getUrl(0),'title'])); + $feeds->setTitle($this->getData (['page', $this->getUrl(0), 'posts','title'])); $feeds->setLink(helper::baseUrl() . $this->getUrl(0)); - $feeds->setDescription(html_entity_decode(strip_tags($this->getData (['page', $this->getUrl(0), 'metaDescription'])))); + $feeds->setDescription(html_entity_decode(strip_tags($this->getData (['page', $this->getUrl(0), 'posts', 'metaDescription'])))); $feeds->setChannelElement('language', 'fr-FR'); $feeds->setDate(time()); $feeds->addGenerator(); @@ -86,9 +88,9 @@ class blog extends common { if($articlePublishedOn <= time() AND $articleIdsStates[$articleId]) { $newsArticle = $feeds->createNewItem(); $newsArticle->addElementArray([ - 'title' => strip_tags($this->getData(['module', $this->getUrl(0), $articleId, 'title']) ), + 'title' => strip_tags($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'title']) ), 'link' => helper::baseUrl() .$this->getUrl(0) . '/' . $articleId, - 'description' => html_entity_decode(strip_tags($this->getData(['module', $this->getUrl(0), $articleId, 'content']))) + 'description' => html_entity_decode(strip_tags($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'content']))) ]); $feeds->addItem($newsArticle); } @@ -113,7 +115,7 @@ class blog extends common { $articleId = helper::increment($articleId, (array) $this->getData(['module', $this->getUrl(0)])); $articleId = helper::increment($articleId, array_keys(self::$actions)); // Crée l'article - $this->setData(['module', $this->getUrl(0), $articleId, [ + $this->setData(['module', $this->getUrl(0), 'posts', $articleId, [ 'closeComment' => $this->getInput('blogAddCloseComment', helper::FILTER_BOOLEAN), 'mailNotification' => $this->getInput('blogAddMailNotification', helper::FILTER_BOOLEAN), 'groupNotification' => $this->getInput('blogAddGroupNotification', helper::FILTER_INT), @@ -200,7 +202,7 @@ class blog extends common { */ public function commentDelete() { // Le commentaire n'existe pas - if($this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'comment', $this->getUrl(3)]) === null) { + if($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment', $this->getUrl(3)]) === null) { // Valeurs en sortie $this->addOutput([ 'access' => false @@ -216,7 +218,7 @@ class blog extends common { } // Suppression else { - $this->deleteData(['module', $this->getUrl(0), $this->getUrl(2), 'comment', $this->getUrl(3)]); + $this->deleteData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment', $this->getUrl(3)]); // Valeurs en sortie $this->addOutput([ 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/comment', @@ -243,11 +245,8 @@ class blog extends common { 'state' => true ]); } else { - // Extraire la clé config mot clé réservé - $articles = $this->getData(['module', $this->getUrl(0)]); - unset($articles['config']); // Ids des articles par ordre de publication - $articleIds = array_keys(helper::arrayCollumn($articles, 'publishedOn', 'SORT_DESC')); + $articleIds = array_keys(helper::arrayCollumn($this->getData(['module', $this->getUrl(0),'posts']), 'publishedOn', 'SORT_DESC')); // Supprimer le bloc config // Pagination $pagination = helper::pagination($articleIds, $this->getUrl(),$this->getData(['config','itemsperPage'])); @@ -256,16 +255,16 @@ class blog extends common { // Articles en fonction de la pagination for($i = $pagination['first']; $i < $pagination['last']; $i++) { // Met en forme le tableau - $date = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), $articleIds[$i], 'publishedOn'])), 'UTF-8', true) - ? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), $articleIds[$i], 'publishedOn'])) - : utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), $articleIds[$i], 'publishedOn']))); - $heure = mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), $articleIds[$i], 'publishedOn'])), 'UTF-8', true) - ? strftime('%H:%M', $this->getData(['module', $this->getUrl(0), $articleIds[$i], 'publishedOn'])) - : utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), $articleIds[$i], 'publishedOn']))); + $date = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])), 'UTF-8', true) + ? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])) + : utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn']))); + $heure = mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])), 'UTF-8', true) + ? strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])) + : utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn']))); self::$articles[] = [ - $this->getData(['module', $this->getUrl(0), $articleIds[$i], 'title']), + $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'title']), $date .' à '. $heure, - self::$states[$this->getData(['module', $this->getUrl(0), $articleIds[$i], 'state'])], + self::$states[$this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'state'])], template::button('blogConfigEdit' . $articleIds[$i], [ 'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $articleIds[$i] . '/' . $_SESSION['csrf'], 'value' => template::ico('pencil') @@ -289,7 +288,7 @@ class blog extends common { * Suppression */ public function delete() { - if($this->getData(['module', $this->getUrl(0), $this->getUrl(2)]) === null) { + if($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2)]) === null) { // Valeurs en sortie $this->addOutput([ 'access' => false @@ -305,7 +304,7 @@ class blog extends common { } // Suppression else { - $this->deleteData(['module', $this->getUrl(0), $this->getUrl(2)]); + $this->deleteData(['module', $this->getUrl(0), 'posts', $this->getUrl(2)]); // Valeurs en sortie $this->addOutput([ 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config', @@ -328,7 +327,7 @@ class blog extends common { ]); } // L'article n'existe pas - if($this->getData(['module', $this->getUrl(0), $this->getUrl(2)]) === null) { + if($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2)]) === null) { // Valeurs en sortie $this->addOutput([ 'access' => false @@ -345,11 +344,11 @@ class blog extends common { $articleId = helper::increment($articleId, $this->getData(['module', $this->getUrl(0)])); $articleId = helper::increment($articleId, array_keys(self::$actions)); } - $this->setData(['module', $this->getUrl(0), $articleId, [ + $this->setData(['module', $this->getUrl(0), 'posts', $articleId, [ 'closeComment' => $this->getInput('blogEditCloseComment'), 'mailNotification' => $this->getInput('blogEditMailNotification', helper::FILTER_BOOLEAN), 'groupNotification' => $this->getInput('blogEditGroupNotification', helper::FILTER_INT), - 'comment' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'comment']), + 'comment' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment']), 'content' => $this->getInput('blogEditContent', null), 'picture' => $this->getInput('blogEditPicture', helper::FILTER_STRING_SHORT, true), 'hidePicture' => $this->getInput('blogEditHidePicture', helper::FILTER_BOOLEAN), @@ -362,7 +361,7 @@ class blog extends common { ]]); // Supprime l'ancien article if($articleId !== $this->getUrl(2)) { - $this->deleteData(['module', $this->getUrl(0), $this->getUrl(2)]); + $this->deleteData(['module', $this->getUrl(0), 'posts', $this->getUrl(2)]); } // Valeurs en sortie $this->addOutput([ @@ -380,7 +379,7 @@ class blog extends common { unset($userFirstname); // Valeurs en sortie $this->addOutput([ - 'title' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'title']), + 'title' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'title']), 'vendor' => [ 'flatpickr', 'tinymce' @@ -401,7 +400,7 @@ class blog extends common { AND intval($this->getUrl(1)) === 0 ) { // L'article n'existe pas - if($this->getData(['module', $this->getUrl(0), $this->getUrl(1)]) === null) { + if($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1)]) === null) { // Valeurs en sortie $this->addOutput([ 'access' => false @@ -420,8 +419,8 @@ class blog extends common { self::$inputNotices['blogArticleCaptcha'] = 'Incorrect'; } // Crée le commentaire - $commentId = helper::increment(uniqid(), $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'comment'])); - $this->setData(['module', $this->getUrl(0), $this->getUrl(1), 'comment', $commentId, [ + $commentId = helper::increment(uniqid(), $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment'])); + $this->setData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment', $commentId, [ 'author' => $this->getInput('blogArticleAuthor', helper::FILTER_STRING_SHORT, empty($this->getInput('blogArticleUserId')) ? TRUE : FALSE), 'content' => $this->getInput('blogArticleContent', helper::FILTER_STRING_SHORT, true), 'createdOn' => time(), @@ -433,17 +432,17 @@ class blog extends common { $to = []; // Liste des destinataires foreach($this->getData(['user']) as $userId => $user) { - if ($user['group'] >= $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'groupNotification']) ) { + if ($user['group'] >= $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'groupNotification']) ) { $to[] = $user['mail']; } } // Envoi du mail $sent code d'erreur ou de réussite - if ($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'mailNotification']) === true) { + if ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'mailNotification']) === true) { $sent = $this->sendMail( $to, 'Nouveau commentaire', 'Bonjour' . ' ' . $user['firstname'] . ' ' . $user['lastname'] . ',

' . - 'Nouveau commentaire déposé sur la page "' . $this->getData(['page', $this->getUrl(0), 'title']) . '" :

', + 'Nouveau commentaire déposé sur la page "' . $this->getData(['page', $this->getUrl(0), 'posts', 'title']) . '" :

', '' ); // Valeurs en sortie @@ -466,20 +465,21 @@ class blog extends common { } // Ids des commentaires par ordre de publication - $commentIds = array_keys(helper::arrayCollumn($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'comment']), 'createdOn', 'SORT_DESC')); + $commentIds = array_keys(helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment']), 'createdOn', 'SORT_DESC')); // Pagination $pagination = helper::pagination($commentIds, $this->getUrl(),$this->getData(['config','itemsperPage']),'#comment'); // Liste des pages self::$pages = $pagination['pages']; // Commentaires en fonction de la pagination for($i = $pagination['first']; $i < $pagination['last']; $i++) { - self::$comments[$commentIds[$i]] = $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'comment', $commentIds[$i]]); + self::$comments[$commentIds[$i]] = $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment', $commentIds[$i]]); } self::$rssUrl = helper::baseUrl() . $this->getUrl(0) . '/rss'; + self::$rssLabel = $this->getData(['module', $this->getUrl(0), 'config','feedsLabel']); // Valeurs en sortie $this->addOutput([ 'showBarEditButton' => true, - 'title' => $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'title']), + 'title' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'title']), 'view' => 'article' ]); } @@ -488,8 +488,8 @@ class blog extends common { // Liste des articles else { // Ids des articles par ordre de publication - $articleIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0)]), 'publishedOn', 'SORT_DESC'); - $articleIdsStates = helper::arrayCollumn($this->getData(['module', $this->getUrl(0)]), 'state', 'SORT_DESC'); + $articleIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0),'posts']), 'publishedOn', 'SORT_DESC'); + $articleIdsStates = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'state', 'SORT_DESC'); $articleIds = []; foreach($articleIdsPublishedOns as $articleId => $articlePublishedOn) { if($articlePublishedOn <= time() AND $articleIdsStates[$articleId]) { @@ -502,9 +502,10 @@ class blog extends common { self::$pages = $pagination['pages']; // Articles en fonction de la pagination for($i = $pagination['first']; $i < $pagination['last']; $i++) { - self::$articles[$articleIds[$i]] = $this->getData(['module', $this->getUrl(0), $articleIds[$i]]); + self::$articles[$articleIds[$i]] = $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i]]); } self::$rssUrl = helper::baseUrl() . $this->getUrl(0) . '/rss'; + self::$rssLabel = $this->getData(['module', $this->getUrl(0), 'config','feedsLabel']); // Valeurs en sortie $this->addOutput([ 'showBarEditButton' => true, diff --git a/module/blog/view/add/add.php b/module/blog/view/add/add.php index 37230abd..1162ad58 100644 --- a/module/blog/view/add/add.php +++ b/module/blog/view/add/add.php @@ -57,7 +57,7 @@
$this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'hidePicture']) + 'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'hidePicture']) ]); ?>
diff --git a/module/blog/view/article/article.php b/module/blog/view/article/article.php index 43e5cf94..22fe5da1 100644 --- a/module/blog/view/article/article.php +++ b/module/blog/view/article/article.php @@ -3,12 +3,12 @@
- getData(['module', $this->getUrl(0), $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) - ? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'publishedOn'])) - : utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'publishedOn']))); - $heure = mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) - ? strftime('%H:%M', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'publishedOn'])) - : utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'publishedOn']))); + getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) + ? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])) + : utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))); + $heure = mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) + ? strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])) + : utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))); echo $date . ' à ' . $heure; ?>
@@ -25,30 +25,33 @@
- getData(['module', $this->getUrl(0), $this->getUrl(1), 'pictureSize']) === null ? '100' : $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'pictureSize']); ?> - getData(['module', $this->getUrl(0), $this->getUrl(1), 'hidePicture']) == false) { - echo '' . $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'picture']) . ''; + getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'pictureSize']) === null ? '100' : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'pictureSize']); ?> + getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'hidePicture']) == false) { + echo '' . $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'picture']) . ''; } ?> - getData(['module', $this->getUrl(0), $this->getUrl(1), 'content']); ?> + getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'content']); ?>

- getData(['user', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'userId']), 'firstname']); ?> - getData(['user', $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'userId']), 'lastname']); ?> + getData(['user', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId']), 'firstname']); ?> + getData(['user', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId']), 'lastname']); ?>

-

Syndication RSS

+ + ' . $module::$rssLabel . '

' ; + ?>
- getData(['module', $this->getUrl(0), $this->getUrl(1), 'closeComment'])): ?> + getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'closeComment'])): ?>

Cet article ne reçoit pas de commentaire.

- getData(['module', $this->getUrl(0), $this->getUrl(1), 'comment'])); ?> + getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment'])); ?> 0 ? $commentsNb . ' ' . 'commentaire' . $s : 'Pas encore de commentaire'; ?>

diff --git a/module/blog/view/config/config.php b/module/blog/view/config/config.php index a044b793..8543b80a 100644 --- a/module/blog/view/config/config.php +++ b/module/blog/view/config/config.php @@ -3,7 +3,7 @@
'buttonGrey', - 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), + 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), 'posts', 'ico' => 'left', 'value' => 'Retour' ]); ?> @@ -31,14 +31,14 @@

Paramètres du module

- $this->getData(['module', $this->getUrl(0), 'config', 'feeds']), ]); ?>
'Etiquette', - 'value' => empty($this->getData(['module', $this->getUrl(0), 'config','feedsLabel'])) ? 'Syndication RSS' : $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel']) + 'label' => 'Texte de l\'étiquette', + 'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel']) ]); ?>
diff --git a/module/blog/view/edit/edit.php b/module/blog/view/edit/edit.php index e964ef93..53e7bccf 100644 --- a/module/blog/view/edit/edit.php +++ b/module/blog/view/edit/edit.php @@ -31,7 +31,7 @@
'Titre', - 'value' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'title']) + 'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'title']) ]); ?>
@@ -41,19 +41,19 @@ 'help' => 'Taille optimale de l\'image de couverture : ' . ((int) substr($this->getData(['theme', 'site', 'width']), 0, -2) - (20 * 2)) . ' x 350 pixels.', 'label' => 'Image de couverture', 'type' => 1, - 'value' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'picture']) + 'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'picture']) ]); ?>
'Largeur de l\'image', - 'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'pictureSize']) + 'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'pictureSize']) ]); ?>
'Position', - 'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'picturePosition']), + 'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'picturePosition']), 'help' => 'Le texte de l\'article est adapté autour de l\'image' ]); ?>
@@ -61,7 +61,7 @@
$this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'hidePicture']) + 'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'hidePicture']) ]); ?>
@@ -70,7 +70,7 @@ 'editorWysiwyg', - 'value' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'content']) + 'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'content']) ]); ?>
@@ -83,7 +83,7 @@ 'L\'article n\'est visible qu\'après la date de publication prévue.', 'label' => 'Date de publication', - 'value' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'publishedOn']) + 'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'publishedOn']) ]); ?>
@@ -91,16 +91,16 @@

Options avancées

$this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'closeComment']) + 'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'closeComment']) ]); ?> $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'mailNotification']), + 'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'mailNotification']), 'help' => 'Editeurs = éditeurs + administrateurs
Membres = membres + éditeurs + administrateurs' ]); ?> '', - 'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'groupNotification']) + 'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'groupNotification']) ]); ?>
diff --git a/module/blog/view/index/index.php b/module/blog/view/index/index.php index 5c8ab59e..134101f0 100644 --- a/module/blog/view/index/index.php +++ b/module/blog/view/index/index.php @@ -50,7 +50,10 @@
-

Syndication RSS

+ + ' . $module::$rssLabel . '

' ; + ?>