123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <?php
- if (!defined('STATUSNET')) {
- exit(1);
- }
- class ExtendedProfilePlugin extends Plugin
- {
- const PLUGIN_VERSION = '2.0.0';
- function onPluginVersion(array &$versions)
- {
- $versions[] = array(
- 'name' => 'ExtendedProfile',
- 'version' => self::PLUGIN_VERSION,
- 'author' => 'Brion Vibber, Samantha Doherty, Zach Copley',
- 'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/ExtendedProfile',
-
- 'rawdescription' => _m('UI extensions for additional profile fields.')
- );
- return true;
- }
-
- public function onStartInitializeRouter(URLMapper $m)
- {
- $m->connect(
- ':nickname/detail',
- array('action' => 'profiledetail'),
- array('nickname' => Nickname::DISPLAY_FMT)
- );
- $m->connect(
- '/settings/profile/finduser',
- array('action' => 'Userautocomplete')
- );
- $m->connect(
- 'settings/profile/detail',
- array('action' => 'profiledetailsettings')
- );
- return true;
- }
- function onCheckSchema()
- {
- $schema = Schema::get();
- $schema->ensureTable('profile_detail', Profile_detail::schemaDef());
- return true;
- }
- 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, 'class' => 'profiledetail'), _m('More details...'));
- }
- }
- }
|