Commit 4739efeb authored by Naomi Guyer's avatar Naomi Guyer Committed by Aaron Wells

NEW:Optionally include parent theme, Forms, icons, tidyup (bootstrap)

Bug 1465107: Use Bootstrap CSS Framework

Change-Id: I1f631d6f2637b22e00ea9e0972f0447a52304f4c
parent 848a06fd
......@@ -42,11 +42,12 @@ foreach ($cleanurlconfigkeys as $k) {
}
$smarty = smarty();
setpageicon($smarty, 'icon-puzzle-piece');
$smarty->assign('cleanurls', get_config('cleanurls'));
$smarty->assign('cleanurlconfig', $cleanurlconfig);
$smarty->assign('regenerateform', $regenerateform);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-puzzle-piece');
$smarty->display('admin/extensions/cleanurls.tpl');
// Regenerates urlids for users, groups, and portfolio pages.
......
......@@ -47,9 +47,10 @@ function reloadfilters_submit(Pieform $form, $values) {
}
$smarty = smarty();
setpageicon($smarty, 'icon-puzzle-piece');
$smarty->assign('reloadform', $reloadform);
$smarty->assign('newfiltersdescription', get_string('newfiltersdescription', 'admin', get_config('libroot') . 'htmlpurifiercustom'));
$smarty->assign('filters', $filters);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-puzzle-piece');
$smarty->display('admin/extensions/filters.tpl');
......@@ -255,8 +255,9 @@ $js = <<<EOF
EOF;
$smarty = smarty();
setpageicon($smarty, 'icon-puzzle-piece');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-puzzle-piece');
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->assign('editurls', $editurls);
$smarty->assign('newform', $newform);
......
......@@ -138,9 +138,9 @@ foreach (array_keys($plugins) as $plugin) {
global $THEME;
$loadingicon = 'fa fa-spinner fa-pulse';
$successicon = 'fa fa-check text-success';
$failureicon = 'fa fa-exclaimation-triangle';
$loadingicon = 'icon icon-spinner icon-pulse';
$successicon = 'icon icon-check text-success';
$failureicon = 'icon icon-exclaimation-triangle';
$loadingstring = json_encode(get_string('upgradeloading', 'admin'));
$successstring = json_encode(get_string('upgradesuccesstoversion', 'admin'));
......@@ -188,9 +188,10 @@ JAVASCRIPT;
$smarty = smarty();
setpageicon($smarty, 'icon-puzzle-piece');
$smarty->assign('INLINEJAVASCRIPT', $javascript);
$smarty->assign('plugins', $plugins);
$smarty->assign('installlink', 'installplugin');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-puzzle-piece');
$smarty->display('admin/extensions/plugins.tpl');
......@@ -56,6 +56,8 @@ addLoadEvent(function() {
EOF;
$smarty = smarty(array('adminexportqueue','paginator'), array(), array('ascending' => 'mahara', 'descending' => 'mahara'));
setpageicon($smarty, 'icon-users');
$smarty->assign('search', $search);
$smarty->assign('limit', $limit);
$smarty->assign('institutions', $institutions);
......@@ -67,5 +69,4 @@ $smarty->assign('sortby', $search['sortby']);
$smarty->assign('sortdir', $search['sortdir']);
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-users');
$smarty->display('admin/groups/archives.tpl');
\ No newline at end of file
$smarty->display('admin/groups/archives.tpl');
......@@ -88,20 +88,20 @@ function formatrow (item) {
'type':'button',
'title':{$getstring['edit']},
'alt':{$getstring['editspecific']}.replace('%s', item.name)},
SPAN({'class':'fa fa-cog'}),
SPAN({'class':'icon icon-cog'}),
SPAN({'class':'sr-only'}, {$getstring['editspecific']}.replace('%s', item.name))
);
connect(edit, 'onclick', function (e) { e.stop(); edititem(item); });
var del = BUTTON({
'class':'btn btn-default btn-sm',
'id':'item' + item.id,
'type':'button',
'title':{$getstring['delete']},
'alt':{$getstring['deletespecific']}.replace('%s', item.name)},
SPAN({'class':'fa fa-trash text-danger'}),
SPAN({'class':'icon icon-trash text-danger'}),
SPAN({'class':'sr-only'}, {$getstring['deletespecific']}.replace('%s', item.name))
);
......@@ -222,8 +222,9 @@ addLoadEvent(function () {
EOJS;
$smarty = smarty();
setpageicon($smarty, 'icon-users');
$smarty->assign('PAGEHEADING', hsc(get_string('groupcategories', 'admin')));
$smarty->assign('PAGEICON', 'fa fa-users');
$smarty->assign('INLINEJAVASCRIPT', $ijs);
$smarty->assign('optionform', $optionform);
$smarty->display('admin/groups/groupcategories.tpl');
......@@ -64,8 +64,9 @@ connect('search_submit', 'onclick', function (event) {
EOF;
$smarty = smarty(array('paginator'));
setpageicon($smarty, 'icon-users');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-users');
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->assign('searchform', $searchform);
$smarty->assign('results', $data);
......
......@@ -124,8 +124,9 @@ function groupadminsform_submit(Pieform $form, $values) {
}
$smarty = smarty();
setpageicon($smarty, 'icon-users');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-users');
$smarty->assign('quotasform', $quotasform);
$smarty->assign('groupname', $group->name);
$smarty->assign('managegroupform', $groupadminsform);
......
......@@ -377,8 +377,8 @@ $form = pieform($form);
set_progress_done('uploadgroupscsv');
$smarty = smarty(array('adminuploadcsv'));
setpageicon($smarty, 'icon-users');
$smarty->assign('uploadcsvpagedescription', $uploadcsvpagedescription);
$smarty->assign('uploadcsvform', $form);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-users');
$smarty->display('admin/groups/uploadcsv.tpl');
......@@ -238,8 +238,9 @@ $form = pieform($form);
set_progress_done('uploadgroupmemberscsv');
$smarty = smarty(array('adminuploadcsv'));
setpageicon($smarty, 'icon-users');
$smarty->assign('uploadcsvpagedescription', $uploadcsvpagedescription);
$smarty->assign('uploadcsvform', $form);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-users');
$smarty->display('admin/groups/uploadcsv.tpl');
......@@ -28,11 +28,10 @@ if (!get_config('registration_lastsent')) {
$smarty = smarty();
setpageicon($smarty, 'icon-star');
if (isset($register)) {
$smarty->assign('register', $register);
}
$smarty->assign('PAGEICON', 'fa fa-star');
$smarty->display('admin/registersite.tpl');
......@@ -40,7 +40,7 @@ $form = pieform(array(
'defaultvalue' => $enabled,
),
'generaloptions' => array(
'iconclass' => 'fa fa-cog',
'iconclass' => 'icon icon-cog',
'class' => 'first',
'type' => 'fieldset',
'collapsible' => true,
......@@ -92,7 +92,7 @@ $form = pieform(array(
),
),
'stylingoptions' => array(
'iconclass' => 'fa fa-paint-brush',
'iconclass' => 'icon icon-paint-brush',
'type' => 'fieldset',
'collapsible' => true,
'collapsed' => ($enabled ? false : true),
......@@ -140,7 +140,7 @@ $form = pieform(array(
),
),
'featureoptions' => array(
'iconclass' => 'fa fa-star',
'iconclass' => 'icon icon-star',
'class' => 'last',
'type' => 'fieldset',
'collapsible' => true,
......@@ -202,6 +202,8 @@ function cookieconsent_submit(Pieform $form, $values) {
$smarty = smarty(array('expandable'));
setpageicon($smarty, 'icon-shield');
$smarty->assign('form', $form);
$smarty->assign('introtext1', get_string('cookieconsentintro1', 'cookieconsent'));
$smarty->assign('introtext2', get_string('cookieconsentintro2', 'cookieconsent'));
......@@ -211,6 +213,4 @@ $smarty->assign('introtext5', get_string('cookieconsentintro51', 'cookieconsent'
// Official EU languages
$smarty->assign('languages', array('BG','CS','DA','DE','EL','EN','ES','ET','FI','FR','HU','IT','LT','LV','MT','NL','PL','PT','RO','SK','SL','SV'));
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-shield');
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->display('admin/site/cookieconsent.tpl');
......@@ -26,7 +26,7 @@ define('DEFAULTPAGE', 'home');
$examplesocialbefore = <<<CODE
<pre>
&lt;div id="fb-root"&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;(function(d, s, id) {
&lt;script type="application/javascript"&gt;(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
......@@ -51,14 +51,14 @@ CODE;
$exampleanalyticsbefore = <<<CODE
<pre>
&lt;script type="text/javascript"&gt;
&lt;script type="application/javascript"&gt;
// &lt;![CDATA[
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-00000000-1']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
var ga = document.createElement('script'); ga.type = 'application/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
......@@ -76,7 +76,7 @@ $exampleanalyticsafter = <<<CODE
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
var ga = document.createElement('script'); ga.type = 'application/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
......@@ -87,7 +87,7 @@ CODE;
$exampleadvertisingbefore = <<<CODE
<pre>
&lt;script type="text/javascript"&gt;
&lt;script type="application/javascript"&gt;
&lt;!--
google_ad_client = "ca-pub-0000000000000000";
/* test */
......@@ -96,7 +96,7 @@ $exampleadvertisingbefore = <<<CODE
google_ad_height = 90;
//-->
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;script type="application/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
</pre>
CODE;
......@@ -119,7 +119,7 @@ CODE;
$examplenecessarybefore = <<<CODE
<pre>
&lt;script type="text/javascript"&gt;
&lt;script type="application/javascript"&gt;
&lt;!--
google_ad_client = "ca-pub-0000000000000000";
/* test */
......@@ -128,7 +128,7 @@ $examplenecessarybefore = <<<CODE
google_ad_height = 90;
//-->
&lt;/script&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;script type="application/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
</pre>
CODE;
......
......@@ -43,8 +43,9 @@ $extralicenses = get_column_sql("
");
$smarty = smarty();
setpageicon($smarty, 'icon-legal');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-legal');
$smarty->assign('licenses', $licenses);
$smarty->assign('extralicenses', $extralicenses);
$smarty->assign('enabled', get_config('licensemetadata'));
......
......@@ -321,10 +321,11 @@ function footerlinks_submit(Pieform $form, $values) {
$smarty = smarty();
setpageicon($smarty, 'icon-bars');
$smarty->assign('INLINEJAVASCRIPT', $ijs);
$smarty->assign('MENUS', $menulist);
$smarty->assign('descriptionstrargs', array('<a href="' . get_config('wwwroot') . 'artefact/file/sitefiles.php">', '</a>'));
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-bars');
$smarty->assign('footerform', $footerform);
$smarty->display('admin/site/menu.tpl');
......@@ -28,8 +28,9 @@ $xmlrpcext = extension_loaded('xmlrpc');
if (!$opensslext || !$curlext || !$xmlrpcext) {
$smarty = smarty();
setpageicon($smarty, 'icon-exchange');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-exchange');
$missingextensions = array();
!$opensslext && $missingextensions[] = 'openssl';
!$curlext && $missingextensions[] = 'curl';
......@@ -161,7 +162,7 @@ function networkingform_submit(Pieform $form, $values) {
}
$smarty = smarty();
setpageicon($smarty, 'icon-exchange');
$smarty->assign('networkingform', $networkingform);
$smarty->assign('PAGEICON', 'fa fa-exchange');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->display('admin/site/networking.tpl');
......@@ -974,8 +974,8 @@ EOF;
$thispage = json_encode(get_config('wwwroot') . 'admin/site/options.php');
$smarty = smarty(array('adminsiteoptions'));
setpageicon($smarty, 'icon-cogs');
$smarty->assign('siteoptionform', $siteoptionform);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-cogs');
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->display('admin/site/options.tpl');
......@@ -91,7 +91,8 @@ function editsitepage_submit(Pieform $form, $values) {
}
$smarty = smarty(array('adminsitepages'), array(), array('admin' => array('discardpageedits')));
setpageicon($smarty, 'icon-pencil');
$smarty->assign('pageeditform', $form);
$smarty->assign('PAGEICON', 'fa fa-pencil');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->display('admin/site/pages.tpl');
......@@ -19,7 +19,8 @@ define('TITLE', get_string('share', 'view'));
$accesslists = View::get_accesslists(null, null, 'mahara');
$smarty = smarty();
$smarty->assign('PAGEICON', 'fa fa-key');
setpageicon($smarty, 'icon-key');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('accesslists', $accesslists);
$smarty->display('view/share.tpl');
......@@ -45,7 +45,7 @@ $css = array(
);
$smarty = smarty(array(), $css, array(), array());
$smarty = smarty(array(), $css);
$smarty->assign('skins', $data->data);
$smarty->assign('siteskins', true);
$smarty->assign('pagination', $pagination['html']);
......
......@@ -59,8 +59,9 @@ $js .= '});';
$createviewform = pieform(create_view_form(null, 'mahara'));
$smarty = smarty(array('paginator'));
setpageicon($smarty, 'icon-file-text');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-file-text');
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->assign('views', $views);
$smarty->assign('institution', 'mahara');
......
......@@ -66,8 +66,9 @@ addLoadEvent(function () {
EOF;
$smarty = smarty(array('paginator'));
setpageicon($smarty, 'icon-area-chart');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-area-chart');
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->assign('sitedata', $sitedata);
......
......@@ -85,10 +85,10 @@ if (empty($upgrades['core']->install)) {
}
}
$loadingicon = 'fa fa-spinner fa-pulse';
$successicon = 'fa fa-check text-success';
$failureicon = 'fa fa-minus-circle text-danger';
$warningicon = 'fa fa-exclaimation-triangle';
$loadingicon = 'icon icon-spinner icon-pulse';
$successicon = 'icon icon-check text-success';
$failureicon = 'icon icon-exclaimation-triangle';
$warningicon = 'icon icon-exclaimation-triangle';
// Remove all files in the smarty and dwoo caches
......
......@@ -359,7 +359,7 @@ function adduser_submit(Pieform $form, $values) {
}
$smarty = smarty(array('adminadduser'));
setpageicon($smarty, 'icon-user-plus');
$smarty->assign('form', $form);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-user-plus');
$smarty->display('admin/users/add.tpl');
......@@ -68,7 +68,8 @@ function adminusers_submit(Pieform $form, $values) {
}
$smarty = smarty();
setpageicon($smarty, 'icon-user');
$smarty->assign('adminusersform', $form);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-user');
$smarty->display('admin/users/admin.tpl');
......@@ -160,6 +160,7 @@ addLoadEvent(function() {
EOF;
$smarty = smarty(array('adminexportqueue', 'paginator'), array(), array('ascending' => 'mahara', 'descending' => 'mahara'));
setpageicon($smarty, 'icon-user');
$smarty->assign('search', $search);
$smarty->assign('limit', $limit);
$smarty->assign('institutions', $institutions);
......@@ -171,5 +172,4 @@ $smarty->assign('sortby', $search['sortby']);
$smarty->assign('sortdir', $search['sortdir']);
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-user');
$smarty->display('admin/users/exportqueue.tpl');
......@@ -24,6 +24,8 @@ $s = institution_selector_for_page(param_alphanum('institution', false),
$institution = $s['institution'];
$smarty = smarty();
setpageicon($smarty, 'icon-university');
if ($institution === false) {
$smarty->display('admin/users/noinstitutions.tpl');
exit;
......@@ -95,5 +97,4 @@ addLoadEvent(function() {
});');
$smarty->assign('adminusersform', pieform($form));
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-university');
$smarty->display('admin/users/institutionadmins.tpl');
......@@ -47,7 +47,7 @@ else if (!empty($institutionselector['options']) && sizeof($institutionselector[
}
else if (empty($institutionselector['options'])) {
// Only the 'no institution' institution exists so we need to display this fact
$smarty = smarty(array(), array(), array());
$smarty = smarty();
$smarty->assign('noinstitutionsadmin', (($USER->admin) ? get_string('noinstitutionstaticpagesadmin', 'admin', get_config('wwwroot') . 'admin/site/pages.php') : false));
$smarty->assign('noinstitutions', get_string('noinstitutionstaticpages', 'admin'));
$smarty->assign('PAGEHEADING', TITLE);
......@@ -150,8 +150,9 @@ function editsitepage_submit(Pieform $form, $values) {
}
$smarty = smarty(array('adminsitepages'), array(), array('admin' => array('discardpageedits')));
setpageicon($smarty, 'icon-university');
$smarty->assign('noinstitutionsadmin', (($USER->admin) ? get_string('noinstitutionstaticpagesadmin', 'admin', get_config('wwwroot') . 'admin/site/pages.php') : false));
$smarty->assign('pageeditform', $form);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-university');
$smarty->display('admin/site/pages.tpl');
......@@ -607,6 +607,7 @@ else {
$data = build_institutions_html($filter, $showdefault, $query, $limit, $offset, $count);
$smarty = smarty(array('lib/pieforms/static/core/pieforms.js', 'paginator'));
setpageicon($smarty, 'icon-university');
$smarty->assign('results', $data);
$smarty->assign('countinstitutions', $count);
......@@ -642,7 +643,6 @@ EOF;
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->assign('siteadmin', $USER->get('admin'));
$smarty->assign('PAGEICON', 'fa fa-university');
$smarty->assign('PAGEHEADING', get_string('admininstitutions', 'admin'));
$smarty->display('admin/users/institutions.tpl');
exit;
......@@ -1124,6 +1124,8 @@ $j(function() {
';
$smarty = smarty();
setpageicon($smarty, 'icon-university');
$smarty->assign('INLINEJAVASCRIPT', $themeoptionsjs);
$smarty->assign('institution_form', $institutionform);
$smarty->assign('instancestring', $instancestring);
......@@ -1142,7 +1144,6 @@ if (isset($suspended)) {
}
$smarty->assign('PAGEHEADING', get_string('admininstitutions', 'admin'));
$smarty->assign('PAGEICON', 'fa fa-university');
$smarty->display('admin/users/institutions.tpl');
function theme_sort($a, $b) {
......
......@@ -24,6 +24,9 @@ $s = institution_selector_for_page(param_alphanum('institution', false),
$institution = $s['institution'];
$smarty = smarty();
setpageicon($smarty, 'icon-university');
if ($institution === false) {
$smarty->display('admin/users/noinstitutions.tpl');
exit;
......@@ -93,5 +96,4 @@ addLoadEvent(function() {
});');
$smarty->assign('staffusersform', pieform($form));
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-university');
$smarty->display('admin/users/institutionstaff.tpl');
......@@ -289,10 +289,10 @@ addLoadEvent(function() {
EOF;
$smarty = smarty();
setpageicon($smarty, 'icon-university');
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->assign('usertypeselector', $usertypeselector);
$smarty->assign('instructions', get_string('institutionusersinstructions' . $usertype . '1', 'admin', $userlistelement['lefttitle'], $userlistelement['righttitle']));
$smarty->assign('institutionusersform', $userlistform);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-university');
$smarty->display('admin/users/institutionusers.tpl');
......@@ -71,8 +71,9 @@ if ($userinstitutions) {
}
$smarty = smarty();
setpageicon($smarty, 'icon-university');
$smarty->assign('users', $users);
$smarty->assign('types', $types);
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-university');
$smarty->display('admin/users/notifications.tpl');
......@@ -75,8 +75,9 @@ addLoadEvent(function() {
EOF;
$smarty = smarty();
setpageicon($smarty, 'icon-university');
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('PAGEICON', 'fa fa-university');
$smarty->assign('INLINEJAVASCRIPT', $js);