Commit 1fe404c4 authored by Hugh Davenport's avatar Hugh Davenport
Browse files

Collection preview

Change-Id: I37a455d728b5b162ac5c82a73b813f45a1e78d77
Signed-off-by: default avatarHugh Davenport <>
parent 7cfae143
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2010 Catalyst IT Ltd and others; see:
* 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
* 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 <>.
* @package mahara
* @subpackage core
* @author Catalyst IT Ltd
* @license GNU GPL
* @copyright (C) 2006-2010 Catalyst IT Ltd
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(__FILE__)) . '/init.php');
require_once(get_config('libroot') . 'view.php');
require_once(get_config('libroot') . 'collection.php');
$id = param_integer('id');
if (!can_view_view($id)) {
json_reply('local', get_string('accessdenied', 'error'));
$firstview = new View($id);
$collection = $firstview->get('collection');
$smarty = smarty_core();
$smarty->assign('viewid', $id);
$smarty->assign('collectiontitle', $collection->get('name'));
$smarty->assign('ownername', $firstview->formatted_owner());
$smarty->assign('collectiondescription', $collection->get('description'));
$smarty->assign('viewcontent', $firstview->build_columns());
$smarty->assign('tags', $firstview->get('tags'));
$shownav = $collection->get('navigation');
if ($shownav) {
if ($views = $collection->get('views')) {
if (count($views['views']) > 1) {
$smarty->assign_by_ref('collection', array_chunk($views['views'], 5));
$html = ob_get_contents();
json_reply(false, array(
'message' => null,
'html' => $html,
......@@ -94,3 +94,4 @@ $string['viewnavigationdesc'] = 'Add a horizontal navigation bar to every page i
$string['viewsaddedtocollection'] = 'Pages added to collection. Collection updated to include access from new pages.';
$string['viewstobeadded'] = 'Pages to be added';
$string['viewconfirmremove'] = 'Are you sure you wish to remove this page from the collection?';
$string['by'] = 'by';
<h2>{$collectiontitle}{if $ownername} {str tag=by section=collection} {$ownername}{/if}</h2>
<p class="collection-description">{$collectiondescription|clean_html|safe}</p>
<!-- include a modified navigation bar -->
{include file=previewcollectionnav.tpl}
<div id="view" class="cb">
<div id="bottom-pane">
<div id="column-container">
<div class="cb">
{if $tags}
<div class="viewfooter cb">
<div class="tags"><label>{str tag=tags}:</label> {list_tags owner=0 tags=$tags}</div>
<div id="collectionnavwrap">
{foreach from=$collection item=chunk name=cchunk}
<div class="{if $dwoo.foreach.cchunk.first}colnav1{else}colnav-extra{/if}">
<ul class="colnav">
{foreach from=$chunk item=view}
<li{if $view->view == $viewid} class="selected"{/if}>
{if $view->view != $viewid}
<a class="colnav" onclick="{literal}
var params = {}; = {/literal}{$view->view}{literal};
sendjsonrequest('../collection/viewcontent.json.php', params, 'POST', partial(showPreview, 'big'));
{/literal}" href="{$WWWROOT}view/view.php?id={$view->view}">{$view->title|str_shorten_text:30:true}</a>
<div class="cb"></div>
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