Commit 2f71cfb4 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Remove some ancient templates and js from blog and file artefacts


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 443dc3d5
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
*
* 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 artefact-blog
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006-2008 Catalyst IT Ltd http://catalyst.net.nz
*
*/
defined('INTERNAL') || die();
$enc_wwwroot = json_encode(get_config('wwwroot'));
$enc_id = json_encode($this->id);
$enc_options = json_encode(json_encode($options));
return <<<EOJAVASCRIPT
var blog_listchildren{$blockid} = new TableRenderer(
'blog_listchildren{$blockid}',
{$enc_wwwroot} + 'artefact/blog/render/blog_listchildren.json.php',
[
function(r) {
var td = TD();
if (typeof(r.content.html) != 'undefined') {
td.innerHTML = r.content.html;
}
else {
td.innerHTML = r.content;
}
return td;
}
]
);
blog_listchildren{$blockid}.statevars.push('id');
blog_listchildren{$blockid}.id = {$enc_id};
blog_listchildren{$blockid}.statevars.push('options');
blog_listchildren{$blockid}.options = {$enc_options};
blog_listchildren{$blockid}.updateOnLoad();
EOJAVASCRIPT;
?>
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
*
* 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 artefact-blog
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006-2008 Catalyst IT Ltd http://catalyst.net.nz
*
*/
define('INTERNAL', 1);
define('JSON', 1);
require(dirname(dirname(dirname(dirname(__FILE__)))) . '/init.php');
safe_require('artefact', 'blog');
json_headers();
$limit = param_integer('limit', ArtefactTypeBlog::pagination);
$offset = param_integer('offset', 0);
$id = param_integer('id');
$options = json_decode(param_variable('options'));
list($count, $data) = ArtefactTypeBlogPost::render_posts(FORMAT_ARTEFACT_LISTSELF,
$options, $id, $limit, $offset);
if (!$count) {
$count = 1;
$data = array(
array(
'content' => get_string('noresults', 'artefact.blog')
)
);
}
echo json_encode(array(
'count' => $count,
'limit' => $limit,
'offset' => $offset,
'data' => $data
));
?>
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
*
* 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 artefact-blog
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006-2008 Catalyst IT Ltd http://catalyst.net.nz
*
*/
defined('INTERNAL') || die();
$enc_wwwroot = json_encode(get_config('wwwroot'));
$enc_id = json_encode($this->id);
$enc_options = json_encode(json_encode($options));
return <<<EOJAVASCRIPT
var blog_renderfull{$blockid} = new TableRenderer(
'blog_renderfull{$blockid}',
{$enc_wwwroot} + 'artefact/blog/render/blog_renderfull.json.php',
[
function(r) {
var td = TD();
td.innerHTML = r.content.html;
return td;
}
]
);
blog_renderfull{$blockid}.statevars.push('id');
blog_renderfull{$blockid}.id = {$enc_id};
blog_renderfull{$blockid}.statevars.push('options');
blog_renderfull{$blockid}.options = {$enc_options};
blog_renderfull{$blockid}.updateOnLoad();
EOJAVASCRIPT;
?>
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
*
* 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 artefact-blog
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006-2008 Catalyst IT Ltd http://catalyst.net.nz
*
*/
define('INTERNAL', 1);
define('JSON', 1);
define('PUBLIC', 1);
require(dirname(dirname(dirname(dirname(__FILE__)))) . '/init.php');
safe_require('artefact', 'blog');
json_headers();
$id = param_integer('id');
$limit = param_integer('limit', ArtefactTypeBlog::pagination);
$offset = param_integer('offset', 0);
$options = json_decode(param_variable('options'));
$viewid = isset($options->viewid) ? $options->viewid : null;
if ($viewid) {
if (!can_view_view($viewid)) {
throw new AccessDeniedException();
}
}
else {
if (!$USER->is_logged_in()) {
throw new AccessDeniedException();
}
if (!$viewid && get_field('artefact', 'owner', 'id', $id) != $USER->get('id')) {
throw new AccessDeniedException();
}
}
list($count, $data) = ArtefactTypeBlogPost::render_posts(FORMAT_ARTEFACT_RENDERFULL,
$options, $id, $limit, $offset);
if (!$count) {
$count = 1;
$data = array(
array(
'content' => get_string('noresults', 'artefact.blog')
)
);
}
echo json_encode(array(
'count' => $count,
'limit' => $limit,
'offset' => $offset,
'data' => $data
));
?>
{**
* This smarty template renders a list of a blog's children.
*}
<table id="blog_listchildren{$blockid}">
<thead></thead>
<tbody></tbody>
</table>
{**
* This smarty template renders a list of a blog's children.
*}
<h2>{$artefacttitle}</h2>
<table id="blog_renderfull{$blockid}">
<thead></thead>
<tbody></tbody>
</table>
<div>{$title}
{if isset($size)}
({$size})
{/if}
</div>
<table>
<tbody>
{foreach from=$PROPERTIES item=item}
<tr>
<td>{$item.name}</td>
<td>{$item.value}</td>
</tr>
{/foreach}
</tbody>
</table>
<div>
{if isset($children)}
<table>
<tbody>
{foreach from=$children item=child}
<tr class="{cycle values=r1,r0}"><td>{$child}</td></tr>
{/foreach}
</tbody></table>
{else}
{str tag=emptyfolder section=artefact.file}
{/if}
</div>
<div>{$title}
{if isset($size)}
({$size})
{/if}
</div>
<div>
<h3>{$artefact->get('title')|escape}</h3>
<div>{$artefact->get('description')}</div>
<div>
{if (isset($children))}
<table>
<thead>
<tr>
<th colspan=5>{str tag=contents section=artefact.file}:</th>
</tr>
<tr>
{if (isset($options.icon))}
<th></th>
{/if}
<th>{str tag=name}</th>
<th>{str tag=description}</th>
{if (isset($options.date))}
<th>{str tag=Date section=artefact.file}</th>
{/if}
</tr>
</thead>
<tbody>
{foreach from=$children item=child}
<tr class="{cycle values=r1,r0}">
{if (isset($options.icon))}
<td><img src="{$child->iconsrc}" border="0" alt="{$child->artefacttype}"></td>
{/if}
<td>{$child->title}</td>
<td>{$child->description}</td>
{if (isset($options.date))}
<td>{$child->date}</td>
{/if}
</tr>
{/foreach}
</tbody></table>
{else}
{str tag=emptyfolder section=artefact.file}
{/if}
</div>
</div>
{if isset($url)}
<a href="{$url}">
{/if}
<img src="{$src}" width="{$width}" height="{$height}" alt="{$title}">
{if isset($url)}
</a>
{/if}
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