I hereby claim:
- I am rtripault on github.
- I am rtripault (https://keybase.io/rtripault) on keybase.
- I have a public key ASBH7E3QHCx946gTCPZ1GWj-kkpBY5J_wHFciF6l0Yjgowo
To claim this, I am signing this object:
| <?php | |
| /** | |
| * A sample plugin to display the "welcome message" to all users, login for the first time in Revo manager | |
| * | |
| * @var modX $modx | |
| * @var array $scriptProperties | |
| * @var modPlugin $this | |
| * | |
| * @see modPlugin::process() | |
| * |
| <?php | |
| /** | |
| * Sample plugin to add a "created by" field on a resource form | |
| * | |
| * @var modX $modx | |
| * @var array $scriptProperties | |
| * | |
| * @event OnDocFormPrerender | |
| */ |
I hereby claim:
To claim this, I am signing this object:
| <?php | |
| /** | |
| * Babel | |
| * | |
| * @package babel | |
| */ | |
| /** | |
| * | |
| * Events: | |
| * OnDocFormPrerender,OnDocFormSave,OnEmptyTrash,OnContextRemove,OnResourceDuplicate |
| <?php | |
| $doodle = $modx->getService('doodles','Doodles',$modx->getOption('doodles.core_path',null,$modx->getOption('core_path').'components/doodles/').'model/doodles/'); | |
| if (!($doodle instanceof Doodles)) { | |
| $hook->addError('error_message','Unable to load doodle service.'); | |
| return false; | |
| }; | |
| $newEntry = $modx->newObject('Doodle'); | |
| $newEntry->fromArray($scriptProperties['fields']); |
| switch(strtolower(MODX_HTTP_HOST)) { | |
| case 'dns.tld1:80': | |
| case 'dns.tld1': | |
| $modx->initialize('ctx1'); | |
| break; | |
| case 'dns.tld2:443': | |
| case 'dns.tld2:80': | |
| case 'dns.tld2': | |
| $modx->initialize('ctx2'); |
| <?php | |
| if (isset($redirs)){ | |
| $redirs=explode(',',$redirs); | |
| if (count($redirs)>0){ | |
| foreach ($redirs as $redir){ | |
| $redir=explode(':',$redir); | |
| if (count($redir)==2){ | |
| <?php | |
| // Gets the analytics if the person is not logged in | |
| // Must call un-cached. | |
| // [[!Get_Analytics]] | |
| $return = ''; | |
| $viewer_logged_in = false; | |
| $viewer = $modx->user; | |
| <?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 |
| <?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'); |