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
79c87954
Commit
79c87954
authored
Sep 01, 2008
by
Richard Mansfield
Browse files
Group sideblock
parent
d35207dc
Changes
16
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/file/groupfiles.php
View file @
79c87954
...
...
@@ -53,16 +53,7 @@ browser.setgroup({$group->id});
uploader.setgroup({$group->id});
GROUPJS;
$smarty
=
smarty
(
array
(
'tablerenderer'
,
'artefact/file/js/file.js'
),
array
(),
array
(),
array
(
'sideblocks'
=>
array
(
interaction_sideblock
(
$group
->
id
),
),
)
);
$smarty
=
smarty
(
array
(
'tablerenderer'
,
'artefact/file/js/file.js'
));
$smarty
->
assign
(
'heading'
,
$group
->
name
.
' - '
.
get_string
(
'Files'
,
'artefact.file'
));
$smarty
->
assign
(
'INLINEJAVASCRIPT'
,
$javascript
);
$smarty
->
display
(
'artefact:file:index.tpl'
);
...
...
htdocs/group/changerole.php
View file @
79c87954
...
...
@@ -100,7 +100,7 @@ function changerole_submit(Pieform $form, $values) {
define
(
'TITLE'
,
$group
->
name
.
' - '
.
get_string
(
'changerole'
,
'group'
));
$smarty
=
smarty
(
array
(),
array
(),
array
(),
array
(
'sideblocks'
=>
array
(
interaction_sideblock
(
$group
->
id
,
$role
)))
);
$smarty
=
smarty
();
$smarty
->
assign
(
'subtitle'
,
get_string
(
'changeroleofuseringroup'
,
'group'
,
display_name
(
$user
),
$group
->
name
));
$smarty
->
assign
(
'changeform'
,
$changeform
);
...
...
htdocs/group/members.php
View file @
79c87954
...
...
@@ -50,9 +50,7 @@ $offset = param_integer('offset', 0);
$limit
=
param_integer
(
'limit'
,
10
);
list
(
$html
,
$pagination
,
$count
,
$offset
,
$membershiptype
)
=
group_get_membersearch_data
(
$group
->
id
,
$query
,
$offset
,
$limit
,
$membershiptype
);
$smarty
=
smarty
(
array
(
'groupmembersearch'
),
array
(),
array
(),
array
(
'sideblocks'
=>
array
(
interaction_sideblock
(
$group
->
id
,
$role
)),
));
$smarty
=
smarty
(
array
(
'groupmembersearch'
));
$smarty
->
assign
(
'query'
,
$query
);
$smarty
->
assign
(
'results'
,
$html
);
$smarty
->
assign
(
'pagination'
,
$pagination
[
'html'
]);
...
...
htdocs/group/view.php
View file @
79c87954
...
...
@@ -94,7 +94,7 @@ $foruminfo = get_records_sql_array('
p.ctime DESC
LIMIT 5;
'
,
array
(
$group
->
id
));
$smarty
=
smarty
(
array
(),
array
(),
array
(),
array
(
'sideblocks'
=>
array
(
interaction_sideblock
(
$group
->
id
,
$role
)))
);
$smarty
=
smarty
();
$smarty
->
assign
(
'group'
,
$group
);
$smarty
->
assign
(
'groupid'
,
$group
->
id
);
$smarty
->
assign
(
'foruminfo'
,
$foruminfo
);
...
...
htdocs/interaction/delete.php
View file @
79c87954
...
...
@@ -66,7 +66,7 @@ $form = pieform(array(
)
));
$smarty
=
smarty
(
array
(
'tablerenderer'
)
,
array
(),
array
(),
array
(
'sideblocks'
=>
array
(
interaction_sideblock
(
$group
->
id
)))
);
$smarty
=
smarty
(
array
(
'tablerenderer'
));
$smarty
->
assign
(
'form'
,
$form
);
$smarty
->
assign
(
'heading'
,
TITLE
);
$smarty
->
assign
(
'message'
,
get_string
(
'deleteinteractionsure'
,
'group'
));
...
...
htdocs/interaction/edit.php
View file @
79c87954
...
...
@@ -80,7 +80,7 @@ $form = pieform(array(
)
);
$smarty
=
smarty
(
array
(
'tablerenderer'
)
,
array
(),
array
(),
array
(
'sideblocks'
=>
array
(
interaction_sideblock
(
$groupid
)))
);
$smarty
=
smarty
(
array
(
'tablerenderer'
));
$smarty
->
assign
(
'form'
,
$form
);
$smarty
->
assign
(
'heading'
,
TITLE
);
$smarty
->
display
(
'interaction/edit.tpl'
);
...
...
htdocs/interaction/forum/deletepost.php
View file @
79c87954
...
...
@@ -137,7 +137,7 @@ function deletepost_submit(Pieform $form, $values) {
redirect
(
'/interaction/forum/topic.php?id='
.
$values
[
'topic'
]
.
'#post'
.
$values
[
'parent'
]);
}
$smarty
=
smarty
(
array
(),
array
(),
array
(),
array
(
'sideblocks'
=>
array
(
interaction_sideblock
(
$post
->
group
)))
);
$smarty
=
smarty
();
$smarty
->
assign
(
'breadcrumbs'
,
$breadcrumbs
);
$smarty
->
assign
(
'heading'
,
TITLE
);
$smarty
->
assign
(
'post'
,
$post
);
...
...
htdocs/interaction/forum/deletetopic.php
View file @
79c87954
...
...
@@ -126,7 +126,7 @@ function deletetopic_submit(Pieform $form, $values) {
redirect
(
'/interaction/forum/view.php?id='
.
$values
[
'forum'
]);
}
$smarty
=
smarty
(
array
(),
array
(),
array
(),
array
(
'sideblocks'
=>
array
(
interaction_sideblock
(
$topic
->
group
)))
);
$smarty
=
smarty
();
$smarty
->
assign
(
'breadcrumbs'
,
$breadcrumbs
);
$smarty
->
assign
(
'forum'
,
$topic
->
title
);
$smarty
->
assign
(
'heading'
,
TITLE
);
...
...
htdocs/interaction/forum/editpost.php
View file @
79c87954
...
...
@@ -241,9 +241,7 @@ function addpost_submit(Pieform $form, $values) {
redirect
(
'/interaction/forum/topic.php?id='
.
$values
[
'topic'
]
.
'#post'
.
$postid
);
}
$smarty
=
smarty
(
array
(),
array
(),
array
(),
array
(
'sideblocks'
=>
array
(
interaction_sideblock
(
$parent
->
group
)),
));
$smarty
=
smarty
();
$smarty
->
assign
(
'breadcrumbs'
,
$breadcrumbs
);
$smarty
->
assign
(
'heading'
,
TITLE
);
$smarty
->
assign
(
'editform'
,
$editform
);
...
...
htdocs/interaction/forum/edittopic.php
View file @
79c87954
...
...
@@ -253,10 +253,7 @@ function edittopic_submit(Pieform $form, $values) {
}
}
$smarty
=
smarty
(
array
(),
array
(),
array
(),
array
(
'sideblocks'
=>
array
(
interaction_sideblock
(
$forum
->
groupid
)),
'group'
=>
(
object
)
array
(
'id'
=>
$forum
->
groupid
,
'name'
=>
$forum
->
groupname
,
'grouptype'
=>
$forum
->
grouptype
),
));
$smarty
=
smarty
();
$smarty
->
assign
(
'breadcrumbs'
,
$breadcrumbs
);
$smarty
->
assign
(
'heading'
,
TITLE
);
$smarty
->
assign
(
'editform'
,
$editform
);
...
...
htdocs/interaction/forum/index.php
View file @
79c87954
...
...
@@ -128,7 +128,7 @@ if ($forums) {
}
}
$smarty
=
smarty
(
array
(),
array
(),
array
(),
array
(
'sideblocks'
=>
array
(
interaction_sideblock
(
$groupid
)))
);
$smarty
=
smarty
();
$smarty
->
assign
(
'breadcrumbs'
,
$breadcrumbs
);
$smarty
->
assign
(
'groupid'
,
$groupid
);
$smarty
->
assign
(
'heading'
,
TITLE
);
...
...
htdocs/interaction/forum/topic.php
View file @
79c87954
...
...
@@ -159,9 +159,7 @@ for ($i = 0; $i < $count; $i++) {
// builds the first post (with index 0) which has as children all the posts in the topic
$posts
=
buildpost
(
0
,
''
,
$posts
);
$smarty
=
smarty
(
array
(),
array
(),
array
(),
array
(
'sideblocks'
=>
array
(
interaction_sideblock
(
$topic
->
groupid
)),
));
$smarty
=
smarty
();
$smarty
->
assign
(
'breadcrumbs'
,
$breadcrumbs
);
$smarty
->
assign
(
'heading'
,
TITLE
);
$smarty
->
assign
(
'topic'
,
$topic
);
...
...
htdocs/interaction/forum/view.php
View file @
79c87954
...
...
@@ -247,9 +247,7 @@ addLoadEvent(function() {
});
EOF;
$smarty
=
smarty
(
array
(),
array
(),
array
(),
array
(
'sideblocks'
=>
array
(
interaction_sideblock
(
$forum
->
groupid
)),
));
$smarty
=
smarty
();
$smarty
->
assign
(
'breadcrumbs'
,
$breadcrumbs
);
$smarty
->
assign
(
'heading'
,
TITLE
);
$smarty
->
assign
(
'forum'
,
$forum
);
...
...
htdocs/lib/group.php
View file @
79c87954
...
...
@@ -770,6 +770,8 @@ function group_get_grouptype_options() {
* @return array
*/
function
group_get_menu_tabs
()
{
static
$menu
;
$group
=
group_current_group
();
$menu
=
array
(
array
(
...
...
@@ -818,6 +820,7 @@ function group_get_menu_tabs() {
$menu
=
array_merge
(
$menu
,
$plugin_menu
);
}
}
return
$menu
;
}
...
...
@@ -879,4 +882,32 @@ function group_current_group() {
}
/**
* creates the group sideblock
*/
function
group_sideblock
()
{
require_once
(
'group.php'
);
$data
[
'group'
]
=
group_current_group
();
$data
[
'menu'
]
=
group_get_menu_tabs
();
// @todo either: remove this if interactions become group
// artefacts, or: do this in interaction/lib.php if we leave them
// as interactions
$data
[
'forums'
]
=
get_records_select_array
(
'interaction_instance'
,
'"group" = ? AND deleted = ? AND plugin = ?'
,
array
(
GROUP
,
0
,
'forum'
),
'ctime'
,
'id, plugin, title'
);
if
(
!
$data
[
'forums'
])
{
$data
[
'forums'
]
=
array
();
}
else
{
safe_require
(
'interaction'
,
'forum'
);
$data
[
'forums'
]
=
PluginInteractionForum
::
sideblock_sort
(
$data
[
'forums'
]);
}
return
$data
;
}
?>
htdocs/lib/web.php
View file @
79c87954
...
...
@@ -408,7 +408,15 @@ EOF;
);
}
if
(
!
$USER
->
is_logged_in
())
{
if
(
defined
(
'GROUP'
))
{
$SIDEBLOCKS
[]
=
array
(
'name'
=>
'group'
,
'weight'
=>
-
10
,
'data'
=>
group_sideblock
()
);
}
if
(
!
$USER
->
is_logged_in
())
{
$SIDEBLOCKS
[]
=
array
(
'name'
=>
'login'
,
'weight'
=>
-
10
,
...
...
htdocs/theme/default/templates/sideblocks/group.tpl
0 → 100644
View file @
79c87954
<h3>
{
$data.group
->
name
}
</h3>
<ul>
{
foreach
from
=
$data.menu
item
=
item
}
{
if
$item.path
!=
'groups'
}
<li><a
href=
"
{
$WWWROOT
}{
$item.url
}
"
>
{
$item.title
}
</a>
{
if
$item.path
==
'groups/forums'
&&
!
empty
(
$data.forums
)
}
<ul>
{
foreach
from
=
$data.forums
item
=
forum
}
<li><a
href=
"
{
$WWWROOT
}
interaction/forum/view.php?id=
{
$forum
->
id
}
"
>
{
$forum
->
title
}
</a>
{/
foreach
}
</ul>
{/
if
}
</li>
{/
if
}
{/
foreach
}
</ul>
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