Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gnu-social
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
194
Issues
194
List
Boards
Labels
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gnu.io
gnu-social
Commits
3022d711
Commit
3022d711
authored
Apr 08, 2011
by
Zach Copley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some more events to aside profile blocks and rework a bit
parent
8335d234
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
22 deletions
+79
-22
EVENTS.txt
EVENTS.txt
+16
-0
lib/accountprofileblock.php
lib/accountprofileblock.php
+11
-0
lib/groupprofileblock.php
lib/groupprofileblock.php
+10
-0
lib/profileblock.php
lib/profileblock.php
+41
-20
plugins/ExtendedProfile/ExtendedProfilePlugin.php
plugins/ExtendedProfile/ExtendedProfilePlugin.php
+1
-2
No files found.
EVENTS.txt
View file @
3022d711
...
@@ -1147,3 +1147,19 @@ StartDefaultLocalNav: When showing the default local nav
...
@@ -1147,3 +1147,19 @@ StartDefaultLocalNav: When showing the default local nav
EndDefaultLocalNav: When showing the default local nav
EndDefaultLocalNav: When showing the default local nav
- $menu: the menu
- $menu: the menu
- $user: current user
- $user: current user
StartShowAccountProfileBlock: When showing the profile block for an account
- $out: XMLOutputter to append custom output
- $profile: the profile being shown
EndShowAccountProfileBlock: After showing the profile block for an account
- $out: XMLOutputter to append custom output
- $profile: the profile being shown
StartShowGroupProfileBlock: When showing the profile block for a group
- $out: XMLOutputter to append custom output
- $profile: the profile being shown
EndShowGroupProfileBlock: After showing showing the profile block for a group
- $out: XMLOutputter to append custom output
- $group: the group being shown
\ No newline at end of file
lib/accountprofileblock.php
View file @
3022d711
...
@@ -289,4 +289,15 @@ class AccountProfileBlock extends ProfileBlock
...
@@ -289,4 +289,15 @@ class AccountProfileBlock extends ProfileBlock
// TRANS: Link text for link that will subscribe to a remote profile.
// TRANS: Link text for link that will subscribe to a remote profile.
_m
(
'BUTTON'
,
'Subscribe'
));
_m
(
'BUTTON'
,
'Subscribe'
));
}
}
function
show
()
{
common_debug
(
"show"
);
$this
->
out
->
elementStart
(
'div'
,
'account_profile_block section'
);
if
(
Event
::
handle
(
'StartShowAccountProfileBlock'
,
array
(
$this
->
out
,
$this
->
profile
)))
{
parent
::
show
();
Event
::
handle
(
'EndShowAccountProfileBlock'
,
array
(
$this
->
out
,
$this
->
profile
));
}
$this
->
out
->
elementEnd
(
'div'
);
}
}
}
lib/groupprofileblock.php
View file @
3022d711
...
@@ -123,4 +123,14 @@ class GroupProfileBlock extends ProfileBlock
...
@@ -123,4 +123,14 @@ class GroupProfileBlock extends ProfileBlock
$this
->
out
->
elementEnd
(
'ul'
);
$this
->
out
->
elementEnd
(
'ul'
);
$this
->
out
->
elementEnd
(
'div'
);
$this
->
out
->
elementEnd
(
'div'
);
}
}
function
show
()
{
$this
->
out
->
elementStart
(
'div'
,
'group_profile_block section'
);
if
(
Event
::
handle
(
'StartShowGroupProfileBlock'
,
array
(
$this
->
out
,
$this
->
group
)))
{
parent
::
show
();
Event
::
handle
(
'EndShowGroupProfileBlock'
,
array
(
$this
->
out
,
$this
->
group
));
}
$this
->
out
->
elementEnd
(
'div'
);
}
}
}
lib/profileblock.php
View file @
3022d711
...
@@ -56,16 +56,32 @@ abstract class ProfileBlock extends Widget
...
@@ -56,16 +56,32 @@ abstract class ProfileBlock extends Widget
function
show
()
function
show
()
{
{
$this
->
out
->
elementStart
(
'div'
,
'profile_block section'
);
$this
->
showActions
();
$this
->
showAvatar
();
$this
->
showName
();
$this
->
showLocation
();
$this
->
showHomepage
();
$this
->
showDescription
();
}
function
showAvatar
()
{
$size
=
$this
->
avatarSize
();
$size
=
$this
->
avatarSize
();
$this
->
out
->
element
(
'img'
,
array
(
'src'
=>
$this
->
avatar
(),
$this
->
out
->
element
(
'class'
=>
'profile_block_avatar'
,
'img'
,
'alt'
=>
$this
->
name
(),
array
(
'width'
=>
$size
,
'src'
=>
$this
->
avatar
(),
'height'
=>
$size
));
'class'
=>
'ur_face'
,
'alt'
=>
$this
->
name
(),
'width'
=>
$size
,
'height'
=>
$size
)
);
}
function
showName
()
{
$name
=
$this
->
name
();
$name
=
$this
->
name
();
if
(
!
empty
(
$name
))
{
if
(
!
empty
(
$name
))
{
...
@@ -79,30 +95,35 @@ abstract class ProfileBlock extends Widget
...
@@ -79,30 +95,35 @@ abstract class ProfileBlock extends Widget
}
}
$this
->
out
->
elementEnd
(
'p'
);
$this
->
out
->
elementEnd
(
'p'
);
}
}
}
function
showDescription
()
{
$description
=
$this
->
description
();
if
(
!
empty
(
$description
))
{
$this
->
out
->
element
(
'p'
,
'profile_block_description'
,
$description
);
}
}
function
showLocation
()
{
$location
=
$this
->
location
();
$location
=
$this
->
location
();
if
(
!
empty
(
$location
))
{
if
(
!
empty
(
$location
))
{
$this
->
out
->
element
(
'p'
,
'profile_block_location'
,
$location
);
$this
->
out
->
element
(
'p'
,
'profile_block_location'
,
$location
);
}
}
}
$homepage
=
$this
->
homepage
();
function
showHomepage
()
{
if
(
!
empty
(
$homepage
))
{
if
(
!
empty
(
$homepage
))
{
$this
->
out
->
element
(
'a'
,
'profile_block_homepage'
,
$homepage
);
$this
->
out
->
element
(
'a'
,
'profile_block_homepage'
,
$homepage
);
}
}
$description
=
$this
->
description
();
if
(
!
empty
(
$description
))
{
$this
->
out
->
element
(
'p'
,
'profile_block_description'
,
$description
);
}
$this
->
showActions
();
$this
->
out
->
elementEnd
(
'div'
);
}
}
function
avatarSize
()
function
avatarSize
()
...
...
plugins/ExtendedProfile/ExtendedProfilePlugin.php
View file @
3022d711
...
@@ -115,13 +115,12 @@ class ExtendedProfilePlugin extends Plugin
...
@@ -115,13 +115,12 @@ class ExtendedProfilePlugin extends Plugin
return
true
;
return
true
;
}
}
function
on
StartProfilePageActionsSection
(
HTMLOutputter
$out
,
Profile
$profile
)
{
function
on
EndShowAccountProfileBlock
(
HTMLOutputter
$out
,
Profile
$profile
)
{
$user
=
User
::
staticGet
(
'id'
,
$profile
->
id
);
$user
=
User
::
staticGet
(
'id'
,
$profile
->
id
);
if
(
$user
)
{
if
(
$user
)
{
$url
=
common_local_url
(
'profiledetail'
,
array
(
'nickname'
=>
$user
->
nickname
));
$url
=
common_local_url
(
'profiledetail'
,
array
(
'nickname'
=>
$user
->
nickname
));
// TRANS: Link text on user profile page leading to extended profile page.
// TRANS: Link text on user profile page leading to extended profile page.
$out
->
element
(
'a'
,
array
(
'href'
=>
$url
,
'class'
=>
'profiledetail'
),
_m
(
'More details...'
));
$out
->
element
(
'a'
,
array
(
'href'
=>
$url
,
'class'
=>
'profiledetail'
),
_m
(
'More details...'
));
}
}
return
true
;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment