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:
@@ -1095,6 +1095,7 @@ class G
|
|||||||
$skinVariant = strtolower( $filenameParts[1] );
|
$skinVariant = strtolower( $filenameParts[1] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$configurationFile = '';
|
||||||
if ($skinName == "jscolors") {
|
if ($skinName == "jscolors") {
|
||||||
$skinName = "classic";
|
$skinName = "classic";
|
||||||
}
|
}
|
||||||
@@ -1157,7 +1158,6 @@ class G
|
|||||||
$output .= file_get_contents( $baseCSSPath . 'ext-all-notheme.css' );
|
$output .= file_get_contents( $baseCSSPath . 'ext-all-notheme.css' );
|
||||||
//$output .= file_get_contents ( $publicExtPath . 'ext-all.css' );
|
//$output .= file_get_contents ( $publicExtPath . 'ext-all.css' );
|
||||||
|
|
||||||
|
|
||||||
//Classic Skin
|
//Classic Skin
|
||||||
$extJsSkin = 'xtheme-gray';
|
$extJsSkin = 'xtheme-gray';
|
||||||
|
|
||||||
@@ -1381,6 +1381,7 @@ class G
|
|||||||
$output = '';
|
$output = '';
|
||||||
$pathJs = PATH_GULLIVER_HOME . PATH_SEP . 'js' . PATH_SEP;
|
$pathJs = PATH_GULLIVER_HOME . PATH_SEP . 'js' . PATH_SEP;
|
||||||
switch ($jsName) {
|
switch ($jsName) {
|
||||||
|
//
|
||||||
case 'draw2d.js':
|
case 'draw2d.js':
|
||||||
$cachePath = PATH_C . 'ExtJs' . PATH_SEP;
|
$cachePath = PATH_C . 'ExtJs' . PATH_SEP;
|
||||||
$checksum = G::getCheckSum( array ($pathJs . 'ext/wz_jsgraphics.js',$pathJs . 'ext/mootools.js',$pathJs . 'ext/moocanvas.js'
|
$checksum = G::getCheckSum( array ($pathJs . 'ext/wz_jsgraphics.js',$pathJs . 'ext/mootools.js',$pathJs . 'ext/moocanvas.js'
|
||||||
|
|||||||
@@ -246,17 +246,16 @@ class Publisher
|
|||||||
if ($Part['Template'] == 'xmlform_preview') {
|
if ($Part['Template'] == 'xmlform_preview') {
|
||||||
$Part['Template'] = 'xmlform';
|
$Part['Template'] = 'xmlform';
|
||||||
}
|
}
|
||||||
|
|
||||||
$template = PATH_CORE . 'templates/' . $Part['Template'] . '.html';
|
$template = PATH_CORE . 'templates/' . $Part['Template'] . '.html';
|
||||||
|
|
||||||
//erik: new feature, now templates such as xmlform.html can be personalized via skins
|
//erik: new feature, now templates such as xmlform.html can be personalized via skins
|
||||||
if (defined( 'SYS_SKIN' ) && strtolower( SYS_SKIN ) != 'classic') {
|
if (defined( 'SYS_SKIN' ) && strtolower( SYS_SKIN ) != 'classic') {
|
||||||
// first, verify if the template exists on base skins path
|
// First, verify if the template exists on Custom skins path
|
||||||
if (is_file( G::ExpandPath( "skinEngine" ) . SYS_SKIN . PATH_SEP . $Part['Template'] . '.html' )) {
|
if (is_file( PATH_CUSTOM_SKINS . 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' )) {
|
|
||||||
$template = 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
|
//end new feature
|
||||||
|
|||||||
@@ -962,10 +962,26 @@ class System
|
|||||||
foreach ($skinInformationArray as $keyInfo => $infoValue) {
|
foreach ($skinInformationArray as $keyInfo => $infoValue) {
|
||||||
$res['SKIN_' . strtoupper( $keyInfo )] = $infoValue['__VALUE__'];
|
$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['skins'][] = $res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$skinListArray['currentSkin'] = SYS_SKIN;
|
$skinListArray['currentSkin'] = SYS_SKIN;
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,11 @@ class Admin extends Controller
|
|||||||
require_once PATH_CONTROLLERS . 'main.php';
|
require_once PATH_CONTROLLERS . 'main.php';
|
||||||
G::loadClass( 'system' );
|
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 ();
|
$skins = array ();
|
||||||
$timeZonesList = System::getAllTimeZones();
|
$timeZonesList = System::getAllTimeZones();
|
||||||
$timeZonesList = array_keys( $timeZonesList );
|
$timeZonesList = array_keys( $timeZonesList );
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ function skinList ()
|
|||||||
if ($skinList['currentSkin'] == $value['SKIN_FOLDER_ID']) {
|
if ($skinList['currentSkin'] == $value['SKIN_FOLDER_ID']) {
|
||||||
$value['SKIN_STATUS'] = $wildcard . G::LoadTranslation( 'ID_ACTIVE' );
|
$value['SKIN_STATUS'] = $wildcard . G::LoadTranslation( 'ID_ACTIVE' );
|
||||||
$value['SKIN_NAME'] = $wildcard . $value['SKIN_NAME'];
|
$value['SKIN_NAME'] = $wildcard . $value['SKIN_NAME'];
|
||||||
|
$value['SKIN_WORKSPACE'] = $wildcard . $value['SKIN_WORKSPACE'];
|
||||||
$value['SKIN_DESCRIPTION'] = $wildcard . $value['SKIN_DESCRIPTION'];
|
$value['SKIN_DESCRIPTION'] = $wildcard . $value['SKIN_DESCRIPTION'];
|
||||||
$value['SKIN_AUTHOR'] = $wildcard . $value['SKIN_AUTHOR'];
|
$value['SKIN_AUTHOR'] = $wildcard . $value['SKIN_AUTHOR'];
|
||||||
$value['SKIN_CREATEDATE'] = $wildcard . $value['SKIN_CREATEDATE'];
|
$value['SKIN_CREATEDATE'] = $wildcard . $value['SKIN_CREATEDATE'];
|
||||||
@@ -126,14 +127,26 @@ function newSkin ($baseSkin = 'classic')
|
|||||||
$configFileOriginal = $pathBase . PATH_SEP . 'config.xml';
|
$configFileOriginal = $pathBase . PATH_SEP . 'config.xml';
|
||||||
$configFileFinal = PATH_CUSTOM_SKINS . $skinFolder . PATH_SEP . 'config.xml';
|
$configFileFinal = PATH_CUSTOM_SKINS . $skinFolder . PATH_SEP . 'config.xml';
|
||||||
$xmlConfiguration = file_get_contents( $configFileOriginal );
|
$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 );
|
$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 );
|
$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( "/(<description>)(.+?)(<\/description>)/i", "<description>" . $skinDescription . "</description><!-- $2 -->", $xmlConfiguration );
|
||||||
$xmlConfiguration = preg_replace( "/(<author>)(.+?)(<\/author>)/i", "<author>" . $skinAuthor . "</author><!-- $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( "/(<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 );
|
$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['success'] = true;
|
||||||
$response['message'] = G::LoadTranslation( 'ID_SKIN_SUCCESS_CREATE' );
|
$response['message'] = G::LoadTranslation( 'ID_SKIN_SUCCESS_CREATE' );
|
||||||
print_r( G::json_encode( $response ) );
|
print_r( G::json_encode( $response ) );
|
||||||
@@ -226,6 +239,24 @@ function importSkin ()
|
|||||||
if (! $res) {
|
if (! $res) {
|
||||||
throw (new Exception( G::LoadTranslation( 'ID_SKIN_ERROR_EXTRACTING' ) ));
|
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
|
//Delete Temporal
|
||||||
@unlink( PATH_CUSTOM_SKINS . '.tmp' . PATH_SEP . $filename );
|
@unlink( PATH_CUSTOM_SKINS . '.tmp' . PATH_SEP . $filename );
|
||||||
|
|
||||||
|
|||||||
@@ -183,6 +183,10 @@ Ext.onReady(function(){
|
|||||||
name : 'SKIN_NAME'
|
name : 'SKIN_NAME'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name : 'SKIN_WORKSPACE'
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name : 'SKIN_DESCRIPTION'
|
name : 'SKIN_DESCRIPTION'
|
||||||
},
|
},
|
||||||
@@ -227,6 +231,14 @@ Ext.onReady(function(){
|
|||||||
renderer: selectedSkinChecked
|
renderer: selectedSkinChecked
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
header: _('ID_ROOT_FOLDER'),
|
||||||
|
dataIndex: 'SKIN_WORKSPACE',
|
||||||
|
width: 80,
|
||||||
|
align:'left',
|
||||||
|
renderer: nameWorkspace
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
header: _('ID_DESCRIPTION'),
|
header: _('ID_DESCRIPTION'),
|
||||||
dataIndex: 'SKIN_DESCRIPTION',
|
dataIndex: 'SKIN_DESCRIPTION',
|
||||||
@@ -403,6 +415,16 @@ selectedSkinChecked = function (value){
|
|||||||
}
|
}
|
||||||
return 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
|
//Funtion Handles Context Menu Opening
|
||||||
@@ -505,7 +527,20 @@ newSkin = function(){
|
|||||||
allowBlank: false,
|
allowBlank: false,
|
||||||
selectOnFocus:true,
|
selectOnFocus:true,
|
||||||
width:200
|
width:200
|
||||||
})
|
}),
|
||||||
|
{
|
||||||
|
xtype: 'radio',
|
||||||
|
name: 'workspace',
|
||||||
|
inputValue: 'global',
|
||||||
|
checked: true,
|
||||||
|
boxLabel: 'All Workspace'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
xtype: 'radio',
|
||||||
|
name: 'workspace',
|
||||||
|
inputValue: 'current',
|
||||||
|
boxLabel: 'Current Workspace'
|
||||||
|
}
|
||||||
],
|
],
|
||||||
buttons:[
|
buttons:[
|
||||||
{
|
{
|
||||||
@@ -612,6 +647,19 @@ importSkin = function(){
|
|||||||
fieldLabel: _('ID_OVERWRITE'),
|
fieldLabel: _('ID_OVERWRITE'),
|
||||||
name: "overwrite_files",
|
name: "overwrite_files",
|
||||||
checked: true
|
checked: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
xtype: 'radio',
|
||||||
|
name: 'workspace',
|
||||||
|
inputValue: 'global',
|
||||||
|
checked: true,
|
||||||
|
boxLabel: 'All Workspace'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
xtype: 'radio',
|
||||||
|
name: 'workspace',
|
||||||
|
inputValue: 'current',
|
||||||
|
boxLabel: 'Current Workspace'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
buttons:[
|
buttons:[
|
||||||
|
|||||||
Reference in New Issue
Block a user