Skip to content

Commit

Permalink
Dev: added Material Design Template
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Jul 18, 2017
1 parent 14ed422 commit 54faf98
Show file tree
Hide file tree
Showing 220 changed files with 21,174 additions and 8 deletions.
2 changes: 1 addition & 1 deletion application/config/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

$config['versionnumber'] = '3.0.0-alpha'; //The current version of this branch
$config['masterversion'] = '2.62.2'; //The current masters version merged into this branch
$config['dbversionnumber'] = 301;
$config['dbversionnumber'] = 302;
$config['buildnumber'] = '';
$config['updatable'] = true;
$config['assetsversionnumber'] = '2671';
Expand Down
46 changes: 41 additions & 5 deletions application/helpers/update/updatedb_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,11 @@ function db_upgrade_all($iOldDBVersion, $bSilent=false) {
* Template tables
* @since 2017-07-12
*/
if ($iOldDBVersion < 301) {
if ($iOldDBVersion < 302) {
$oTransaction = $oDB->beginTransaction();
upgradeTemplateTables301($oDB);
upgradeTemplateTables302($oDB);
$oTransaction->commit();
$oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>301),"stg_name='DBVersion'");
$oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>302),"stg_name='DBVersion'");
}

}
Expand Down Expand Up @@ -429,7 +429,7 @@ function createSurveyMenuTable293($oDB) {
* @param $oDB
* @return void
*/
function upgradeTemplateTables301($oDB)
function upgradeTemplateTables302($oDB)
{
// Drop the old survey rights table.
if (tableExists('{templates}')) {
Expand Down Expand Up @@ -503,6 +503,28 @@ function upgradeTemplateTables301($oDB)
));



// Add material template
$oDB->createCommand()->insert('{{templates}}', array(
'name' => 'material',
'folder' => 'material',
'title' => 'Material Template',
'creation_date' => '2017-07-12 12:00:00',
'author' => 'Louis Gac',
'author_email' => 'louis.gac@limesurvey.org',
'author_url' => 'https://www.limesurvey.org/',
'copyright' => 'Copyright (C) 2007-2017 The LimeSurvey Project Team\r\nAll rights reserved.',
'license' => '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.',
'version' => '1.0',
'api_version' => '3.0',
'view_folder' => 'views',
'files_folder' => 'files',
'description' => 'fezvrasta bootstrap-material-design',
'owner_id' => '1',
'extends_templates_name' => '',
));


// Add template configuration table
$oDB->createCommand()->createTable('{{template_configuration}}', array(
'id' => 'pk',
Expand Down Expand Up @@ -535,7 +557,7 @@ function upgradeTemplateTables301($oDB)
));


// Add global configuration for Advanced Template
// Add global configuration for Minimal Template
$oDB->createCommand()->insert('{{template_configuration}}', array(
'id' => '2',
'templates_name' => 'minimal',
Expand All @@ -549,6 +571,20 @@ function upgradeTemplateTables301($oDB)
'packages_to_load' => 'template-core,',
));

// Add global configuration for Material Template
$oDB->createCommand()->insert('{{template_configuration}}', array(
'id' => '2',
'templates_name' => 'material',
'files_css' => '{"add": ["css/template.css", "css/bootstrap-material-design.css", "css/ripples.min.css"]}',
'files_js' => '{"add": ["scripts/template.js", "scripts/material.js", "scripts/ripples.min.js"]}',
'files_print_css' => '{"add":"css/print_template.css",}',
'options' => '{}',
'cssframework_name' => 'bootstrap',
'cssframework_css' => '{}',
'cssframework_js' => '',
'packages_to_load' => 'template-core,',
));

}


Expand Down
2 changes: 1 addition & 1 deletion application/models/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ public static function forceAssets()
public static function getStandardTemplateList()
{

$standardTemplates = array('default', 'minimal');
$standardTemplates = array('default', 'minimal', 'material');
return $standardTemplates;

/*
Expand Down
5 changes: 5 additions & 0 deletions installer/sql/create-mssql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,9 @@ INSERT INTO prefix_templates VALUES
('default', 'default', 'Advanced Template', '2017-07-12 10:00:00', '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', 'LimeSurvey Advanced Template:\\r\\nMany options for user customizations. \\r\\n', NULL, 1, '');
INSERT INTO prefix_templates VALUES
('minimal', 'minimal', 'Minimal Template', '2017-07-12 10:00:00', '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', 'LimeSurvey Minimal Template:\\r\\nA clean base for developpments. \\r\\n', NULL, 1, '');
INSERT INTO prefix_templates VALUES
('material', 'material', 'Material Template', '2017-07-12 10:00:00', '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', 'fezvrasta bootstrap-material-design.', NULL, 1, '');



-- -----------------------------------------------------
Expand Down Expand Up @@ -779,6 +782,8 @@ INSERT INTO prefix_template_configuration VALUES
(1, 'default', NULL, NULL, NULL, '{"add": ["css/template.css", "css/animate.css"]}', '{"add": ["scripts/template.js"]}', '{"add":"css/print_template.css",}', '{"ajaxmode":"on","brandlogo":"on", "boxcontainer":"on","backgroundimage":"on","animatebody":"on","bodyanimation":"lightSpeedIn","animatequestion":"on","questionanimation":"flipInX","animatealert":"on","alertanimation":"shake"}', 'bootstrap', '{"replace": [["css/bootstrap.css","css/flatly.css"]]}', '', '', '', '');
INSERT INTO prefix_template_configuration VALUES
(2, 'minimal', NULL, NULL, NULL, '{"add": ["css/template.css"]}', '{"add": ["scripts/template.js"]}', '{"add":"css/print_template.css",}', '{}', 'bootstrap', '{}', '', '', '', '');
INSERT INTO prefix_template_configuration VALUES
(3,'material',NULL,NULL,NULL,'{"add": ["css/template.css", "css/bootstrap-material-design.css", "css/ripples.min.css"]}','{"add": ["scripts/template.js", "scripts/material.js", "scripts/ripples.min.js"]}','{"add":"css/print_template.css",}','{}','bootstrap','{}','','','','');

--
-- Version Info
Expand Down
4 changes: 4 additions & 0 deletions installer/sql/create-mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,8 @@ INSERT INTO `prefix_templates` VALUES
('default', 'default', 'Advanced Template', '2017-07-12 10:00:00', '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', 'LimeSurvey Advanced Template:\\r\\nMany options for user customizations. \\r\\n', NULL, 1, '');
INSERT INTO `prefix_templates` VALUES
('minimal', 'minimal', 'Minimal Template', '2017-07-12 10:00:00', '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', 'LimeSurvey Minimal Template:\\r\\nA clean base for developpments. \\r\\n', NULL, 1, '');
INSERT INTO `prefix_templates` VALUES
('material', 'material', 'Material Template', '2017-07-12 10:00:00', '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', 'fezvrasta bootstrap-material-design.', NULL, 1, '');


-- -----------------------------------------------------
Expand Down Expand Up @@ -769,6 +771,8 @@ INSERT INTO `prefix_template_configuration` VALUES
(1,'default',NULL,NULL,NULL,'{"add": ["css/template.css", "css/animate.css"]}','{"add": ["scripts/template.js"]}','{"add":"css/print_template.css",}','{"ajaxmode":"on","brandlogo":"on", "boxcontainer":"on", "backgroundimage":"on","animatebody":"on","bodyanimation":"lightSpeedIn","animatequestion":"on","questionanimation":"flipInX","animatealert":"on","alertanimation":"shake"}','bootstrap','{"replace": [["css/bootstrap.css","css/flatly.css"]]}','','','','');
INSERT INTO `prefix_template_configuration` VALUES
(2,'minimal',NULL,NULL,NULL,'{"add": ["css/template.css"]}','{"add": ["scripts/template.js"]}','{"add":"css/print_template.css",}','{}','bootstrap','{}','','','','');
INSERT INTO `prefix_template_configuration` VALUES
(3,'material',NULL,NULL,NULL,'{"add": ["css/template.css", "css/bootstrap-material-design.css", "css/ripples.min.css"]}','{"add": ["scripts/template.js", "scripts/material.js", "scripts/ripples.min.js"]}','{"add":"css/print_template.css",}','{}','bootstrap','{}','','','','');


--
Expand Down
8 changes: 7 additions & 1 deletion installer/sql/create-pgsql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,8 @@ INSERT INTO prefix_templates VALUES
('default', 'default', 'Advanced Template', '2017-07-12 10:00:00', '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', 'LimeSurvey Advanced Template:\\r\\nMany options for user customizations. \\r\\n', NULL, 1, '');
INSERT INTO prefix_templates VALUES
('minimal', 'minimal', 'Minimal Template', '2017-07-12 10:00:00', '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', 'LimeSurvey Minimal Template:\\r\\nA clean base for developpments. \\r\\n', NULL, 1, '');
INSERT INTO prefix_templates VALUES
('material', 'material', 'Material Template', '2017-07-12 10:00:00', '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', 'fezvrasta bootstrap-material-design.', NULL, 1, '');

-- -----------------------------------------------------
-- Table prefix_template_configuration
Expand Down Expand Up @@ -799,7 +801,11 @@ INSERT INTO prefix_template_configuration VALUES
(1, 'default', NULL, NULL, NULL, '{"add": ["css/template.css", "css/animate.css"]}', '{"add": ["scripts/template.js"]}', '{"add":"css/print_template.css",}', '{"ajaxmode":"on","brandlogo":"on", "boxcontainer":"on","backgroundimage":"on","animatebody":"on","bodyanimation":"lightSpeedIn","animatequestion":"on","questionanimation":"flipInX","animatealert":"on","alertanimation":"shake"}', 'bootstrap', '{"replace": [["css/bootstrap.css","css/flatly.css"]]}', '', '', '', '');

INSERT INTO prefix_template_configuration VALUES
(2, 'minimal', NULL, NULL, NULL, '{"add": ["css/template.css"]}', '{"add": ["scripts/template.js"]}', '{"add":"css/print_template.css",}', '{"ajaxmode":"on","brandlogo":"on", "boxcontainer":"on","backgroundimage":"on","animatebody":"on","bodyanimation":"lightSpeedIn","animatequestion":"on","questionanimation":"flipInX","animatealert":"on","alertanimation":"shake"}', 'bootstrap', '{}', '', '', '', '');
(2, 'minimal', NULL, NULL, NULL, '{"add": ["css/template.css"]}', '{"add": ["scripts/template.js"]}', '{"add":"css/print_template.css",}', '{}', 'bootstrap', '{}', '', '', '', '');

INSERT INTO prefix_template_configuration VALUES
(3,'material',NULL,NULL,NULL,'{"add": ["css/template.css", "css/bootstrap-material-design.css", "css/ripples.min.css"]}','{"add": ["scripts/template.js", "scripts/material.js", "scripts/ripples.min.js"]}','{"add":"css/print_template.css",}','{}','bootstrap','{}','','','','');


--
-- Version Info
Expand Down

0 comments on commit 54faf98

Please sign in to comment.