本文整理汇总了PHP中Plugin::addHook方法的典型用法代码示例。如果您正苦于以下问题:PHP Plugin::addHook方法的具体用法?PHP Plugin::addHook怎么用?PHP Plugin::addHook使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugin
的用法示例。
在下文中一共展示了Plugin::addHook方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: olb_parse_link
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");
示例2: Effect
$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");
示例3: array
<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'));
示例4:
<?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");
示例5: api_plugin_setting_link
// @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');
}
示例6:
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");
示例7: plugin_filemanager_plugin_dashboard
<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");
示例8: _t
<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");
示例9:
</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");
示例10: title
<?php
/*
@name DisplayPictureTitle
@author Kvnco <kvnco@laposte.net>
@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");
示例11: squelette_plugin_action
</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");
示例12: header
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");
示例13: ng_plugin_button
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");
示例14:
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");
示例15: wireRelay_plugin_setting_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");