Commit 595a77d6 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add share tab to groups


Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 0eaac613
......@@ -70,7 +70,7 @@ class PluginArtefactFile extends PluginArtefact {
'path' => 'groups/files',
'url' => 'artefact/file/groupfiles.php?group='.$groupid,
'title' => get_string('Files', 'artefact.file'),
'weight' => 60,
'weight' => 70,
),
);
}
......
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2009 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package mahara
* @subpackage core
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
*
*/
define('INTERNAL', 1);
require(dirname(dirname(__FILE__)) . '/init.php');
require_once(get_config('libroot') . 'view.php');
require_once(get_config('libroot') . 'group.php');
define('TITLE', get_string('share', 'view'));
define('MENUITEM', 'groups/share');
define('GROUP', param_integer('group'));
$group = group_current_group();
if (!group_user_can_edit_views($group->id)) {
throw new AccessDeniedException();
}
$accesslists = View::get_accesslists(null, $group->id);
$js = <<<EOF
addLoadEvent(function () {
forEach(getElementsByTagAndClassName('a', 'secreturl', null), function (elem) {
connect(elem, 'onclick', function(e) {
e.stop();
var displayelem = getFirstElementByTagAndClassName(null, 'expandurl', getFirstParentByTagAndClassName(elem, null, 'accesslistitem'));
toggleElementClass('hidden', displayelem);
});
});
});
EOF;
$smarty = smarty();
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->assign('accesslists', $accesslists);
$smarty->display('view/share.tpl');
......@@ -1055,6 +1055,12 @@ function group_get_menu_tabs() {
'title' => get_string('Views', 'group'),
'weight' => 50,
);
$menu['share'] = array(
'path' => 'groups/share',
'url' => 'group/shareviews.php?group='.$group->id,
'title' => get_string('share', 'view'),
'weight' => 60,
);
if (group_user_access($group->id)) {
safe_require('grouptype', $group->grouptype);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment