This commit is contained in:
Christophe 2021-02-17 10:38:10 +01:00
parent a983e6e87f
commit 963177d34c
2 changed files with 34 additions and 23 deletions

View file

@ -83,6 +83,11 @@ snippet edit "SPIP #EDIT{ VISUAL }" w
#EDIT{${1:${VISUAL}}}${0}
endsnippet
snippet envdd "SPIP tout l'env via dd"
#ENVDD
${0}
endsnippet
snippet env** "SPIP tout l'env"
[<pre>(#ENV**|unserialize|print_r{1})</pre>]
${0}

View file

@ -1,18 +1,20 @@
#extends html
#symfony
# plugin DD
snippet dd
dd(${1:$});${0}
debug($${1});${0}
endsnippet
snippet action "SPIP action declenchee dans un lien"
<?php
if (!defined('_ECRIRE_INC_VERSION')) return;
if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
function action_`!v vim_snippets#Filename()`_dist() {
include_spip('inc/autoriser');
if (! autoriser("etre","connecte")) {
if (! autoriser('etre', 'connecte')) {
return false;
}
@ -36,12 +38,14 @@ endsnippet
snippet action2 "SPIP action ajax à la mano"
<?php
if (!defined('_ECRIRE_INC_VERSION')) return;
if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
function action_`!v vim_snippets#Filename()`_dist($arg=null) {
include_spip('inc/autoriser');
if (! autoriser("etre","connecte")) {
if (! autoriser('etre', 'connecte')) {
return false;
}
@ -68,11 +72,13 @@ endsnippet
snippet cvt "SPIP"
<?php
if (!defined('_ECRIRE_INC_VERSION')) return;
if (!defined('_ECRIRE_INC_VERSION')) {
return;
}
function formulaires_`!v vim_snippets#Filename()`_charger_dist($${1:variables} $redirect = '') {
$valeurs = array(
"${2:nom_du_champ}" => ${3:""},
'${2:nom_du_champ}' => ${3:''},
);
${0}
return $valeurs;
@ -88,7 +94,7 @@ function formulaires_`!v vim_snippets#Filename()`_verifier_dist($$1 $redirect =
}
//autres erreurs
$erreurs['$2'] = "Ce champ ne convient pas.";
$erreurs['$2'] = 'Ce champ ne convient pas.';
//Il y a des erreurs
if (count($erreurs)) {
@ -102,7 +108,7 @@ function formulaires_`!v vim_snippets#Filename()`_traiter_dist($$1 $redirect = '
$$2 = _request('$2');
$retour = array();
$retour['message_ok'] = "bravo";
$retour['message_ok'] = 'bravo';
if ($redirect) {
$retour['redirect'] = $redirect;
}
@ -160,7 +166,7 @@ endsnippet
snippet testauto "SPIP"
include_spip('inc/autoriser');
if (! autoriser("${1:action}","${2:objet}")) {
if (! autoriser('${1:action}', '${2:objet}')) {
return false;
}
${0}
@ -173,7 +179,7 @@ function autoriser_${1:objet}_${2:action}_dist($faire, $type, $id, $qui, $opt) {
${0}
endsnippet
snippet id_auteur_session "$GLOBALS['visiteur_session']['id_auteur']"
snippet id_auteur_session "$GLOBALS['visiteur_session']['id_auteur']" w
$GLOBALS['visiteur_session']['id_auteur']${0}
endsnippet