diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index 243e44c59..3843a65d2 100644 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -1095,6 +1095,7 @@ class G $skinVariant = strtolower( $filenameParts[1] ); } + $configurationFile = ''; if ($skinName == "jscolors") { $skinName = "classic"; } @@ -1157,7 +1158,6 @@ class G $output .= file_get_contents( $baseCSSPath . 'ext-all-notheme.css' ); //$output .= file_get_contents ( $publicExtPath . 'ext-all.css' ); - //Classic Skin $extJsSkin = 'xtheme-gray'; @@ -1381,6 +1381,7 @@ class G $output = ''; $pathJs = PATH_GULLIVER_HOME . PATH_SEP . 'js' . PATH_SEP; switch ($jsName) { + // case 'draw2d.js': $cachePath = PATH_C . 'ExtJs' . PATH_SEP; $checksum = G::getCheckSum( array ($pathJs . 'ext/wz_jsgraphics.js',$pathJs . 'ext/mootools.js',$pathJs . 'ext/moocanvas.js' diff --git a/gulliver/system/class.publisher.php b/gulliver/system/class.publisher.php index dce470ea7..e3ea093e5 100755 --- a/gulliver/system/class.publisher.php +++ b/gulliver/system/class.publisher.php @@ -246,17 +246,16 @@ class Publisher if ($Part['Template'] == 'xmlform_preview') { $Part['Template'] = 'xmlform'; } - $template = PATH_CORE . 'templates/' . $Part['Template'] . '.html'; //erik: new feature, now templates such as xmlform.html can be personalized via skins if (defined( 'SYS_SKIN' ) && strtolower( SYS_SKIN ) != 'classic') { - // first, verify if the template exists on base skins path - if (is_file( G::ExpandPath( "skinEngine" ) . SYS_SKIN . PATH_SEP . $Part['Template'] . '.html' )) { - $template = G::ExpandPath( "skinEngine" ) . SYS_SKIN . PATH_SEP . $Part['Template'] . '.html'; - // second, verify if the template exists on user skins path - } elseif (is_file( PATH_CUSTOM_SKINS . SYS_SKIN . PATH_SEP . $Part['Template'] . '.html' )) { + // First, verify if the template exists on Custom skins path + if (is_file( PATH_CUSTOM_SKINS . SYS_SKIN . PATH_SEP . $Part['Template'] . '.html' )) { $template = PATH_CUSTOM_SKINS . SYS_SKIN . PATH_SEP . $Part['Template'] . '.html'; + //Second, verify if the template exists on base skins path + } elseif (is_file( G::ExpandPath( "skinEngine" ) . SYS_SKIN . PATH_SEP . $Part['Template'] . '.html' )) { + $template = G::ExpandPath( "skinEngine" ) . SYS_SKIN . PATH_SEP . $Part['Template'] . '.html'; } } //end new feature diff --git a/workflow/engine/classes/class.system.php b/workflow/engine/classes/class.system.php index 96636abae..f41bc1316 100755 --- a/workflow/engine/classes/class.system.php +++ b/workflow/engine/classes/class.system.php @@ -942,6 +942,7 @@ class System } $customSkins = array_merge( $baseSkins, $customSkins ); + $global = G::LoadTranslation('ID_GLOBAL'); //Read and parse each Configuration File foreach ($customSkins as $key => $configInformation) { @@ -962,8 +963,24 @@ class System foreach ($skinInformationArray as $keyInfo => $infoValue) { $res['SKIN_' . strtoupper( $keyInfo )] = $infoValue['__VALUE__']; } + $res['SKIN_CREATEDATE'] = (isset($res['SKIN_CREATEDATE'])) ? $res['SKIN_CREATEDATE']: ''; + $res['SKIN_MODIFIEDDATE'] = (isset($res['SKIN_MODIFIEDDATE'])) ? $res['SKIN_MODIFIEDDATE']: ''; + $res['SKIN_WORKSPACE'] = (isset($res['SKIN_WORKSPACE'])) ? ( ($res['SKIN_WORKSPACE'] != '')? $res['SKIN_WORKSPACE'] : $global): $global; - $skinListArray['skins'][] = $res; + $swWS = true; + if ($res['SKIN_WORKSPACE'] != $global) { + $workspace = explode("|", $res['SKIN_WORKSPACE']); + $swWS = false; + foreach ($workspace as $key => $value) { + if ($value == SYS_SYS) { + $swWS = true; + break; + } + } + } + if ($swWS) { + $skinListArray['skins'][] = $res; + } } } diff --git a/workflow/engine/controllers/admin.php b/workflow/engine/controllers/admin.php index 4b4fdaeba..a43cc3f54 100644 --- a/workflow/engine/controllers/admin.php +++ b/workflow/engine/controllers/admin.php @@ -17,7 +17,12 @@ class Admin extends Controller { require_once PATH_CONTROLLERS . 'main.php'; G::loadClass( 'system' ); - $skinsList = System::getSkingList(); + $skinsList = System::getSkingList(); + foreach ($skinsList['skins'] as $key => $value) { + if ($value['SKIN_WORKSPACE'] != 'Global') { + unset( $skinsList['skins'][$key] ); + } + } $skins = array (); $timeZonesList = System::getAllTimeZones(); $timeZonesList = array_keys( $timeZonesList ); diff --git a/workflow/engine/methods/setup/skin_Ajax.php b/workflow/engine/methods/setup/skin_Ajax.php index 3fb3e8161..1faa117c1 100755 --- a/workflow/engine/methods/setup/skin_Ajax.php +++ b/workflow/engine/methods/setup/skin_Ajax.php @@ -56,6 +56,7 @@ function skinList () if ($skinList['currentSkin'] == $value['SKIN_FOLDER_ID']) { $value['SKIN_STATUS'] = $wildcard . G::LoadTranslation( 'ID_ACTIVE' ); $value['SKIN_NAME'] = $wildcard . $value['SKIN_NAME']; + $value['SKIN_WORKSPACE'] = $wildcard . $value['SKIN_WORKSPACE']; $value['SKIN_DESCRIPTION'] = $wildcard . $value['SKIN_DESCRIPTION']; $value['SKIN_AUTHOR'] = $wildcard . $value['SKIN_AUTHOR']; $value['SKIN_CREATEDATE'] = $wildcard . $value['SKIN_CREATEDATE']; @@ -126,14 +127,26 @@ function newSkin ($baseSkin = 'classic') $configFileOriginal = $pathBase . PATH_SEP . 'config.xml'; $configFileFinal = PATH_CUSTOM_SKINS . $skinFolder . PATH_SEP . 'config.xml'; $xmlConfiguration = file_get_contents( $configFileOriginal ); + + $workspace = ($_REQUEST['workspace'] == 'global') ? '' : SYS_SYS; + $xmlConfigurationObj = G::xmlParser( $xmlConfiguration ); + $skinInformationArray = $skinFilesArray = $xmlConfigurationObj->result['skinConfiguration']['__CONTENT__']['information']['__CONTENT__']; $xmlConfiguration = preg_replace( '/()(.+?)(<\/id>)/i', '' . G::generateUniqueID() . '', $xmlConfiguration ); - $xmlConfiguration = preg_replace( "/()(.+?)(<\/name>)/i", "" . $skinName . "", $xmlConfiguration ); + if (isset( $skinInformationArray['workspace'] )) { + $workspace = ($skinInformationArray['workspace'] != '') ? ($skinInformationArray['workspace']."|".$workspace) : $workspace; + $xmlConfiguration = preg_replace( "/()(.+?)(<\/modifiedDate>)/i", "" . $workspace . "", $xmlConfiguration ); + $xmlConfiguration = preg_replace( "/()(.+?)(<\/name>)/i", "" . $skinName . "", $xmlConfiguration ); + } else { + $xmlConfiguration = preg_replace( "/()(.+?)(<\/name>)/i", "" . $skinName . " + " . $workspace . "", $xmlConfiguration ); + } + $xmlConfiguration = preg_replace( "/()(.+?)(<\/description>)/i", "" . $skinDescription . "", $xmlConfiguration ); $xmlConfiguration = preg_replace( "/()(.+?)(<\/author>)/i", "" . $skinAuthor . "", $xmlConfiguration ); $xmlConfiguration = preg_replace( "/()(.+?)(<\/createDate>)/i", "" . date( "Y-m-d H:i:s" ) . "", $xmlConfiguration ); $xmlConfiguration = preg_replace( "/()(.+?)(<\/modifiedDate>)/i", "" . date( "Y-m-d H:i:s" ) . "", $xmlConfiguration ); - file_put_contents( $configFileFinal, $xmlConfiguration ); + file_put_contents( $configFileFinal, $xmlConfiguration ); $response['success'] = true; $response['message'] = G::LoadTranslation( 'ID_SKIN_SUCCESS_CREATE' ); print_r( G::json_encode( $response ) ); @@ -226,6 +239,24 @@ function importSkin () if (! $res) { throw (new Exception( G::LoadTranslation( 'ID_SKIN_ERROR_EXTRACTING' ) )); } + + $configFileOriginal = PATH_CUSTOM_SKINS . $skinName . PATH_SEP . 'config.xml'; + $configFileFinal = PATH_CUSTOM_SKINS . $skinName . PATH_SEP . 'config.xml'; + $xmlConfiguration = file_get_contents( $configFileOriginal ); + + $workspace = ($_REQUEST['workspace'] == 'global') ? '' : SYS_SYS; + $xmlConfigurationObj = G::xmlParser( $xmlConfiguration ); + $skinInformationArray = $skinFilesArray = $xmlConfigurationObj->result['skinConfiguration']['__CONTENT__']['information']['__CONTENT__']; + if (isset( $skinInformationArray['workspace'] )) { + $workspace = ($skinInformationArray['workspace'] != '') ? ($skinInformationArray['workspace']."|".$workspace) : $workspace; + $xmlConfiguration = preg_replace( "/()(.+?)(<\/modifiedDate>)/i", "" . $workspace . "", $xmlConfiguration ); + } else { + $xmlConfiguration = preg_replace( "/()(.+?)(<\/name>)/i", "".$skinName." + " . $workspace . "", $xmlConfiguration ); + } + + file_put_contents( $configFileFinal, $xmlConfiguration ); + //Delete Temporal @unlink( PATH_CUSTOM_SKINS . '.tmp' . PATH_SEP . $filename ); diff --git a/workflow/engine/templates/setup/skinList.js b/workflow/engine/templates/setup/skinList.js index c169f6ac1..946ac7925 100755 --- a/workflow/engine/templates/setup/skinList.js +++ b/workflow/engine/templates/setup/skinList.js @@ -183,6 +183,10 @@ Ext.onReady(function(){ name : 'SKIN_NAME' }, + { + name : 'SKIN_WORKSPACE' + }, + { name : 'SKIN_DESCRIPTION' }, @@ -227,6 +231,14 @@ Ext.onReady(function(){ renderer: selectedSkinChecked }, + { + header: _('ID_ROOT_FOLDER'), + dataIndex: 'SKIN_WORKSPACE', + width: 80, + align:'left', + renderer: nameWorkspace + }, + { header: _('ID_DESCRIPTION'), dataIndex: 'SKIN_DESCRIPTION', @@ -403,6 +415,16 @@ selectedSkinChecked = function (value){ } return value; }; +nameWorkspace = function (value){ + if(value[0]=='@'){ + str = value.substring(1); + return '' + ((value == _('ID_GLOBAL')) ? value : _('ID_WORKSPACE')) + ''; + } + if (value != _('ID_GLOBAL')) { + value = _('ID_WORKSPACE'); + } + return value; +}; //Funtion Handles Context Menu Opening @@ -505,7 +527,20 @@ newSkin = function(){ allowBlank: false, selectOnFocus:true, width:200 - }) + }), + { + xtype: 'radio', + name: 'workspace', + inputValue: 'global', + checked: true, + boxLabel: _('ID_ALL_WORKSPACES') + }, + { + xtype: 'radio', + name: 'workspace', + inputValue: 'current', + boxLabel: _('ID_CURRENT_WORKSPACE') + } ], buttons:[ { @@ -612,7 +647,20 @@ importSkin = function(){ fieldLabel: _('ID_OVERWRITE'), name: "overwrite_files", checked: true - } + }, + { + xtype: 'radio', + name: 'workspace', + inputValue: 'global', + checked: true, + boxLabel: _('ID_ALL_WORKSPACES') + }, + { + xtype: 'radio', + name: 'workspace', + inputValue: 'current', + boxLabel: _('ID_CURRENT_WORKSPACE') + } ], buttons:[ {