return true;
}
- /**
- * Load related modules when needed
- *
- * @param string $cls Name of the class to be loaded
- *
- * @return boolean hook value; true means continue processing, false means stop.
- */
-
- function onAutoload($cls)
- {
- $dir = dirname(__FILE__);
-
- switch ($cls)
- {
- case 'ModLog':
- include_once $dir . '/'.$cls.'.php';
- return false;
- default:
- return true;
- }
- }
-
- function onEndGrantRole($profile, $role)
+ function onEndGrantRole(Profile $profile, $role)
{
$modlog = new ModLog();
$modlog->profile_id = $profile->id;
$cur = common_current_user();
-
+
if (!empty($cur)) {
$modlog->moderator_id = $cur->id;
}
return true;
}
- function onEndRevokeRole($profile, $role)
+ function onEndRevokeRole(Profile $profile, $role)
{
$modlog = new ModLog();
$modlog->profile_id = $profile->id;
$cur = common_current_user();
-
+
if (!empty($cur)) {
$modlog->moderator_id = $cur->id;
}
return true;
}
- function onEndShowSections($action)
+ function onEndShowSections(Action $action)
{
if ($action->arg('action') != 'showstream') {
return true;
$action->element('td', null, sprintf(($ml->is_grant) ? _('+%s') : _('-%s'), $ml->role));
$action->elementStart('td');
if ($ml->moderator_id) {
- $mod = Profile::staticGet('id', $ml->moderator_id);
+ $mod = Profile::getKV('id', $ml->moderator_id);
if (empty($mod)) {
$action->text(_('[unknown]'));
} else {
}
}
- function onUserRightsCheck($profile, $right, &$result) {
+ function onUserRightsCheck(Profile $profile, $right, &$result) {
switch ($right) {
case self::VIEWMODLOG:
$result = ($profile->hasRole(Profile_role::MODERATOR) || $profile->hasRole('modhelper'));
}
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$versions[] = array('name' => 'ModLog',
- 'version' => STATUSNET_VERSION,
+ 'version' => GNUSOCIAL_VERSION,
'author' => 'Evan Prodromou',
'homepage' => 'http://status.net/wiki/Plugin:ModLog',
'description' =>