Skip to content

Commit

Permalink
Make theme a mandatory 'normal' attribute of learningObject in stead of
Browse files Browse the repository at this point in the history
optional

 - A mandatory attribute will always be added, even for an existing LO.
   This is new beheviour.
  • Loading branch information
torinfo committed Mar 7, 2015
1 parent 7b939d1 commit d7934e1
Show file tree
Hide file tree
Showing 7 changed files with 506 additions and 528 deletions.
5 changes: 1 addition & 4 deletions editor/js/toolbox.js
Expand Up @@ -1208,10 +1208,7 @@ var EDITOR = (function ($, parent) {
}
else
{
if (name in lo_data[key]['attributes'])
{
lo_data[key]['attributes'][name] = values[i];
}
lo_data[key]['attributes'][name] = values[i];
}

});
Expand Down
4 changes: 4 additions & 0 deletions editor/js/tree.js
Expand Up @@ -575,6 +575,10 @@ var EDITOR = (function ($, parent) {
{
toolbox.displayParameter('#mainPanel .wizard', node_options['normal'], attribute_name, attribute_value.value, key);
}
else if (node_options['normal'][i].value.mandatory)
{
toolbox.displayParameter('#mainPanel .wizard', node_options['normal'], attribute_name, node_options['normal'][i].value.defaultValue, key);
}
}

$('#languagePanel').html("<hr><table class=\"wizard\" border=\"0\">");
Expand Down
2 changes: 2 additions & 0 deletions modules/xerte/edithtml.php
Expand Up @@ -109,6 +109,8 @@ function output_editor_code($row_edit, $xerte_toolkits_site, $read_status, $vers
*/
$theme_folder = $xerte_toolkits_site->root_file_path . "themes/" . $row_edit['template_name'] . "/";
$ThemeList = array();
// Add default theme
$ThemeList[] = array(name => "default", display_name => "Xerte Online Toolkits", description => "Xerte Online Toolkits", preview => "");
$d = opendir($theme_folder);
while($f = readdir($d)){
if(is_dir($theme_folder . $f)){
Expand Down
Expand Up @@ -229,6 +229,16 @@ x_makeAbsolute = function(html){
}
pos = temp.indexOf('FileLocation + \'');
}
var pos = temp.indexOf('FileLocation%20+%20\'');
while (pos >= 0)
{
var pos2 = temp.substr(pos+20).indexOf("'") + pos;
if (pos2>=0)
{
temp = temp.substr(0, pos) + FileLocation + temp.substr(pos + 20, pos2-pos) + temp.substr(pos2+21);
}
pos = temp.indexOf('FileLocation%20+%20\'');
}
return temp;
}

Expand Down Expand Up @@ -395,7 +405,7 @@ function x_setUp() {
if (x_params.stylesheet != undefined) {
x_insertCSS(eval(x_params.stylesheet));
}
if (x_params.theme != undefined) {
if (x_params.theme != undefined && x_params.theme != "default") {
x_insertCSS(x_themePath + x_params.theme + '/' + x_params.theme + '.css');
}

Expand Down Expand Up @@ -950,7 +960,7 @@ function x_changePage(x_gotoPage) {
// Start page tracking -- NOTE: You HAVE to do this before pageLoad and/or Page setup, because pageload could trigger XTSetPageType and/or XTEnterInteraction
XTEnterPage(x_currentPage, pageTitle);

var builtPage = x_pageInfo[x_currentPage].built;
var builtPage = x_makeAbsolute(x_pageInfo[x_currentPage].built);
$x_pageDiv.append(builtPage);
builtPage.hide();
builtPage.fadeIn();
Expand Down
1,005 changes: 485 additions & 520 deletions modules/xerte/parent_templates/Nottingham/wizards/en-GB/data.xwd

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion modules/xerte/templates/Nottingham/data.xml
@@ -1 +1 @@
<learningObject name="Learning Object Title" navigation="Linear" textSize="12" displayMode="default" />
<learningObject name="Learning Object Title" navigation="Linear" textSize="12" theme="default" displayMode="default" />
2 changes: 1 addition & 1 deletion src/Nottingham/wizards/en-GB/basic.xwd
Expand Up @@ -7,6 +7,7 @@
<textSize type="ComboBox" options="10,12,14,16,18,24,36" label="Default Text Size" width="100"/>
<visuals optional="true" type="ComboBox" options="No Visuals,Default Visuals,Clean Visuals without titles, Clean Visuals with titles" data="0,1,2,3" label="Flash Engine Visuals" defaultValue="1" width="250" flashonly="true" />
<language type="LanguageList" label="Language" width="170"/>
<theme type="ThemeList" label="Theme" mandatory="true" defaultValue="default" />
<hideHeader optional="true" type="CheckBox" label="Hide Header" defaultValue="false" />
<hideFooter optional="true" type="CheckBox" label="Hide Footer" defaultValue="false" />
<fixDisplay optional="true" type="TextInput" label="Fixed Display Size" defaultValue="800,600" />
Expand Down Expand Up @@ -36,7 +37,6 @@
<stylesheet optional="true" type="Media" label="Stylesheet"/>
<authorSupport label="Add Author Support" type="Checkbox" defaultValue="true" optional="true"/>
<trackingMode optional="true" label="SCORM tracking mode" width="250" type="ComboBox" options="Full tracking of first pass,Minimal tracking of first pass,Full tracking of last pass,Minimal tracking of last pass,No tracking" data="full_first,minimal_first,full,minimal,none" defaultValue="full_first" />
<theme optional="true" type="ThemeList" label="Theme" defaultValue=""/>
<resume label="Enable resuming" type="CheckBox" defaultValue="false" optional="true"/>

<newNodes>
Expand Down

0 comments on commit d7934e1

Please sign in to comment.