forked from GNUsocial/gnu-social
show profile flag form when showing profile list or profile page
This commit is contained in:
parent
7701bc2e56
commit
f72857d73e
@ -108,6 +108,9 @@ class UserFlagPlugin extends Plugin
|
|||||||
case 'AdminprofileflagAction':
|
case 'AdminprofileflagAction':
|
||||||
require_once(INSTALLDIR.'/plugins/UserFlag/' . strtolower(mb_substr($cls, 0, -6)) . '.php');
|
require_once(INSTALLDIR.'/plugins/UserFlag/' . strtolower(mb_substr($cls, 0, -6)) . '.php');
|
||||||
return false;
|
return false;
|
||||||
|
case 'FlagProfileForm':
|
||||||
|
require_once(INSTALLDIR.'/plugins/UserFlag/' . strtolower($cls . '.php'));
|
||||||
|
return false;
|
||||||
case 'User_flag_notice':
|
case 'User_flag_notice':
|
||||||
case 'Notice_flag':
|
case 'Notice_flag':
|
||||||
case 'User_flag_profile':
|
case 'User_flag_profile':
|
||||||
@ -118,4 +121,32 @@ class UserFlagPlugin extends Plugin
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onEndProfilePageActionsElements(&$action, $profile)
|
||||||
|
{
|
||||||
|
$user = common_current_user();
|
||||||
|
|
||||||
|
if (!empty($user)) {
|
||||||
|
|
||||||
|
$form = new FlagProfileForm($action, $profile);
|
||||||
|
|
||||||
|
$form->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onEndProfileListItemActionElements($item)
|
||||||
|
{
|
||||||
|
$user = common_current_user();
|
||||||
|
|
||||||
|
if (!empty($user)) {
|
||||||
|
|
||||||
|
$form = new FlagProfileForm($item->action, $item->profile);
|
||||||
|
|
||||||
|
$form->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user