Exemplo n.º 1
0
 * @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('MENUITEM', 'myportfolio/blogs');
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');
$id = param_integer('id');
$blog = new ArtefactTypeBlog($id);
$blog->check_permission();
// This javascript is used to generate a list of blog posts.
$js = '';
if ($blog->count_children()) {
    $js = (require 'index.js.php');
}
$images = array('themepaths' => array('images/file.gif', 'images/image.gif'));
$smarty = smarty(array('tablerenderer'), array(), array(), $images);
$smarty->assign_by_ref('blog', $blog);
$smarty->assign_by_ref('editform', $form);
$smarty->assign_by_ref('INLINEJAVASCRIPT', $js);
$smarty->assign('heading', get_string('viewblog', 'artefact.blog') . ' - ' . $blog->get('title'));
$smarty->assign('strnopostsaddone', get_string('nopostsaddone', 'artefact.blog', '<a href="' . get_config('wwwroot') . 'artefact/blog/post.php?blog=' . $blog->get('id') . '">', '</a>'));
$smarty->display('artefact:blog:view.tpl');