Commit c520fbee authored by Richard Mansfield's avatar Richard Mansfield

Add share pages for site/institution & remove unused js from group views page

Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 20a71339
<?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);
define('ADMIN', 1);
define('MENUITEM', 'configsite/share');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
require_once(get_config('libroot') . 'view.php');
define('TITLE', get_string('share', 'view'));
$accesslists = View::get_accesslists(null, null, 'mahara');
$smarty = smarty();
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('accesslists', $accesslists);
$smarty->display('view/share.tpl');
......@@ -44,7 +44,7 @@ define('TITLE', $title);
$createviewform = pieform(create_view_form(null, 'mahara'));
$smarty = smarty(array('jquery', 'myviews'));
$smarty = smarty();
$smarty->assign('PAGEHEADING', TITLE);
$data = View::get_myviews_data($limit, $offset, null, 'mahara');
......
......@@ -40,20 +40,7 @@ if (!group_user_can_edit_views($group->id)) {
$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');
......@@ -1692,14 +1692,20 @@ function admin_nav() {
array(
'path' => 'configsite/siteviews',
'url' => 'admin/site/views.php',
'title' => get_string('siteviews', 'admin'),
'title' => get_string('Views', 'view'),
'weight' => 50,
),
array(
'path' => 'configsite/share',
'url' => 'admin/site/shareviews.php',
'title' => get_string('share', 'view'),
'weight' => 60,
),
array(
'path' => 'configsite/sitefiles',
'url' => 'artefact/file/sitefiles.php',
'title' => get_string('sitefiles', 'admin'),
'weight' => 60,
'title' => get_string('Files', 'artefact.file'),
'weight' => 70,
),
array(
'path' => 'configusers',
......@@ -1782,7 +1788,7 @@ function admin_nav() {
array(
'path' => 'manageinstitutions/institutionusers',
'url' => 'admin/users/institutionusers.php',
'title' => get_string('institutionmembers', 'admin'),
'title' => get_string('Members', 'admin'),
'weight' => 20,
),
array(
......@@ -1800,14 +1806,20 @@ function admin_nav() {
array(
'path' => 'manageinstitutions/institutionviews',
'url' => 'view/institutionviews.php',
'title' => get_string('views'),
'title' => get_string('Views', 'view'),
'weight' => 50,
),
array(
'path' => 'manageinstitutions/share',
'url' => 'view/institutionshare.php',
'title' => get_string('share', 'view'),
'weight' => 60,
),
array(
'path' => 'manageinstitutions/institutionfiles',
'url' => 'artefact/file/institutionfiles.php',
'title' => get_string('Files', 'artefact.file'),
'weight' => 60,
'weight' => 70,
),
array(
'path' => 'configextensions',
......@@ -1909,14 +1921,20 @@ function institutional_admin_nav() {
array(
'path' => 'manageinstitutions/institutionviews',
'url' => 'view/institutionviews.php',
'title' => get_string('views'),
'title' => get_string('Views', 'view'),
'weight' => 60,
),
array(
'path' => 'manageinstitutions/share',
'url' => 'view/institutionshare.php',
'title' => get_string('share', 'view'),
'weight' => 70,
),
array(
'path' => 'manageinstitutions/institutionfiles',
'url' => 'artefact/file/institutionfiles.php',
'title' => get_string('Files', 'artefact.file'),
'weight' => 70,
'weight' => 80,
),
);
......
{include file="header.tpl"}
{if $institution} {$institutionselector|safe}{/if}
{if !$accesslists}
<p>{str tag=youhaventcreatedanyviewsyet section=view}</p>
{else}
......
<?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);
define('INSTITUTIONALADMIN', 1);
define('MENUITEM', 'manageinstitutions/share');
require(dirname(dirname(__FILE__)) . '/init.php');
require_once(get_config('libroot') . 'view.php');
require_once(get_config('libroot') . 'institution.php');
require_once('pieforms/pieform.php');
$institution = param_alpha('institution', false);
if ($institution == 'mahara') {
redirect('/admin/site/shareviews.php');
}
$s = institution_selector_for_page($institution, get_config('wwwroot') . 'view/institutionshare.php');
$institution = $s['institution'];
define('TITLE', get_string('share', 'view'));
if ($institution === false) {
$smarty = smarty();
$smarty->display('admin/users/noinstitutions.tpl');
exit;
}
$accesslists = View::get_accesslists(null, null, $institution);
$smarty = smarty();
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('institutionselector', $s['institutionselector']);
$smarty->assign('INLINEJAVASCRIPT', $s['institutionselectorjs']);
$smarty->assign('accesslists', $accesslists);
$smarty->assign('institution', $institution);
$smarty->display('view/share.tpl');
......@@ -70,7 +70,7 @@ $pagination = build_pagination(array(
'resultcounttextplural' => get_string('views', 'view')
));
$smarty = smarty(array('jquery', 'myviews'));
$smarty = smarty();
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('institutionselector', $s['institutionselector']);
$smarty->assign('INLINEJAVASCRIPT', $s['institutionselectorjs']);
......
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