1
0
mirror of https://github.com/e107inc/e107.git synced 2025-10-17 15:56:25 +02:00

New e_event.php v2.x specification. (e_module is no longer required for registering events.) Example added to e107_plugins/_blank

This commit is contained in:
Cameron
2016-04-06 19:43:31 -07:00
parent 8143469f5c
commit 6d0aa7cdd9
4 changed files with 82 additions and 5 deletions

View File

@@ -0,0 +1,51 @@
<?php
/*
* e107 website system
*
* Copyright (C) 2008-2013 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* XXX HIGHLY EXPERIMENTAL AND SUBJECT TO CHANGE WITHOUT NOTICE.
*/
if (!defined('e107_INIT')) { exit; }
class _blank_event // plugin-folder + '_event'
{
/**
* Configure functions/methods to run when specific e107 events are triggered.
* For a list of events, please visit: http://e107.org/developer-manual/classes-and-methods#events
* Developers can trigger their own events using: e107::getEvent()->trigger('plugin_event',$array);
* Where 'plugin' is the folder of their plugin and 'event' is a unique name of the event.
* $array is data which is sent to the triggered function. eg. myfunction($array) in the example below.
*
* @return array
*/
function config()
{
$event = array();
$event[] = array(
'name' => "login", // when this is triggered... (see http://e107.org/developer-manual/classes-and-methods#events)
'function' => "myfunction", // ..run this function (see below).
);
return $event;
}
function myfunction($data) // the method to run.
{
print_a($data);
}
} //end class

View File

@@ -107,7 +107,7 @@ class social_shortcodes extends e_shortcode
if($data['href'] != '')
{
$text .= '<a rel="external" href="'.$data['href'].'" data-tooltip-position="'.$tooltipPos.'" class="'.$tooltip.' social-icon social-'.$id.'" title="'.$data['title'].'"><span class="fa fa-'.$id.' '.$class.'"></span></a>';
$text .= '<a rel="external" href="'.$data['href'].'" data-tooltip-position="'.$tooltipPos.'" class="'.$tooltip.' social-icon social-'.$id.'" title="'.$data['title'].'"><span class="fa fa-fw fa-'.$id.' '.$class.'"></span></a>';
$text .= "\n";
}
}
@@ -288,7 +288,7 @@ class social_shortcodes extends e_shortcode
$opt[$k] = "<a class='".$tooltip." btn ".$butSize." btn-default social-share' target='_blank' title='".$val["title"]."' href='".$shareUrl."'>".$tp->toIcon($val["icon"])."</a>";
$opt[$k] = "<a class='".$tooltip." btn ".$butSize." btn-default social-share' target='_blank' title='".$val["title"]."' href='".$shareUrl."'>".$tp->toIcon($val["icon"], array('fw'=>1))."</a>";
}
// Show only Email, Facebook, Twitter and Google.