Exemplo n.º 1
0
 *
 */
define('INTERNAL', 1);
define('SECTION_PLUGINTYPE', 'artefact');
define('SECTION_PLUGINNAME', 'blog');
define('SECTION_PAGE', 'view');
require dirname(dirname(dirname(dirname(__FILE__)))) . '/init.php';
define('TITLE', get_string('viewblog', 'artefact.blog'));
safe_require('artefact', 'blog');
require_once get_config('libroot') . 'pieforms/pieform.php';
if (!PluginArtefactBlog::is_active()) {
    throw new AccessDeniedException(get_string('plugindisableduser', 'mahara', get_string('blog', 'artefact.blog')));
}
$id = param_integer('id', null);
if ($blogpost = param_integer('blogpost', null)) {
    $post = ArtefactTypeBlogPost::get_post_data($blogpost);
    $id = $post->blogid;
    $limit = 1;
    $setlimit = 1;
    $offset = $post->offset;
}
$institutionname = null;
$title = '';
if ($institution = param_alphanum('institution', null)) {
    if ($institution == 'mahara') {
        $institutionname = $institution;
        if (!$USER->get('admin')) {
            throw new AccessDeniedException();
        }
        $title = get_string('siteblogs', 'artefact.blog');
    } else {