Fixed template lcube6 for tool configuration of adminnode object

This commit is contained in:
Rooty 2020-12-13 22:02:35 +01:00
parent d3227d9b12
commit e225955379
2 changed files with 94 additions and 99 deletions

View File

@ -1,108 +1,100 @@
<form id="configObject" method="post" mXattribut="action:urlAction">
<input type="hidden" name="urlReturn" mXattribut="value:urlActionReturn"/>
<input type="hidden" name="contentType" mXattribut="value:contentType"/>
<input type="hidden" name="objectId" mXattribut="value:objectId"/>
<div class="tabe">
<ul>
<ul class="nav container-fluid nav-tabs w-75 border-bottom-0">
<mx:bloc id="TabeB">
<li mXattribut="class:TabeView">
<a mXattribut="href:UrlTabeView" mXattribut="class:ClassTabeView">
<i class="mr-1 fa fa-lg fa-<mx:text id="pictoTabe"/>"></i>
<mx:text id="TabeNameView"/>
</a>
</li>
</mx:bloc id="TabeB">
</ul>
</div>
<div class="box">
<div class="header"><h2><mx:text id="TabeBTabeNameView"/></h2><p><mx:text id="configurationObject"/> (<mx:text id="TxtContentType"/>)</p></div>
<div class="tabe">
<ul>
<li mXattribut="class:TabeView">
<a mXattribut="href:UrlTabeView" mXattribut="class:ClassTabeView">
<i class="mr-1 fa fa-lg fa-<mx:text id="pictoTabe"/>"></i>
<mx:text id="TabeNameView"/>
</a>
</li>
</mx:bloc id="TabeB">
</ul>
<div class="tab-content container-fluid px-2 py-2 w-75 border">
<ul class="nav container-fluid nav-tabs border-bottom-0">
<mx:bloc id="TabeSecond">
<li mXattribut="class:TabeView">
<a mXattribut="href:UrlTabeView" mXattribut="class:ClassTabeView"><i class="mr-1 fa fa-lg fa-<mx:text id="pictoTabe"/>"></i><mx:text id="TabeNameView"/></a>
<a mXattribut="href:UrlTabeView" mXattribut="class:ClassTabeView"><i class="mr-1 fa fa-lg fa-<mx:text id="pictoTabe"/>"></i><mx:text id="TabeNameView"/></a>
</li>
</mx:bloc id="TabeSecond">
</ul>
</div>
<div class="box">
<div class="header"><h2><mx:text id="TabeSecondTabeNameView"/></h2><p><mx:text id="TxtGeneral"/></p></div>
<fieldset class="fieldset">
<legend><mx:text id="TxtFormLegend"/></legend>
<div>
<div class="field"><label for="iconeN" class="require"><mx:text id="TxtImage"/></label><img name="pictoObject" id="pictoObject" src="data/template/default/media/picto/object/defaultobject.gif" alt="Picto"/><mx:select id="icone" class="selectsmall"/></div>
<div class="field"><label for="nameInput" class="require"><mx:text id="nameObject"/></label>
<mx:bloc id="blocName">
<mx:image id="pictoLanguage"/><input type="text" mXattribut="value:namelanguagevalue" mXattribut="name:nameInput" id="nameInput"/>
</mx:bloc id="blocName">
</ul>
<div class="tab-content container-fluid px-2 py-2 w-100 border">
<form id="configObject" name="configObject" role="form" class="form text-center px-0" method="post" mXattribut="action:urlAction">
<input type="hidden" name="urlReturn" mXattribut="value:urlActionReturn"/>
<input type="hidden" name="contentType" mXattribut="value:contentType"/>
<input type="hidden" name="objectId" mXattribut="value:objectId"/>
<div class="card w-100 mb-0">
<div class="card-header">
<h3><mx:text id="configurationObject"/> (<mx:text id="TxtContentType"/>)</h3>
</div>
<div class="field"><label for="resume"><mx:text id="resumeLanguage"/> :</label><textarea cols="5" rows="5" name="resume" id="resume"><mx:text id="resumeValue"/></textarea></div>
<div class="field"><label for="keyword"><mx:text id="keyword"/> :</label><textarea cols="5" rows="5" name="keyWord" id="keyword"><mx:text id="keyWordValue"/></textarea></div>
<div class="field"><label for="node" class="require"><mx:text id="TxtNode"/></label><mx:select id="NODE" id="node"/></div>
</div>
</fieldset>
<fieldset class="fieldset">
<legend><mx:text id="TxtConfiguration"/></legend>
<div>
<div class="field"><label for="TEMPLATE_ADMIN"><mx:text id="TxtTemplateAdmin"/></label>
<mx:select id="TEMPLATE_ADMIN"/></div>
<div class="field"><label for="Nodeadmin"><mx:text id="TxtNodeAdmin"/></label>
<mx:select id="NODE_ADMIN" id="Nodeadmin"/>
<div><br/><img name="pictoTemplate" id="pictoTemplate" src="data/template/default/preview.png" class="preview" alt="preview"/></div>
<div class="card-body">
<div class="row mb-2">
<div class="input-group col-xs-12 col-sm-8 col-lg-6 p-0 m-0">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-file-picture-o"></i></span>
</div>
<mx:select id="icone"/>
<div class="input-group-append">
<span class="input-group-text"><mx:image id="pictoObject"/></span>
</div>
</div>
<div class="input-group col-xs-12 col-sm-8 col-lg-6 p-0 m-0">
<mx:bloc id="blocName">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa"><mx:image id="pictoLanguage"/></i></span>
</div>
<mx:formField id="nameInput"/>
</mx:bloc id="blocName">
</div>
</div>
<div class="row mb-2">
<div class="input-group col-xs-12 col-sm-8 col-lg-6 p-0 m-0">
<mx:formField id="resumeValue"/>
</div>
<div class="input-group col-xs-12 col-sm-8 col-lg-6 p-0 m-0">
<mx:formField id="keyWordValue"/>
</div>
</div>
</div>
<div class="action">
<input type="submit" name="BtnValid" mXattribut="value:BtnValid" class="save"/>
<div class="card-header">
<h3><mx:text id="TxtConfiguration"/></h3>
</div>
<div class="card-body">
<div class="row mb-2">
<div class="input-group col-xs-12 col-sm-8 col-lg-6 p-0 m-0">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa"><mx:text id="TxtGroupAdmin"/></i></span>
</div>
<mx:select id="NODE" id="node"/>
</div>
<div class="input-group col-xs-12 col-sm-8 col-lg-6 p-0 m-0">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa"><mx:text id="TxtNodeAdmin"/></i></span>
</div>
<mx:select id="NODE_ADMIN" id="Nodeadmin"/>
</div>
</div>
<div class="row mb-0">
<div class="form-inline col-xs-12 col-sm-8 col-lg-6 p-0 m-0">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lg fa-picture-o"></i></span>
</div>
<mx:select id="TEMPLATE_ADMIN" onchange="javascript:imgTemplate();"/>
</div>
</div>
<div class="form-inline col-xs-12 col-sm-8 col-lg-6 p-0 m-0">
<div class="input-group">
<!-- <mx:image id="screenTemplate" id="screenTemplate"/> -->
<img name="screenTemplate" id="screenTemplate" src="data/template/lcube6/preview.png" class="preview" alt="preview"/></div>
</div>
</div>
</div>
</div>
<div class="card-footer border-0 bg-white text-center">
<input type="reset" name="BtnReset" class="btn btn-outline-secondary btn-lg btn-sm" aria-pressed="true" title="<mx:text id="BtnReset"/>" value="<mx:text id="BtnReset"/>" onclick="this.form.reset();"/>
<input type="button" name="BtnReturn" class="btn btn-outline-secondary btn-lg btn-sm" aria-pressed="true" value="<mx:text id="BtnReturn"/>" onclick="history.back();"/>
<input type="submit" name="BtnValid" class="btn btn-outline-secondary btn-lg btn-sm" aria-pressed="true" mXattribut="value:BtnValid"/>
</div>
</fieldset>
<div class="info"><mx:text id="TxtField"/></div>
</div>
</form>
</div>
</div>
</form>
<script type="text/javascript">
//<![CDATA[
function imgPicto()
{
// cas ns6
if (document.getElementById)
{
if (document.getElementById("configObject"))
{
document.getElementById("pictoObject").src="data/template/default/media/picto/object/"+document.getElementById("configObject").iconeN.options[(document.getElementById("configObject").iconeN.selectedIndex)].value;
}
}
// cas ie 5.5
else if (document.all)
{
if (document.all["configObject"])
{
document.all["pictoObject"].src="data/template/default/media/picto/object/"+document.all["configObject"].iconeN.options[(document.all["configObject"].iconeN.selectedIndex)].value;
}
}
}
imgPicto();
function imgTemplate()
{
if (document.getElementById)
{
if (document.getElementById("configObject"))
{
var obj=document.getElementById("configObject"); //configObject.template[]
document.pictoTemplate.src="data/template/"+obj.options[(obj.selectedIndex)].value+"/preview.png";
}
}
// cas ie 5.5
else if (document.all)
{
if (document.all["configObject"])
{
var obj=document.all["configObject"]; //configObject.template[]
document.pictoTemplate.src="data/template/"+obj.options[(obj.selectedIndex)].value+"/preview.png";
}
}
}
imgTemplate();
// ]]>
</script>

View File

@ -861,14 +861,14 @@ Class AdminNode extends CoordinationObj
{
if (in_array($file, $tabTpl ) || count($tabTpl)==0 )
{
if($file !="" && $file !="." && $file !=".." && (strpos("CACHE",$file)===FALSE) && is_dir($chemintotal.$file))
if($file !="" && $file !="." && $file !=".." && (strpos("CACHE,cache",$file)===FALSE) && is_dir($chemintotal.$file))
{
$tabIcone[$file]=$file;
}
}
}
@closedir($handle);
$GLOBALS['SYSTEM_TEMPLATE']->MxSelect("TEMPLATE_ADMIN", "template", $tabTemplate, $tabIcone, '', 15, ' onchange="javascript:imgTemplate();" id="TEMPLATE_ADMIN"');
$GLOBALS['SYSTEM_TEMPLATE']->MxSelect("TEMPLATE_ADMIN", "template", $tabTemplate, $tabIcone, '', 8, ' onchange="javascript:imgTemplate();" id="TEMPLATE_ADMIN"');
/* Fin Affichage des templates */
return $end;
@ -969,6 +969,9 @@ Class AdminNode extends CoordinationObj
*/
function __updateObject($url, $urlReturn, $groupIdPass, $nodeIdPass, $tabForbiddenPass)
{
$arrayRawJs[] = "function imgTemplate(){if (document.getElementById){if (document.getElementById(\"TEMPLATE_ADMIN\")){var obj=document.getElementById(\"TEMPLATE_ADMIN\");document.screenTemplate.src=\"data/template/\"+obj.options[(obj.selectedIndex)].value+\"/preview.png\";}}else if(document.all){if(document.all[\"TEMPLATE_ADMIN\"]){var obj=document.all[\"TEMPLATE_ADMIN\"];document.screenTemplate.src=\"data/template/\"+obj.options[(obj.selectedIndex)].value+\"/preview.png\";}}}imgTemplate();";
mxRawJs($arrayRawJs);
withBlocPath("AdminNode", "configuration");
$end=$this->configurePrint($url, $urlReturn, $groupIdPass, $nodeIdPass, $tabForbiddenPass);
exitBloc();