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
be498131
Commit
be498131
authored
Jun 10, 2010
by
Richard Mansfield
Browse files
Make display of group type/visibility settings smaller & more descriptive
Signed-off-by:
Richard Mansfield
<
richardm@catalyst.net.nz
>
parent
0d21d69a
Changes
6
Hide whitespace changes
Inline
Side-by-side
htdocs/group/groupinfo.json.php
View file @
be498131
...
...
@@ -41,7 +41,7 @@ $group->admins = get_column_sql("SELECT member
$filecounts
=
ArtefactTypeFileBase
::
count_user_files
(
null
,
$group
->
id
,
null
);
$group
->
grouptypedescription
=
get_string
(
'grouptype
description
'
,
'
group
'
,
get_string
(
'name'
,
'grouptype.'
.
$group
->
grouptype
),
get_string
(
'membershiptype.'
.
$group
->
jointype
,
'group'
)
);
$group
->
settings
description
=
group
_display_settings
(
$group
);
$smarty
=
smarty_core
();
$smarty
->
assign
(
'group'
,
$group
);
...
...
htdocs/group/view.php
View file @
be498131
...
...
@@ -78,7 +78,7 @@ if (is_logged_in()) {
}
}
$group
->
grouptypedescription
=
get_string
(
'grouptype
description
'
,
'
group
'
,
get_string
(
'name'
,
'grouptype.'
.
$group
->
grouptype
),
get_string
(
'membershiptype.'
.
$group
->
jointype
,
'group'
)
);
$group
->
settings
description
=
group
_display_settings
(
$group
);
$filecounts
=
ArtefactTypeFileBase
::
count_user_files
(
null
,
$group
->
id
,
null
);
...
...
htdocs/lang/en.utf8/group.php
View file @
be498131
...
...
@@ -67,10 +67,10 @@ $string['Admin'] = 'Admin';
$string
[
'grouptype'
]
=
'Group type'
;
$string
[
'publiclyviewablegroup'
]
=
'Publicly Viewable Group?'
;
$string
[
'publiclyviewablegroupdescription'
]
=
'Allow people who are not logged-in to view this group, including the forums?'
;
$string
[
'publicvisibility'
]
=
'Publicly visible'
;
$string
[
'Type'
]
=
'Type'
;
$string
[
'publiclyvisible'
]
=
'Publicly visible'
;
$string
[
'usersautoadded'
]
=
'Users auto-added?'
;
$string
[
'usersautoaddeddescription'
]
=
'Automatically put all new users into this group?'
;
$string
[
'grouptypedescription'
]
=
'%s > %s'
;
$string
[
'hasrequestedmembership'
]
=
'has requested membership of this group'
;
$string
[
'hasbeeninvitedtojoin'
]
=
'has been invited to join this group'
;
...
...
@@ -314,4 +314,5 @@ $string['membersdescription:controlled'] = 'This is a controlled membership grou
// View submission
$string
[
'submit'
]
=
'Submit'
;
$string
[
'allowssubmissions'
]
=
'Allows submissions'
;
?>
htdocs/lib/group.php
View file @
be498131
...
...
@@ -824,7 +824,7 @@ function group_prepare_usergroups_for_display($groups, $returnto='mygroups') {
else
if
(
$group
->
membershiptype
==
'invite'
)
{
$group
->
invite
=
group_get_accept_form
(
'invite'
.
$i
++
,
$group
->
id
,
$returnto
);
}
$group
->
grouptypedescription
=
get_string
(
'grouptype
description
'
,
'
group
'
,
get_string
(
'name'
,
'grouptype.'
.
$group
->
grouptype
),
get_string
(
'membershiptype.'
.
$group
->
jointype
,
'group'
)
);
$group
->
settings
description
=
group
_display_settings
(
$group
);
}
}
...
...
@@ -1307,6 +1307,20 @@ function group_get_user_course_groups($userid=null) {
}
function
group_allows_submission
(
$grouptype
)
{
return
get_field
(
'grouptype'
,
'submittableto'
,
'name'
,
$grouptype
);
static
$grouptypes
=
null
;
if
(
is_null
(
$grouptypes
))
{
$grouptypes
=
get_records_assoc
(
'grouptype'
);
}
return
(
bool
)
$grouptypes
[
$grouptype
]
->
submittableto
;
}
function
group_display_settings
(
$group
)
{
$string
=
get_string
(
'membershiptype.'
.
$group
->
jointype
,
'group'
);
if
(
group_allows_submission
(
$group
->
grouptype
))
{
$string
.
=
', '
.
get_string
(
'allowssubmissions'
,
'group'
);
}
if
(
$group
->
public
)
{
$string
.
=
', '
.
get_string
(
'publiclyvisible'
,
'group'
);
}
return
$string
;
}
?>
htdocs/theme/raw/templates/group/group.tpl
View file @
be498131
{
auto_escape
off
}
<h3><a
href=
"
{
$WWWROOT
}
group/view.php?id=
{
$group
->
id
|
escape
}
"
>
{
$group
->
name
|
escape
}
</a></h3>
<h6>
{
foreach
name
=
admins
from
=
$group
->
admins
item
=
id
}
<a
href=
"
{
$WWWROOT
}
user/view.php?id=
{
$id
|
escape
}
"
>
{
$id
|
display_name
|
escape
}
</a>
{
if
!
$
.
foreach
.
admins
.
last
}
,
{/
if
}{/
foreach
}
</h6>
<div>
{
str
tag
=
"grouptype"
section
=
"group"
}
:
{
$group
->
grouptypedescription
}
</div>
<div>
{
str
tag
=
"publicvisibility"
section
=
"group"
}
:
{
if
$group
->
public
}{
str
tag
=
"yes"
}{
else
}{
str
tag
=
"no"
}{/
if
}
</div>
<div>
{
$group
->
settingsdescription
}
</div>
{
$group
->
description
}
<div>
{
str
tag
=
"memberslist"
section
=
"group"
}
{
foreach
name
=
members
from
=
$group
->
members
item
=
member
}
...
...
htdocs/theme/raw/templates/group/info.tpl
View file @
be498131
...
...
@@ -4,8 +4,7 @@
<img
src=
"
{
$WWWROOT
}
thumb.php?type=profileicon&maxsize=20&id=
{
$id
|
escape
}
"
alt=
""
>
<a
href=
"
{
$WWWROOT
}
user/view.php?id=
{
$id
|
escape
}
"
>
{
$id
|
display_name
|
escape
}
</a>
{
if
!
$
.
foreach
.
admins
.
last
}
,
{/
if
}
{/
foreach
}
</li>
<li><label>
{
str
tag
=
"grouptype"
section
=
"group"
}
:
</label>
{
$group
->
grouptypedescription
}
</li>
<li><label>
{
str
tag
=
"publicvisibility"
section
=
"group"
}
:
</label>
{
if
$group
->
public
}{
str
tag
=
"yes"
}{
else
}{
str
tag
=
"no"
}{/
if
}
</li>
<li>
{
$group
->
settingsdescription
}
</li>
<li><label>
{
str
tag
=
Created
section
=
group
}
:
</label>
{
$group
->
ctime
}
</li>
<li><span><label>
{
str
tag
=
Members
section
=
group
}
:
</label>
{
$membercount
}
</span>
<span><label>
{
str
tag
=
Views
section
=
view
}
:
</label>
{
$viewcount
}
</span>
...
...
Write
Preview
Supports
Markdown
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