Merge branch 'master' of ssh://git.gamuza.fr:2222/snippet/snippets-vscodium
This commit is contained in:
commit
b294608b72
8 changed files with 3882 additions and 15 deletions
3143
UltiSnips/fa.snippets
Normal file
3143
UltiSnips/fa.snippets
Normal file
File diff suppressed because it is too large
Load diff
309
UltiSnips/html.snippets
Executable file
309
UltiSnips/html.snippets
Executable file
|
@ -0,0 +1,309 @@
|
|||
extends javascript
|
||||
extends fa
|
||||
|
||||
##########
|
||||
## SPIP ##
|
||||
##########
|
||||
|
||||
#BOUCLE :
|
||||
#------------------------------------------------------
|
||||
snippet b "SPIP <BOUCLE_>"
|
||||
`!p t[2] = t[2].upper()`<BOUCLE_${1:nom}(${2:ARTICLES}){${3:critere}}${4}>
|
||||
${0:${VISUAL}}
|
||||
</BOUCLE_$1>
|
||||
endsnippet
|
||||
|
||||
snippet bb "SPIP <B_>"
|
||||
`!p t[2] = t[2].upper()`<B_$1>
|
||||
${5}
|
||||
<BOUCLE_${1:nom}(${2:ARTICLES}){${3:critere}}${4}>
|
||||
${0:${VISUAL}}
|
||||
</BOUCLE_$1>
|
||||
${6}
|
||||
</B_$1>
|
||||
endsnippet
|
||||
|
||||
snippet id_art "SPIP #ID_ARTICLE" w
|
||||
#ID_ARTICLE${0}
|
||||
endsnippet
|
||||
|
||||
snippet id_aut "SPIP #ID_AUTEUR" w
|
||||
#ID_AUTEUR${0}
|
||||
endsnippet
|
||||
|
||||
snippet id_rub "SPIP #ID_RUBRIQUE" w
|
||||
#ID_RUBRIQUE${0}
|
||||
endsnippet
|
||||
|
||||
snippet id_mot "SPIP #ID_MOT" w
|
||||
#ID_MOT
|
||||
endsnippet
|
||||
|
||||
snippet id_doc "SPIP #ID_DOCUMENT" w
|
||||
#ID_DOCUMENT${0}
|
||||
endsnippet
|
||||
|
||||
# <INCLURE ...>
|
||||
snippet inclure "SPIP inclure" w
|
||||
<INCLURE{fond=${1:inclure/}${2}}${3}>
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet http_header "SPIP #HTTP_HEADER{}"
|
||||
#HTTP_HEADER{Content-Type: text/plain; charset=#CHARSET}
|
||||
endsnippet
|
||||
|
||||
snippet autoriser "SPIP [(#AUTORISER{" w
|
||||
[(#AUTORISER{${1:action},${2:objet}}|oui)${3}]
|
||||
endsnippet
|
||||
|
||||
snippet rem
|
||||
[(#REM)
|
||||
${1:${VISUAL}}
|
||||
]
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet edit "SPIP #EDIT{ VISUAL }" w
|
||||
#EDIT{${1:${VISUAL}}}${0}
|
||||
endsnippet
|
||||
|
||||
snippet env** "SPIP tout l'env"
|
||||
[<pre>(#ENV**|unserialize|print_r{1})</pre>]
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet env "SPIP #ENV{}" w
|
||||
#ENV{${1}}${0}
|
||||
endsnippet
|
||||
|
||||
snippet set "SPIP #SET{}" w
|
||||
#SET{${1},${2:${VISUAL}}}${0}
|
||||
endsnippet
|
||||
|
||||
snippet get "SPIP #GET{}" w
|
||||
#GET{${1}}${0}
|
||||
endsnippet
|
||||
|
||||
snippet ll "SPIP <:prefix:chaine_langue:>" w
|
||||
<:${1:${VISUAL}}:${2}:>${3}
|
||||
endsnippet
|
||||
|
||||
snippet chemin "SPIP #CHEMIN{}" w
|
||||
[(#CHEMIN{${1}})]${0}
|
||||
endsnippet
|
||||
|
||||
snippet cache "SPIP #CACHE{0}"
|
||||
#CACHE{0}
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet url_page "SPIP #URL_PAGE{}" w
|
||||
[(#URL_PAGE{${1:${VISUAL}}}${0})]
|
||||
endsnippet
|
||||
|
||||
snippet action "SPIP #URL_ACTION_AUTEUR{name,var1/var2,#SELF}" w
|
||||
[(#URL_ACTION_AUTEUR{${1:name},${2:var1/var2},${3:#SELF}})]${0}
|
||||
endsnippet
|
||||
|
||||
snippet foreachSpip "SPIP foreach"
|
||||
[(${1}|foreach)]
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet config "SPIP #CONFIG{}" w
|
||||
#CONFIG{${1}}${0}
|
||||
endsnippet
|
||||
|
||||
snippet session "SPIP #SESSION{}" w
|
||||
#SESSION{${1:${VISUAL:id_auteur}}}${0}
|
||||
endsnippet
|
||||
|
||||
snippet setenv "SPIP [(#BALISE|setenv{nom_env})]" w
|
||||
[(#${1:balise}|setenv{${2:nom_env}})]${0}
|
||||
endsnippet
|
||||
|
||||
snippet formulaire "SPIP #FORMULAIRE_" w
|
||||
`!p t[1] = t[1].upper()`
|
||||
[(#FORMULAIRE_${1}{${2}})]${0}
|
||||
endsnippet
|
||||
|
||||
snippet use "SPIP SVG use"
|
||||
<svg class="${2:$1}" width="${3}" height="${4}" alt="${5}">
|
||||
${6:<title></title>}
|
||||
<use xlink:href="#${1:${VISUAL:id}}" />
|
||||
</svg>
|
||||
endsnippet
|
||||
|
||||
snippet cptboucle "SPIP #COMPTEUR_BOUCLE" w
|
||||
#COMPTEUR_BOUCLE${0}
|
||||
endsnippet
|
||||
|
||||
snippet totboucle "SPIP #TOTAL_BOUCLE" w
|
||||
#TOTAL_BOUCLE${0}
|
||||
endsnippet
|
||||
|
||||
#FORMULAIRE
|
||||
#------------------------------------------------------
|
||||
snippet cvt "SPIP formulaire CVT"
|
||||
<div class="formulaire_spip formulaire_#FORM">
|
||||
|
||||
[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
|
||||
[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
|
||||
|
||||
[(#ENV{editable}|oui) ]
|
||||
<form name="formulaire_#FORM" action="#ENV{action}" method="post"><div>
|
||||
#ACTION_FORMULAIRE{#ENV{action}}
|
||||
<div class="editer_groupe">
|
||||
|
||||
${1}
|
||||
|
||||
</div>
|
||||
<p class="boutons"><input type="submit" class="submit" value="Envoyer" ></p>
|
||||
</div></form>
|
||||
|
||||
</div>
|
||||
endsnippet
|
||||
|
||||
snippet cvttext "SPIP <input type='text'"
|
||||
<div class="editer_groupe">
|
||||
#SET{name,${1}}
|
||||
#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
|
||||
#SET{obli,"obligatoire"}
|
||||
<div class="editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
|
||||
<label for="#GET{name}">${2}</label>
|
||||
[<span class="erreur_message">(#GET{erreurs})</span>]
|
||||
<input type="text" class="text ${3:$1}" name="#GET{name}" id="#GET{name}" value="#ENV{#GET{name}}" >
|
||||
</div>
|
||||
</div>
|
||||
${0}
|
||||
endsnippet
|
||||
snippet cvttextarea "SPIP <textarea ...> "
|
||||
<div class="editer_groupe">
|
||||
#SET{name,${1}}
|
||||
#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
|
||||
#SET{obli,"obligatoire"}
|
||||
<div class="editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
|
||||
<label for="#GET{name}">${2}</label>
|
||||
[<span class="erreur_message">(#GET{erreurs})</span>]
|
||||
<textarea class="textarea ${3:$1}" name="#GET{name}" id="#GET{name}">#ENV{#GET{name}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet cvtcheckbox "SPIP <input type='checkbox'>"
|
||||
<div class="editer_groupe">
|
||||
#SET{name,${1}}
|
||||
#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
|
||||
#SET{obli,"obligatoire"}
|
||||
<div class="editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
|
||||
<div class="choix">
|
||||
<input type="checkbox" class="checkbox" name="#GET{name}[]" id="#GET{name}_1"[ (#GET{name}|in_array{#ENV{#GET{name}}}|oui) checked="checked"})] >
|
||||
<label for="#GET{name}_1">${2}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet cvtradio "SPIP <input type='radio'>"
|
||||
<div class="editer_groupe">
|
||||
#SET{name,${1}}
|
||||
#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
|
||||
#SET{obli,"obligatoire"}
|
||||
<div class="editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
|
||||
<div class="choix">
|
||||
<input type="radio" class="radio" name="#GET{name}" value="non" id="#GET{name}_non"[ (#ENV{#GET{name}}|=={non}|?{checked="checked"})] >
|
||||
<label for="#GET{name}_non">${2}</label>
|
||||
</div>
|
||||
<div class="choix">
|
||||
<input type="radio" class="radio" name="#GET{name}" value="oui" id="#GET{name}_oui"[ (#ENV{#GET{name}}|=={oui}|?{checked="checked"})] >
|
||||
<label for="#GET{name}_oui">${3}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet cvtselect "SPIP <select>"
|
||||
<div class="editer_groupe">
|
||||
#SET{name,${1}}
|
||||
#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
|
||||
#SET{obli,"obligatoire"}
|
||||
<div class="editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
|
||||
<label for="#GET{name}">${2}</label>
|
||||
<select id="#GET{name}" name="#GET{name}" class="#GET{name}">
|
||||
<option value="${3}">${4}</option>
|
||||
${0}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
endsnippet
|
||||
|
||||
snippet saisie "SPIP #SAISIE{}"
|
||||
[(#SAISIE{${1:type},${2:nom}}
|
||||
{label="${3}"}
|
||||
${0}
|
||||
)]
|
||||
endsnippet
|
||||
|
||||
snippet saisiedata "SPIP #SAISIE{datas}"
|
||||
[(#SAISIE{${1:type},${2:nom}}
|
||||
{label="${3}"}
|
||||
{defaut=${4}}
|
||||
{datas=${5}}
|
||||
)]
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet br "<br>" w
|
||||
<br>
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet hr "<hr>"
|
||||
<hr>
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet nbs "&nbs;" i
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet html "<html>"
|
||||
<html>
|
||||
|
||||
${0}
|
||||
|
||||
</html>
|
||||
endsnippet
|
||||
|
||||
snippet script
|
||||
<script type="text/javascript">
|
||||
|
||||
${0}
|
||||
|
||||
</script>
|
||||
endsnippet
|
||||
|
||||
snippet scriptsrc
|
||||
<script src="[(#CHEMIN{${1}})]" type="text/javascript"></script>
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet style
|
||||
<style type="text/css" media="${1:screen}">
|
||||
${2}
|
||||
</style>
|
||||
endsnippet
|
||||
|
||||
snippet confirm "Onclick='ruturn confirm'" w
|
||||
onClick="return confirm('${1:Confirmer cette action}');"
|
||||
endsnippet
|
||||
|
||||
snippet action_url "SPIP url => action spip"
|
||||
var url_${1:nom} = "[(#VAL{$1}|generer_url_action{"", 1})]";
|
||||
${0}
|
||||
endsnippet
|
||||
|
42
UltiSnips/javascript.snippets
Normal file
42
UltiSnips/javascript.snippets
Normal file
|
@ -0,0 +1,42 @@
|
|||
# -----------------
|
||||
# JAVASCRIPT + SPIP
|
||||
# -----------------
|
||||
snippet jq
|
||||
jQuery(function() {
|
||||
`!v vim_snippets#Filename()`();
|
||||
//onAjaxLoad(`!v vim_snippets#Filename()`);
|
||||
|
||||
function `!v vim_snippets#Filename()`(){
|
||||
${0}
|
||||
}
|
||||
});
|
||||
endsnippet
|
||||
|
||||
snippet con
|
||||
console.log(${1});
|
||||
endsnippet
|
||||
|
||||
snippet ajax_action "req ajax jquery"
|
||||
data = {
|
||||
|
||||
};
|
||||
var request = jQuery.ajax({
|
||||
url: ${1},
|
||||
data: data,
|
||||
async: true,
|
||||
dataType: 'json',
|
||||
});
|
||||
request.done(function(){
|
||||
${0}
|
||||
// console.log(ma_variable_php_de_retour);
|
||||
});
|
||||
endsnippet
|
||||
|
||||
snippet ajax_reload "Reload ajax spip"
|
||||
ajaxReload('${1}', {
|
||||
args:{
|
||||
${2}:$2,${0}
|
||||
},
|
||||
callback: function(){}
|
||||
});
|
||||
endsnippet
|
336
UltiSnips/php.snippets
Executable file
336
UltiSnips/php.snippets
Executable file
|
@ -0,0 +1,336 @@
|
|||
#extends html
|
||||
|
||||
snippet action "SPIP action declenchee dans un lien"
|
||||
<?php
|
||||
if (!defined('_ECRIRE_INC_VERSION')) return;
|
||||
|
||||
function action_`!v vim_snippets#Filename()`_dist(){
|
||||
$securiser_action = charger_fonction('securiser_action', 'inc');
|
||||
$arg = $securiser_action();
|
||||
$$1 = $arg;
|
||||
list($${1:var1},$${2:var2}) = preg_split(',[^0-9],',$arg);
|
||||
${0}
|
||||
|
||||
// Cache
|
||||
include_spip('inc/invalideur');
|
||||
suivre_invalideur("id='$1/$$1'");
|
||||
|
||||
// redirection sur la création d'un rapport
|
||||
//$retour = "spip.php?page=";
|
||||
//include_spip('inc/headers');
|
||||
//redirige_par_entete($retour);
|
||||
}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet action2 "SPIP action ajax à la mano"
|
||||
<?php
|
||||
if (!defined('_ECRIRE_INC_VERSION')) return;
|
||||
|
||||
function action_`!v vim_snippets#Filename()`_dist($arg=null){
|
||||
|
||||
if (is_null($arg)) {
|
||||
// DEMI sécurité : s'il y a un hash, on teste la sécurité
|
||||
if (_request('hash')) {
|
||||
$securiser_action = charger_fonction('securiser_action', 'inc');
|
||||
$arg = $securiser_action();
|
||||
}
|
||||
// Sinon, on prend l'arg direct
|
||||
else {
|
||||
$arg = _request('arg');
|
||||
}
|
||||
}
|
||||
$${1:var} = $arg;
|
||||
${0}
|
||||
|
||||
// on renvoit le test en variable js
|
||||
$js = "var $1=$$1;";
|
||||
header('Content-Type: text/javascript; charset=' . $GLOBALS['meta']['charset']);
|
||||
echo $js;
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet cvt "SPIP"
|
||||
<?php
|
||||
if (!defined('_ECRIRE_INC_VERSION')) return;
|
||||
|
||||
function formulaires_`!v vim_snippets#Filename()`_charger_dist($${1:variables}){
|
||||
$valeurs = array(
|
||||
"${2:nom_du_champ}" => ${3:""},
|
||||
);
|
||||
${0}
|
||||
return $valeurs;
|
||||
}
|
||||
|
||||
function formulaires_`!v vim_snippets#Filename()`_verifier_dist($$1){
|
||||
$$2 = _request('$2');
|
||||
|
||||
$erreurs = array();
|
||||
//champs obligatoire
|
||||
foreach (array ('$2') as $obligatoire) {
|
||||
if (!_request($obligatoire)) $erreurs[$obligatoire] = 'Ce champs est obligatoire';
|
||||
}
|
||||
|
||||
//autres erreurs
|
||||
$erreurs['$2'] = "Ce champ ne convient pas.";
|
||||
|
||||
//Il y a des erreurs
|
||||
if (count($erreurs)) {
|
||||
$erreurs['message_erreur'] = 'Votre saisie contient des erreurs !';
|
||||
}
|
||||
|
||||
return $erreurs;
|
||||
}
|
||||
|
||||
function formulaires_`!v vim_snippets#Filename()`_traiter_dist($$1){
|
||||
$$2 = _request('$2');
|
||||
|
||||
$retour = array();
|
||||
$retour['message_ok'] = "bravo";
|
||||
$retour['redirect'] = "spip.php?page=perdu";
|
||||
$retour['editable'] = true;
|
||||
|
||||
return $retour;
|
||||
}
|
||||
endsnippet
|
||||
|
||||
|
||||
|
||||
|
||||
snippet bigint "SQL bigint(21)" w
|
||||
'bigint(${1:21}) NOT NULL',${0}
|
||||
endsnippet
|
||||
|
||||
snippet float "SQL float" w
|
||||
'float NOT NULL',${0}
|
||||
endsnippet
|
||||
|
||||
snippet tinyint "SQL tinyint(4)" w
|
||||
'tinyint(4) NOT NULL',${0}
|
||||
endsnippet
|
||||
|
||||
snippet decimal "SQL decimal(10,2)" w
|
||||
'decimal(10,2) DEFAULT "0" NOT NULL',${0}
|
||||
endsnippet
|
||||
|
||||
snippet text "SQL text NOT NULL" w
|
||||
'text NOT NULL DEFAULT ""',${0}
|
||||
endsnippet
|
||||
|
||||
snippet varchar "SQL varchar(25)" w
|
||||
'varchar(${1:255}) NOT NULL DEFAULT ""',${0}
|
||||
endsnippet
|
||||
|
||||
snippet datetime "SQL datetime" w
|
||||
'datetime NOT NULL DEFAULT "0000-00-00 00:00:00"',${0}
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet php
|
||||
<?php
|
||||
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet php2 "SPIP php"
|
||||
<?php
|
||||
if (!defined('_ECRIRE_INC_VERSION')) return;
|
||||
|
||||
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet testauto "SPIP"
|
||||
include_spip('inc/autoriser');
|
||||
if (! autoriser("${1:action}","${2:objet}")) {
|
||||
return false;
|
||||
}
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet id_auteur_session "$GLOBALS['visiteur_session']['id_auteur']"
|
||||
$GLOBALS['visiteur_session']['id_auteur']${0}
|
||||
endsnippet
|
||||
|
||||
snippet date_php "SPIP date('Y-m-d H:i:s')" w
|
||||
date("Y-m-d H:i:s")${0}
|
||||
endsnippet
|
||||
|
||||
snippet ll "SPIP chaine de langue" w
|
||||
_T('${1:prefix}:${2}')${0}
|
||||
endsnippet
|
||||
|
||||
snippet api_objet "SPIP API Objet"
|
||||
// utilisation API editer_objet pour l'insertion en BDD'
|
||||
// http://www.spip.net/fr_article5526.html
|
||||
include_spip('action/editer_objet');
|
||||
$objet = "${1:article}";
|
||||
|
||||
$set = array (
|
||||
'${1:champs1}' => $${2:valeur_champs1},
|
||||
'${3:champs2}' => $${4:valeur_champs2},
|
||||
);
|
||||
$id_objet = objet_inserer($objet, $id_parent);
|
||||
//ou $id_objet=$ma_variable;
|
||||
|
||||
objet_modifier($objet, $id_objet, $set);
|
||||
endsnippet
|
||||
|
||||
snippet api_lien "SPIP API Lien"
|
||||
// utilisation API editier_liens
|
||||
// http://www.spip.net/fr_article5477.html
|
||||
include_spip('action/editer_liens');
|
||||
|
||||
$objets_source = array("${1:auteur}"=>${2:id_auteur ou array});
|
||||
$objets_lies = array("${3:article}"=>${:id_article ou array});
|
||||
${0}
|
||||
|
||||
objet_associer($objets_source, $objets_lies);
|
||||
endsnippet
|
||||
|
||||
snippet cache "SPIP invalide cache"
|
||||
include_spip('inc/invalideur');
|
||||
suivre_invalideur("id='${1:id_objet}/1'");
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet req "SPIP _request()"
|
||||
_request('${1}')${0}
|
||||
endsnippet
|
||||
|
||||
snippet array "SPIP Array( X lignes)" w
|
||||
array(
|
||||
'${1}' => ${2},${0}
|
||||
);
|
||||
endsnippet
|
||||
|
||||
snippet array_ligne "SPIP Une ligne d'array"
|
||||
'${1:var}' => $$1,${0}
|
||||
endsnippet
|
||||
|
||||
snippet vd "var_dump()"
|
||||
var_dump($${1:var});
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet ec "Echo"
|
||||
echo ${1};
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet pre "<pre> print_r"
|
||||
echo "<pre>";
|
||||
print_r($${1});
|
||||
echo "</pre>";
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet include "SPIP include_spip"
|
||||
include_spip('${1:fichier}');
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet pipeline "SPIP Les pipelines de base"
|
||||
/**
|
||||
* Charger des styles CSS
|
||||
*
|
||||
* @pipeline insert_head_css
|
||||
* @param string $flux Code html des styles CSS à charger
|
||||
* @return string Code html complété
|
||||
**/
|
||||
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="' . timestamp(find_in_path('css/bigup.css')) . '" type="text/css" />' . "\n";
|
||||
return $flux;
|
||||
}
|
||||
${0}
|
||||
/**
|
||||
* Charger des scripts jquery
|
||||
*
|
||||
* @pipeline jqueryui_plugins
|
||||
* @param array $scripts Liste à charger
|
||||
* @return array Liste complétée
|
||||
**/
|
||||
function $1_jquery_plugins($scripts){
|
||||
$scripts[] = "aa";
|
||||
$scripts[] = produire_fond_statique('javascript/bigup.js');
|
||||
return $scripts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Charger des scripts jquery ui
|
||||
*
|
||||
* @pipeline jqueryui_plugins
|
||||
* @param array $scripts Liste à charger
|
||||
* @return array Liste complétée
|
||||
**/
|
||||
function $1_jqueryui_plugins($scripts){
|
||||
$scripts[] = "aa";
|
||||
return $scripts;
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet debugspip "SPIP define de debug"
|
||||
function debug_spip(){
|
||||
define('_DEBUG_SLOW_QUERIES', true);
|
||||
define('_BOUCLE_PROFILER', 5000);
|
||||
define('_LOG_FILTRE_GRAVITE', 8);
|
||||
define('_LOG_FILELINE',true);
|
||||
define('_DEBUG_AUTORISER', true);
|
||||
define('_MAX_LOG', 500000);
|
||||
|
||||
error_reporting(E_ALL^E_NOTICE);
|
||||
ini_set ("display_errors", "On");
|
||||
ini_set("html_errors", "On");
|
||||
ini_set("allow_url_fopen", "On");
|
||||
define('SPIP_ERREUR_REPORT',E_ALL^E_NOTICE);
|
||||
define('SPIP_ERREUR_REPORT_INCLUDE_PLUGINS',E_ALL^E_NOTICE);
|
||||
|
||||
|
||||
define('_NO_CACHE', -1);
|
||||
define('_INTERDIRE_COMPACTE_HEAD_ECRIRE', true);
|
||||
}
|
||||
|
||||
if ( $_SERVER['SERVER_ADDR'] === "127.0.0.1") {
|
||||
debug_spip();
|
||||
}
|
||||
|
||||
if ( substr($_SERVER['SERVER_ADDR'],0,7) === "192.168") {
|
||||
debug_spip();
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet /*
|
||||
/**
|
||||
* ${0}
|
||||
**/
|
||||
endsnippet
|
||||
|
||||
snippet doc
|
||||
/**
|
||||
* ${1:function non documente}
|
||||
*
|
||||
* @param ${2}
|
||||
* @return ${0}
|
||||
* @author tofulm
|
||||
**/
|
||||
endsnippet
|
||||
|
||||
# Function doc
|
||||
snippet fdoc
|
||||
/**
|
||||
* ${4:fonction non documente}
|
||||
*
|
||||
* @param ${5}
|
||||
* @return ${3}
|
||||
* @author tofulm
|
||||
**/
|
||||
function ${1}(${2}){
|
||||
${6}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet spip_log "SPIP fctn spip_log()"
|
||||
spip_log(${1},${2:"gamuza"});
|
||||
${0}
|
||||
endsnippet
|
7
UltiSnips/scss.snippets
Normal file
7
UltiSnips/scss.snippets
Normal file
|
@ -0,0 +1,7 @@
|
|||
extends css
|
||||
|
||||
snippet media "@media (min-width:$small){}"
|
||||
@media (min-width: $${1:small}){
|
||||
${0}
|
||||
}
|
||||
endsnippet
|
20
UltiSnips/spip-js.json
Normal file
20
UltiSnips/spip-js.json
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"jq": {
|
||||
"prefix": "jq",
|
||||
"body": "jQuery(function() {\n\t`!v vim_snippets#Filename()`();\n\t//onAjaxLoad(`!v vim_snippets#Filename()`);\n\n\tfunction `!v vim_snippets#Filename()`(){\n\t\t${0}\n\t}\n});"
|
||||
},
|
||||
"con": {
|
||||
"prefix": "con",
|
||||
"body": "console.log(${1});"
|
||||
},
|
||||
"ajax_action": {
|
||||
"prefix": "ajax_action",
|
||||
"body": "data = {\n\n};\nvar request = jQuery.ajax({\n\turl: ${1},\n\tdata: data,\n\tasync: true,\n\tdataType: 'json',\n});\nrequest.done(function(){\n\t${0}\n\t// console.log(ma_variable_php_de_retour);\n});",
|
||||
"description": "req ajax jquery"
|
||||
},
|
||||
"ajax_reload": {
|
||||
"prefix": "ajax_reload",
|
||||
"body": "ajaxReload('${1}', {\n\targs:{\n\t\t${2}:$2,${0}\n\t},\n\tcallback: function(){}\n});",
|
||||
"description": "Reload ajax spip"
|
||||
}
|
||||
}
|
10
UltiSnips/xml.snippets
Normal file
10
UltiSnips/xml.snippets
Normal file
|
@ -0,0 +1,10 @@
|
|||
|
||||
snippet necessite "SPIP <necessite ...>"
|
||||
<necessite nom="${1}" compatibilite="[${2};[" />
|
||||
${0}
|
||||
endsnippet
|
||||
|
||||
snippet pipeline "SPIP <pipeline ...>"
|
||||
<pipeline nom="${1}" inclure="${2:_pipelines}.php" />
|
||||
endsnippet
|
||||
|
30
php.json
30
php.json
|
@ -1,4 +1,19 @@
|
|||
{
|
||||
"action": {
|
||||
"prefix": "action",
|
||||
"body": "<?php\nif (!defined('_ECRIRE_INC_VERSION')) return;\n\nfunction action_${TM_FILENAME_BASE}_dist(){\n\t$securiser_action = charger_fonction('securiser_action', 'inc');\n\t$arg = $securiser_action();\n\t$$1 = $arg;\n\tlist($${1:var1},$${2:var2}) = preg_split(',[^0-9],',$arg);\n\t${0}\n\n\t// Cache\n\tinclude_spip('inc/invalideur');\n\tsuivre_invalideur(\"id='$1/$$1'\");\n\n\t// redirection sur la création d'un rapport\n\t//$retour = \"spip.php?page=\";\n\t//include_spip('inc/headers');\n\t//redirige_par_entete($retour);\n}",
|
||||
"description": "SPIP action declenchee dans un lien"
|
||||
},
|
||||
"action2": {
|
||||
"prefix": "action2",
|
||||
"body": "<?php\nif (!defined('_ECRIRE_INC_VERSION')) return;\n\nfunction action_${TM_FILENAME_BASE}_dist($arg=null){\n\n\tif (is_null($arg)) {\n\t\t// DEMI sécurité : s'il y a un hash, on teste la sécurité\n\t\tif (_request('hash')) {\n\t\t\t$securiser_action = charger_fonction('securiser_action', 'inc');\n\t\t\t$arg = $securiser_action();\n\t\t}\n\t\t// Sinon, on prend l'arg direct\n\t\telse {\n\t\t\t$arg = _request('arg');\n\t\t}\n\t}\n\t$${1:var} = $arg;\n\t${0}\n\n\t// on renvoit le test en variable js\n\t$js = \"var $1=$$1;\";\n\theader('Content-Type: text/javascript; charset=' . $GLOBALS['meta']['charset']);\n\techo $js;\n}",
|
||||
"description": "SPIP action ajax à la mano"
|
||||
},
|
||||
"cvt": {
|
||||
"prefix": "cvt",
|
||||
"body": "<?php\nif (!defined('_ECRIRE_INC_VERSION')) return;\n\nfunction formulaires_${TM_FILENAME_BASE}_charger_dist($${1:variables}){\n\t$valeurs = array(\n\t\t\"${2:nom_du_champ}\" => ${3:\"\"},\n\t);\n\t${0}\n\treturn $valeurs;\n}\n\nfunction formulaires_${TM_FILENAME_BASE}_verifier_dist($$1){\n\t$$2 = _request('$2');\n\n\t$erreurs = array();\n\t//champs obligatoire\n\tforeach (array ('$2') as $obligatoire) {\n\t\tif (!_request($obligatoire)) $erreurs[$obligatoire] = 'Ce champs est obligatoire';\n\t}\n\n\t//autres erreurs\n\t$erreurs['$2'] = \"Ce champ ne convient pas.\";\n\n\t//Il y a des erreurs\n\tif (count($erreurs)) {\n\t\t$erreurs['message_erreur'] = 'Votre saisie contient des erreurs !';\n\t}\n\n\treturn $erreurs;\n}\n\nfunction formulaires_${TM_FILENAME_BASE}_traiter_dist($$1){\n\t$$2 = _request('$2');\n\n\t$retour = array();\n\t$retour['message_ok'] = \"bravo\";\n\t$retour['redirect'] = \"spip.php?page=perdu\";\n\t$retour['editable'] = true;\n\n\treturn $retour;\n}",
|
||||
"description": "SPIP"
|
||||
},
|
||||
"bigint": {
|
||||
"prefix": "bigint",
|
||||
"body": "'bigint(${1:21}) NOT NULL',${0}",
|
||||
|
@ -53,21 +68,6 @@
|
|||
"body": "$GLOBALS['visiteur_session']['id_auteur']${0}",
|
||||
"description": "$GLOBALS['visiteur_session']['id_auteur']"
|
||||
},
|
||||
"cvt": {
|
||||
"prefix": "cvt",
|
||||
"body": "<?php\nif (!defined('_ECRIRE_INC_VERSION')) return;\n\nfunction formulaires_${TM_FILENAME_BASE}_charger_dist($${1:variables}){\n\t$valeurs = array(\n\t\t\"${2:nom_du_champ}\" => ${3:\"\"},\n\t);\n\t${0}\n\treturn $valeurs;\n}\n\nfunction formulaires_${TM_FILENAME_BASE}_verifier_dist($$1){\n\t$$2 = _request('$2');\n\n\t$erreurs = array();\n\t//champs obligatoire\n\tforeach (array ('$2') as $obligatoire) {\n\t\tif (!_request($obligatoire)) $erreurs[$obligatoire] = 'Ce champs est obligatoire';\n\t}\n\n\t//autres erreurs\n\t$erreurs['$2'] = \"Ce champ ne convient pas.\";\n\n\t//Il y a des erreurs\n\tif (count($erreurs)) {\n\t\t$erreurs['message_erreur'] = 'Votre saisie contient des erreurs !';\n\t}\n\n\treturn $erreurs;\n}\n\nfunction formulaires_${TM_FILENAME_BASE}_traiter_dist($$1){\n\t$$2 = _request('$2');\n\n\t$retour = array();\n\t$retour['message_ok'] = \"bravo\";\n\t$retour['redirect'] = \"spip.php?page=perdu\";\n\t$retour['editable'] = true;\n\n\treturn $retour;\n}",
|
||||
"description": "SPIP"
|
||||
},
|
||||
"action2": {
|
||||
"prefix": "action2",
|
||||
"body": "<?php\nif (!defined('_ECRIRE_INC_VERSION')) return;\n\nfunction action_${TM_FILENAME_BASE}_dist($arg=null){\n\n\tif (is_null($arg)) {\n\t\t// DEMI sécurité : s'il y a un hash, on teste la sécurité\n\t\tif (_request('hash')) {\n\t\t\t$securiser_action = charger_fonction('securiser_action', 'inc');\n\t\t\t$arg = $securiser_action();\n\t\t}\n\t\t// Sinon, on prend l'arg direct\n\t\telse {\n\t\t\t$arg = _request('arg');\n\t\t}\n\t}\n\t$${1:var} = $arg;\n\t${0}\n\n\t// on renvoit le test en variable js\n\t$js = \"var $1=$$1;\";\n\theader('Content-Type: text/javascript; charset=' . $GLOBALS['meta']['charset']);\n\techo $js;\n}",
|
||||
"description": "SPIP action ajax à la mano"
|
||||
},
|
||||
"action": {
|
||||
"prefix": "action",
|
||||
"body": "<?php\nif (!defined('_ECRIRE_INC_VERSION')) return;\n\nfunction action_${TM_FILENAME_BASE}_dist(){\n\t$securiser_action = charger_fonction('securiser_action', 'inc');\n\t$arg = $securiser_action();\n\t$$1 = $arg;\n\tlist($${1:var1},$${2:var2}) = preg_split(',[^0-9],',$arg);\n\t${0}\n\n\t// Cache\n\tinclude_spip('inc/invalideur');\n\tsuivre_invalideur(\"id='$1/$$1'\");\n\n\t// redirection sur la création d'un rapport\n\t//$retour = \"spip.php?page=\";\n\t//include_spip('inc/headers');\n\t//redirige_par_entete($retour);\n}",
|
||||
"description": "SPIP action declenchee dans un lien"
|
||||
},
|
||||
"date_php": {
|
||||
"prefix": "date_php",
|
||||
"body": "date(\"Y-m-d H:i:s\")${0}",
|
||||
|
|
Loading…
Add table
Reference in a new issue