X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FExtendedProfile%2FExtendedProfilePlugin.php;h=a1717c897e9d569a58657b33bc94e77346b28370;hb=bc030da3208143afcb869ce4611cb39d8d465fa6;hp=d1572ce9fdcc3bd286ad7845ce43fe4fbd30df6b;hpb=41420449f8316bd461a5136df25db46c045d0757;p=quix0rs-gnu-social.git diff --git a/plugins/ExtendedProfile/ExtendedProfilePlugin.php b/plugins/ExtendedProfile/ExtendedProfilePlugin.php index d1572ce9fd..a1717c897e 100644 --- a/plugins/ExtendedProfile/ExtendedProfilePlugin.php +++ b/plugins/ExtendedProfile/ExtendedProfilePlugin.php @@ -29,61 +29,30 @@ if (!defined('STATUSNET')) { */ class ExtendedProfilePlugin extends Plugin { - - function onPluginVersion(&$versions) + function onPluginVersion(array &$versions) { - $versions[] = array('name' => 'ExtendedProfile', - 'version' => STATUSNET_VERSION, - 'author' => 'Brion Vibber', - 'homepage' => 'http://status.net/wiki/Plugin:ExtendedProfile', - 'rawdescription' => - _m('UI extensions for additional profile fields.')); + $versions[] = array( + 'name' => 'ExtendedProfile', + 'version' => GNUSOCIAL_VERSION, + 'author' => 'Brion Vibber, Samantha Doherty, Zach Copley', + 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/ExtendedProfile', + // TRANS: Plugin description. + 'rawdescription' => _m('UI extensions for additional profile fields.') + ); return true; } - /** - * Autoloader - * - * Loads our classes if they're requested. - * - * @param string $cls Class requested - * - * @return boolean hook return - */ - function onAutoload($cls) - { - $lower = strtolower($cls); - - switch ($lower) - { - case 'extendedprofile': - case 'extendedprofilewidget': - case 'profiledetailaction': - case 'profiledetailsettingsaction': - require_once dirname(__FILE__) . '/' . $lower . '.php'; - return false; - case 'userautocompleteaction': - require_once dirname(__FILE__) . '/action/' . mb_substr($lower, 0, -6) . '.php'; - return false; - case 'profile_detail': - require_once dirname(__FILE__) . '/' . ucfirst($lower) . '.php'; - return false; - default: - return true; - } - } - /** * Add paths to the router table * * Hook for RouterInitialized event. * - * @param Net_URL_Mapper $m URL mapper + * @param URLMapper $m URL mapper * * @return boolean hook return */ - function onStartInitializeRouter($m) + public function onStartInitializeRouter(URLMapper $m) { $m->connect( ':nickname/detail', @@ -110,22 +79,12 @@ class ExtendedProfilePlugin extends Plugin return true; } - function onEndAccountSettingsProfileMenuItem($widget, $menu) - { - // TRANS: Link title attribute in user account settings menu. - $title = _('Change additional profile settings'); - // TRANS: Link description in user account settings menu. - $widget->showMenuItem('profiledetailsettings',_m('Details'),$title); - return true; - } - - function onEndProfilePageProfileElements(HTMLOutputter $out, Profile $profile) { - $user = User::staticGet('id', $profile->id); + function onEndShowAccountProfileBlock(HTMLOutputter $out, Profile $profile) { + $user = User::getKV('id', $profile->id); if ($user) { $url = common_local_url('profiledetail', array('nickname' => $user->nickname)); - $out->element('a', array('href' => $url), _m('More details...')); + // TRANS: Link text on user profile page leading to extended profile page. + $out->element('a', array('href' => $url, 'class' => 'profiledetail'), _m('More details...')); } - return; } - }