Version 4.7.0
This commit is contained in:
1 parent
517a5e1f70
commit
8ba7d43898
1933 files changed
+65613
-11332
No files matched your search
+48
-1
@@ -106,7 +106,11 @@ class _Log extends \IPS\Patterns\ActiveRecord
|
||||
$log->url = \IPS\Request::i()->url();
|
||||
$log->member_id = \IPS\Member::loggedIn()->member_id ?: 0;
|
||||
}
|
||||
|
||||
|
||||
if ( \IPS\Application::load('core')->long_version >= 106149 ) #Column was added in 106149
|
||||
{
|
||||
$log->loaded_hooks = json_encode( \IPS\IPS::$loadedHooks );
|
||||
}
|
||||
$log->category = $category;
|
||||
$log->save();
|
||||
|
||||
@@ -235,4 +239,47 @@ class _Log extends \IPS\Patterns\ActiveRecord
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Loaded Hooks
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_loaded_hooks()
|
||||
{
|
||||
return ( $this->_data['loaded_hooks'] ) ? json_decode( $this->_data['loaded_hooks'] ) : array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Hook details
|
||||
*
|
||||
* @param string $file filename of loaded hook
|
||||
* @return array
|
||||
*/
|
||||
public static function hookDetails( $file )
|
||||
{
|
||||
$bits = explode( '/', $file );
|
||||
|
||||
$return = array();
|
||||
|
||||
/* Plugins are always third party */
|
||||
if ( $bits[0] === 'plugins' )
|
||||
{
|
||||
$plugin = NULL;
|
||||
try
|
||||
{
|
||||
$plugin = \IPS\Plugin::getPluginFromPath( "/" . $file );
|
||||
}
|
||||
catch ( \Exception $e ) {}
|
||||
|
||||
$return['type'] = 'plugin';
|
||||
$return['id'] = ( $plugin ) ? $plugin->id : NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
$return['type'] = 'app';
|
||||
$return['id'] = $bits[1];
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user