Skip to content

Instantly share code, notes, and snippets.

View tpayen's full-sized avatar
🏠
Office

Thomas P tpayen

🏠
Office
  • Apitech
  • Lyon
View GitHub Profile
<?php
// Récupération de la boite a restaurer
$mbox = driver_mel::gi()->getUser($this->rc->plugins->get_plugin('mel')->get_user_bal(), false);
@tpayen
tpayen / orm share.php
Created April 19, 2017 08:17
Utilisation de la classe Share pour le partage des agendas
<?php
$share = new LibMelanie\Api\Melanie2\Share($this->calendar);
$share->type = $this->group === true ? LibMelanie\Api\Melanie2\Share::TYPE_GROUP : LibMelanie\Api\Melanie2\Share::TYPE_USER;
$share->name = $user;
$share->acl = 0;
// Compléter automatiquement les droits
if (in_array('w', $rights)) {
// Ecriture + Lecture + Freebusy
$share->acl |= LibMelanie\Api\Melanie2\Share::ACL_WRITE
| LibMelanie\Api\Melanie2\Share::ACL_DELETE
@tpayen
tpayen / Exemple agenda-events avec ORM.php
Last active April 12, 2017 15:42
Création des données obm2013 dans l'ORM
<?php
// Inclure le fichier includes.php
include_once 'includes/libm2.php';
// Utilisation des namespaces
/*
* Possibilité de faire
* use LibMelanie\Api\Melanie2;
* au lieu de
* use LibMelanie\Api\Melanie2\User;
@tpayen
tpayen / markasjunk2.php
Last active October 19, 2016 08:39
Add mobile buttons
<?php
if ($this->toolbar) {
if ($this->rc->config->get('ismobile', false)) {
// add the buttons to the main toolbar
$this->add_button(array('command' => 'plugin.markasjunk2.junk', 'type' => 'link', 'class' => 'button buttonPas markasjunk2 disabled', 'classact' => 'button markasjunk2', 'classsel' => 'button markasjunk2Sel', 'title' => 'markasjunk2.buttonjunk', 'label' => 'junk', 'style' => $display_junk), 'toolbar_mobile');
$this->add_button(array('command' => 'plugin.markasjunk2.not_junk', 'type' => 'link', 'class' => 'button buttonPas markasnotjunk2 disabled', 'classact' => 'button markasnotjunk2', 'classsel' => 'button markasnotjunk2Sel', 'title' => 'markasjunk2.buttonnotjunk', 'label' => 'markasjunk2.notjunk', 'style' => $display_not_junk), 'toolbar_mobile');
}
else {
// add the buttons to the main toolbar
$this->add_button(array('command' => 'plugin.markasjunk2.junk', 'type' => 'link', 'class' => 'button buttonPas markasjunk2 disabled', 'classact' => 'button markasjunk2', 'classs
@tpayen
tpayen / melanie2_larry_mobile.min.css
Last active June 17, 2022 11:14
Reduce colored circle & remove the text
#messagelist li span.mobile_text {
height: 20px;
width: 20px;
text-indent: -9999px;
}
#messagelist li span.from span span {
margin-left: 25px;
}
@tpayen
tpayen / mobile.php
Last active January 11, 2016 09:09
Fix bin scripts error ?
<?php
// Are we using the mobile skin or not ?
if ($this->api->output->type == 'html') {
if ($this->isMobile() && strpos($skin, '_mobile') === false) {
$skin = 'melanie2_larry_mobile';
$this->rc->config->set('skin', $skin);
$this->rc->output->set_env('skin', $skin);
$this->rc->output->set_skin($skin);
}
elseif (! $this->isMobile() && strpos($skin, '_mobile') !== false) {