@ -21,10 +21,10 @@ function blocks_autoriser() {
}
// -----------------
// Objet blocs
// Objet block s
/**
* Autorisation de voir un élément de menu (blocs)
* Autorisation de voir un élément de menu (block s)
*
* @param string $faire Action demandée
* @param string $type Type d'objet sur lequel appliquer l'action
@ -33,12 +33,12 @@ function blocks_autoriser() {
* @param array $opt Options de cette autorisation
* @return bool true s'il a le droit, false sinon
**/
function autoriser_blocs_menu_dist($faire, $type, $id, $qui, $opt) {
function autoriser_block s_menu_dist($faire, $type, $id, $qui, $opt) {
return autoriser('webmestre', '', '', $qui);
}
/**
* Autorisation de voir (blocs)
* Autorisation de voir (block s)
*
* @param string $faire Action demandée
* @param string $type Type d'objet sur lequel appliquer l'action
@ -47,12 +47,12 @@ function autoriser_blocs_menu_dist($faire, $type, $id, $qui, $opt) {
* @param array $opt Options de cette autorisation
* @return bool true s'il a le droit, false sinon
**/
function autoriser_blocs_voir_dist($faire, $type, $id, $qui, $opt) {
function autoriser_block s_voir_dist($faire, $type, $id, $qui, $opt) {
return true;
}
/**
* Autorisation de voir (bloc)
* Autorisation de voir (block )
*
* @param string $faire Action demandée
* @param string $type Type d'objet sur lequel appliquer l'action
@ -61,12 +61,12 @@ function autoriser_blocs_voir_dist($faire, $type, $id, $qui, $opt) {
* @param array $opt Options de cette autorisation
* @return bool true s'il a le droit, false sinon
**/
function autoriser_bloc_voir_dist($faire, $type, $id, $qui, $opt) {
function autoriser_block _voir_dist($faire, $type, $id, $qui, $opt) {
return true;
}
/**
* Autorisation de créer (bloc)
* Autorisation de créer (block )
*
* @param string $faire Action demandée
* @param string $type Type d'objet sur lequel appliquer l'action
@ -75,12 +75,12 @@ function autoriser_bloc_voir_dist($faire, $type, $id, $qui, $opt) {
* @param array $opt Options de cette autorisation
* @return bool true s'il a le droit, false sinon
**/
function autoriser_bloc_creer_dist($faire, $type, $id, $qui, $opt) {
function autoriser_block _creer_dist($faire, $type, $id, $qui, $opt) {
return in_array($qui['statut'], ['0minirezo', '1comite']);
}
/**
* Autorisation de modifier (bloc)
* Autorisation de modifier (block )
*
* @param string $faire Action demandée
* @param string $type Type d'objet sur lequel appliquer l'action
@ -89,12 +89,12 @@ function autoriser_bloc_creer_dist($faire, $type, $id, $qui, $opt) {
* @param array $opt Options de cette autorisation
* @return bool true s'il a le droit, false sinon
**/
function autoriser_bloc_modifier_dist($faire, $type, $id, $qui, $opt) {
function autoriser_block _modifier_dist($faire, $type, $id, $qui, $opt) {
return in_array($qui['statut'], ['0minirezo', '1comite']);
}
/**
* Autorisation de supprimer (bloc)
* Autorisation de supprimer (block )
*
* @param string $faire Action demandée
* @param string $type Type d'objet sur lequel appliquer l'action
@ -103,14 +103,14 @@ function autoriser_bloc_modifier_dist($faire, $type, $id, $qui, $opt) {
* @param array $opt Options de cette autorisation
* @return bool true s'il a le droit, false sinon
**/
function autoriser_bloc_supprimer_dist($faire, $type, $id, $qui, $opt) {
function autoriser_block _supprimer_dist($faire, $type, $id, $qui, $opt) {
return ($qui['statut'] == '0minirezo' and !$qui['restreint'])
or (blocks_autoriser_statuts('bloc', $id, $qui, $opt)
and $auteurs = blocks_auteurs_objet('bloc', $id) and in_array($qui['id_auteur'], $auteurs));
or (blocks_autoriser_statuts('block ', $id, $qui, $opt)
and $auteurs = blocks_auteurs_objet('block ', $id) and in_array($qui['id_auteur'], $auteurs));
}
/**
* Autorisation de créer l'élément (bloc) dans un blocs_ types
* Autorisation de créer l'élément (block) dans un block types
*
* @param string $faire Action demandée
* @param string $type Type d'objet sur lequel appliquer l'action
@ -119,12 +119,12 @@ function autoriser_bloc_supprimer_dist($faire, $type, $id, $qui, $opt) {
* @param array $opt Options de cette autorisation
* @return bool true s'il a le droit, false sinon
**/
function autoriser_blocstype_creerblocdans_dist($faire, $type, $id, $qui, $opt) {
return ($id and autoriser('voir', 'blocs_ types', $id) and autoriser('creer', 'bloc'));
function autoriser_block stype_creerblock dans_dist($faire, $type, $id, $qui, $opt) {
return ($id and autoriser('voir', 'block types', $id) and autoriser('creer', 'block '));
}
/**
* Autorisation de lier/délier l'élément (blocs)
* Autorisation de lier/délier l'élément (block s)
*
* @param string $faire Action demandée
* @param string $type Type d'objet sur lequel appliquer l'action
@ -133,17 +133,17 @@ function autoriser_blocstype_creerblocdans_dist($faire, $type, $id, $qui, $opt)
* @param array $opt Options de cette autorisation
* @return bool true s'il a le droit, false sinon
**/
function autoriser_associerblocs_dist($faire, $type, $id, $qui, $opt) {
function autoriser_associerblock s_dist($faire, $type, $id, $qui, $opt) {
return ($qui['statut'] == '0minirezo' and !$qui['restreint'])
or (blocks_autoriser_statuts('bloc', $id, $qui, $opt)
and $auteurs = blocks_auteurs_objet('bloc', $id) and in_array($qui['id_auteur'], $auteurs));
or (blocks_autoriser_statuts('block ', $id, $qui, $opt)
and $auteurs = blocks_auteurs_objet('block ', $id) and in_array($qui['id_auteur'], $auteurs));
}
// -----------------
// Objet blocs_ types
// Objet block types
/**
* Autorisation de voir un élément de menu (blocstypes)
* Autorisation de voir un élément de menu (block stypes)
*
* @param string $faire Action demandée
* @param string $type Type d'objet sur lequel appliquer l'action
@ -152,12 +152,12 @@ function autoriser_associerblocs_dist($faire, $type, $id, $qui, $opt) {
* @param array $opt Options de cette autorisation
* @return bool true s'il a le droit, false sinon
**/
function autoriser_blocstypes_menu_dist($faire, $type, $id, $qui, $opt) {
function autoriser_block stypes_menu_dist($faire, $type, $id, $qui, $opt) {
return true;
}
/**
* Autorisation de voir (blocstypes)
* Autorisation de voir (block stypes)
*
* @param string $faire Action demandée
* @param string $type Type d'objet sur lequel appliquer l'action
@ -166,12 +166,12 @@ function autoriser_blocstypes_menu_dist($faire, $type, $id, $qui, $opt) {
* @param array $opt Options de cette autorisation
* @return bool true s'il a le droit, false sinon
**/
function autoriser_blocstypes_voir_dist($faire, $type, $id, $qui, $opt) {
function autoriser_block stypes_voir_dist($faire, $type, $id, $qui, $opt) {
return true;
}
/**
* Autorisation de voir (blocstype)
* Autorisation de voir (block stype)
*
* @param string $faire Action demandée
* @param string $type Type d'objet sur lequel appliquer l'action
@ -180,12 +180,12 @@ function autoriser_blocstypes_voir_dist($faire, $type, $id, $qui, $opt) {
* @param array $opt Options de cette autorisation
* @return bool true s'il a le droit, false sinon
**/
function autoriser_blocstype_voir_dist($faire, $type, $id, $qui, $opt) {
function autoriser_block stype_voir_dist($faire, $type, $id, $qui, $opt) {
return true;
}
/**
* Autorisation de créer (blocstype)
* Autorisation de créer (block stype)
*
* @param string $faire Action demandée
* @param string $type Type d'objet sur lequel appliquer l'action
@ -194,12 +194,12 @@ function autoriser_blocstype_voir_dist($faire, $type, $id, $qui, $opt) {
* @param array $opt Options de cette autorisation
* @return bool true s'il a le droit, false sinon
**/
function autoriser_blocstype_creer_dist($faire, $type, $id, $qui, $opt) {
function autoriser_block stype_creer_dist($faire, $type, $id, $qui, $opt) {
return autoriser('webmestre', '', '', $qui);
}
/**
* Autorisation de modifier (blocstype)
* Autorisation de modifier (block stype)
*
* @param string $faire Action demandée
* @param string $type Type d'objet sur lequel appliquer l'action
@ -208,12 +208,12 @@ function autoriser_blocstype_creer_dist($faire, $type, $id, $qui, $opt) {
* @param array $opt Options de cette autorisation
* @return bool true s'il a le droit, false sinon
**/
function autoriser_blocstype_modifier_dist($faire, $type, $id, $qui, $opt) {
function autoriser_block stype_modifier_dist($faire, $type, $id, $qui, $opt) {
return autoriser('webmestre', '', '', $qui);
}
/**
* Autorisation de supprimer (blocstype)
* Autorisation de supprimer (block stype)
*
* @param string $faire Action demandée
* @param string $type Type d'objet sur lequel appliquer l'action
@ -222,8 +222,8 @@ function autoriser_blocstype_modifier_dist($faire, $type, $id, $qui, $opt) {
* @param array $opt Options de cette autorisation
* @return bool true s'il a le droit, false sinon
**/
function autoriser_blocstype_supprimer_dist($faire, $type, $id, $qui, $opt) {
if (!sql_countsel('spip_blocs', 'id_blocs_ type = '.(int)$id)) {
function autoriser_block stype_supprimer_dist($faire, $type, $id, $qui, $opt) {
if (!sql_countsel('spip_blocks', 'id_block type = '.(int)$id)) {
return autoriser('webmestre', '', '', $qui);
}
return false;