Commit 629a64e6 authored by Naomi Guyer's avatar Naomi Guyer Committed by Aaron Wells
Browse files

NEW submenu for tertiary navigation

Bug 1465107: Use Bootstrap CSS Framework

Change-Id: I7196464441c27c657820742b2d310de4fb409b2d
parent 63a997cd
......@@ -22,8 +22,7 @@ if ($readone) {
set_field('notification_internal_activity', 'read', 1, 'id', $readone, 'usr', $USER->get('id'));
$unread = $USER->add_unread(-1);
$data = array(
'newunreadcount' => $unread,
'newimage' => $THEME->get_image_url($unread ? 'newmail' : 'message'),
'newunreadcount' => $unread
);
json_reply(false, array('data' => $data));
}
......@@ -98,7 +97,6 @@ $newhtml = activitylist_html($type, $limit, $offset);
if (isset($newunread)) {
$newhtml['newunreadcount'] = $newunread;
$newhtml['newimage'] = $THEME->get_image_url($newunread ? 'newmail' : 'message');
}
json_reply(false, (object) array('message' => $message, 'data' => $newhtml));
......@@ -137,9 +137,10 @@ foreach (array_keys($plugins) as $plugin) {
}
global $THEME;
$loadingicon = $THEME->get_image_url('loading');
$successicon = $THEME->get_image_url('success');
$failureicon = $THEME->get_image_url('failure');
$loadingicon = 'fa fa-spinner fa-pulse';
$successicon = 'fa fa-check text-success';
$failureicon = 'fa fa-exclaimation-triangle';
$loadingstring = json_encode(get_string('upgradeloading', 'admin'));
$successstring = json_encode(get_string('upgradesuccesstoversion', 'admin'));
......@@ -148,12 +149,12 @@ $failurestring = json_encode(get_string('upgradefailure', 'admin'));
$javascript = <<<JAVASCRIPT
function installplugin(name) {
$(name + '.message').innerHTML = '<img src="{$loadingicon}" alt=' + {$loadingstring} + '" />';
$(name + '.message').innerHTML = '<span class="{$loadingicon}" title=' + {$loadingstring} + '"></span>';
sendjsonrequest('../upgrade.json.php', { 'name': name }, 'GET', function (data) {
if (!data.error) {
var message = {$successstring} + data.newversion;
$(name + '.message').innerHTML = '<img src="{$successicon}" alt=":)" /> ' + message;
$(name + '.message').innerHTML = '<span class="{$successicon}" title=":)"></span>' + message;
$(name + '.install').innerHTML = '';
// move the whole thing into the list of installed plugins
// new parent node
......@@ -174,7 +175,7 @@ function installplugin(name) {
else {
message = {$failurestring};
}
$(name).innerHTML = '<img src="{$failureicon}" alt=":(" /> ' + message;
$(name).innerHTML = '<span class="{$failureicon}" title=":("></span>' + message;
}
},
function () {
......
......@@ -85,10 +85,11 @@ if (empty($upgrades['core']->install)) {
}
}
$loadingicon = $THEME->get_image_url('loading');
$successicon = $THEME->get_image_url('success');
$failureicon = $THEME->get_image_url('failure');
$warningicon = $THEME->get_image_url('warning');
$loadingicon = 'fa fa-spinner fa-pulse';
$successicon = 'fa fa-check text-success';
$failureicon = 'fa fa-minus-circle text-danger';
$warningicon = 'fa fa-exclaimation-triangle';
// Remove all files in the smarty and dwoo caches
// TODO post 1.2 remove the smarty part
......@@ -145,18 +146,18 @@ $js = <<< EOJS
return; // done
}
$(element).innerHTML = '<img src="{$loadingicon}" alt="' + {$loadingstring} + '" />';
$(element).innerHTML = '<span class="{$loadingicon}" title="' + {$loadingstring} + '"></span>';
sendjsonrequest('upgrade.json.php', { 'name': element, 'last': todo.length == 0 }, 'GET', function (data) {
if ( !data.error ) {
var message;
if (data.coredata) {
message = {$coresuccess};
$(data.key).innerHTML = '<img src="{$successicon}" alt=":)" /> ' + message;
$(data.key).innerHTML = '<span class="{$successicon}" title=":)"></span>' + message;
}
else if (data.localdata) {
message = {$localsuccess};
$(data.key).innerHTML = '<img src="{$successicon}" alt=":)" /> ' + message;
$(data.key).innerHTML = '<span class="{$successicon}" title=":)"></span>' + message;
}
else if (data.install || data.upgrade) {
if (data.install) {
......@@ -171,7 +172,7 @@ $js = <<< EOJS
}
}
message += data.newversion ? data.newversion : '';
$(data.key).innerHTML = '<img src="{$successicon}" alt=":)" /> ' + message;
$(data.key).innerHTML = '<span class="{$successicon}" title=":)"></span>' + message;
}
else if (data.done) {
message = data.message;
......@@ -179,7 +180,7 @@ $js = <<< EOJS
}
else {
message = data.message;
$(data.key).innerHTML = '<img src="{$failureicon}" alt=":(" /> ' + message;
$(data.key).innerHTML = '<span class="{$failureicon}" title=":("></span>' + message;
}
if (data.feedback) {
var feedback_element = DIV();
......@@ -196,11 +197,11 @@ $js = <<< EOJS
else {
message = {$failurestring};
}
$(data.key).innerHTML = '<img src="{$failureicon}" alt=":(" /> ' + message;
$(data.key).innerHTML = '<span class="{$failureicon}" title=":("></span>' + message;
}
},
function () {
$(element).innerHTML = '<img src="{$failureicon}" alt=":(" /> ' + {$failurestring};
$(element).innerHTML = '<span class="{$failureicon}" title=":(" ></span>' + {$failurestring};
},
true);
}
......
......@@ -235,7 +235,7 @@ class ArtefactTypeAnnotation extends ArtefactType {
public static function get_icon($options=null) {
global $THEME;
return $THEME->get_image_url('annotation', 'artefact/annotation');
return false;
}
public static function get_links($id) {
......@@ -482,7 +482,7 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
public static function get_icon($options=null) {
global $THEME;
return $THEME->get_image_url('annotation', 'artefact/annotation');
return false;
}
public function delete() {
......@@ -1186,9 +1186,10 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
'artefactid' => array('type' => 'hidden', 'value' => $artefactid),
'blockid' => array('type' => 'hidden', 'value' => $blockid),
'submit' => array(
'type' => 'image',
'src' => $THEME->get_image_url('btn_deleteremove'),
'type' => 'button',
'usebuttontag' => true,
'value' => get_string('delete'),
'class' => 'btn btn-default',
'elementtitle' => get_string('delete'),
'confirm' => get_string('reallydeletethisannotationfeedback', 'artefact.annotation'),
'name' => 'delete_annotation_feedback_submit',
......
......@@ -263,7 +263,7 @@ class ArtefactTypeBlog extends ArtefactType {
public static function get_icon($options=null) {
global $THEME;
return $THEME->get_image_url('journal');
return false;
}
public static function is_singular() {
......@@ -707,7 +707,7 @@ class ArtefactTypeBlogPost extends ArtefactType {
public static function get_icon($options=null) {
global $THEME;
return $THEME->get_image_url('journal_entry');
return false;
}
public static function is_singular() {
......
......@@ -261,7 +261,7 @@ class ArtefactTypeComment extends ArtefactType {
public static function get_icon($options=null) {
global $THEME;
return $THEME->get_image_url('comment', 'artefact/comment');
return false;
}
public function delete() {
......
......@@ -48,6 +48,7 @@ $smarty = smarty(
)
);
$smarty->assign('heading', $group->name);
$smarty->assign('subsectionheading', get_string('Files', 'artefact.file'));
$smarty->assign('headingclass', 'page-header');
$smarty->assign('form', $form);
$smarty->assign('INLINEJAVASCRIPT', $js);
......
......@@ -851,7 +851,7 @@ class ArtefactTypeHtml extends ArtefactType {
public static function get_icon($options=null) {
global $THEME;
return $THEME->get_image_url('note', 'artefact/internal');
return false;
}
public static function is_singular() {
......
......@@ -137,7 +137,6 @@ $newhtml = activitylistin_html($type, $limit, $offset);
if (isset($newunread)) {
$newhtml['newunreadcount'] = $newunread;
$newhtml['newimage'] = $THEME->get_image_url($newunread ? 'newmail' : 'message');
}
json_reply(false, (object) array('message' => $message, 'data' => $newhtml));
......@@ -27,7 +27,6 @@ if ($readone) {
$unread = $USER->add_unread(-1);
$data = array(
'newunreadcount' => $unread,
'newimage' => $THEME->get_image_url($unread ? 'newmail' : 'message'),
);
json_reply(false, array('data' => $data));
}
......@@ -90,7 +89,6 @@ $newhtml = activitylistout_html($type, $limit, $offset);
if (isset($newunread)) {
$newhtml['newunreadcount'] = $newunread;
$newhtml['newimage'] = $THEME->get_image_url($newunread ? 'newmail' : 'message');
}
json_reply(false, (object) array('message' => $message, 'data' => $newhtml));
......@@ -81,7 +81,7 @@ class ArtefactTypePlan extends ArtefactType {
public static function get_icon($options=null) {
global $THEME;
return $THEME->get_image_url('plan', 'artefact/plans');
return false;
}
public static function is_singular() {
......@@ -355,7 +355,7 @@ class ArtefactTypeTask extends ArtefactType {
public static function get_icon($options=null) {
global $THEME;
return $THEME->get_image_url('plantask', 'artefact/plans');
return false;
}
public static function is_singular() {
......
......@@ -68,7 +68,7 @@ class PluginArtefactResume extends PluginArtefact {
'workskill' => array('text'),
);
}
public static function submenu_items() {
$tabs = array(
'index' => array(
......@@ -1053,8 +1053,8 @@ EOF;
$editjsstr = json_encode(get_string('editspecific', 'mahara', '%s')) . ".replace('%s', {$titlestring})";
$deljsstr = json_encode(get_string('deletespecific', 'mahara', '%s')) . ".replace('%s', {$titlestring})";
$imagemoveblockup = json_encode($THEME->get_image_url('btn_moveup'));
$imagemoveblockdown = json_encode($THEME->get_image_url('btn_movedown'));
$imagemoveblockup = false;
$imagemoveblockdown = false;
$upstr = get_string('moveup', 'artefact.resume');
$downstr = get_string('movedown', 'artefact.resume');
......@@ -1072,7 +1072,7 @@ EOF;
function (r, d) {
var buttons = [];
if (r._rownumber > 1) {
var up =
var up =
A({'href': '', 'class': 'moveup'},
SPAN({'class': 'fa fa-long-arrow-up'}),
SPAN({'class': 'sr-only'}, '{$upstr}'));
......@@ -1083,10 +1083,10 @@ EOF;
buttons.push(up);
}
if (!r._last) {
var down =
var down =
A({'href': '', 'class':'movedown'},
SPAN({'class': 'fa fa-long-arrow-down'}),
SPAN({'class': 'sr-only'}, '{$downstr}'));
SPAN({'class': 'sr-only'}, '{$downstr}'));
connect(down, 'onclick', function (e) {
e.stop();
return moveComposite(d.type, r.id, r.artefact, 'down');
......@@ -1102,14 +1102,14 @@ EOF;
$js .= <<<EOF
function (r, d) {
var editlink =
var editlink =
A({'href': 'editcomposite.php?id=' + r.id + '&artefact=' + r.artefact, 'title': {$editstr}, 'class': 'btn btn-default btn-xs'},
SPAN({'class': 'fa fa-pencil'}),
SPAN({'class': 'sr-only'}, {$editstr}));
var dellink =
var dellink =
A({'href': '', 'title': {$delstr}, 'class': 'btn btn-default btn-xs'},
SPAN({'class': 'fa fa-trash text-danger'}),
SPAN({'class': 'sr-only'}, {$deljsstr}));
SPAN({'class': 'sr-only'}, {$deljsstr}));
connect(dellink, 'onclick', function (e) {
e.stop();
return deleteComposite(d.type, r.id, r.artefact);
......
......@@ -92,20 +92,15 @@ class PluginAuthWebservice extends PluginAuth {
if (!is_plugin_active('webservice')) {
return array();
}
return array(
$map = array(
'configextensions/webservices' => array(
'path' => 'configextensions/webservices',
'url' => 'webservice/admin/index.php',
'title' => get_string('webservice', 'auth.webservice'),
'weight' => 50,
),
'configextensions/webservices/webservice' => array(
'path' => 'configextensions/webservices/webservice',
'parent' => 'configextensions/webservices',
'url' => 'webservice/admin/index.php',
'title' => get_string('webservicesconfig', 'auth.webservice'),
'weight' => 5,
),
'configextensions/webservices/oauthconfig' => array(
'path' => 'configextensions/webservices/oauthconfig',
'url' => 'webservice/admin/oauthv1sregister.php',
......@@ -131,6 +126,14 @@ class PluginAuthWebservice extends PluginAuth {
'weight' => 40,
),
);
if (defined('MENUITEM') && isset($map[MENUITEM])) {
$map[MENUITEM]['selected'] = true;
}
return $map;
}
/*
......
......@@ -28,6 +28,8 @@ $institutionname = param_alphanum('institution', false);
$urlparams = array();
$pageIcon = 'fa fa-bookmark';
$subsectionheading = false;
if (!empty($groupid)) {
define('MENUITEM', 'groups/collections');
define('GROUP', $groupid);
......@@ -39,9 +41,12 @@ if (!empty($groupid)) {
throw new GroupAccessDeniedException(get_string('cantlistgroupcollections', 'collection'));
}
define('SUBTITLE', get_string('groupcollections', 'collection'));
define('SUBTITLE', false);
define('TITLE', $group->name);
$urlparams['group'] = $groupid;
$subsectionheading = get_string('Collections', 'collection');
$pageIcon = '';
}
else if (!empty($institutionname)) {
if ($institutionname == 'mahara') {
......@@ -129,6 +134,14 @@ if (!empty($institutionname) && ($institutionname != 'mahara')) {
$smarty->assign('institutionselector', $s['institutionselector']);
$smarty->assign('INLINEJAVASCRIPT', $s['institutionselectorjs']);
}
if($subsectionheading){
$smarty->assign('subsectionheading', $subsectionheading);
}
if(SUBTITLE) {
$smarty->assign('PAGESUBHEADING', SUBTITLE);
}
$smarty->assign('canedit', $canedit);
$smarty->assign('urlparamsstr', $urlparamsstr);
$smarty->assign('collections', $data->data);
......@@ -136,6 +149,6 @@ $smarty->assign('pagination', $pagination['html']);
$smarty->assign('headingclass', 'page-header');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', $pageIcon);
$smarty->assign('PAGESUBHEADING', SUBTITLE);
$smarty->assign('SUBPAGETOP', 'collection/actions.tpl');
$smarty->display('collection/index.tpl');
......@@ -286,6 +286,7 @@ EOF;
$smarty = smarty(array('jquery','js/jquery/jquery-ui/js/jquery-ui-1.10.2.min.js','js/jquery/jquery-ui/js/jquery-ui.touch-punch.min.js'));
if (!empty($groupid)) {
$smarty->assign('PAGESUBHEADING', SUBTITLE);
$smarty->assign('PAGEHELPNAME', '0');
$smarty->assign('SUBPAGEHELPNAME', '1');
......@@ -293,6 +294,7 @@ if (!empty($groupid)) {
else {
$smarty->assign('PAGEHEADING', SUBTITLE);
}
$smarty->assign('PAGEICON', 'fa fa-folder-open');
$smarty->assign('INLINEJAVASCRIPT', $inlinejs);
$smarty->assign('baseurl', $baseurl);
......
......@@ -176,6 +176,7 @@ if ($role == 'admin') {
}
$smarty->assign('headingclass', 'page-header');
$smarty->assign('subsectionheading', get_string('members'));
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->assign('heading', $group->name);
$smarty->assign('form', $searchform);
......
......@@ -26,6 +26,7 @@ $accesslists = View::get_accesslists(null, $group->id);
$smarty = smarty();
$smarty->assign('heading', $group->name);
$smarty->assign('subsectionheading', TITLE);
$smarty->assign('headingclass', 'page-header');
$smarty->assign('accesslists', $accesslists);
$smarty->display('view/share.tpl');
......@@ -86,6 +86,8 @@ $smarty = smarty(
array(),
array('stylesheets' => array('style/views.css'))
);
$smarty->assign('INLINEJAVASCRIPT', $inlinejs);
$smarty->assign('viewid', $view->get('id'));
$smarty->assign('viewcontent', $viewcontent);
......@@ -94,4 +96,5 @@ $smarty->assign('editwindow', $editwindow);
$smarty->assign('returnto', 'view');
$smarty->assign('SUBPAGETOP', 'group/groupuserstatus.tpl');
$smarty->assign('headingclass', 'page-header');
$smarty->assign('subsectionheading', get_string('about'));
$smarty->display('group/view.tpl');
......@@ -108,6 +108,8 @@ $smarty->assign('publicgroup', $group->public);
$smarty->assign('feedlink', $feedlink);
$smarty->assign('heading', $group->name);
$smarty->assign('headingclass', 'page-header');
$smarty->assign('subsectionheading', get_string('nameplural', 'interaction.forum'));
$smarty->assign('rsswithtitle', true);
$smarty->assign('admin', $membership == 'admin');
$smarty->assign('groupadmins', group_get_admins(array($groupid)));
$smarty->assign('forums', $forums);
......
......@@ -68,15 +68,17 @@ $groupadmins = group_get_admin_ids($topic->groupid);
if ($membership && !$topic->forumsubscribed) {
$topic->subscribe = pieform(array(
'name' => 'subscribe_topic',
'renderer' => 'oneline',
'renderer' => 'div',
'plugintype' => 'interaction',
'pluginname' => 'forum',
'class' => 'form-as-button pull-left',
'autofocus' => false,
'elements' => array(
'submit' => array(
'type' => 'submit',
'class' => $topic->topicsubscribed ? 'btn btn-danger' : 'btn btn-success',
'value' => $topic->topicsubscribed ? get_string('unsubscribefromtopic', 'interaction.forum') : get_string('subscribetotopic', 'interaction.forum'),
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-default',
'value' => $topic->topicsubscribed ? '<span class="fa fa-lg fa-star-o prs text-danger"></span> ' . get_string('unsubscribefromtopic', 'interaction.forum') : '<span class="fa fa-lg fa-star prs text-primary"></span> ' . get_string('subscribetotopic', 'interaction.forum'),
'help' => false
),
'topic' => array(
......
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