Commit b6a023a1 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge "Add the group.php library. Bug 1313963"

parents 8873a7d0 693504a8
......@@ -15,6 +15,8 @@ define('MENUITEM', 'groups/topics');
require(dirname(dirname(__FILE__)) . '/init.php');
require_once('pieforms/pieform.php');
safe_require('interaction', 'forum');
require_once('group.php');
define('TITLE', get_string('Topics', 'interaction.forum'));
if (!$USER->is_logged_in()) {
......@@ -30,7 +32,7 @@ $data = PluginInteractionForum::get_active_topics($limit, $offset, $category);
$pagination = build_pagination(array(
'id' => 'topics_pagination',
'url' => get_config('wwwroot') . 'group/topics.php' . ($category ? ('?category=' . (int) $category) : ''),
'jsonscript' => '/json/topics.php',
'jsonscript' => 'json/topics.php',
'datatable' => 'topiclist',
'count' => $data['count'],
'limit' => $limit,
......@@ -40,6 +42,6 @@ $pagination = build_pagination(array(
$smarty = smarty(array('paginator'));
$smarty->assign_by_ref('topics', $data['data']);
$smarty->assign_by_ref('pagination', $pagination['html']);
$smarty->assign('INLINEJAVASCRIPT', 'addLoadEvent(function() {' . $pagination['javascript'] . '});');
$smarty->assign('INLINEJAVASCRIPT', 'addLoadEvent(function() { p = ' . $pagination['javascript'] . '});');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->display('group/topics.tpl');
......@@ -14,6 +14,7 @@ define('JSON', 1);
require(dirname(dirname(__FILE__)) . '/init.php');
safe_require('interaction', 'forum');
require_once('group.php');
$limit = param_integer('limit', 10);
$offset = param_integer('offset', 0);
......@@ -24,7 +25,7 @@ $data = PluginInteractionForum::get_active_topics($limit, $offset, $category);
$pagination = build_pagination(array(
'id' => 'topics_pagination',
'url' => get_config('wwwroot') . 'group/topics.php' . ($category ? ('?category=' . (int) $category) : ''),
'jsonscript' => '/json/topics.php',
'jsonscript' => 'json/topics.php',
'datatable' => 'topiclist',
'count' => $data['count'],
'limit' => $limit,
......
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