diff --git a/dist/prober.php b/dist/prober.php index bde3a025..914fa4a5 100644 --- a/dist/prober.php +++ b/dist/prober.php @@ -310,8 +310,8 @@ function fillNetworkStats(data) { HTML; } } -namespace InnStudio\Prober\Events; class EventsApi { private static $PRIORITY_ID = 'priority'; private static $CALLBACK_ID = 'callback'; private static $events = array(); public static function on($name, $callback, $priority = 10) { if ( ! isset(self::$events[$name])) { self::$events[$name] = array(); } self::$events[$name][] = array( self::$PRIORITY_ID => $priority, self::$CALLBACK_ID => $callback, ); } public static function emit($name, $returns = null) { $events = isset(self::$events[$name]) ? self::$events[$name] : false; if ( ! $events) { return $returns; } $sortArr = \array_map(function ($filter) { return $filter[self::$PRIORITY_ID]; }, $events); \array_multisort( $sortArr, \SORT_ASC, \SORT_NUMERIC, $events ); foreach ($events as $filter) { $args = \func_get_args(); unset($args[0]); $returns = \call_user_func_array($filter[self::$CALLBACK_ID], $args); } return $returns; } } -namespace InnStudio\Prober\MyInfo; use InnStudio\Prober\Events\EventsApi; use InnStudio\Prober\Helper\HelperApi; use InnStudio\Prober\I18n\I18nApi; class MyInfo { private $ID = 'myInfo'; public function __construct() { EventsApi::on('mods', array($this, 'filter'), 900); } public function filter($mods) { $mods[$this->ID] = array( 'title' => I18nApi::_('My information'), 'tinyTitle' => I18nApi::_('Mine'), 'display' => array($this, 'display'), ); return $mods; } public function display() { return \implode('', \array_map(function (array $item) { return << $priority, self::$CALLBACK_ID => $callback, ); } public static function emit() { $args = \func_get_args(); $name = $args[0]; $return = isset($args[1]) ? $args[1] : null; unset($args[0],$args[1]); $events = isset(self::$events[$name]) ? self::$events[$name] : false; if ( ! $events) { return $return; } $sortArr = array(); foreach ($events as $k => $filter) { $sortArr[$k] = $filter[self::$PRIORITY_ID]; } \array_multisort($sortArr, $events); foreach ($events as $filter) { $return = \call_user_func_array($filter[self::$CALLBACK_ID], array($return, $args)); } return $return; } } +namespace InnStudio\Prober\MyInfo; use InnStudio\Prober\Events\EventsApi; use InnStudio\Prober\Helper\HelperApi; use InnStudio\Prober\I18n\I18nApi; class MyInfo { private $ID = 'myInfo'; public function __construct() { EventsApi::on('mods', array($this, 'filter'), 900); } public function filter(array $mods) { $mods[$this->ID] = array( 'title' => I18nApi::_('My information'), 'tinyTitle' => I18nApi::_('Mine'), 'display' => array($this, 'display'), ); return $mods; } public function display() { return \implode('', \array_map(function (array $item) { return <<
{$item[0]}
{$item[1]}
@@ -522,7 +522,7 @@ function getVersionInfo(data){ HTML; } return $content; } } -namespace InnStudio\Prober\Config; class ConfigApi { public static $APP_VERSION = '1.7.3'; public static $APP_NAME = 'X Prober'; public static $APP_URL = 'https://github.com/kmvan/x-prober'; public static $AUTHOR_URL = 'https://inn-studio.com/prober'; public static $UPDATE_PHP_URL = 'https://raw.githubusercontent.com/kmvan/x-prober/master/dist/prober.php'; public static $AUTHOR_NAME = 'INN STUDIO'; public static $CHANGELOG_URL = 'https://raw.githubusercontent.com/kmvan/x-prober/master/CHANGELOG.md'; public static $LATEST_PHP_STABLE_VERSION = '7.2.12'; } +namespace InnStudio\Prober\Config; class ConfigApi { public static $APP_VERSION = '1.7.4'; public static $APP_NAME = 'X Prober'; public static $APP_URL = 'https://github.com/kmvan/x-prober'; public static $AUTHOR_URL = 'https://inn-studio.com/prober'; public static $UPDATE_PHP_URL = 'https://raw.githubusercontent.com/kmvan/x-prober/master/dist/prober.php'; public static $AUTHOR_NAME = 'INN STUDIO'; public static $CHANGELOG_URL = 'https://raw.githubusercontent.com/kmvan/x-prober/master/CHANGELOG.md'; public static $LATEST_PHP_STABLE_VERSION = '7.2.12'; } namespace InnStudio\Prober\Style; use InnStudio\Prober\Events\EventsApi; class Style { private $ID = 'style'; public function __construct() { EventsApi::on('style', array($this, 'filter')); } public function filter() { $this->styleProgress(); $this->styleGlobal(); $this->stylePoiContainer(); $this->stylePoiGrid(); $this->styleTitle(); } private function styleTitle() { ?>