index.json.php 940 Bytes
Newer Older
1
2
3
4
5
6
<?php
/**
 *
 * @package    mahara
 * @subpackage artefact-blog
 * @author     Catalyst IT Ltd
7
8
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
9
10
11
12
13
14
15
 *
 */

define('INTERNAL', 1);
define('JSON', 1);

require(dirname(dirname(dirname(__FILE__))) . '/init.php');
16
require_once(get_config('libroot') . 'pieforms/pieform.php');
17
18
19
20
21
safe_require('artefact', 'blog');

$blogs = (object) array(
    'offset' => param_integer('offset', 0),
    'limit'  => param_integer('limit', 10),
22
23
    'institution' => param_alpha('institution', null),
    'group'  => param_integer('group', null),
24
25
);

26
list($blogs->count, $blogs->data) = ArtefactTypeBlog::get_blog_list($blogs->limit, $blogs->offset, $blogs->institution, $blogs->group);
27
28
29
ArtefactTypeBlog::build_blog_list_html($blogs);

json_reply(false, array('data' => $blogs));