function olb_parse_link($event) { $link = tracking_cleanup($event->getLink()); $link = url_cleanup($link, $event); // cleanup end of url $link = preg_replace("/\\?&/", "", $link); if (isset($link[strlen($link) - 1])) { if ($link[strlen($link) - 1] == '?') { $link = substr($link, 0, strlen($link) - 1); } } $link = tracking_cleanup($link); return $link; } function olb_events_plugin_link(&$events) { foreach ($events as $event) { // if special function present, call it to process link if (function_exists('olb_special_plugin_link')) { $onEvents[] =& $event; olb_special_plugin_link($onEvents); } $event->setTitle(olb_parse_title($event)); // manage event's title $event->setLink(olb_parse_link($event)); // manage event's link } } // hook before events display Plugin::addHook("index_post_treatment", "olb_events_plugin_link");
$current = new Effect(); $current->type = $effect['type']; $current->setValues($effect); $current->sort = $i; $current->union = $cause['union']; $current->story = $story->id; $current->save(); $i++; } }, array()); break; } } function story_vocal_command(&$response, $actionUrl) { global $conf; require_once dirname(__FILE__) . '/Cause.class.php'; $causeManager = new Cause(); $vocals = $causeManager->loadAll(array('type' => 'listen')); foreach ($vocals as $vocal) { $response['commands'][] = array('command' => $conf->get('VOCAL_ENTITY_NAME') . ' ' . $vocal->value, 'url' => $actionUrl . '?action=plugin_story_check&type=talk&event=' . $vocal->id, 'confidence' => '0.90' + $conf->get('VOCAL_SENSITIVITY')); } } Plugin::addCss("/css/main.css"); Plugin::addJs("/js/main.js"); Plugin::addHook("menubar_pre_home", "story_plugin_menu"); Plugin::addHook("home", "story_plugin_page"); Plugin::addHook("action_post_case", "story_plugin_action"); Plugin::addHook("vocal_command", "story_vocal_command"); Plugin::addHook("cron", "plugin_story_check");
<input type="text" class="input-large" name="emiterCode" value="<?php echo $conf->get('plugin_radioRelay_emitter_code'); ?> " placeholder="par exemple 8217034..."> <button type="submit" class="btn">Enregistrer</button> </form> </div> <?php } else { ?> <div id="main" class="wrapper clearfix"> <article> <h3>Vous devez être connecté</h3> </article> </div> <?php } } } Plugin::addHook("preference_menu", "radioRelay_plugin_preference_menu"); Plugin::addHook("preference_content", "radioRelay_plugin_preference_page"); Plugin::addHook("action_post_case", "radioRelay_action_radioRelay"); Plugin::addHook("node_display", "radioRelay_display"); Plugin::addHook("setting_bloc", "radioRelay_plugin_setting_page"); Plugin::addHook("setting_menu", "radioRelay_plugin_setting_menu"); Plugin::addHook("vocal_command", "radioRelay_vocal_command"); //Anonnce que le plugin propose un évenement à l'application lors du changement d'etat (cf Event::emit('relay_change_state') dans le code ) Event::announce('relay_change_state', 'Changement de l\'état d\'un relais radio', array('code radio' => 'int', 'etat' => 'string'));
<?php } else { ?> <div id="main" class="wrapper clearfix"> <article> <h3>Vous devez être connecté</h3> </article> </div> <?php } } } Plugin::addCss("/css/main.css"); Plugin::addJs("/js/main.js", true); //Lie radioRelay_plugin_preference_menu au menu de réglages Plugin::addHook("preference_menu", "radioRelay_plugin_preference_menu"); //Lie radioRelay_plugin_preference_page a la page de réglages Plugin::addHook("preference_content", "radioRelay_plugin_preference_page"); //Lie radioRelay_plugin_setting_page a la zone réglages Plugin::addHook("setting_bloc", "radioRelay_plugin_setting_page"); //Lie radioRelay_plugin_setting_menu au menu de réglages Plugin::addHook("setting_menu", "radioRelay_plugin_setting_menu"); //Lie radiorelay_plugin_action a la page d'action qui perme d'effecuer des actionx ajax ou ne demdnant pas de retour visuels Plugin::addHook("action_post_case", "radiorelay_plugin_action"); //Lie radiorelay_plugin_vocal_command a la gestion de commandes vocales proposées par yana Plugin::addHook("vocal_command", "radiorelay_plugin_vocal_command"); //Lie radioRelay_plugin_widget aux widgets de la dashboard Plugin::addHook("widgets", "radioRelay_plugin_widget");
// @version 0.11 @description Le plugin API permet de gérer ses flux Leed via une application externe */ require_once 'constantAPI.php'; function api_plugin_setting_link(&$myUser) { echo '<li><a class="toggle" href="#leedAPIBloc">' . _t('P_LEEDAPI_TITLE') . '</a></li>'; } function api_plugin_setting_bloc(&$myUser) { echo ' <section id="leedAPIBloc" class="leedAPIBloc" style="display:none;"> <h2>' . _t('P_LEEDAPI_TITLE') . '</h2> <section class="preferenceBloc"> <h3>' . _t('P_LEEDAPI_SUBTITLE') . '</h3>'; // La clé n'est affichée que si le plugin est activé if (PLUGIN_ENABLED == 1) { echo '<p>' . _t('P_LEEDAPI_DESCRIPTION_KEY') . '</p>'; echo '<p>' . _t('P_LEEDAPI_TEXT_KEY') . ' <b>' . KEY . '</b>.</p>'; } echo ' </section> </section> '; } $myUser = isset($_SESSION['currentUser']) ? unserialize($_SESSION['currentUser']) : false; if ($myUser != false) { Plugin::addHook('setting_post_link', 'api_plugin_setting_link'); Plugin::addHook('setting_post_section', 'api_plugin_setting_bloc'); }
width: 35%; } .driver_content .driver_properties li .driver_property_value{ min-width: 60%; } </style> <div class="driver_content"> <div class="driver_image"> <i class="fa fa-sun">image</i> </div> <div class="driver_view"> 19° </div> <label class="driver_properties_title">Propriétés</label> <ul class="driver_properties"> <li> <div class="driver_property_label">Label</div><div class="driver_property_value">Valeur html</div> </li> </ul> </div> </body> </html> */ Plugin::addCss('/css/style.css', true); Plugin::addJs('/js/main.js', true); Plugin::addHook("widgets", "dash_monitoring_plugin_menu"); Plugin::addHook("action_post_case", "dash_monitoring_plugin_actions");
<input class="span2" id="keyword" placeholder="ma recherche ici..." type="text"> <button onclick="plugin_filemanager_search();" class="btn" type="button"><i class="fa fa-search"></i></button> </div> <div id="plugin_filemanager_list"></div> <?php } } function plugin_filemanager_plugin_dashboard() { global $_, $myUser; if ($myUser->can('file', 'r')) { ?> <li style="cursor:pointer;" onclick="window.location='index.php?module=filemanager';" class="span2"> <div class="thumbnail"> <img src="./plugins/file/img/file.png"> <h4>Module fichier</h4> <p>Gestion des fichiers et de médias.</p> </div> </li> <?php } } Plugin::addJs("/js/main.js"); Plugin::addHook("menubar_pre_home", "plugin_filemanager_plugin_menu"); Plugin::addHook("home", "plugin_filemanager_plugin_page"); Plugin::addHook("action_post_case", "plugin_filemanager_plugin_actions"); Plugin::addHook("preference_content", "plugin_filemanager_plugin_setting_page"); Plugin::addHook("preference_menu", "plugin_filemanager_plugin_setting_menu"); Plugin::addHook("dashboard", "plugin_filemanager_plugin_dashboard");
<form action="action.php?action=intheleed_update" method="POST"> <h2>' . _t('P_INTHELEED_PLUGIN_TITLE') . '</h2> <p class="pocheBlock"> <label for="plugin_poche_link">' . _t('P_INTHELEED_POCHE_LINK') . '</label> <input style="width:50%;" type="text" placeholder="http://poche.mondomaine.com" value="' . $configurationManager->get('plugin_poche_link') . '" id="plugin_poche_link" name="plugin_poche_link" /> <input type="submit" class="button" value="' . _t('P_INTHELEED_SAVE') . '"><br/> </p> <strong>' . _t('P_INTHELEED_NB') . '</strong> ' . _t('P_INTHELEED_NB_INFO') . ' </form> </section> '; } function intheleed_plugin_update($_) { $myUser = isset($_SESSION['currentUser']) ? unserialize($_SESSION['currentUser']) : false; if ($myUser === false) { exit(_t('P_INTHELEED_CONNECTION_ERROR')); } if ($_['action'] == 'intheleed_update') { $configurationManager = new Configuration(); $configurationManager->put('plugin_poche_link', $_['plugin_poche_link']); $_SESSION['configuration'] = null; header('location: settings.php'); } } Plugin::addHook('event_post_top_options', 'intheleed_plugin_button'); Plugin::addHook('setting_post_link', 'intheleed_plugin_setting_link'); Plugin::addHook('setting_post_section', 'intheleed_plugin_setting_bloc'); Plugin::addHook("action_post_case", "intheleed_plugin_update");
</table> <h2>Barre de progression</h2> <div class="progress progress-striped active"> <div class="bar" style="width: 40%;"></div> </div> <h2>Pagination</h2> <div class="pagination"> <ul> <li><a href="#">Prev</a></li> <li><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">5</a></li> <li><a href="#">Next</a></li> </ul> </div> </div> <?php } } Plugin::addCss("/css/style.css"); //Plugin::addJs("/js/main.js"); Plugin::addHook("menubar_pre_home", "test_plugin_menu"); Plugin::addHook("home", "test_plugin_page"); Plugin::addHook("action_post_case", "test_plugin_action"); Plugin::addHook("vocal_command", "test_plugin_vocal_command");
<?php /* @name DisplayPictureTitle @author Kvnco <*****@*****.**> @link https://twitter.com/kvnco @licence CC by 3.0 http://creativecommons.org/licenses/by/3.0/fr/ @version 1.0.1 @description Permet d'afficher en dessous d'une image le texte apparaissant dans la basile title (utile pour les terminaux tactiles) */ function displayPictureTitle(&$event) { echo "<script>\n\t\t\tvar picts = document.getElementById('" . $event->getId() . "').getElementsByTagName('img');\n\t\t\tfor (var i = 0; i < picts.length; i++) {\n\t\t\t\tif (picts[i].title)\n\t\t\t\t\tpicts[i].insertAdjacentHTML('afterend', '<div class=\\'img-title\\'>' + picts[i].title + '</div>');\n\t\t\t}\n\t\t</script>"; } // Ajout de la fonction au Hook situé avant l'affichage des évenements Plugin::addCss("/css/style.css"); Plugin::addHook("event_post_content", "displayPictureTitle");
</ul> </aside>'; */ } function squelette_plugin_action($_, $myUser) { /* Ajoutez un code qui s'executera en tant qu'action ex : // ne rien mettre entre le début de la fonction et votre test sur l'action. if($_['action']=='squelette_action'){ if($myUser==false) exit('Vous devez vous connecter pour cette action.'); if($_['state']=='add'){ $return = mysql_query('INSERT INTO '.MYSQL_PREFIX.'plugin_feaditlater (event)VALUES(\''.$_['id'].'\')'); }else{ $return = mysql_query('DELETE FROM '.MYSQL_PREFIX.'plugin_feaditlater WHERE event=\''.$_['id'].'\''); } if(!$return) echo mysql_error(); } */ } /* Ajout du css du squelette en en tête de leed - par défaut, s'il existe, le fichier default.css est ajouté - par défaut, s'il existe, le fichier "nomDuTheme".css est ajouté - si vous souhaitez inclure un fichier css supplémentaire (pour tous les thèmes) */ //Plugin::addCss("/css/style.css"); //Ajout du javascript du squelette au bas de page de leed Plugin::addJs("/js/main.js"); //Ajout de la fonction squelette_plugin_displayEvents au Hook situé après le menu des flux Plugin::addHook("menu_post_folder_menu", "squelette_plugin_menu"); //Ajout de la fonction squelette_plugin_action à la page action de leed qui contient tous les traitements qui n'ont pas besoin d'affichage (ex :supprimer un flux, faire un appel ajax etc...) Plugin::addHook("action_post_case", "squelette_plugin_action");
echo $conf->get('port', 'marantz'); ?> " placeholder="80"> <br/><br/><label>Zone de l'amplificateur</label><br/> <input type="text" class="input-large" name="zone" value="<?php echo $conf->get('zone', 'marantz'); ?> " placeholder="MainZone"> <br/><br/><button type="submit" class="btn">Sauvegarder</button> </form> <?php if (!function_exists('curl_version')) { echo '<strong>Important: </strong>Pour profiter de ce plugin il vous faut installer CURL <code>sudo apt-get install php5-curl</code><BR><BR>'; } ?> </div> <?php } else { header('location:index.php?connexion=ko'); } } } Plugin::addJs('/js/main.js', true); Plugin::addHook("setting_menu", "marantz_plugin_menu"); Plugin::addHook("setting_bloc", "marantz_plugin_page"); Plugin::addHook("preference_menu", "marantz_plugin_preference_menu"); Plugin::addHook("preference_content", "marantz_plugin_preference_page"); #Plugin::addHook("widgets", "marantz_widget_plugin_menu"); Plugin::addHook("action_post_case", "marantz_action"); Plugin::addHook("vocal_command", "marantz_vocal_command");
if (isset($content['infos']) && strlen($content['infos']) > 0) { $event->setLink($content['infos']); } } } } function ng_plugin_button(&$event) { $requete = 'SELECT guid,content,link,title FROM `' . MYSQL_PREFIX . 'event` WHERE id = ' . $event->getId(); /* $query = mysql_query($requete); $result = mysql_fetch_array($query); */ $mysql = new MysqlEntity(); $results = $mysql->customQuery($requete); $result = $results->fetch_array(); if (stristr($result['content'], 'Langue :')) { get_content($result['content'], $content); complete_content($content); echo '['; $bsLink = $content['indexers']['binsearch']; echo '<a title="Chercher: ' . $result['title'] . '" target="_blank" href="' . $bsLink . '" rel="noreferrer">' . 'BS!' . '</a> '; $bsLink = $content['indexers']['nzbindex']; echo '<a title="Chercher: ' . $result['title'] . '" target="_blank" href="' . $bsLink . '" rel="noreferrer">' . 'NI!' . '</a> '; $bsLink = $content['indexers']['nzbclub']; echo '<a title="Chercher: ' . $result['title'] . '" target="_blank" href="' . $bsLink . '" rel="noreferrer">' . 'NC!' . '</a> '; echo '] '; } } Plugin::addHook("event_post_top_options", "ng_plugin_button");
echo $myUser->getMail(); ?> "><br/> <label for="password">Mot de passe</label> <input type="password" class="input-large" id="password" name="password" value=""><br/> <button type="submit" class="btn">Modifier</button><br/> <br/> </form> </div> <?php } else { ?> <div id="main" class="wrapper clearfix"> <article> <h3>Vous devez être connecté</h3> </article> </div> <?php } } } Plugin::addCss('/css/style.css', true); Plugin::addHook("setting_menu", "profil_plugin_menu"); Plugin::addHook("setting_bloc", "profil_plugin_page"); Plugin::addHook("action_post_case", "profil_plugin_actions"); Plugin::addHook("widgets", "dash_profil_plugin_menu");
<?php } } function wireRelay_plugin_setting_menu() { global $_; echo '<li ' . (isset($_['section']) && $_['section'] == 'wireRelay' ? 'class="active"' : '') . '><a href="setting.php?section=wireRelay"><i class="fa fa-angle-right"></i> Relais filaires</a></li>'; } function wireRelay_plugin_listen($command, $text, $confidence) { //echo 'diction de la commande : '.$command; } function wireRelay_plugin_widget(&$widgets) { $widgets[] = array('uid' => 'dash_wirerelay', 'icon' => 'fa fa-flash', 'label' => 'Relais', 'background' => '#50597b', 'color' => '#fffffff', 'onLoad' => 'action.php?action=wireRelay_load_widget', 'onEdit' => 'action.php?action=wireRelay_edit_widget', 'onSave' => 'action.php?action=wireRelay_save_widget'); } Plugin::addCss("/css/main.css"); Plugin::addJs("/js/main.js"); //Lie wireRelay_plugin_setting_page a la zone réglages Plugin::addHook("setting_bloc", "wireRelay_plugin_setting_page"); //Lie wireRelay_plugin_setting_menu au menu de réglages Plugin::addHook("setting_menu", "wireRelay_plugin_setting_menu"); //Lie wirerelay_plugin_action a la page d'action qui perme d'effecuer des actionx ajax ou ne demdnant pas de retour visuels Plugin::addHook("action_post_case", "wirerelay_plugin_action"); //Lie wirerelay_plugin_vocal_command a la gestion de commandes vocales proposées par yana Plugin::addHook("vocal_command", "wirerelay_plugin_vocal_command"); //Lie wireRelay_plugin_widget aux widgets de la dashboard Plugin::addHook("widgets", "wireRelay_plugin_widget"); Plugin::addHook("listen", "wireRelay_plugin_listen");
system($cmd, $out); usleep($wireRelay->getPulse()); //TODO - remplacer par Gpio::write($wireRelay->getPin(),0); $cmd = '/usr/local/bin/gpio write ' . $wireRelay->getPin() . ' 0'; Functions::log('Launch system command : ' . $cmd); system($cmd, $out); } //TODO change bdd state if (!isset($_['webservice'])) { header('location:index.php?module=room&id=' . $wireRelay->getRoom()); } else { $affirmations = array('A vos ordres!', 'Bien!', 'Oui commandant!', 'Avec plaisir!', 'J\'aime vous obéir!', 'Avec plaisir!', 'Certainement!', 'Je fais ça sans tarder!', 'Avec plaisir!', 'Oui chef!'); $affirmation = $affirmations[rand(0, count($affirmations) - 1)]; $response = array('responses' => array(array('type' => 'talk', 'sentence' => $affirmation))); $json = json_encode($response); echo $json == '[]' ? '{}' : $json; } } else { $response = array('responses' => array(array('type' => 'talk', 'sentence' => 'Je ne vous connais pas, je refuse de faire ça!'))); echo json_encode($response); } break; } } Plugin::addCss("/css/style.css"); Plugin::addHook("action_post_case", "wireRelay_action_wireRelay"); Plugin::addHook("node_display", "wireRelay_display"); Plugin::addHook("setting_bloc", "wireRelay_plugin_setting_page"); Plugin::addHook("setting_menu", "wireRelay_plugin_setting_menu"); Plugin::addHook("vocal_command", "wireRelay_vocal_command");
,this);"><i class="fa fa-times"></i></div> </td> </td> </tr> <?php } ?> </table> </fieldset> </div> <?php } } function ipcam_plugin_setting_menu() { global $_; echo '<li ' . (isset($_['section']) && $_['section'] == 'ipcam' ? 'class="active"' : '') . '><a href="setting.php?section=ipcam"><i class="fa fa-angle-right"></i> Caméra IP</a></li>'; } function ipcam_plugin_widget(&$widgets) { $widgets[] = array('uid' => 'dash_ipcam', 'icon' => 'fa fa-video-camera', 'label' => 'Camera', 'background' => '#C511D6', 'color' => '#fffffff', 'onLoad' => 'action.php?action=ipcam_load_widget', 'onEdit' => 'action.php?action=ipcam_edit_widget', 'onSave' => 'action.php?action=ipcam_save_widget'); } Plugin::addJs("/js/main.js"); //Lie wireRelay_plugin_setting_page a la zone réglages Plugin::addHook("setting_bloc", "ipcam_plugin_setting_page"); //Lie wireRelay_plugin_setting_menu au menu de réglages Plugin::addHook("setting_menu", "ipcam_plugin_setting_menu"); Plugin::addHook("action_post_case", "ipcam_action"); Plugin::addHook("widgets", "ipcam_plugin_widget");
} else { $r = @unlink($folder . "/" . $file); if ($r) { $infos['nb_files']++; } else { $infos['return'] = false; return $infos; } } } closedir($handle); return $infos; } function delcache_plugin_setting_link(&$feed) { echo '<li><a class="toggle" href="action.php?action=delcache" alt="Vider le cache de Leed" title="Vider le cache">Vider le cache</a></li>'; } function delcache_plugin_action(&$_) { if ($_['action'] == 'delcache') { $myUser = isset($_SESSION['currentUser']) ? unserialize($_SESSION['currentUser']) : false; if ($myUser == false) { exit('Vous devez vous connecter pour cette action.'); } clear_folder("cache/"); echo "<script type='text/javascript'>\n if (window.confirm('Le cache a été vidé')) {\n window.location.href='index.php';\n }\n </script>"; } } Plugin::addHook('setting_post_link', 'delcache_plugin_setting_link'); Plugin::addHook("action_post_case", "delcache_plugin_action");
if ($myUser->getLogin() . '.log' == $value) { echo '<option value="' . $value . '" selected>' . $value . '</option>'; } else { echo '<option value="' . $value . '">' . $value . '</option>'; } } } } } echo ' </select> <button type="submit">Afficher</button> </form>'; } } if (!isset($fileLog)) { $fileLog = $dir . '/' . $myUser->getLogin() . '.log'; } if (isset($_POST['plugin_leedLogSync_file'])) { echo _t('P_LOGSYNC_SHOW_FILE_TITLE', array($fileLog)); if (file_exists($fileLog)) { print_r(file_get_contents($fileLog)); } else { echo _t('P_LOGSYNC_SHOW_FILE_ERR', array($fileLog)); } } echo '</section>'; } // Ajout de la fonction au Hook situé avant l'affichage des évenements Plugin::addHook("setting_post_link", "leedLogSync_plugin_AddLink"); Plugin::addHook("setting_post_section", "leedLogSync_plugin_AddForm");
<?php } } } ?> </table> <br/> <?php } } ?> </div> <?php } else { header('location:index.php?connexion=ko'); } } } Plugin::addJs('/js/main.js', true); Plugin::addHook("setting_menu", "domoticz_plugin_menu"); Plugin::addHook("setting_bloc", "domoticz_plugin_page"); Plugin::addHook("preference_menu", "domoticz_plugin_preference_menu"); Plugin::addHook("preference_content", "domoticz_plugin_preference_page"); Plugin::addHook("widgets", "domoticz_widget_plugin_menu"); Plugin::addHook("action_post_case", "domoticz_action"); Plugin::addHook("vocal_command", "domoticz_vocal_command");
$config->getAll(); return $config->get('toggleEventContent_default'); } // Lecture des paramètres de configuration $FS_config = new Configuration(); $FS_config->getAll(); // Insertion du bouton 'Haut' // si l'affichage du contenu de l'article est demandé if ($FS_config->get('articleDisplayContent') == '1' or $FS_config->get('articleDisplayMode') != '') { Plugin::addHook("event_pre_top_options", "FS_toggleEventContent_AddButton"); } // Insertion du bouton 'Bas' // si l'affichage du contenu de l'article * entier * est demandé if (($FS_config->get('articleDisplayContent') == '1' or $FS_config->get('articleDisplayMode') != '') and $FS_config->get('articleView') != 'partial') { Plugin::addHook("event_pre_bottom_options", "FS_toggleEventContent_AddButton"); } // Restriction sur la configuration des plugins // Issue: https://github.com/ldleman/Leed-market/issues/79 $myUser = isset($_SESSION['currentUser']) ? unserialize($_SESSION['currentUser']) : false; if ($myUser != false) { // Insertion du lien dans le menu de gestion Plugin::addHook("setting_post_link", "FS_toggleEventContent_SettingLink"); // Affichage du menu de gestion Plugin::addHook("setting_post_section", "FS_toggleEventContent_SettingForm"); // Mise à jour du choix de l'affichage Plugin::addHook("action_post_case", "toggleEventContent_Update"); // Execution du choix : insertion ou non du CSS Plugin::addHook("index_pre_treatment", "FS_toggleEventContent_PreTest"); } // Insertion du javascript Plugin::addJs("/js/main.js");
<td class="leedStats_border leedStats_textright">' . $data['nbFavorite'] . '</td> </tr> '; } echo '</table> </div>'; } echo ' </section> </section> '; } function short_name($str, $limit) { // Make sure a small or negative limit doesn't cause a negative length for substr(). if ($limit < 3) { $limit = 3; } // Now truncate the string if it is over the limit. if (strlen($str) > $limit) { return substr($str, 0, $limit - 3) . '...'; } else { return $str; } } // Ajout de la fonction au Hook situé avant l'affichage des évenements $myUser = isset($_SESSION['currentUser']) ? unserialize($_SESSION['currentUser']) : false; if ($myUser != false) { Plugin::addHook('setting_post_link', 'leedStats_plugin_setting_link'); Plugin::addHook('setting_post_section', 'leedStats_plugin_setting_bloc'); }
Et enfin<br/> <code> sudo chown -R www-data:www-data /var/www/yana-server/plugins </code><br/> Redémarrez et c'est ok :) </p> </div> </div> </div> <?php } } function camera_action_camera() { global $_, $conf; switch ($_['action']) { case 'camera_refresh': $absolute_path = getcwd() . "/plugins/camera/"; system('raspistill -hf -w 400 -h 400 -o ' . $absolute_path . 'view.jpg'); header('location:index.php?module=camera'); break; } } Plugin::addJs('/js/main.js'); Plugin::addHook("action_post_case", "camera_action_camera"); Plugin::addHook("menubar_pre_home", "camera_plugin_menu"); Plugin::addHook("home", "camera_plugin_page");
} ?> <tr> <td colspan="3"><div class="btn" onclick="plugin_vocalinfo_save();">Enregistrer</div></td> </tr> </table> </div> <?php } else { ?> <div id="main" class="wrapper clearfix"> <article> <h3>Vous devez être connecté</h3> </article> </div> <?php } } } Plugin::addJs('/js/jquery.dashboard.js', true); Plugin::addJs('/js/main.js', true); Plugin::addCss('/css/jquery.dashboard.css', true); Plugin::addHook("home", "dashboard_plugin_home"); Plugin::addHook("action_post_case", "dashboard_plugin_actions"); Plugin::addHook("preference_menu", "dashboard_plugin_preference_menu"); Plugin::addHook("preference_content", "dashboard_plugin_preference_page");
if ($myUser->can('room', $right_toverify)) { $room = new Room(); if ($right_toverify == "u") { $room = $room->load(array("id" => $_['id'])); } $room->setName($_['nameRoom']); $room->setDescription($_['descriptionRoom']); $room->save(); header('location:setting.php?section=room'); } else { header('location:setting.php?section=room&error=Vous n\'avez pas le droit de faire ça!'); } break; case 'room_delete_room': if ($myUser->can('room', 'd')) { $roomManager = new Room(); $roomManager->delete(array('id' => $_['id'])); header('location:setting.php?section=room'); } else { header('location:setting.php?section=room&error=Vous n\'avez pas le droit de faire ça!'); } break; } } Plugin::addCss("/css/style.css"); Plugin::addHook("setting_menu", "room_plugin_setting_menu"); Plugin::addHook("setting_bloc", "room_plugin_setting_page"); Plugin::addHook("action_post_case", "room_action_room"); Plugin::addHook("menubar_pre_home", "room_plugin_menu"); Plugin::addHook("home", "room_plugin_page");
function itDoesntAllowToListenSameHookSeveralTimes() { $this->expectException(); $plugin = new Plugin(); $plugin->addHook('bla'); $plugin->addHook('bla'); }
?> " placeholder="Votre ville"> <span id="weather_query" class="btn">Chercher</span> <br/><br/><label>Votre Identifiant WOEID</label> <input type="text" class="input-large" name="woeid" value="<?php echo $conf->get('plugin_vocalinfo_woeid'); ?> " placeholder="Votre WOEID"> <button type="submit" class="btn">Sauvegarder</button> </form> </div> <?php } else { ?> <div id="main" class="wrapper clearfix"> <article> <h3>Vous devez être connecté</h3> </article> </div> <?php } } } Plugin::addHook("preference_menu", "vocalinfo_plugin_preference_menu"); Plugin::addHook("preference_content", "vocalinfo_plugin_preference_page"); Plugin::addHook("get_event", "vocalinfo_event"); Plugin::addHook("action_post_case", "vocalinfo_action"); Plugin::addHook("vocal_command", "vocalinfo_vocal_command");
} } } return $result; } function plugin_leedUpdateSource_messageAccueil() { $configurationManager = new Configuration(); $configurationManager->getAll(); // afin de ne pas intéroger cinquante fois par jour et bouffer du temps de réponse, une recherche par jour est suffisante. if ($configurationManager->get('plugin_leedUpdateSource_date') == date('Ymd')) { echo ''; } else { $configurationManager->put('plugin_leedUpdateSource_date', date('Ymd')); $message = plugin_leedUpdateSource_message('plugin_leedUpdateSource_source'); if ($message == '') { $message = plugin_leedUpdateSource_message('plugin_leedUpdateSource_sourcePlugin'); } $message == '' ? $return = '' : ($return = '<aside>Une mise à jour est disponible - <a href="settings.php#leedUpdateSource">Go !!!</a></aside>'); echo $return; } } $myUser = isset($_SESSION['currentUser']) ? unserialize($_SESSION['currentUser']) : false; if ($myUser != false) { if ($myUser->getId() == 1) { // Ajout de la fonction au Hook situé avant l'affichage des évenements Plugin::addHook("setting_post_link", "plugin_leedUpdateSource_AddLink"); Plugin::addHook("setting_post_section", "plugin_leedUpdateSource_AddForm"); Plugin::addHook("menu_post_folder_menu", "plugin_leedUpdateSource_messageAccueil"); } }
?> <div id="main" class="wrapper clearfix"> <article> <h3>Vous devez être connecté</h3> </article> </div> <?php } } } function transmission_plugin_menu() { global $_, $conf; } function transmission_widget_plugin_menu(&$widgets) { $widgets[] = array('uid' => 'transmission_widget_dl', 'icon' => 'fa fa-play-circle-o', 'label' => 'Transmission', 'background' => '#50597B', 'color' => '#fffffff', 'onLoad' => 'action.php?action=transmission_widget_load&bloc=dl', 'onEdit' => 'action.php?action=transmission_widget_edit&bloc=dl', 'onDelete' => 'action.php?action=transmission_widget_delete&bloc=dl'); } function transmission_plugin_page() { global $myUser, $_, $conf; } Plugin::addHook("setting_menu", "transmission_plugin_menu"); Plugin::addHook("setting_bloc", "transmission_plugin_page"); Plugin::addHook("preference_menu", "transmission_plugin_preference_menu"); Plugin::addHook("preference_content", "transmission_plugin_preference_page"); Plugin::addHook("widgets", "transmission_widget_plugin_menu"); Plugin::addHook("action_post_case", "transmission_action"); Plugin::addHook("vocal_command", "transmission_vocal_command");
<?php /* @name Instaleed @author Idleman <*****@*****.**> @link http://blog.idleman.fr @licence CC by nc sa http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ @version 1.0.0 @description Le plugin InstaPaper permet d'afficher les évenements directement sur instapaper lors du clic sur le titre d'un évenement */ function instapaper_plugin_updateTitle(&$events) { foreach ($events as $event) { $event->setLink('http://www.instapaper.com/text?u=' . $event->getLink()); } } // Ajout de la fonction au Hook situé avant l'affichage des évenements Plugin::addHook("index_post_treatment", "instapaper_plugin_updateTitle");