summaryrefslogtreecommitdiff
path: root/plugins/UserFlag/UserFlagPlugin.php
diff options
context:
space:
mode:
authorSiebrand Mazeland <s.mazeland@xs4all.nl>2010-10-02 22:25:32 +0200
committerSiebrand Mazeland <s.mazeland@xs4all.nl>2010-10-02 22:25:32 +0200
commit0f4f6fdb0130aacb0d8c7aa04ddfb76baa1b9e6b (patch)
tree90936c1d8161b9ee64cd7473f831647cfd4f5ee8 /plugins/UserFlag/UserFlagPlugin.php
parent08054e85fe4b47b6d28acb83b4c251be92f12316 (diff)
* i18n/L10n review.
* add onPluginVersion()
Diffstat (limited to 'plugins/UserFlag/UserFlagPlugin.php')
-rw-r--r--plugins/UserFlag/UserFlagPlugin.php37
1 files changed, 26 insertions, 11 deletions
diff --git a/plugins/UserFlag/UserFlagPlugin.php b/plugins/UserFlag/UserFlagPlugin.php
index ae3dfe036..e6ad3e37d 100644
--- a/plugins/UserFlag/UserFlagPlugin.php
+++ b/plugins/UserFlag/UserFlagPlugin.php
@@ -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;
+ }
}