Commit 254ccc73 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Reorganise admin nav to include group categories page next to manage groups page


Restore group categories site option form on group categories page
Internationalise a couple of strings on manage groups page
Add manage groups section to admin home page
Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 7ff30f84
......@@ -27,17 +27,32 @@
define('INTERNAL', 1);
define('ADMIN', 1);
define('MENUITEM', 'configsite/groups');
define('SECTION_PLUGINTYPE', 'core');
define('SECTION_PLUGINNAME', 'admin');
define('SECTION_PAGE', 'groups');
define('MENUITEM', 'managegroups/categories');
require(dirname(dirname(dirname(__FILE__))) . '/init.php');
define('TITLE', get_string('groups', 'admin'));
if (!get_config('allowgroupcategories')) {
$SESSION->add_error_msg(get_string('groupcategoriesnotenabled', 'admin'));
redirect(get_config('wwwroot') . 'admin');
$optionform = pieform(array(
'name' => 'groupcategories',
'renderer' => 'table',
'plugintype' => 'core',
'pluginname' => 'admin',
'elements' => array(
'allowgroupcategories' => array(
'type' => 'checkbox',
'title' => get_string('enablegroupcategories', 'admin'),
'defaultvalue' => get_config('allowgroupcategories'),
),
'submit' => array(
'type' => 'submit',
'value' => get_string('submit'),
),
)
));
function groupcategories_submit(Pieform $form, $values) {
set_config('allowgroupcategories', (int) $values['allowgroupcategories']);
redirect(get_config('wwwroot') . 'admin/groups/groupcategories.php');
}
$strings = array('edit','delete','update','cancel','add','name','unknownerror');
......@@ -176,9 +191,10 @@ addLoadEvent(function () {
});
EOJS;
$smarty = smarty(array('groupoptions'));
$smarty = smarty();
$smarty->assign('PAGEHEADING', hsc(get_string('groupcategories', 'admin')));
$smarty->assign('INLINEJAVASCRIPT', $ijs);
$smarty->display('admin/site/groupcategories.tpl');
$smarty->assign('optionform', $optionform);
$smarty->display('admin/groups/groupcategories.tpl');
?>
\ No newline at end of file
......@@ -46,14 +46,13 @@ $groups = get_records_sql_array(
FROM {group} g WHERE g.deleted = 0 ORDER BY g.id DESC", array()
);
foreach ($groups as &$group) {
$group->type = get_string('grouptypedescription', 'group', get_string('name', 'grouptype.' . $group->grouptype), get_string('membershiptype.'.$group->jointype, 'group'));
//$group->type = "$group->grouptype > $group->jointype";
$group->type = get_string('name', 'grouptype.' . $group->grouptype) . ', ' . get_string('membershiptype.'.$group->jointype, 'group');
$group->visible = $group->visible ? 'Public' : 'Private';
}
$smarty = smarty();
$smarty->assign('groups', $groups);
$smarty->assign('PAGEHEADING', hsc('Administer Groups'));
$smarty->assign('PAGEHEADING', get_string('administergroups', 'admin'));
$smarty->assign('siteadmin', true);
$smarty->display('admin/groups/groups.tpl');
......
......@@ -201,12 +201,10 @@ $siteoptionform = array(
'help' => true,
),
'allowgroupcategories' => array(
'type' => 'select',
'type' => 'checkbox',
'title' => get_string('allowgroupcategories', 'admin'),
'description' => get_string('allowgroupcategoriesdescription', 'admin'),
'defaultvalue' => get_config('allowgroupcategories'),
'options' => array(true => get_string('yes'), false => get_string('no')),
'help' => true,
),
),
),
......
......@@ -67,6 +67,9 @@ $string['dbcollationmismatch'] = 'A column of your database is using a collation
$string['adminhome'] = 'Admin home';
$string['configsite'] = 'Configure Site';
$string['configusers'] = 'Manage Users';
$string['groups'] = 'Groups';
$string['managegroups'] = 'Manage Groups';
$string['Extensions'] = 'Extensions';
$string['configextensions'] = 'Administer Extensions';
$string['manageinstitutions'] = 'Manage Institutions';
......@@ -100,6 +103,10 @@ $string['usersearch'] = 'User Search';
$string['usersearchdescription'] = 'Search all users and perform administrative actions on them';
$string['usersearchinstructions'] = 'You can search for users by clicking on the initials of their first and last names, or by entering a name in the search box. You can also enter an email address in the search box if you would like to search email addresses.';
$string['administergroups'] = 'Administer Groups';
$string['administergroupsdescription'] = 'Appoint group administrators and delete groups';
$string['groupcategoriesdescription'] = 'Add and edit group categories';
$string['institutionmembersdescription'] = 'Associate users with institutions';
$string['institutionstaffdescription'] = 'Assign users Staff permissions';
$string['institutionadminsdescription'] = 'Assign Institution Administrator access rights';
......@@ -117,14 +124,15 @@ $string['newfiltersdescription'] = 'If you have downloaded a new set of HTML fil
$string['filtersinstalled'] = 'Filters installed.';
$string['nofiltersinstalled'] = 'No html filters installed.';
$string['groupcategories'] ='Group Categories';
$string['allowgroupcategories'] ='Allow Group Categories';
$string['allowgroupcategoriesdescription'] ='If set to yes, admins will be able to create categories for users to assign their groups';
$string['groupcategories'] = 'Group Categories';
$string['allowgroupcategories'] = 'Allow Group Categories';
$string['enablegroupcategories'] = 'Enable Group Categories';
$string['addcategories'] = 'Add Categories';
$string['allowgroupcategoriesdescription'] = 'If checked, admins will be able to create categories for users to assign their groups';
$string['groupoptionsset'] = 'Group options have been updated.';
$string['groups'] = 'Groups';
$string['groupsdescription'] = 'Manage group options';
$string['groupcategorydeleted'] = 'Category deleted';
$string['confirmdeletecategory'] = 'Do you really want to delete this category?';
$string['groupcategoriespagedescription'] = 'The categories listed here can be assigned to groups during group creation, and used to filter groups during searches.';
// Register your Mahara
$string['Field'] = 'Field';
......
......@@ -1672,7 +1672,7 @@ function admin_nav() {
array(
'path' => 'configusers',
'url' => 'admin/users/search.php',
'title' => get_string('configusers', 'admin'),
'title' => get_string('users'),
'weight' => 30,
),
array(
......@@ -1717,11 +1717,29 @@ function admin_nav() {
'title' => get_string('uploadcsv', 'admin'),
'weight' => 60,
),
array(
'path' => 'managegroups',
'url' => 'admin/groups/groups.php',
'title' => get_string('groups', 'admin'),
'weight' => 40,
),
array(
'path' => 'managegroups/groups',
'url' => 'admin/groups/groups.php',
'title' => get_string('administergroups', 'admin'),
'weight' => 10,
),
array(
'path' => 'managegroups/categories',
'url' => 'admin/groups/groupcategories.php',
'title' => get_string('groupcategories', 'admin'),
'weight' => 20,
),
array(
'path' => 'manageinstitutions',
'url' => 'admin/users/institutions.php',
'title' => get_string('manageinstitutions', 'admin'),
'weight' => 35,
'title' => get_string('institutions', 'admin'),
'weight' => 50,
),
array(
'path' => 'manageinstitutions/institutions',
......@@ -1759,23 +1777,11 @@ function admin_nav() {
'title' => get_string('Files', 'artefact.file'),
'weight' => 60,
),
array(
'path' => 'managegroups',
'url' => 'admin/groups/groups.php',
'title' => 'Manage Groups',
'weight' => 35,
),
array(
'path' => 'managegroups/groups',
'url' => 'admin/groups/groups.php',
'title' => 'Administer Groups',
'weight' => 10,
),
array(
'path' => 'configextensions',
'url' => 'admin/extensions/plugins.php',
'title' => get_string('configextensions', 'admin'),
'weight' => 40,
'title' => get_string('Extensions', 'admin'),
'weight' => 60,
),
array(
'path' => 'configextensions/pluginadmin',
......
{auto_escape off}
{include file="header.tpl"}
{$optionform|safe}
<h4>{str tag=addcategories section=admin}</h4>
<p>{str tag=groupcategoriespagedescription section=admin}</p>
<div id="editmenus">
<div id="menuitemlist"></div>
</div>
{include file="footer.tpl"}
{/auto_escape}
......@@ -67,18 +67,8 @@
<li><strong><a href="{$WWWROOT}admin/site/networking.php">{str tag=networking section=admin}</a></strong> - {str tag=networkingdescription section=admin}</li>
<li><strong><a href="{$WWWROOT}admin/site/views.php">{str tag=siteviews section=admin}</a></strong> - {str tag=siteviewsdescription section=admin}</li>
<li><strong><a href="{$WWWROOT}artefact/file/sitefiles.php">{str tag=sitefiles section=admin}</a></strong> - {str tag=sitefilesdescription section=admin}</li>
<li><strong><a href="{$WWWROOT}admin/site/groups.php">{str tag=groups section=admin}</a></strong> - {str tag=groupsdescription section=admin}</li>
</ul>
<h3>{str tag=configextensions section=admin}</h3>
<ul>
<li><strong><a href="{$WWWROOT}admin/extensions/plugins.php">{str tag=pluginadmin section=admin}</a></strong> - {str tag=pluginadmindescription section=admin}</li>
<li><strong><a href="{$WWWROOT}admin/extensions/filter.php">{str tag=htmlfilters section=admin}</a></strong> - {str tag=htmlfiltersdescription section=admin}</li>
</ul>
</div>
<div class="admin-home-column fr">
<h3>{str tag=configusers section=admin}</h3>
<ul>
<li><strong><a href="{$WWWROOT}admin/users/search.php">{str tag=usersearch section=admin}</a></strong> - {str tag=usersearchdescription section=admin}</li>
......@@ -89,6 +79,17 @@
<li><strong><a href="{$WWWROOT}admin/users/add.php">{str tag=adduser section=admin}</a></strong> - {str tag=adduserdescription section=admin}</li>
<li><strong><a href="{$WWWROOT}admin/users/uploadcsv.php">{str tag=uploadcsv section=admin}</a></strong> - {str tag=uploadcsvdescription section=admin}</li>
</ul>
</div>
<div class="admin-home-column fr">
<h3>{str tag=managegroups section=admin}</h3>
<ul>
<li><strong><a href="{$WWWROOT}admin/groups/groups.php">{str tag=administergroups section=admin}</a></strong> - {str tag=administergroupsdescription section=admin}</li>
<li><strong><a href="{$WWWROOT}admin/groups/groupcategories.php">{str tag=groupcategories section=admin}</a></strong> - {str tag=groupcategoriesdescription section=admin}</li>
</ul>
<h3>{str tag=manageinstitutions section=admin}</h3>
<ul>
<li><strong><a href="{$WWWROOT}admin/users/institutions.php">{str tag=institutions section=admin}</a></strong> - {str tag=institutionsdescription section=admin}</li>
......@@ -98,6 +99,12 @@
<li><strong><a href="{$WWWROOT}view/institutionviews.php">{str tag=institutionviews section=admin}</a></strong> - {str tag=institutionviewsdescription section=admin}</li>
<li><strong><a href="{$WWWROOT}artefact/file/institutionfiles.php">{str tag=institutionfiles section=admin}</a></strong> - {str tag=institutionfilesdescription section=admin}</li>
</ul>
<h3>{str tag=configextensions section=admin}</h3>
<ul>
<li><strong><a href="{$WWWROOT}admin/extensions/plugins.php">{str tag=pluginadmin section=admin}</a></strong> - {str tag=pluginadmindescription section=admin}</li>
<li><strong><a href="{$WWWROOT}admin/extensions/filter.php">{str tag=htmlfilters section=admin}</a></strong> - {str tag=htmlfiltersdescription section=admin}</li>
</ul>
</div>
<div class="cb"></div>
......
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