BUG 7817 Se puede ver todos los skins que tiene el servidor... SOLVED

- No was validated skin.
- Was add validation a skin for workspaces.
This commit is contained in:
Marco Antonio Nina
2012-10-26 17:46:16 -04:00
parent cabbc113b0
commit 8695139590
6 changed files with 113 additions and 13 deletions

View File

@@ -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'

View File

@@ -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

View File

@@ -962,10 +962,26 @@ 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';
$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;
}
}
}
$skinListArray['currentSkin'] = SYS_SKIN;

View File

@@ -18,6 +18,11 @@ class Admin extends Controller
require_once PATH_CONTROLLERS . 'main.php';
G::loadClass( 'system' );
$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 );

View File

@@ -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>)(.+?)(<\/id>)/i', '<id>' . G::generateUniqueID() . '</id><!-- $2 -->', $xmlConfiguration );
if (isset( $skinInformationArray['workspace'] )) {
$workspace = ($skinInformationArray['workspace'] != '') ? ($skinInformationArray['workspace']."|".$workspace) : $workspace;
$xmlConfiguration = preg_replace( "/(<workspace>)(.+?)(<\/modifiedDate>)/i", "<workspace>" . $workspace . "</workspace><!-- $2 -->", $xmlConfiguration );
$xmlConfiguration = preg_replace( "/(<name>)(.+?)(<\/name>)/i", "<name>" . $skinName . "</name><!-- $2 -->", $xmlConfiguration );
} else {
$xmlConfiguration = preg_replace( "/(<name>)(.+?)(<\/name>)/i", "<name>" . $skinName . "</name><!-- $2 -->
<workspace>" . $workspace . "</workspace>", $xmlConfiguration );
}
$xmlConfiguration = preg_replace( "/(<description>)(.+?)(<\/description>)/i", "<description>" . $skinDescription . "</description><!-- $2 -->", $xmlConfiguration );
$xmlConfiguration = preg_replace( "/(<author>)(.+?)(<\/author>)/i", "<author>" . $skinAuthor . "</author><!-- $2 -->", $xmlConfiguration );
$xmlConfiguration = preg_replace( "/(<createDate>)(.+?)(<\/createDate>)/i", "<createDate>" . date( "Y-m-d H:i:s" ) . "</createDate><!-- $2 -->", $xmlConfiguration );
$xmlConfiguration = preg_replace( "/(<modifiedDate>)(.+?)(<\/modifiedDate>)/i", "<modifiedDate>" . date( "Y-m-d H:i:s" ) . "</modifiedDate><!-- $2 -->", $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( "/(<workspace>)(.+?)(<\/modifiedDate>)/i", "<workspace>" . $workspace . "</workspace><!-- $2 -->", $xmlConfiguration );
} else {
$xmlConfiguration = preg_replace( "/(<name>)(.+?)(<\/name>)/i", "<name>".$skinName."</name><!-- $2 -->
<workspace>" . $workspace . "</workspace>", $xmlConfiguration );
}
file_put_contents( $configFileFinal, $xmlConfiguration );
//Delete Temporal
@unlink( PATH_CUSTOM_SKINS . '.tmp' . PATH_SEP . $filename );

View File

@@ -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 '<b><i>' + ((value == 'Global') ? value : 'Workspace') + '</i></b>';
}
if (value != 'Global') {
value = "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: 'All Workspace'
},
{
xtype: 'radio',
name: 'workspace',
inputValue: 'current',
boxLabel: 'Current Workspace'
}
],
buttons:[
{
@@ -612,6 +647,19 @@ importSkin = function(){
fieldLabel: _('ID_OVERWRITE'),
name: "overwrite_files",
checked: true
},
{
xtype: 'radio',
name: 'workspace',
inputValue: 'global',
checked: true,
boxLabel: 'All Workspace'
},
{
xtype: 'radio',
name: 'workspace',
inputValue: 'current',
boxLabel: 'Current Workspace'
}
],
buttons:[