Code review fixes
- The default value must be "neoclassic"
- Comments, psr-2 fixes
This commit is contained in:
davidcallizaya
2017-05-25 11:47:33 -04:00
parent 4304abc2a6
commit f7798b4320
2 changed files with 8 additions and 8 deletions

View File

@@ -51,7 +51,7 @@ class SkinsTest extends \WorkflowTestCase
} }
/** /**
* Get defaut skins, one custom global and one custom current workspace skin. * Get default skins, one custom global and one custom current workspace skin.
* *
* @covers ProcessMaker\BusinessModel\Skins::getSkins * @covers ProcessMaker\BusinessModel\Skins::getSkins
* @covers ProcessMaker\BusinessModel\Skins::createSkin * @covers ProcessMaker\BusinessModel\Skins::createSkin

View File

@@ -40,7 +40,7 @@ class Skins
$skinDescription = '', $skinDescription = '',
$skinAuthor = 'ProcessMaker Team', $skinAuthor = 'ProcessMaker Team',
$skinWorkspace = 'global', $skinWorkspace = 'global',
$skinBase = 'classic' $skinBase = 'neoclassic'
) { ) {
try { try {
if (!(isset($skinName))) { if (!(isset($skinName))) {
@@ -61,7 +61,7 @@ class Skins
switch ($skinBase) { switch ($skinBase) {
//Validate skin base //Validate skin base
case 'uxmodern': case 'uxmodern':
$this->copy_skin_folder(G::ExpandPath("skinEngine").'uxmodern'.PATH_SEP, $this->copySkinFolder(G::ExpandPath("skinEngine").'uxmodern'.PATH_SEP,
PATH_CUSTOM_SKINS.$skinFolder, PATH_CUSTOM_SKINS.$skinFolder,
array("config.xml" array("config.xml"
)); ));
@@ -69,7 +69,7 @@ class Skins
break; break;
case 'classic': case 'classic':
//Special Copy of this dir + xmlreplace //Special Copy of this dir + xmlreplace
$this->copy_skin_folder(G::ExpandPath("skinEngine").'base'.PATH_SEP, $this->copySkinFolder(G::ExpandPath("skinEngine").'base'.PATH_SEP,
PATH_CUSTOM_SKINS.$skinFolder, PATH_CUSTOM_SKINS.$skinFolder,
array("config.xml", "baseCss" array("config.xml", "baseCss"
)); ));
@@ -77,7 +77,7 @@ class Skins
break; break;
case 'neoclassic': case 'neoclassic':
//Special Copy of this dir + xmlreplace //Special Copy of this dir + xmlreplace
$this->copy_skin_folder(G::ExpandPath("skinEngine").'neoclassic'.PATH_SEP, $this->copySkinFolder(G::ExpandPath("skinEngine").'neoclassic'.PATH_SEP,
PATH_CUSTOM_SKINS.$skinFolder, PATH_CUSTOM_SKINS.$skinFolder,
array("config.xml", "baseCss" array("config.xml", "baseCss"
)); ));
@@ -85,7 +85,7 @@ class Skins
break; break;
default: default:
//Commmon copy/paste of a folder + xmlrepalce //Commmon copy/paste of a folder + xmlrepalce
$this->copy_skin_folder(PATH_CUSTOM_SKINS.$skinBase, $this->copySkinFolder(PATH_CUSTOM_SKINS.$skinBase,
PATH_CUSTOM_SKINS.$skinFolder, PATH_CUSTOM_SKINS.$skinFolder,
array("config.xml" array("config.xml"
)); ));
@@ -151,7 +151,7 @@ class Skins
} }
} }
private function copy_skin_folder($path, $dest, $exclude = array()) private function copySkinFolder($path, $dest, $exclude = array())
{ {
$defaultExcluded = array(".", ".."); $defaultExcluded = array(".", "..");
$excludedItems = array_merge($defaultExcluded, $exclude); $excludedItems = array_merge($defaultExcluded, $exclude);
@@ -164,7 +164,7 @@ class Skins
continue; continue;
} }
if (is_dir($path.PATH_SEP.$file)) { if (is_dir($path.PATH_SEP.$file)) {
$this->copy_skin_folder($path.PATH_SEP.$file, $this->copySkinFolder($path.PATH_SEP.$file,
$dest.PATH_SEP.$file, $exclude); $dest.PATH_SEP.$file, $exclude);
} else { } else {
copy($path.PATH_SEP.$file, $dest.PATH_SEP.$file); copy($path.PATH_SEP.$file, $dest.PATH_SEP.$file);