116 lines
4.7 KiB
PHP
Executable File
116 lines
4.7 KiB
PHP
Executable File
<?php
|
|
|
|
/**-----------------------------------------------
|
|
*
|
|
* Rooty, 2018 <rooty@rooty.me>
|
|
*
|
|
*
|
|
* This software is protected by copyright, please
|
|
* read the file COPYRIGHT.
|
|
* This program is distributed in the hope that it
|
|
* will be useful, but without any warranty; without
|
|
* even the implied warranty of merchantability or
|
|
* fitness for a particular purpose. Please
|
|
* read the file LICENCE.
|
|
*
|
|
*
|
|
* @author Rooty <www.rooty.me|rooty@rooty.me>
|
|
* @since 2005/03/09
|
|
* @link www.rooty.me
|
|
* @version 0.3
|
|
* @package package
|
|
* @subpackage tabe
|
|
* @copyright Copyright © 2004-2005, Initiance
|
|
*/
|
|
|
|
if ( !defined('SYSTEM_IN') )
|
|
{
|
|
die("Hacking attempt");
|
|
}
|
|
|
|
/**
|
|
*function printTabeAdmin permet d'afficher les onglets d'administration pour chaque brique
|
|
*<P>L'ordre ou indice des tableau doivent être correspondant</P>
|
|
*<P>La syntaxe Mx doit être la suivante :<br>
|
|
*<mx:bloc id="TabeB"><BR/>
|
|
* <TD valign="bottom"><BR/>
|
|
* <TABLE border="0" mXattribut="class:TabeView" mXattribut="cellpadding:TabeViewCell" cellspacing="0"><BR/>
|
|
* <TR><BR/>
|
|
* <TD><img mXattribut="src:pictoTabe" border="0"/></TD><BR/>
|
|
* <TD><a mXattribut="href:UrlTabeView" mXattribut="class:ClassTabeView"><mx:text id="TabeNameView"/></a><BR/></TD><BR/>
|
|
* </TR><BR/>
|
|
* </TABLE><BR/>
|
|
* </TD><BR/>
|
|
*</mx:bloc id="TabeB"><BR/>
|
|
*</P>
|
|
*<P>Les styles css utilisés sont:<br>
|
|
*WindowTabeData
|
|
*WindowTabeDataSelected
|
|
*</P>
|
|
* @param chaine nom du bloc modelixe
|
|
* @param tableau libelles des onglets
|
|
* @param tableau url des onglets
|
|
* @param tableau picto des onglets
|
|
* @param tableau tableau de tableau des action des onglets
|
|
* @param chaine servant pour une selection d'un paramètre autre que la méthode
|
|
* @param chaine nom du style css selectionné
|
|
* @param chaine nom du style css / défaut
|
|
* @return booleen
|
|
*/
|
|
function printTabeAdmin($MxBlocName, $tabTabe, $TabUrlTabe, $tabPictoTabe, $tabAction, $flag_param="*", $styleSelected="nav-item font-weight-bold active", $style="nav-item font-weight-bold")
|
|
{
|
|
global $SYSTEM_TEMPLATE;
|
|
$selected = "";
|
|
|
|
if($flag_param == "*"){
|
|
$selected = $GLOBALS["SYSTEM_CONTROL"]->methodName;
|
|
} else {
|
|
$selected = $flag_param;
|
|
}
|
|
|
|
for ($i=0; $i<count($tabTabe); $i++)
|
|
{
|
|
for ($j=0; $j<count($tabAction[$i]);$j++)
|
|
{
|
|
$tabAction[$i][$j]=strtolower($tabAction[$i][$j]);
|
|
}
|
|
|
|
if(in_array(strtolower($selected),$tabAction[$i]))
|
|
{
|
|
// $GLOBALS['SYSTEM_TEMPLATE']->MxAttribut($MxBlocName.".pictoTabe", $GLOBALS["SYSTEM_TEMPLATE_PATH"].$GLOBALS["SYSTEM_TEMPLATE_DIR"]."media/picto/".$tabPictoTabe[$i]);
|
|
$GLOBALS['SYSTEM_TEMPLATE']->MxText($MxBlocName.".pictoTabe", $tabPictoTabe[$i]);
|
|
$GLOBALS['SYSTEM_TEMPLATE']->MxAttribut($MxBlocName.".UrlTabeView", $TabUrlTabe[$i]);
|
|
$GLOBALS['SYSTEM_TEMPLATE']->MxText($MxBlocName.".TabeNameView", getMessage($tabTabe[$i]));
|
|
$GLOBALS['SYSTEM_TEMPLATE']->MxAttribut($MxBlocName.".TabeNameView", getMessage($tabTabe[$i]));
|
|
|
|
/* Presentation */
|
|
$GLOBALS['SYSTEM_TEMPLATE']->MxAttribut($MxBlocName.".ClassTabeView", "nav-link text-nowrap active");
|
|
$GLOBALS['SYSTEM_TEMPLATE']->MxAttribut($MxBlocName.".TabeViewCell",2);
|
|
$GLOBALS['SYSTEM_TEMPLATE']->MxAttribut($MxBlocName.".TabeView", $styleSelected);
|
|
|
|
/* Pour l'élément séléectionné, appel a la balise $MxBlocNameTabeNameView */
|
|
// $GLOBALS['SYSTEM_TEMPLATE']->MxAttribut($MxBlocName."pictoTabe", $GLOBALS["SYSTEM_TEMPLATE_PATH"].$GLOBALS["SYSTEM_TEMPLATE_DIR"]."media/picto/".$tabPictoTabe[$i]);
|
|
$GLOBALS['SYSTEM_TEMPLATE']->MxText($MxBlocName."pictoTabe", $tabPictoTabe[$i]);
|
|
$GLOBALS['SYSTEM_TEMPLATE']->MxAttribut($MxBlocName."UrlTabeView", $TabUrlTabe[$i]);
|
|
$GLOBALS['SYSTEM_TEMPLATE']->MxText($MxBlocName."TabeNameView", getMessage($tabTabe[$i]));
|
|
$GLOBALS['SYSTEM_TEMPLATE']->MxAttribut($MxBlocName."TabeNameView", getMessage($tabTabe[$i]));
|
|
}
|
|
else
|
|
{
|
|
// $GLOBALS['SYSTEM_TEMPLATE']->MxAttribut($MxBlocName.".pictoTabe", $GLOBALS["SYSTEM_TEMPLATE_PATH"].$GLOBALS["SYSTEM_TEMPLATE_DIR"]."media/picto/".$tabPictoTabe[$i]);
|
|
$GLOBALS['SYSTEM_TEMPLATE']->MxText($MxBlocName.".pictoTabe", $tabPictoTabe[$i]);
|
|
$GLOBALS['SYSTEM_TEMPLATE']->MxAttribut($MxBlocName.".UrlTabeView", $TabUrlTabe[$i]);
|
|
$GLOBALS['SYSTEM_TEMPLATE']->MxText($MxBlocName.".TabeNameView", getMessage($tabTabe[$i]));
|
|
$GLOBALS['SYSTEM_TEMPLATE']->MxAttribut($MxBlocName.".TabeNameView", getMessage($tabTabe[$i]));
|
|
|
|
/* Presentation */
|
|
$GLOBALS['SYSTEM_TEMPLATE']->MxAttribut($MxBlocName.".ClassTabeView", "nav-link text-nowrap");
|
|
$GLOBALS['SYSTEM_TEMPLATE']->MxAttribut($MxBlocName.".TabeViewCell",1);
|
|
$GLOBALS['SYSTEM_TEMPLATE']->MxAttribut($MxBlocName.".TabeView", $style);
|
|
}
|
|
$GLOBALS['SYSTEM_TEMPLATE']->MxBloc($MxBlocName, "loop");
|
|
}
|
|
return true;
|
|
}
|
|
?>
|