Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
d55f88c2
Commit
d55f88c2
authored
Mar 21, 2016
by
Robert Lyon
Committed by
Gerrit Code Review
Mar 21, 2016
Browse files
Merge "Bug 1544381: Need to move get_homepage_url() out of template"
parents
c4f11934
3df10959
Changes
12
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/group.php
View file @
d55f88c2
...
...
@@ -2084,6 +2084,11 @@ function group_get_associated_groups($userid, $filter='all', $limit=20, $offset=
ORDER BY g1.name'
;
$groups
=
get_records_sql_array
(
$sql
,
$values
,
$offset
,
$limit
);
if
(
$groups
)
{
foreach
(
$groups
as
$group
)
{
$group
->
homeurl
=
group_homepage_url
(
$group
);
}
}
return
array
(
'groups'
=>
$groups
?
$groups
:
array
(),
'count'
=>
$count
);
...
...
@@ -2133,6 +2138,11 @@ function group_get_user_groups($userid=null, $roles=null, $sort=null, $limit=nul
ORDER BY g.name, gm.role = 'admin' DESC, gm.role, g.id"
,
array
(
$loggedinid
,
$userid
)
);
if
(
$groups
)
{
foreach
(
$groups
as
$key
=>
$group
)
{
$group
->
homeurl
=
group_homepage_url
(
$group
);
}
}
$usergroups
[
$userid
]
=
$groups
?
$groups
:
array
();
}
...
...
htdocs/lib/registration.php
View file @
d55f88c2
...
...
@@ -1110,7 +1110,11 @@ function group_stats_table($limit, $offset) {
$result
[
'csv'
]
=
true
;
require_once
(
'group.php'
);
if
(
$groupdata
)
{
foreach
(
$groupdata
as
$group
)
{
$group
->
homeurl
=
group_homepage_url
(
$group
);
}
}
$smarty
=
smarty_core
();
$smarty
->
assign
(
'data'
,
$groupdata
);
$smarty
->
assign
(
'offset'
,
$offset
);
...
...
htdocs/lib/view.php
View file @
d55f88c2
...
...
@@ -5249,6 +5249,7 @@ class View {
else
if
(
!
empty
(
$v
->
group
))
{
$v
->
sharedby
=
$groups
[
$v
->
group
]
->
name
;
$v
->
groupdata
=
$groups
[
$v
->
group
];
$v
->
groupdata
->
homeurl
=
group_homepage_url
(
$v
->
groupdata
);
}
else
if
(
!
empty
(
$v
->
institution
))
{
$v
->
sharedby
=
$institutions
[
$v
->
institution
]
->
displayname
;
...
...
@@ -5566,6 +5567,9 @@ class View {
$results
=
self
::
view_search
(
$search
->
query
,
$search
->
ownerquery
,
null
,
$search
->
copyableby
,
$search
->
limit
,
$search
->
offset
,
true
,
$search
->
sort
,
null
,
true
);
$oldcollid
=
null
;
foreach
(
$results
->
data
as
&
$r
)
{
if
(
!
empty
(
$r
[
'groupdata'
]))
{
$r
[
'groupdata'
]
->
homeurl
=
group_homepage_url
(
$r
[
'groupdata'
],
true
,
true
);
}
if
(
!
empty
(
$search
->
sort
))
{
$collid
=
(
$r
[
'collid'
]
==
$oldcollid
)
?
null
:
$r
[
'collid'
];
}
...
...
htdocs/theme/raw/plugintype/blocktype/groupviews/templates/sharedviews.tpl
View file @
d55f88c2
...
...
@@ -10,7 +10,7 @@
{
if
$view.sharedby
}
<span
class=
"owner inner-link text-small text-midtone"
>
{
if
$view.group
}
<a
href=
"
{
group_homepage_url
(
$view.groupdata
)
}
"
class=
"text-small"
>
<a
href=
"
{
$view.groupdata
->
homeurl
}
"
class=
"text-small"
>
{
$view.sharedby
}
</a>
{
elseif
$view.owner
}
...
...
htdocs/theme/raw/plugintype/blocktype/mygroups/templates/mygroupslist.tpl
View file @
d55f88c2
<div
class=
"list-group"
>
{
foreach
from
=
$items
item
=
item
}
<div
class=
"list-group-item list-group-item-link"
>
<a
href=
"
{
group_homepage_url
(
$item
)
}
"
>
<h5
class=
"text-inline list-group-item-heading"
>
{
$item
->
name
}
</h5>
<a
href=
"
{
$item
->
homeurl
}
"
>
<h5
class=
"text-inline list-group-item-heading"
>
{
$item
->
name
}
</h5>
<span
class=
"text-small text-midtone"
>
(
{
$item
->
roledisplay
}
)
</span>
</a>
</div>
...
...
htdocs/theme/raw/plugintype/blocktype/newviews/templates/newviews.tpl
View file @
d55f88c2
...
...
@@ -9,7 +9,7 @@
{
if
$view.sharedby
}
<div
class=
"groupuserdate text-small"
>
{
if
$view.group
&&
$loggedin
}
<a
href=
"
{
group_homepage_url
(
$view.groupdata
)
}
"
class=
"text-link"
>
<a
href=
"
{
$view.groupdata
->
homeurl
}
"
class=
"text-link"
>
{
$view.sharedby
}
</a>
{
elseif
$view.owner
&&
$loggedin
}
...
...
htdocs/theme/raw/plugintype/blocktype/watchlist/templates/watchlist.tpl
View file @
d55f88c2
...
...
@@ -15,7 +15,7 @@
{
if
$view
->
sharedby
}
<div
class=
"groupuserdate text-small"
>
{
if
$view
->
group
&&
$loggedin
}
<a
class=
"inner-link"
href=
"
{
group_homepage_url
(
$view
->
groupdata
)
}
"
>
{
$view
->
sharedby
}
</a>
<a
class=
"inner-link"
href=
"
{
$view
->
groupdata
->
homeurl
}
"
>
{
$view
->
sharedby
}
</a>
{
elseif
$view
->
owner
&&
$loggedin
}
{
if
$view
->
anonymous
}
{
if
$view
->
staff_or_admin
}
...
...
htdocs/theme/raw/templates/admin/groupstats.tpl
View file @
d55f88c2
{
foreach
from
=
$data
item
=
item
key
=
key
}
<tr
class=
"
{
cycle
values
=
'r0,r1'
}
"
>
<td>
{
$offset
+
$dwoo.foreach.default.iteration
}
</td>
<td><a
href=
"
{
group_homepage_url
(
$item
)
}
"
>
{
$item
->
name
}
</a></td>
<td><a
href=
"
{
$item
->
homeurl
}
"
>
{
$item
->
name
}
</a></td>
<td
class=
"center"
>
{
$item
->
members
}
</td>
<td
class=
"center"
>
{
$item
->
views
}
</td>
<td
class=
"center"
>
{
$item
->
forums
}
</td>
...
...
htdocs/theme/raw/templates/group/group.tpl
View file @
d55f88c2
<div
class=
"list-group-item
{
if
$group
->
membershiptype
==
'invite'
||
$group
->
membershiptype
==
'request'
||
$group
->
requests
}
list-group-item-warning
{/
if
}
"
>
<a
href=
"
{
group
_
home
page_url
(
$group
)
}
"
class=
"outer-link"
><span
class=
"sr-only"
>
{
$group
->
name
}
</span></a>
<a
href=
"
{
$
group
->
home
url
}
"
class=
"outer-link"
><span
class=
"sr-only"
>
{
$group
->
name
}
</span></a>
<div
class=
"row"
>
<div
class=
"col-md-8"
>
<h3
class=
"list-group-item-heading text-inline"
>
...
...
htdocs/theme/raw/templates/sideblocks/profile.tpl
View file @
d55f88c2
...
...
@@ -36,7 +36,7 @@
<div
class=
"list-group-item-heading sidebar-item-heading"
><a
href=
"
{
$WWWROOT
}
group/mygroups.php"
>
{
str
tag
=
"mygroups"
}
:
</a></div>
<ul
class=
"list-nested list-group-item-text list-unstyled list-group-item-link"
>
{
foreach
from
=
$sbdata.groups
item
=
group
}
<li><a
href=
"
{
group
_
home
page_url
(
$group
)
}
"
class=
"bordered"
>
{
$group
->
name
}
{
if
$group
->
role
==
'admin'
}
<small>
(
{
str
tag
=
Admin
section
=
group
}
)
</small>
{/
if
}
</a></li>
<li><a
href=
"
{
$
group
->
home
url
}
"
class=
"bordered"
>
{
$group
->
name
}
{
if
$group
->
role
==
'admin'
}
<small>
(
{
str
tag
=
Admin
section
=
group
}
)
</small>
{/
if
}
</a></li>
{/
foreach
}
</ul>
<span
class=
"text-small text-midtone"
>
{
$sbdata.grouplimitstr
}
</span>
...
...
htdocs/theme/raw/templates/view/sharedviewrows.tpl
View file @
d55f88c2
...
...
@@ -5,7 +5,7 @@
{
if
$view.sharedby
}
<div
class=
"groupdate"
>
{
if
$view.group
}
<a
href=
"
{
group_homepage_url
(
$view.groupdata
)
}
"
>
{
$view.sharedby
}
</a>
<a
href=
"
{
$view.groupdata
->
homeurl
}
"
>
{
$view.sharedby
}
</a>
{
elseif
$view.owner
}
{
if
$view.anonymous
}
{
str
tag
=
anonymoususer
section
=
mahara
}
...
...
htdocs/theme/raw/templates/view/templatesearchresults.tpl
View file @
d55f88c2
...
...
@@ -25,7 +25,7 @@
</td>
{
elseif
$row.group
}
<td
class=
"owner"
>
<a
class=
"grouplink"
href=
"
{
group_homepage_url
(
$row.groupdata
,
true
,
true
)
}
"
target=
"_blank"
>
{
$row.sharedby
}
</a>
<a
class=
"grouplink"
href=
"
{
$row.groupdata
->
homeurl
}
"
target=
"_blank"
>
{
$row.sharedby
}
</a>
</td>
{
elseif
$row.owner
}
<td
class=
"ownericon"
>
...
...
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