* i18n/L10n review.

* add onPluginVersion()
This commit is contained in:
Siebrand Mazeland
2010-10-02 22:25:32 +02:00
parent 08054e85fe
commit 0f4f6fdb01
7 changed files with 61 additions and 71 deletions

View File

@@ -40,7 +40,6 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
class UserFlagPlugin extends Plugin
{
const REVIEWFLAGS = 'UserFlagPlugin::reviewflags';
@@ -56,7 +55,6 @@ class UserFlagPlugin extends Plugin
*
* @return boolean hook return
*/
function onCheckSchema()
{
$schema = Schema::get();
@@ -83,7 +81,6 @@ class UserFlagPlugin extends Plugin
*
* @return boolean hook return
*/
function onRouterInitialized($m)
{
$m->connect('main/flag/profile', array('action' => 'flagprofile'));
@@ -99,7 +96,6 @@ class UserFlagPlugin extends Plugin
*
* @return boolean hook return
*/
function onAutoload($cls)
{
switch (strtolower($cls))
@@ -130,7 +126,6 @@ class UserFlagPlugin extends Plugin
*
* @return boolean hook result
*/
function onEndProfilePageActionsElements(&$action, $profile)
{
$user = common_current_user();
@@ -140,6 +135,8 @@ class UserFlagPlugin extends Plugin
$action->elementStart('li', 'entity_flag');
if (User_flag_profile::exists($profile->id, $user->id)) {
// @todo FIXME: Add a title explaining what 'flagged' means?
// TRANS: Message added to a profile if it has been flagged for review.
$action->element('p', 'flagged', _('Flagged'));
} else {
$form = new FlagProfileForm($action, $profile,
@@ -161,7 +158,6 @@ class UserFlagPlugin extends Plugin
*
* @return boolean hook result
*/
function onEndProfileListItemActionElements($item)
{
$user = common_current_user();
@@ -189,7 +185,6 @@ class UserFlagPlugin extends Plugin
*
* @return boolean hook result
*/
function onEndShowScripts($action)
{
$action->inlineScript('if ($(".form_entity_flag").length > 0) { '.
@@ -210,7 +205,6 @@ class UserFlagPlugin extends Plugin
*
* @return boolean hook result
*/
function onUserRightsCheck($user, $right, &$result)
{
switch ($right) {
@@ -233,7 +227,6 @@ class UserFlagPlugin extends Plugin
*
* @return boolean hook result
*/
function onEndBlockProfile($user, $profile)
{
if ($this->flagOnBlock && !User_flag_profile::exists($profile->id,
@@ -255,7 +248,6 @@ class UserFlagPlugin extends Plugin
*
* @return boolean hook result
*/
function onProfileDeleteRelated($profile, &$related)
{
$related[] = 'user_flag_profile';
@@ -272,10 +264,33 @@ class UserFlagPlugin extends Plugin
*
* @return boolean hook result
*/
function onUserDeleteRelated($user, &$related)
{
$related[] = 'user_flag_profile';
return true;
}
/**
* Provide plugin version information.
*
* This data is used when showing the version page.
*
* @param array &$versions array of version data arrays; see EVENTS.txt
*
* @return boolean hook value
*/
function onPluginVersion(&$versions)
{
$url = 'http://status.net/wiki/Plugin:UserFlag';
$versions[] = array('name' => 'UserFlag',
'version' => STATUSNET_VERSION,
'author' => 'Evan Prodromou',
'homepage' => $url,
'rawdescription' =>
// TRANS: Plugin description.
_m('This plugin allows flagging of profiles for review and reviewing flagged profiles.'));
return true;
}
}