forked from ZwiiCMS-Team/ZwiiCMS
Permissions + correction nbre commentaires + noms des variables
This commit is contained in:
parent
1051fa0731
commit
5c35bd3c1d
@ -643,7 +643,6 @@ class init extends common {
|
|||||||
'module' => [
|
'module' => [
|
||||||
'blog' => [
|
'blog' => [
|
||||||
'mon-premier-article' => [
|
'mon-premier-article' => [
|
||||||
'closeComment' => false,
|
|
||||||
'comment' => [
|
'comment' => [
|
||||||
'58e11d09e5aff' => [
|
'58e11d09e5aff' => [
|
||||||
'author' => 'Rémi',
|
'author' => 'Rémi',
|
||||||
@ -660,10 +659,15 @@ class init extends common {
|
|||||||
'publishedOn' => 1548790902,
|
'publishedOn' => 1548790902,
|
||||||
'state' => true,
|
'state' => true,
|
||||||
'title' => 'Mon premier article',
|
'title' => 'Mon premier article',
|
||||||
'userId' => '' // Géré au moment de l'installation
|
'userId' => '', // Géré au moment de l'installation
|
||||||
|
'editConsent' => 'group',
|
||||||
|
'commentMaxlength' => '500',
|
||||||
|
'commentApproved' => false,
|
||||||
|
'commentClose' => false,
|
||||||
|
'commentNotification' => false,
|
||||||
|
'commentGroupNotification' => 1
|
||||||
],
|
],
|
||||||
'mon-deuxieme-article' => [
|
'mon-deuxieme-article' => [
|
||||||
'closeComment' => false,
|
|
||||||
'comment' => [],
|
'comment' => [],
|
||||||
'content' => '<p>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.</p><p>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.</p><p>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.</p>',
|
'content' => '<p>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.</p><p>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.</p><p>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.</p>',
|
||||||
'picture' => 'galerie/landscape/desert.jpg',
|
'picture' => 'galerie/landscape/desert.jpg',
|
||||||
@ -672,10 +676,15 @@ class init extends common {
|
|||||||
'publishedOn' => 1550432502,
|
'publishedOn' => 1550432502,
|
||||||
'state' => true,
|
'state' => true,
|
||||||
'title' => 'Mon deuxième article',
|
'title' => 'Mon deuxième article',
|
||||||
'userId' => '' // Géré au moment de l'installation
|
'userId' => '', // Géré au moment de l'installation
|
||||||
|
'editConsent' => 'group',
|
||||||
|
'commentMaxlength' => '500',
|
||||||
|
'commentApproved' => false,
|
||||||
|
'commentClose' => false,
|
||||||
|
'commentNotification' => false,
|
||||||
|
'commentGroupNotification' => 1
|
||||||
],
|
],
|
||||||
'mon-troisieme-article' => [
|
'mon-troisieme-article' => [
|
||||||
'closeComment' => true,
|
|
||||||
'comment' => [],
|
'comment' => [],
|
||||||
'content' => '<p>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.</p><p>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.</p><p>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.</p>',
|
'content' => '<p>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.</p><p>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.</p><p>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.</p>',
|
||||||
'picture' => 'galerie/landscape/iceberg.jpg',
|
'picture' => 'galerie/landscape/iceberg.jpg',
|
||||||
@ -684,7 +693,13 @@ class init extends common {
|
|||||||
'publishedOn' => 1550864502,
|
'publishedOn' => 1550864502,
|
||||||
'state' => true,
|
'state' => true,
|
||||||
'title' => 'Mon troisième article',
|
'title' => 'Mon troisième article',
|
||||||
'userId' => '' // Géré au moment de l'installation
|
'userId' => '', // Géré au moment de l'installation
|
||||||
|
'editConsent' => 'group',
|
||||||
|
'commentMaxlength' => '500',
|
||||||
|
'commentApproved' => false,
|
||||||
|
'commentClose' => true,
|
||||||
|
'commentNotification' => false,
|
||||||
|
'commentGroupNotification' => 1
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'galeries' => [
|
'galeries' => [
|
||||||
|
@ -14,11 +14,8 @@
|
|||||||
|
|
||||||
class blog extends common {
|
class blog extends common {
|
||||||
|
|
||||||
// Objets
|
const EDIT_OWNER = 'owner';
|
||||||
// Propriétaire - groupe
|
const EDIT_GROUP = 'group';
|
||||||
const EDIT_ALL = '02'; // Groupes Editeurs et admins
|
|
||||||
const EDIT_OWNER_ADMIN = '23'; // Propriétaire éditeur + groupe admin
|
|
||||||
const EDIT_ADMIN = '03'; // Groupe des admin
|
|
||||||
|
|
||||||
public static $actions = [
|
public static $actions = [
|
||||||
'add' => self::GROUP_EDITOR,
|
'add' => self::GROUP_EDITOR,
|
||||||
@ -79,19 +76,16 @@ class blog extends common {
|
|||||||
];
|
];
|
||||||
|
|
||||||
// Permissions d'un article
|
// Permissions d'un article
|
||||||
public static $articleRightsAdmin = [
|
public static $articleConsent = [
|
||||||
self::EDIT_ALL => 'Groupes des éditeurs et des administrateurs',
|
self::EDIT_GROUP => 'Groupe du propriétaire',
|
||||||
self::EDIT_OWNER_ADMIN => 'Editeur et groupe des administrateurs',
|
self::EDIT_OWNER => 'Propiétaire'
|
||||||
self::EDIT_ADMIN => 'Groupe des administrateurs'
|
|
||||||
];
|
|
||||||
public static $articleRightsModerator = [
|
|
||||||
self::EDIT_ALL => 'Groupes des éditeurs et des administrateurs',
|
|
||||||
self::EDIT_OWNER_ADMIN => 'Editeur et groupe des administrateurs'
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static $users = [];
|
public static $users = [];
|
||||||
|
|
||||||
const BLOG_VERSION = '3.04.dev';
|
const BLOG_VERSION = '3.05.dev';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Édition
|
* Édition
|
||||||
@ -111,11 +105,10 @@ class blog extends common {
|
|||||||
$articleId = helper::increment($articleId, (array) $this->getData(['module', $this->getUrl(0)]));
|
$articleId = helper::increment($articleId, (array) $this->getData(['module', $this->getUrl(0)]));
|
||||||
$articleId = helper::increment($articleId, array_keys(self::$actions));
|
$articleId = helper::increment($articleId, array_keys(self::$actions));
|
||||||
// Crée l'article
|
// Crée l'article
|
||||||
$this->setData(['module', $this->getUrl(0), $articleId, [
|
$this->setData(['module',
|
||||||
'closeComment' => $this->getInput('blogAddCloseComment', helper::FILTER_BOOLEAN),
|
$this->getUrl(0),
|
||||||
'mailNotification' => $this->getInput('blogAddMailNotification', helper::FILTER_BOOLEAN),
|
$articleId, [
|
||||||
'groupNotification' => $this->getInput('blogAddGroupNotification', helper::FILTER_INT),
|
'comment' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'comment']),
|
||||||
'comment' => [],
|
|
||||||
'content' => $this->getInput('blogAddContent', null),
|
'content' => $this->getInput('blogAddContent', null),
|
||||||
'picture' => $this->getInput('blogAddPicture', helper::FILTER_STRING_SHORT, true),
|
'picture' => $this->getInput('blogAddPicture', helper::FILTER_STRING_SHORT, true),
|
||||||
'hidePicture' => $this->getInput('blogAddHidePicture', helper::FILTER_BOOLEAN),
|
'hidePicture' => $this->getInput('blogAddHidePicture', helper::FILTER_BOOLEAN),
|
||||||
@ -125,8 +118,14 @@ class blog extends common {
|
|||||||
'state' => $this->getInput('blogAddState', helper::FILTER_BOOLEAN),
|
'state' => $this->getInput('blogAddState', helper::FILTER_BOOLEAN),
|
||||||
'title' => $this->getInput('blogAddTitle', helper::FILTER_STRING_SHORT, true),
|
'title' => $this->getInput('blogAddTitle', helper::FILTER_STRING_SHORT, true),
|
||||||
'userId' => $newuserid,
|
'userId' => $newuserid,
|
||||||
'commentMaxlength' => $this->getInput('blogAddlength', null)
|
'editConsent' => $this->getInput('blogAddConsent'),
|
||||||
]]);
|
'commentMaxlength' => $this->getInput('blogAddCommentMaxlength'),
|
||||||
|
'commentApproved' => $this->getInput('blogAddCommentApproved', helper::FILTER_BOOLEAN),
|
||||||
|
'commentClose' => $this->getInput('blogAddCommentClose', helper::FILTER_BOOLEAN),
|
||||||
|
'commentNotification' => $this->getInput('blogAddCommentNotification', helper::FILTER_BOOLEAN),
|
||||||
|
'commentGroupNotification' => $this->getInput('blogAddCommentGroupNotification', helper::FILTER_INT)
|
||||||
|
]
|
||||||
|
]);
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
||||||
@ -305,16 +304,15 @@ class blog extends common {
|
|||||||
// Gestion des droits d'accès
|
// Gestion des droits d'accès
|
||||||
$filterData=[];
|
$filterData=[];
|
||||||
foreach ($articleIds as $key => $value) {
|
foreach ($articleIds as $key => $value) {
|
||||||
$rights = $this->getData(['module', $this->getUrl(0), $value,'editRights']);
|
$consent = $this->getData(['module', $this->getUrl(0), $value,'editConsent']);
|
||||||
// Compatibilité pas de droit stocké placer droit par défaut
|
|
||||||
$rights = empty($rights) ? '02' : $rights;
|
|
||||||
// Check les droits du propriétaire
|
|
||||||
// Check les droits du groupe
|
|
||||||
if (
|
if (
|
||||||
( substr($rights,0,1) === '2'
|
(
|
||||||
|
$consent === self::EDIT_OWNER
|
||||||
AND $this->getData(['module', $this->getUrl(0), $value,'userId']) === $this->getUser('id')
|
AND $this->getData(['module', $this->getUrl(0), $value,'userId']) === $this->getUser('id')
|
||||||
|
) OR (
|
||||||
|
$consent === self::EDIT_GROUP
|
||||||
|
AND $this->getUser('group') >= $this->getData(['user',$this->getUser('group'),'group'])
|
||||||
)
|
)
|
||||||
OR ( $this->getUser('group') >= substr($rights,1,1) )
|
|
||||||
) {
|
) {
|
||||||
$filterData[] = $value;
|
$filterData[] = $value;
|
||||||
}
|
}
|
||||||
@ -437,10 +435,9 @@ class blog extends common {
|
|||||||
$articleId = helper::increment($articleId, $this->getData(['module', $this->getUrl(0)]));
|
$articleId = helper::increment($articleId, $this->getData(['module', $this->getUrl(0)]));
|
||||||
$articleId = helper::increment($articleId, array_keys(self::$actions));
|
$articleId = helper::increment($articleId, array_keys(self::$actions));
|
||||||
}
|
}
|
||||||
$this->setData(['module', $this->getUrl(0), $articleId, [
|
$this->setData(['module',
|
||||||
'closeComment' => $this->getInput('blogEditCloseComment', helper::FILTER_BOOLEAN),
|
$this->getUrl(0),
|
||||||
'mailNotification' => $this->getInput('blogEditMailNotification', helper::FILTER_BOOLEAN),
|
$articleId, [
|
||||||
'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), $this->getUrl(2), 'comment']),
|
||||||
'content' => $this->getInput('blogEditContent', null),
|
'content' => $this->getInput('blogEditContent', null),
|
||||||
'picture' => $this->getInput('blogEditPicture', helper::FILTER_STRING_SHORT, true),
|
'picture' => $this->getInput('blogEditPicture', helper::FILTER_STRING_SHORT, true),
|
||||||
@ -451,10 +448,14 @@ class blog extends common {
|
|||||||
'state' => $this->getInput('blogEditState', helper::FILTER_BOOLEAN),
|
'state' => $this->getInput('blogEditState', helper::FILTER_BOOLEAN),
|
||||||
'title' => $this->getInput('blogEditTitle', helper::FILTER_STRING_SHORT, true),
|
'title' => $this->getInput('blogEditTitle', helper::FILTER_STRING_SHORT, true),
|
||||||
'userId' => $newuserid,
|
'userId' => $newuserid,
|
||||||
'commentMaxlength' => $this->getInput('blogEditCommentMaxlength'),
|
'editConsent' => $this->getInput('blogEditConsent'),
|
||||||
'commentApprove' => $this->getInput('blogEditCommentApprove', helper::FILTER_BOOLEAN),
|
'commentMaxlength' => $this->getInput('blogEditCommentMaxength'),
|
||||||
'editRights' => $this->getInput('blogEditRights')
|
'commentApproved' => $this->getInput('blogEditCommentApproved', helper::FILTER_BOOLEAN),
|
||||||
]]);
|
'commentClose' => $this->getInput('blogEditCommentClose', helper::FILTER_BOOLEAN),
|
||||||
|
'commentNotification' => $this->getInput('blogEditCommentNotification', helper::FILTER_BOOLEAN),
|
||||||
|
'commentGroupNotification' => $this->getInput('blogEditCommentGroupNotification', helper::FILTER_INT)
|
||||||
|
]
|
||||||
|
]);
|
||||||
// Supprime l'ancien article
|
// Supprime l'ancien article
|
||||||
if($articleId !== $this->getUrl(2)) {
|
if($articleId !== $this->getUrl(2)) {
|
||||||
$this->deleteData(['module', $this->getUrl(0), $this->getUrl(2)]);
|
$this->deleteData(['module', $this->getUrl(0), $this->getUrl(2)]);
|
||||||
@ -526,19 +527,19 @@ class blog extends common {
|
|||||||
'content' => $content,
|
'content' => $content,
|
||||||
'createdOn' => time(),
|
'createdOn' => time(),
|
||||||
'userId' => $this->getInput('blogArticleUserId'),
|
'userId' => $this->getInput('blogArticleUserId'),
|
||||||
'approval' => !$this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'commentApprove']) // true commentaire publié false en attente de publication
|
'approval' => !$this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'commentApproved']) // true commentaire publié false en attente de publication
|
||||||
]]);
|
]]);
|
||||||
// Envoi d'une notification aux administrateurs
|
// Envoi d'une notification aux administrateurs
|
||||||
// Init tableau
|
// Init tableau
|
||||||
$to = [];
|
$to = [];
|
||||||
// Liste des destinataires
|
// Liste des destinataires
|
||||||
foreach($this->getData(['user']) as $userId => $user) {
|
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), $this->getUrl(1), 'commentGroupNotification']) ) {
|
||||||
$to[] = $user['mail'];
|
$to[] = $user['mail'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Envoi du mail $sent code d'erreur ou de réussite
|
// Envoi du mail $sent code d'erreur ou de réussite
|
||||||
$notification = $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'commentApprove']) === true ? 'Commentaire déposé en attente d\'approbation': 'Commentaire déposé';
|
$notification = $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'commentApproved']) === true ? 'Commentaire déposé en attente d\'approbation': 'Commentaire déposé';
|
||||||
if ($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'mailNotification']) === true) {
|
if ($this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'mailNotification']) === true) {
|
||||||
$sent = $this->sendMail(
|
$sent = $this->sendMail(
|
||||||
$to,
|
$to,
|
||||||
@ -567,11 +568,13 @@ class blog extends common {
|
|||||||
}
|
}
|
||||||
// Ids des commentaires approuvés par ordre de publication
|
// Ids des commentaires approuvés par ordre de publication
|
||||||
$commentsApproved = $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'comment']);
|
$commentsApproved = $this->getData(['module', $this->getUrl(0), $this->getUrl(1), 'comment']);
|
||||||
|
if ($commentsApproved) {
|
||||||
foreach( $commentsApproved as $key => $value){
|
foreach( $commentsApproved as $key => $value){
|
||||||
if($value['approval']===false) unset($commentsApproved[$key]);
|
if($value['approval']===false) unset($commentsApproved[$key]);
|
||||||
}
|
}
|
||||||
// Ligne suivante si affichage du nombre total de commentaires approuvés sous l'article
|
// Ligne suivante si affichage du nombre total de commentaires approuvés sous l'article
|
||||||
self::$nbCommentsApproved = count($commentsApproved);
|
self::$nbCommentsApproved = count($commentsApproved);
|
||||||
|
}
|
||||||
$commentIds = array_keys(helper::arrayCollumn($commentsApproved, 'createdOn', 'SORT_DESC'));
|
$commentIds = array_keys(helper::arrayCollumn($commentsApproved, 'createdOn', 'SORT_DESC'));
|
||||||
// Pagination
|
// Pagination
|
||||||
$pagination = helper::pagination($commentIds, $this->getUrl(),$this->getData(['config','itemsperPage']),'#comment');
|
$pagination = helper::pagination($commentIds, $this->getUrl(),$this->getData(['config','itemsperPage']),'#comment');
|
||||||
|
@ -21,19 +21,19 @@ $("#blogAddDraft").on("click", function() {
|
|||||||
/**
|
/**
|
||||||
* Options de commentaires
|
* Options de commentaires
|
||||||
*/
|
*/
|
||||||
$("#blogAddCloseComment").on("change", function() {
|
$("#blogAddCommentClose").on("change", function() {
|
||||||
if ($(this).is(':checked') ) {
|
if ($(this).is(':checked') ) {
|
||||||
$("#commentOptionsWrapper").slideUp();
|
$(".commentOptionsWrapper").slideUp();
|
||||||
} else {
|
} else {
|
||||||
$("#commentOptionsWrapper").slideDown();
|
$(".commentOptionsWrapper").slideDown();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#blogAddMailNotification").on("change", function() {
|
$("#blogAddCommentNotification").on("change", function() {
|
||||||
if ($(this).is(':checked') ) {
|
if ($(this).is(':checked') ) {
|
||||||
$("#blogAddGroupNotification").slideDown();
|
$("#blogAddCommentGroupNotification").slideDown();
|
||||||
} else {
|
} else {
|
||||||
$("#blogAddGroupNotification").slideUp();
|
$("#blogAddCommentGroupNotification").slideUp();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -41,15 +41,14 @@ $("#blogAddMailNotification").on("change", function() {
|
|||||||
$( document).ready(function() {
|
$( document).ready(function() {
|
||||||
|
|
||||||
if ($("#blogAddCloseComment").is(':checked') ) {
|
if ($("#blogAddCloseComment").is(':checked') ) {
|
||||||
$("#commentOptionsWrapper").slideUp();
|
$(".commentOptionsWrapper").slideUp();
|
||||||
} else {
|
} else {
|
||||||
$("#commentOptionsWrapper").slideDown();
|
$(".commentOptionsWrapper").slideDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($("#blogAddMailNotification").is(':checked') ) {
|
if ($("#blogAddCommentNotification").is(':checked') ) {
|
||||||
$("#blogAddGroupNotification").slideDown();
|
$("#blogAddCommentGroupNotification").slideDown();
|
||||||
} else {
|
} else {
|
||||||
$("#blogAddGroupNotification").slideUp();
|
$("#blogAddCommentGroupNotification").slideUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
@ -72,13 +72,6 @@
|
|||||||
<div class="block">
|
<div class="block">
|
||||||
<h4>Options de publication</h4>
|
<h4>Options de publication</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col4">
|
|
||||||
<?php echo template::select('blogAddCommentMaxlength', $module::$commentLength,[
|
|
||||||
'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'article, mise en forme html comprise.',
|
|
||||||
'label' => 'Caractères par commentaire',
|
|
||||||
'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'commentMaxlength'])
|
|
||||||
]); ?>
|
|
||||||
</div>
|
|
||||||
<div class="col4">
|
<div class="col4">
|
||||||
<?php echo template::select('blogAddUserId', $module::$users, [
|
<?php echo template::select('blogAddUserId', $module::$users, [
|
||||||
'label' => 'Auteur',
|
'label' => 'Auteur',
|
||||||
@ -93,44 +86,50 @@
|
|||||||
'value' => time()
|
'value' => time()
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="col4">
|
||||||
</div>
|
<?php echo template::select('blogAddConsent', $module::$articleConsent , [
|
||||||
</div>
|
'label' => 'Edition / Suppression',
|
||||||
</div>
|
'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'editConsent']),
|
||||||
<div class="row">
|
'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'article sans restriction'
|
||||||
<div class="col6">
|
|
||||||
<div class="block">
|
|
||||||
<h4>Permissions</h4>
|
|
||||||
<?php echo template::select('blogAddRights', $this->getUser('group') === self::GROUP_ADMIN ? $module::$articleRightsAdmin : $module::$articleRightsModerator , [
|
|
||||||
'label' => 'Droits d\'édition et de modification',
|
|
||||||
'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'editRights'])
|
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col6">
|
</div>
|
||||||
<div class="block">
|
</div>
|
||||||
<h4>Commentaires</h4>
|
</div>
|
||||||
<?php echo template::checkbox('blogAddCloseComment', true, 'Fermer les commentaires', [
|
|
||||||
'checked' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'closeComment'])
|
|
||||||
]); ?>
|
|
||||||
<div id="commentOptionsWrapper">
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<?php echo template::checkbox('blogAddCommentApprove', true, 'Approbation des commentaires', [
|
<div class="block">
|
||||||
'checked' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'commentApprove']),
|
<h4>Commentaires</h4>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col4 ">
|
||||||
|
<?php echo template::checkbox('blogAddCommentClose', true, 'Fermer les commentaires', [
|
||||||
|
'checked' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'commentClose'])
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
<div class="col4 commentOptionsWrapper ">
|
||||||
|
<?php echo template::checkbox('blogAddCommentApproved', true, 'Approbation par un modérateur', [
|
||||||
|
'checked' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'commentApproved']),
|
||||||
''
|
''
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="col4 commentOptionsWrapper">
|
||||||
<div class="row">
|
<?php echo template::select('blogAddCommentMaxlength', $module::$commentLength,[
|
||||||
<div class="col7">
|
'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'article, mise en forme html comprise.',
|
||||||
<?php echo template::checkbox('blogAddMailNotification', true, 'Notification des nouveaux commentaires par mail aux groupes', [
|
'label' => 'Caractères par commentaire',
|
||||||
'checked' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'mailNotification']),
|
'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'commentMaxlength'])
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col5">
|
</div>
|
||||||
<?php echo template::select('blogAddGroupNotification', $module::$groupNews, [
|
<div class="row">
|
||||||
'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'groupNotification']),
|
<div class="col3 commentOptionsWrapper offset2">
|
||||||
|
<?php echo template::checkbox('blogAddCommentNotification', true, 'Notification par email', [
|
||||||
|
'checked' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'commentNotification']),
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
<div class="col4 commentOptionsWrapper">
|
||||||
|
<?php echo template::select('blogAddCommentGroupNotification', $module::$groupNews, [
|
||||||
|
'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'commentGroupNotification']),
|
||||||
'help' => 'Editeurs = éditeurs + administrateurs<br/> Membres = membres + éditeurs + administrateurs'
|
'help' => 'Editeurs = éditeurs + administrateurs<br/> Membres = membres + éditeurs + administrateurs'
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
@ -138,5 +137,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<?php echo template::formClose(); ?>
|
<?php echo template::formClose(); ?>
|
||||||
|
@ -33,19 +33,19 @@ $("#blogEditDraft").on("click", function() {
|
|||||||
/**
|
/**
|
||||||
* Options de commentaires
|
* Options de commentaires
|
||||||
*/
|
*/
|
||||||
$("#blogEditCloseComment").on("change", function() {
|
$("#blogEditCommentClose").on("change", function() {
|
||||||
if ($(this).is(':checked') ) {
|
if ($(this).is(':checked') ) {
|
||||||
$("#commentOptionsWrapper").slideUp();
|
$(".commentOptionsWrapper").slideUp();
|
||||||
} else {
|
} else {
|
||||||
$("#commentOptionsWrapper").slideDown();
|
$(".commentOptionsWrapper").slideDown();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#blogEditMailNotification").on("change", function() {
|
$("#blogEditCommentNotification").on("change", function() {
|
||||||
if ($(this).is(':checked') ) {
|
if ($(this).is(':checked') ) {
|
||||||
$("#blogEditGroupNotification").slideDown();
|
$("#blogEditCommentGroupNotification").slideDown();
|
||||||
} else {
|
} else {
|
||||||
$("#blogEditGroupNotification").slideUp();
|
$("#blogEditCommentGroupNotification").slideUp();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -53,15 +53,14 @@ $("#blogEditMailNotification").on("change", function() {
|
|||||||
$( document).ready(function() {
|
$( document).ready(function() {
|
||||||
|
|
||||||
if ($("#blogEditCloseComment").is(':checked') ) {
|
if ($("#blogEditCloseComment").is(':checked') ) {
|
||||||
$("#commentOptionsWrapper").slideUp();
|
$(".commentOptionsWrapper").slideUp();
|
||||||
} else {
|
} else {
|
||||||
$("#commentOptionsWrapper").slideDown();
|
$(".commentOptionsWrapper").slideDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($("#blogEditMailNotification").is(':checked') ) {
|
if ($("#blogEditCommentNotification").is(':checked') ) {
|
||||||
$("#blogEditGroupNotification").slideDown();
|
$("#blogEditCommentGroupNotification").slideDown();
|
||||||
} else {
|
} else {
|
||||||
$("#blogEditGroupNotification").slideUp();
|
$("#blogEditCommentGroupNotification").slideUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
@ -78,13 +78,6 @@
|
|||||||
<div class="block">
|
<div class="block">
|
||||||
<h4>Options de publication</h4>
|
<h4>Options de publication</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col4">
|
|
||||||
<?php echo template::select('blogEditCommentMaxlength', $module::$commentLength,[
|
|
||||||
'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'article, mise en forme html comprise.',
|
|
||||||
'label' => 'Caractères par commentaire',
|
|
||||||
'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'commentMaxlength'])
|
|
||||||
]); ?>
|
|
||||||
</div>
|
|
||||||
<div class="col4">
|
<div class="col4">
|
||||||
<?php echo template::select('blogEditUserId', $module::$users, [
|
<?php echo template::select('blogEditUserId', $module::$users, [
|
||||||
'label' => 'Auteur',
|
'label' => 'Auteur',
|
||||||
@ -96,47 +89,54 @@
|
|||||||
<?php echo template::date('blogEditPublishedOn', [
|
<?php echo template::date('blogEditPublishedOn', [
|
||||||
'help' => 'L\'article n\'est visible qu\'après la date de publication prévue.',
|
'help' => 'L\'article n\'est visible qu\'après la date de publication prévue.',
|
||||||
'label' => 'Date de publication',
|
'label' => 'Date de publication',
|
||||||
'value' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'publishedOn'])
|
'value' => time()
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
<div class="col4">
|
||||||
|
<?php echo template::select('blogEditConsent', $module::$articleConsent , [
|
||||||
|
'label' => 'Edition / Suppression',
|
||||||
|
'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'editConsent']),
|
||||||
|
'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'article sans restriction'
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
|
||||||
<div class="col6">
|
|
||||||
<div class="block">
|
|
||||||
<h4>Permissions</h4>
|
|
||||||
<?php echo template::select('blogEditRights', $this->getUser('group') === self::GROUP_ADMIN ? $module::$articleRightsAdmin : $module::$articleRightsModerator , [
|
|
||||||
'label' => 'Droits d\'édition et de modification',
|
|
||||||
'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'editRights'])
|
|
||||||
]); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col6">
|
|
||||||
<div class="block">
|
|
||||||
<h4>Commentaires</h4>
|
|
||||||
<?php echo template::checkbox('blogEditCloseComment', true, 'Fermer les commentaires', [
|
|
||||||
'checked' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'closeComment'])
|
|
||||||
]); ?>
|
|
||||||
<div id="commentOptionsWrapper">
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<?php echo template::checkbox('blogEditCommentApprove', true, 'Approbation des commentaires', [
|
<div class="block">
|
||||||
|
<h4>Commentaires</h4>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col4 ">
|
||||||
|
<?php echo template::checkbox('blogEditCommentClose', true, 'Fermer les commentaires', [
|
||||||
|
'checked' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'commentClose'])
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
<div class="col4 commentOptionsWrapper ">
|
||||||
|
<?php echo template::checkbox('blogEditCommentApprove', true, 'Approbation par un modérateur', [
|
||||||
'checked' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'commentApprove']),
|
'checked' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'commentApprove']),
|
||||||
''
|
''
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="col4 commentOptionsWrapper">
|
||||||
<div class="row">
|
<?php echo template::select('blogEditCommentMaxlength', $module::$commentLength,[
|
||||||
<div class="col7">
|
'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'article, mise en forme html comprise.',
|
||||||
<?php echo template::checkbox('blogEditMailNotification', true, 'Notification des nouveaux commentaires par mail aux groupes', [
|
'label' => 'Caractères par commentaire',
|
||||||
'checked' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'mailNotification']),
|
'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'commentMaxlength'])
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col5">
|
|
||||||
<?php echo template::select('blogEditGroupNotification', $module::$groupNews, [
|
</div>
|
||||||
'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'groupNotification']),
|
<div class="row">
|
||||||
|
<div class="col3 commentOptionsWrapper offset2">
|
||||||
|
<?php echo template::checkbox('blogEditCommentNotification', true, 'Notification par email', [
|
||||||
|
'checked' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'commentNotification']),
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
<div class="col4 commentOptionsWrapper">
|
||||||
|
<?php echo template::select('blogEditCommentGroupNotification', $module::$groupNews, [
|
||||||
|
'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'commentGroupNotification']),
|
||||||
'help' => 'Editeurs = éditeurs + administrateurs<br/> Membres = membres + éditeurs + administrateurs'
|
'help' => 'Editeurs = éditeurs + administrateurs<br/> Membres = membres + éditeurs + administrateurs'
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
@ -144,5 +144,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<?php echo template::formClose(); ?>
|
<?php echo template::formClose(); ?>
|
||||||
|
@ -29,7 +29,9 @@
|
|||||||
</h1>
|
</h1>
|
||||||
<div class="blogComment">
|
<div class="blogComment">
|
||||||
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>#comment">
|
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>#comment">
|
||||||
|
<?php if ($article['comment']): ?>
|
||||||
<?php echo count($article['comment']); ?>
|
<?php echo count($article['comment']); ?>
|
||||||
|
<?php endif; ?>
|
||||||
</a>
|
</a>
|
||||||
<?php echo template::ico('comment', 'left'); ?>
|
<?php echo template::ico('comment', 'left'); ?>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user