maj
This commit is contained in:
parent
a983e6e87f
commit
963177d34c
2 changed files with 34 additions and 23 deletions
|
@ -83,6 +83,11 @@ snippet edit "SPIP #EDIT{ VISUAL }" w
|
||||||
#EDIT{${1:${VISUAL}}}${0}
|
#EDIT{${1:${VISUAL}}}${0}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
snippet envdd "SPIP tout l'env via dd"
|
||||||
|
#ENVDD
|
||||||
|
${0}
|
||||||
|
endsnippet
|
||||||
|
|
||||||
snippet env** "SPIP tout l'env"
|
snippet env** "SPIP tout l'env"
|
||||||
[<pre>(#ENV**|unserialize|print_r{1})</pre>]
|
[<pre>(#ENV**|unserialize|print_r{1})</pre>]
|
||||||
${0}
|
${0}
|
||||||
|
|
|
@ -1,18 +1,20 @@
|
||||||
#extends html
|
#extends html
|
||||||
|
|
||||||
#symfony
|
# plugin DD
|
||||||
snippet dd
|
snippet dd
|
||||||
dd(${1:$});${0}
|
debug($${1});${0}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet action "SPIP action declenchee dans un lien"
|
snippet action "SPIP action declenchee dans un lien"
|
||||||
<?php
|
<?php
|
||||||
if (!defined('_ECRIRE_INC_VERSION')) return;
|
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
function action_`!v vim_snippets#Filename()`_dist(){
|
function action_`!v vim_snippets#Filename()`_dist() {
|
||||||
|
|
||||||
include_spip('inc/autoriser');
|
include_spip('inc/autoriser');
|
||||||
if (! autoriser("etre","connecte")) {
|
if (! autoriser('etre', 'connecte')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,12 +38,14 @@ endsnippet
|
||||||
|
|
||||||
snippet action2 "SPIP action ajax à la mano"
|
snippet action2 "SPIP action ajax à la mano"
|
||||||
<?php
|
<?php
|
||||||
if (!defined('_ECRIRE_INC_VERSION')) return;
|
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
function action_`!v vim_snippets#Filename()`_dist($arg=null){
|
function action_`!v vim_snippets#Filename()`_dist($arg=null) {
|
||||||
|
|
||||||
include_spip('inc/autoriser');
|
include_spip('inc/autoriser');
|
||||||
if (! autoriser("etre","connecte")) {
|
if (! autoriser('etre', 'connecte')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,17 +72,19 @@ endsnippet
|
||||||
|
|
||||||
snippet cvt "SPIP"
|
snippet cvt "SPIP"
|
||||||
<?php
|
<?php
|
||||||
if (!defined('_ECRIRE_INC_VERSION')) return;
|
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
function formulaires_`!v vim_snippets#Filename()`_charger_dist($${1:variables} $redirect = ''){
|
function formulaires_`!v vim_snippets#Filename()`_charger_dist($${1:variables} $redirect = '') {
|
||||||
$valeurs = array(
|
$valeurs = array(
|
||||||
"${2:nom_du_champ}" => ${3:""},
|
'${2:nom_du_champ}' => ${3:''},
|
||||||
);
|
);
|
||||||
${0}
|
${0}
|
||||||
return $valeurs;
|
return $valeurs;
|
||||||
}
|
}
|
||||||
|
|
||||||
function formulaires_`!v vim_snippets#Filename()`_verifier_dist($$1 $redirect = ''){
|
function formulaires_`!v vim_snippets#Filename()`_verifier_dist($$1 $redirect = '') {
|
||||||
$$2 = _request('$2');
|
$$2 = _request('$2');
|
||||||
|
|
||||||
$erreurs = array();
|
$erreurs = array();
|
||||||
|
@ -88,7 +94,7 @@ function formulaires_`!v vim_snippets#Filename()`_verifier_dist($$1 $redirect =
|
||||||
}
|
}
|
||||||
|
|
||||||
//autres erreurs
|
//autres erreurs
|
||||||
$erreurs['$2'] = "Ce champ ne convient pas.";
|
$erreurs['$2'] = 'Ce champ ne convient pas.';
|
||||||
|
|
||||||
//Il y a des erreurs
|
//Il y a des erreurs
|
||||||
if (count($erreurs)) {
|
if (count($erreurs)) {
|
||||||
|
@ -98,11 +104,11 @@ function formulaires_`!v vim_snippets#Filename()`_verifier_dist($$1 $redirect =
|
||||||
return $erreurs;
|
return $erreurs;
|
||||||
}
|
}
|
||||||
|
|
||||||
function formulaires_`!v vim_snippets#Filename()`_traiter_dist($$1 $redirect = ''){
|
function formulaires_`!v vim_snippets#Filename()`_traiter_dist($$1 $redirect = '') {
|
||||||
$$2 = _request('$2');
|
$$2 = _request('$2');
|
||||||
|
|
||||||
$retour = array();
|
$retour = array();
|
||||||
$retour['message_ok'] = "bravo";
|
$retour['message_ok'] = 'bravo';
|
||||||
if ($redirect) {
|
if ($redirect) {
|
||||||
$retour['redirect'] = $redirect;
|
$retour['redirect'] = $redirect;
|
||||||
}
|
}
|
||||||
|
@ -150,7 +156,7 @@ endsnippet
|
||||||
|
|
||||||
snippet php2 "SPIP php"
|
snippet php2 "SPIP php"
|
||||||
<?php
|
<?php
|
||||||
if (!defined('_ECRIRE_INC_VERSION')){
|
if (!defined('_ECRIRE_INC_VERSION')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,7 +166,7 @@ endsnippet
|
||||||
|
|
||||||
snippet testauto "SPIP"
|
snippet testauto "SPIP"
|
||||||
include_spip('inc/autoriser');
|
include_spip('inc/autoriser');
|
||||||
if (! autoriser("${1:action}","${2:objet}")) {
|
if (! autoriser('${1:action}', '${2:objet}')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
${0}
|
${0}
|
||||||
|
@ -173,7 +179,7 @@ function autoriser_${1:objet}_${2:action}_dist($faire, $type, $id, $qui, $opt) {
|
||||||
${0}
|
${0}
|
||||||
endsnippet
|
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}
|
$GLOBALS['visiteur_session']['id_auteur']${0}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
@ -263,7 +269,7 @@ snippet pipeline "SPIP Les pipelines de base"
|
||||||
* @param string $flux Code html des styles CSS à charger
|
* @param string $flux Code html des styles CSS à charger
|
||||||
* @return string Code html complété
|
* @return string Code html complété
|
||||||
**/
|
**/
|
||||||
function ${1:prefix}_insert_head_css($flux){
|
function ${1:prefix}_insert_head_css($flux) {
|
||||||
$flux .= '<link rel="stylesheet" href="' . produire_fond_statique('css/vignettes.css') . '" type="text/css" />' . "\n";
|
$flux .= '<link rel="stylesheet" href="' . produire_fond_statique('css/vignettes.css') . '" type="text/css" />' . "\n";
|
||||||
$flux .= '<link rel="stylesheet" href="' . timestamp(find_in_path('css/bigup.css')) . '" type="text/css" />' . "\n";
|
$flux .= '<link rel="stylesheet" href="' . timestamp(find_in_path('css/bigup.css')) . '" type="text/css" />' . "\n";
|
||||||
return $flux;
|
return $flux;
|
||||||
|
@ -276,7 +282,7 @@ ${0}
|
||||||
* @param array $scripts Liste à charger
|
* @param array $scripts Liste à charger
|
||||||
* @return array Liste complétée
|
* @return array Liste complétée
|
||||||
**/
|
**/
|
||||||
function $1_jquery_plugins($scripts){
|
function $1_jquery_plugins($scripts) {
|
||||||
$scripts[] = "aa";
|
$scripts[] = "aa";
|
||||||
$scripts[] = produire_fond_statique('javascript/bigup.js');
|
$scripts[] = produire_fond_statique('javascript/bigup.js');
|
||||||
return $scripts;
|
return $scripts;
|
||||||
|
@ -289,14 +295,14 @@ function $1_jquery_plugins($scripts){
|
||||||
* @param array $scripts Liste à charger
|
* @param array $scripts Liste à charger
|
||||||
* @return array Liste complétée
|
* @return array Liste complétée
|
||||||
**/
|
**/
|
||||||
function $1_jqueryui_plugins($scripts){
|
function $1_jqueryui_plugins($scripts) {
|
||||||
$scripts[] = "aa";
|
$scripts[] = "aa";
|
||||||
return $scripts;
|
return $scripts;
|
||||||
}
|
}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet debugspip "SPIP define de debug"
|
snippet debugspip "SPIP define de debug"
|
||||||
function debug_spip(){
|
function debug_spip() {
|
||||||
define('_DEBUG_SLOW_QUERIES', true);
|
define('_DEBUG_SLOW_QUERIES', true);
|
||||||
define('_BOUCLE_PROFILER', 5000);
|
define('_BOUCLE_PROFILER', 5000);
|
||||||
define('_LOG_FILTRE_GRAVITE', 8);
|
define('_LOG_FILTRE_GRAVITE', 8);
|
||||||
|
@ -350,7 +356,7 @@ snippet fdoc
|
||||||
* @return ${3}
|
* @return ${3}
|
||||||
* @author tofulm
|
* @author tofulm
|
||||||
**/
|
**/
|
||||||
function ${1}(${2}){
|
function ${1}(${2}) {
|
||||||
${6}
|
${6}
|
||||||
}
|
}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
Loading…
Add table
Reference in a new issue