Skip to content

Instantly share code, notes, and snippets.

View ideesimple's full-sized avatar

Laurent Toulemonde ideesimple

View GitHub Profile
@ideesimple
ideesimple / gist:784234
Created January 18, 2011 09:55
.htaccess de base
#pour forcer version php 5
SetEnv PHP_VER 5
#http://www.manuelphp.com/php/security.globals.php, pour ovh
SetEnv REGISTER_GLOBALS 0
#supprimer les variable de session pour les moteurs de recherche
SetEnv SESSION_USE_TRANS_SID 0
@ideesimple
ideesimple / gist:796903
Created January 26, 2011 16:00
récupérer le nom d'un user
$profile = $modx->getObject('modUserProfile', $id);
$fullname = $profile->get('fullname');
return $fullname;
<?php
/* UserGroups snippet*/
$user =& $modx->user;
if ($user->isMember('membres') {
$output = $modx->getChunk('membres');
} elseif ($user->isMember('administrateurs') {
$output = $modx->getChunk('administrateurs');
} elseif ($user->isMember('employés') {
$output = $modx->getChunk('employés');
<?php
// First fetch all the children of the current resource
$children = $modx->resource->getMany('Children');
// Check if there are any. If not, return false
if (!$children) { return false; }
// Check if there is a tpl set, if not return an error
$tpl = $modx->getOption('tpl',$scriptProperties,'');
if (!$tpl) { return 'No template given.'; }
// Start the output
@ideesimple
ideesimple / gist:838740
Created February 22, 2011 14:27
modulo idx
[[+idx:mod=`5`:default=`class="test5"`]]
[[~[[*id]]? &scheme=`full`]]
var firstCombo = new Ext.form.ComboBox({
store: store_combo_1,
typeAhead: true,
forceSelection: true,
triggerAction: 'all',
emptyText:'Select a state...',
selectOnFocus:true,
id:'combo1'
});
@ideesimple
ideesimple / gist:1077569
Created July 12, 2011 07:43
where avec json
{"id:NOT IN":[12,13,14,15]}
{"id:IN":[12,13,14,15]}
@ideesimple
ideesimple / gist:1080530
Created July 13, 2011 15:29
utilisation de migx avec la possibilité de choisir le type de bloc à rajouter
[
{"formname":"Bloc1", "formtabs":
[
{"caption":"Marque de bateau", "fields": [
{"field":"MarqueBateau","caption":"Marque"}
]}
]
},{"formname":"Bloc2", "formtabs":
[
{"caption":"Détail", "fields": [