Skip to content

Commit

Permalink
Dev: Template => Theme, themes.
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Nov 22, 2017
1 parent d6aa20f commit 3060ceb
Show file tree
Hide file tree
Showing 23 changed files with 183 additions and 139 deletions.
2 changes: 1 addition & 1 deletion application/config/version.php
Expand Up @@ -14,7 +14,7 @@

$config['versionnumber'] = '3.0.0-RC.3'; //The current version of this branch
$config['masterversion'] = '2.67.3'; //The current masters version merged into this branch
$config['dbversionnumber'] = 327;
$config['dbversionnumber'] = 328;
$config['buildnumber'] = '';
$config['updatable'] = true;
$config['assetsversionnumber'] = '3009';
Expand Down
17 changes: 17 additions & 0 deletions application/helpers/update/updatedb_helper.php
Expand Up @@ -678,6 +678,13 @@ function db_upgrade_all($iOldDBVersion, $bSilent = false) {
$oDB->createCommand()->update('{{settings_global}}', array('stg_value'=>327), "stg_name='DBVersion'");
$oTransaction->commit();
}

if ($iOldDBVersion < 328) {
$oTransaction = $oDB->beginTransaction();
upgrade328($oDB);
$oDB->createCommand()->update('{{settings_global}}', array('stg_value'=>328), "stg_name='DBVersion'");
$oTransaction->commit();
}
}
catch (Exception $e)
{
Expand Down Expand Up @@ -724,6 +731,16 @@ function db_upgrade_all($iOldDBVersion, $bSilent = false) {
}


/**
* @param $oDB
* @return void
*/
function upgrade328($oDB)
{
$oDB->createCommand()->update('{{templates}}', array(
'description' => "<strong>LimeSurvey Advanced Theme</strong><br>A theme with custom options to show what it's possible to do with the new engines. Each theme provider will be able to offer its own option page (loaded from theme)",
), "name='default'");
}

/**
* @param $oDB
Expand Down
12 changes: 6 additions & 6 deletions installer/create-database.php
Expand Up @@ -722,11 +722,11 @@ function createDatabase($oDB){
$oDB->createCommand()->createIndex('{{idx4_templates}}', '{{templates}}', 'extends', false);

$headerArray = ['name','folder','title','creation_date','author','author_email','author_url','copyright','license','version','api_version','view_folder','files_folder','description','last_update','owner_id','extends'];
$oDB->createCommand()->insert("{{templates}}", array_combine($headerArray, ['default', 'default', 'Advanced Template', date('Y-m-d H:i:s'), 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\\r\\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\\r\\n\\r\\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '1.0', '3.0', 'views', 'files', "<strong>LimeSurvey Advanced Template</strong><br>A template with custom options to show what it's possible to do with the new engines. Each template provider will be able to offer its own option page (loaded from template)", NULL, 1, '']));
$oDB->createCommand()->insert("{{templates}}", array_combine($headerArray, ['default', 'default', 'Advanced Theme', date('Y-m-d H:i:s'), 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\\r\\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\\r\\n\\r\\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '1.0', '3.0', 'views', 'files', "<strong>LimeSurvey Advanced Theme</strong><br>A theme with custom options to show what it's possible to do with the new engines. Each theme provider will be able to offer its own option page (loaded from theme)", NULL, 1, '']));

$oDB->createCommand()->insert("{{templates}}", array_combine($headerArray,['material', 'material', 'Material Template', date('Y-m-d H:i:s'), 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\\r\\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\\r\\n\\r\\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '1.0', '3.0', 'views', 'files', '<strong>LimeSurvey Advanced Template</strong><br> A template extending default, to show the inheritance concept. Notice the options, differents from Default.<br><small>uses FezVrasta\'s Material design theme for Bootstrap 3</small>', NULL, 1, 'default']));
$oDB->createCommand()->insert("{{templates}}", array_combine($headerArray,['material', 'material', 'Material Theme', date('Y-m-d H:i:s'), 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\\r\\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\\r\\n\\r\\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '1.0', '3.0', 'views', 'files', '<strong>LimeSurvey Advanced Theme</strong><br> A theme extending default, to show the inheritance concept. Notice the options, differents from Default.<br><small>uses FezVrasta\'s Material design theme for Bootstrap 3</small>', NULL, 1, 'default']));

$oDB->createCommand()->insert("{{templates}}", array_combine($headerArray,['monochrome', 'monochrome', 'Monochrome Templates', date('Y-m-d H:i:s'), 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\\r\\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\\r\\n\\r\\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '1.0', '3.0', 'views', 'files', '<strong>LimeSurvey Monochrome Templates</strong><br>A template with monochrome colors for easy customization.', NULL, 1, '']));
$oDB->createCommand()->insert("{{templates}}", array_combine($headerArray,['monochrome', 'monochrome', 'Monochrome Theme', date('Y-m-d H:i:s'), 'Louis Gac', 'louis.gac@limesurvey.org', 'https://www.limesurvey.org/', 'Copyright (C) 2007-2017 The LimeSurvey Project Team\\r\\nAll rights reserved.', 'License: GNU/GPL License v2 or later, see LICENSE.php\\r\\n\\r\\nLimeSurvey is free software. This version may have been modified pursuant to the GNU General Public License, and as distributed it includes or is derivative of works licensed under the GNU General Public License or other free or open source software licenses. See COPYRIGHT.php for copyright notices and details.', '1.0', '3.0', 'views', 'files', '<strong>LimeSurvey Monochrome Theme</strong><br>A theme with monochrome colors for easy customization.', NULL, 1, '']));


// template_configuration
Expand Down Expand Up @@ -754,11 +754,11 @@ function createDatabase($oDB){
$oDB->createCommand()->createIndex('{{idx4_template_configuration}}', '{{template_configuration}}', 'uid', false);

$headerArray = ['template_name','sid','gsid','uid','files_css','files_js','files_print_css','options','cssframework_name','cssframework_css','cssframework_js','packages_to_load','packages_ltr','packages_rtl'];
$oDB->createCommand()->insert("{{template_configuration}}", array_combine($headerArray,['default',NULL,NULL,NULL,'{"add": ["css/animate.css","css/template.css"]}','{"add": ["scripts/template.js", "scripts/ajaxify.js"]}','{"add":"css/print_template.css"}','{"ajaxmode":"on","brandlogo":"on", "brandlogofile": "./files/logo.png", "boxcontainer":"on", "backgroundimage":"off","animatebody":"off","bodyanimation":"fadeInRight","animatequestion":"off","questionanimation":"flipInX","animatealert":"off","alertanimation":"shake"}','bootstrap','{"replace": [["css/bootstrap.css","css/flatly.css"]]}','','["pjax"]','','']));
$oDB->createCommand()->insert("{{template_configuration}}", array_combine($headerArray,['default',NULL,NULL,NULL,'{"add": ["css/animate.css","css/theme.css"]}','{"add": ["scripts/theme.js", "scripts/ajaxify.js"]}','{"add":"css/print_theme.css"}','{"ajaxmode":"on","brandlogo":"on", "brandlogofile": "./files/logo.png", "boxcontainer":"on", "backgroundimage":"off","animatebody":"off","bodyanimation":"fadeInRight","animatequestion":"off","questionanimation":"flipInX","animatealert":"off","alertanimation":"shake"}','bootstrap','{"replace": [["css/bootstrap.css","css/flatly.css"]]}','','["pjax"]','','']));

$oDB->createCommand()->insert("{{template_configuration}}", array_combine($headerArray,['material',NULL,NULL,NULL,'{"add": ["css/bootstrap-material-design.css", "css/ripples.min.css", "css/template.css"]}','{"add": ["scripts/template.js", "scripts/material.js", "scripts/ripples.min.js", "scripts/ajaxify.js"]}','{"add":"css/print_template.css"}','{"ajaxmode":"on","brandlogo":"on", "brandlogofile": "./files/logo.png", "animatebody":"off","bodyanimation":"fadeInRight","animatequestion":"off","questionanimation":"flipInX","animatealert":"off","alertanimation":"shake"}','bootstrap','{"replace": [["css/bootstrap.css","css/bootstrap.css"]]}','','["pjax"]','','']));
$oDB->createCommand()->insert("{{template_configuration}}", array_combine($headerArray,['material',NULL,NULL,NULL,'{"add": ["css/bootstrap-material-design.css", "css/ripples.min.css", "css/theme.css"]}','{"add": ["scripts/theme.js", "scripts/material.js", "scripts/ripples.min.js", "scripts/ajaxify.js"]}','{"add":"css/print_theme.css"}','{"ajaxmode":"on","brandlogo":"on", "brandlogofile": "./files/logo.png", "animatebody":"off","bodyanimation":"fadeInRight","animatequestion":"off","questionanimation":"flipInX","animatealert":"off","alertanimation":"shake"}','bootstrap','{"replace": [["css/bootstrap.css","css/bootstrap.css"]]}','','["pjax"]','','']));

$oDB->createCommand()->insert("{{template_configuration}}", array_combine($headerArray,['monochrome',NULL,NULL,NULL,'{"add":["css/animate.css","css/ajaxify.css","css/sea_green.css", "css/template.css"]}','{"add":["scripts/template.js","scripts/ajaxify.js"]}','{"add":"css/print_template.css"}','{"ajaxmode":"on","brandlogo":"on","brandlogofile":".\/files\/logo.png","boxcontainer":"on","backgroundimage":"off","animatebody":"off","bodyanimation":"fadeInRight","animatequestion":"off","questionanimation":"flipInX","animatealert":"off","alertanimation":"shake"}','bootstrap','{}','','["pjax"]','','']));
$oDB->createCommand()->insert("{{template_configuration}}", array_combine($headerArray,['monochrome',NULL,NULL,NULL,'{"add":["css/animate.css","css/ajaxify.css","css/sea_green.css", "css/theme.css"]}','{"add":["scripts/theme.js","scripts/ajaxify.js"]}','{"add":"css/print_theme.css"}','{"ajaxmode":"on","brandlogo":"on","brandlogofile":".\/files\/logo.png","boxcontainer":"on","backgroundimage":"off","animatebody":"off","bodyanimation":"fadeInRight","animatequestion":"off","questionanimation":"flipInX","animatealert":"off","alertanimation":"shake"}','bootstrap','{}','','["pjax"]','','']));

//tutorials
$oDB->createCommand()->createTable(
Expand Down
52 changes: 26 additions & 26 deletions themes/survey/default/config.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Default configuration for the template.
Default configuration for the theme.
In future versions of LimeSurvey, it will be used to fill a template table,
and to give user control on template configuration (like variables to use to render the questions, banners, background, etc.)
-->
Expand All @@ -17,7 +17,7 @@
<license>GNU General Public License version 2 or later</license>
<version>2.0</version>
<apiVersion>3</apiVersion>
<description><![CDATA[<strong>LimeSurvey Advanced Template</strong><br>A template with custom options to show what it's possible to do with the new engines. Each template provider will be able to offer its own option page (loaded from template)]]></description>
<description><![CDATA[<strong>LimeSurvey Advanced Theme</strong><br>A theme with custom options to show what it's possible to do with the new engines. Each theme provider will be able to offer its own option page (loaded from theme)]]></description>
<last_update>2016-11-14 17:21:00</last_update>
</metadatas>

Expand All @@ -29,14 +29,14 @@
<css>
<add>css/animate.css</add>
<add>css/ajaxify.css</add>
<add>css/template.css</add>
<add>css/theme.css</add>
</css>
<js>
<add>scripts/template.js</add>
<add>scripts/theme.js</add>
<add>scripts/ajaxify.js</add>
</js>
<print_css>
<add>css/print_template.css</add>
<add>css/print_theme.css</add>
</print_css>
</files>

Expand Down Expand Up @@ -96,16 +96,16 @@
<file type="view" role="subview">./subviews/no_js_alert.twig</file>
<file type="view" role="subview">./subviews/language_changer.twig</file>
<file type="css">./css/background-image.css</file>
<file type="css">./css/template.css</file>
<file type="js">./scripts/template.js</file>
<file type="css">./css/theme.css</file>
<file type="js">./scripts/theme.js</file>
</question>

<surveylist>
<file type="view" role="global">layout_global.twig</file>
<file type="view" role="layout">layout_survey_list.twig</file>
<file type="css">./css/template.css</file>
<file type="css">./css/theme.css</file>
<file type="css">./css/background-image.css</file>
<file type="js">./scripts/template.js</file>
<file type="js">./scripts/theme.js</file>
</surveylist>

<welcome>
Expand All @@ -116,25 +116,25 @@
<file type="view" role="subview">./subviews/no_js_alert.twig</file>
<file type="view" role="subview">./subviews/privacy/privacy.twig</file>
<file type="css">./css/background-image.css</file>
<file type="css">./css/template.css</file>
<file type="js">./scripts/template.js</file>
<file type="css">./css/theme.css</file>
<file type="js">./scripts/theme.js</file>
</welcome>

<completed>
<file type="view" role="global">layout_global.twig</file>
<file type="view" role="layout">layout_submit.twig</file>
<file type="css">./css/template.css</file>
<file type="css">./css/theme.css</file>
<file type="css">./css/background-image.css</file>
<file type="js">./scripts/template.js</file>
<file type="js">./scripts/theme.js</file>
</completed>

<assessments>
<file type="view" role="global">layout_global.twig</file>
<file type="view" role="layout">layout_submit.twig</file>
<file type="view" role="subview">./subviews/assessments.twig</file>
<file type="css">./css/template.css</file>
<file type="css">./css/theme.css</file>
<file type="css">./css/background-image.css</file>
<file type="js">./scripts/template.js</file>
<file type="js">./scripts/theme.js</file>
</assessments>

<error>
Expand All @@ -145,36 +145,36 @@
<clearall>
<file type="view" role="global">layout_global.twig</file>
<file type="view" role="layout">layout_clearall.twig</file>
<file type="css">./css/template.css</file>
<file type="css">./css/theme.css</file>
<file type="css">./css/background-image.css</file>
<file type="js">./scripts/template.js</file>
<file type="js">./scripts/theme.js</file>
</clearall>

<load>
<file type="view" role="global">layout_global.twig</file>
<file type="view" role="layout">layout_load.twig</file>
<file type="css">./css/template.css</file>
<file type="css">./css/theme.css</file>
<file type="css">./css/background-image.css</file>
<file type="js">./scripts/template.js</file>
<file type="js">./scripts/theme.js</file>
</load>

<save>
<file type="view" role="global">layout_global.twig</file>
<file type="view" role="layout">layout_save.twig</file>
<file type="css">./css/template.css</file>
<file type="css">./css/theme.css</file>
<file type="css">./css/background-image.css</file>
<file type="js">./scripts/template.js</file>
<file type="js">./scripts/theme.js</file>
</save>

<register>
<file type="view" role="global">layout_global.twig</file>
<file type="view" role="layout">layout_register.twig</file>
<file type="view" role="subview">./subviews/registration/register_head.twig</file>
<file type="view" role="subview">./subviews/registration/register_form.twig</file>
<file type="view" role="subview">./subviews/registration/register_error.twig</file>
<file type="view" role="subview">./subviews/registration/register_message.twig</file>
<file type="view" role="subview">./subviews/registration/register_head.twig</file>
<file type="view" role="subview">./subviews/registration/register_form.twig</file>
<file type="view" role="subview">./subviews/registration/register_error.twig</file>
<file type="view" role="subview">./subviews/registration/register_message.twig</file>
</register>

<printanswers>
<file type="view" role="global">layout_global.twig</file>
<file type="view" role="layout">layout_printanswers.twig</file>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3060ceb

Please sign in to comment.