Commit 07e4220b authored by Naomi Guyer's avatar Naomi Guyer Committed by Aaron Wells

NEW: optionally include parent theme css

Bug 1465107: Use Bootstrap CSS Framework

Change-Id: I59856e71b5aeba04474a017c4fd9d381c1ae56ac
parent dd18d93c
......@@ -70,7 +70,7 @@ if ($forums) {
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-default btn-xs',
'value' => $forum->subscribed ? '<span class="fa fa-lg fa-times prs text-danger"></span> ' . get_string('Unsubscribe', 'interaction.forum') : '<span class="fa fa-lg fa-star prs text-primary"></span> ' . get_string('Subscribe', 'interaction.forum'),
'value' => $forum->subscribed ? '<span class="fa fa-lg fa-times prs text-danger"></span> ' . get_string('Unsubscribe', 'interaction.forum') : '<span class="fa fa-lg fa-star prs text-success"></span> ' . get_string('Subscribe', 'interaction.forum'),
// 'help' => $i == 0 ? true : false
'help' => false
),
......
......@@ -78,7 +78,7 @@ if ($membership && !$topic->forumsubscribed) {
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-default',
'value' => $topic->topicsubscribed ? '<span class="fa fa-times fa-lg text-danger prs"></span>'. get_string('unsubscribefromtopic', 'interaction.forum') : '<span class="fa fa-star fa-lg text-primary prs"></span>' . get_string('subscribetotopic', 'interaction.forum'),
'value' => $topic->topicsubscribed ? '<span class="fa fa-times fa-lg text-danger prs"></span>'. get_string('unsubscribefromtopic', 'interaction.forum') : '<span class="fa fa-star fa-lg text-success prs"></span>' . get_string('subscribetotopic', 'interaction.forum'),
'help' => false
),
'topic' => array(
......
......@@ -182,7 +182,7 @@ if ($membership) {
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-default',
'value' => $forum->subscribed ? '<span class="fa fa-lg fa-times prs text-danger"></span> ' . get_string('unsubscribefromforum', 'interaction.forum') : '<span class="fa fa-lg fa-star prs text-primary"></span> ' . get_string('subscribetoforum', 'interaction.forum'),
'value' => $forum->subscribed ? '<span class="fa fa-lg fa-times prs text-danger"></span> ' . get_string('unsubscribefromforum', 'interaction.forum') : '<span class="fa fa-lg fa-star prs text-success"></span> ' . get_string('subscribetoforum', 'interaction.forum'),
'help' => false
),
'forum' => array(
......
......@@ -103,7 +103,7 @@ mark,
color: $text-muted;
}
@include text-emphasis-variant('.text-primary', $brand-primary);
@include text-emphasis-variant('.text-success', $brand-primary);
@include text-emphasis-variant('.text-success', $state-success-text);
......
......@@ -1127,7 +1127,7 @@ function group_get_accept_form($name, $groupid, $returnto) {
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-default',
'value' => '<span class="fa fa-lg fa-check text-primary prs"></span> ' . get_string('acceptinvitegroup', 'group')
'value' => '<span class="fa fa-lg fa-check text-success prs"></span> ' . get_string('acceptinvitegroup', 'group')
),
'decline' => array(
'type' => 'button',
......@@ -1171,7 +1171,7 @@ function group_get_adduser_form($userid, $groupid) {
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-default',
'value' => '<span class="prs fa fa-lg fa-check text-primary"></span> ' .get_string('add'),
'value' => '<span class="prs fa fa-lg fa-check text-success"></span> ' .get_string('add'),
),
),
));
......
......@@ -6086,7 +6086,7 @@ function create_view_form($group=null, $institution=null, $template=null, $colle
'type' => 'button',
'usebuttontag' => true,
'class' => 'btn btn-default',
'value' => '<span class="fa fa-plus fa-lg text-primary prs"></span>' . get_string('createview', 'view'),
'value' => '<span class="fa fa-plus fa-lg text-success prs"></span>' . get_string('createview', 'view'),
),
)
);
......
......@@ -20,6 +20,82 @@ function smarty_core() {
}
/**
* Helper function to determine what css to include
* podclass app, setting up some variables.
*
* @param $strings A list of language strings required by the javascript code.
* @return array
*/
function getStyleSheets($stylesheets){
global $USER, $SESSION, $THEME, $HEADDATA, $langselectform;
// stylesheet set up - if we're in a plugin also get its stylesheet
$allstylesheets = $THEME->get_url('style/style.css', true);
// determine if we want to include the parent css
if(isset($THEME->overrideparentcss) && $THEME->overrideparentcss && $THEME->parent){
unset($allstylesheets[$THEME->parent]);
}
$stylesheets = array_merge($stylesheets, array_reverse(array_values($allstylesheets)));
if (defined('SECTION_PLUGINTYPE') && defined('SECTION_PLUGINNAME') && SECTION_PLUGINTYPE != 'core') {
if ($pluginsheets = $THEME->get_url('style/style.css', true, SECTION_PLUGINTYPE . '/' . SECTION_PLUGINNAME)) {
$stylesheets = array_merge($stylesheets, array_reverse($pluginsheets));
}
}
if ($adminsection = in_admin_section()) {
if ($adminsheets = $THEME->get_url('style/admin.css', true)) {
$stylesheets = array_merge($stylesheets, array_reverse($adminsheets));
}
}
if (get_config('developermode') & DEVMODE_DEBUGCSS) {
$stylesheets[] = get_config('wwwroot') . 'theme/debug.css';
}
// look for extra stylesheets
if (isset($extraconfig['stylesheets']) && is_array($extraconfig['stylesheets'])) {
foreach ($extraconfig['stylesheets'] as $extrasheet) {
if ($sheets = $THEME->get_url($extrasheet, true)) {
$stylesheets = array_merge($stylesheets, array_reverse(array_values($sheets)));
}
}
}
if ($sheets = $THEME->additional_stylesheets()) {
$stylesheets = array_merge($stylesheets, $sheets);
}
// Give the skin a chance to affect the page
if (!empty($extraconfig['skin'])) {
require_once(get_config('docroot').'/lib/skin.php');
$skinobj = new Skin($extraconfig['skin']['skinid']);
$viewid = isset($extraconfig['skin']['viewid']) ? $extraconfig['skin']['viewid'] : null;
$stylesheets = array_merge($stylesheets, $skinobj->get_stylesheets($viewid));
}
$langdirection = get_string('thisdirection', 'langconfig');
// Include rtl.css for right-to-left langs
if ($langdirection == 'rtl') {
$smarty->assign('LANGDIRECTION', 'rtl');
if ($rtlsheets = $THEME->get_url('style/rtl.css', true)) {
$stylesheets = array_merge($stylesheets, array_reverse($rtlsheets));
}
}
$stylesheets = append_version_number($stylesheets);
return $stylesheets;
}
/**
* This function creates a Smarty object and sets it up for use within our
* podclass app, setting up some variables.
......@@ -45,6 +121,8 @@ function smarty_core() {
* @return Smarty
*/
function smarty($javascript = array(), $headers = array(), $pagestrings = array(), $extraconfig = array()) {
global $USER, $SESSION, $THEME, $HEADDATA, $langselectform;
......@@ -87,6 +165,7 @@ function smarty($javascript = array(), $headers = array(), $pagestrings = array(
}
$theme_list = array();
$adminsection = in_admin_section();
if (function_exists('pieform_get_headdata')) {
$headers = array_merge($headers, pieform_get_headdata());
......@@ -421,57 +500,14 @@ EOF;
$stringjs .= "\nfunction plural(n) { return " . get_raw_string('pluralrule', 'langconfig') . "; }\n";
$stringjs .= '</script>';
// stylesheet set up - if we're in a plugin also get its stylesheet
$stylesheets = array_merge($stylesheets, array_reverse(array_values($THEME->get_url('style/style.css', true))));
if (defined('SECTION_PLUGINTYPE') && defined('SECTION_PLUGINNAME') && SECTION_PLUGINTYPE != 'core') {
if ($pluginsheets = $THEME->get_url('style/style.css', true, SECTION_PLUGINTYPE . '/' . SECTION_PLUGINNAME)) {
$stylesheets = array_merge($stylesheets, array_reverse($pluginsheets));
}
}
if ($adminsection = in_admin_section()) {
if ($adminsheets = $THEME->get_url('style/admin.css', true)) {
$stylesheets = array_merge($stylesheets, array_reverse($adminsheets));
}
}
if (get_config('developermode') & DEVMODE_DEBUGCSS) {
$stylesheets[] = get_config('wwwroot') . 'theme/debug.css';
}
// look for extra stylesheets
if (isset($extraconfig['stylesheets']) && is_array($extraconfig['stylesheets'])) {
foreach ($extraconfig['stylesheets'] as $extrasheet) {
if ($sheets = $THEME->get_url($extrasheet, true)) {
$stylesheets = array_merge($stylesheets, array_reverse(array_values($sheets)));
}
}
}
if ($sheets = $THEME->additional_stylesheets()) {
$stylesheets = array_merge($stylesheets, $sheets);
}
// Give the skin a chance to affect the page
if (!empty($extraconfig['skin'])) {
require_once(get_config('docroot').'/lib/skin.php');
$skinobj = new Skin($extraconfig['skin']['skinid']);
$viewid = isset($extraconfig['skin']['viewid']) ? $extraconfig['skin']['viewid'] : null;
$stylesheets = array_merge($stylesheets, $skinobj->get_stylesheets($viewid));
}
// Allow us to set the HTML lang attribute
$smarty->assign('LANGUAGE', substr(current_language(), 0, 2));
// Include rtl.css for right-to-left langs
if ($langdirection == 'rtl') {
$smarty->assign('LANGDIRECTION', 'rtl');
if ($rtlsheets = $THEME->get_url('style/rtl.css', true)) {
$stylesheets = array_merge($stylesheets, array_reverse($rtlsheets));
}
}
$smarty->assign('STRINGJS', $stringjs);
$stylesheets = append_version_number($stylesheets);
$stylesheets = getStyleSheets($stylesheets);
$smarty->assign('STYLESHEETLIST', $stylesheets);
if (!empty($theme_list)) {
// this gets assigned in smarty_core, but do it again here if it's changed locally
......
# Require any additional compass plugins here.
# Uncomment these to use regular Ruby gems.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "style"
sass_dir = "sass"
images_dir = "images"
# You can select your preferred output style here (can be overridden via the command line) :nested or :expanded or :compact or :compressed:
output_style = :expanded
# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true
# To disable debugging comments that display the original location of your selectors. Uncomment:
line_comments = true
# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
// Generic custom css (anything longer than a screen view should have its own component file)
// *
// * This file is for hotfixes, hacks, and anything that you don't have time to test
// * or implement properly. If you are unsure where to put something, it is ok to put it
// * here.
// *
// * Please comment