Implemented page headers mx blocks in template package

This commit is contained in:
Rooty 2021-05-05 10:56:55 +02:00
parent 06791a2df7
commit dcbfa0604b
7 changed files with 305 additions and 102 deletions

View File

@ -0,0 +1 @@
<meta name="author" content="<mx:text id="author"/>" />

View File

@ -0,0 +1 @@
<meta name="classification" content="<mx:text id="classification"/>" />

View File

@ -0,0 +1 @@
<meta name="description" content="<mx:text id="description"/>" />

View File

@ -0,0 +1 @@
<link rel="shortcut icon" type="image/png" href="<mx:text id="linkFavicon"/>" />

View File

@ -0,0 +1 @@
<meta name="keywords" content="<mx:text id="keywords"/>" />

View File

@ -0,0 +1 @@
<title><mx:text id="title"/></title>

View File

@ -81,7 +81,7 @@ function mxPageTitle($label, $compl=False)
{ {
if ( $GLOBALS["SYSTEM_TEMPLATE"]->isMxBloc("TITLELOAD") && isset($label) ) if ( $GLOBALS["SYSTEM_TEMPLATE"]->isMxBloc("TITLELOAD") && isset($label) )
{ {
$GLOBALS["SYSTEM_TEMPLATE"]->MxBloc("TITLELOAD", "modify", $GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."title.mxt"); $GLOBALS["SYSTEM_TEMPLATE"]->MxBloc("TITLELOAD", "modify", $GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."headers/title.mxt");
$GLOBALS["SYSTEM_TEMPLATE"]->WithMxPath("TITLELOAD", "appe"); $GLOBALS["SYSTEM_TEMPLATE"]->WithMxPath("TITLELOAD", "appe");
if( !$compl ) if( !$compl )
@ -96,12 +96,209 @@ function mxPageTitle($label, $compl=False)
$GLOBALS["SYSTEM_TEMPLATE"]->WithMxPath(""); $GLOBALS["SYSTEM_TEMPLATE"]->WithMxPath("");
return true; return true;
} else { } else {
$GLOBALS["SYSTEM_TEMPLATE"]->MxBloc("TITLELOAD", "modify", $GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."title.mxt"); $GLOBALS["SYSTEM_TEMPLATE"]->MxBloc("TITLELOAD", "modify", $GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."headers/title.mxt");
$GLOBALS['SYSTEM_TEMPLATE']->MxBloc("TITLELOAD", "delete"); $GLOBALS['SYSTEM_TEMPLATE']->MxBloc("TITLELOAD", "delete");
return false; return false;
} }
} }
/**
* fonction d'inclusion des favicons de pages dans le bloc MX principal
* @return booleen
*/
function mxPageFavicon($favicon, $compl=False)
{
if ( $GLOBALS["SYSTEM_TEMPLATE"]->isMxBloc("FAVICONLOAD") && isset($favicon) )
{
$GLOBALS["SYSTEM_TEMPLATE"]->MxBloc("FAVICONLOAD", "modify", $GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."headers/favicon.mxt");
$GLOBALS["SYSTEM_TEMPLATE"]->WithMxPath("FAVICONLOAD", "appe");
if( !$compl )
{
if( getMessage($favicon) )
$GLOBALS['SYSTEM_TEMPLATE']->MxText("linkFavicon", getMessage($favicon));
else
$GLOBALS['SYSTEM_TEMPLATE']->MxText("linkFavicon", $favicon);
} else
$GLOBALS['SYSTEM_TEMPLATE']->MxText("linkFavicon", getMessage($favicon)." ".$compl);
$GLOBALS["SYSTEM_TEMPLATE"]->WithMxPath("");
return true;
} else {
$GLOBALS["SYSTEM_TEMPLATE"]->MxBloc("FAVICONLOAD", "modify", $GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."headers/favicon.mxt");
$GLOBALS['SYSTEM_TEMPLATE']->MxBloc("FAVICONLOAD", "delete");
return false;
}
}
/**
* fonction d'inclusion des mots clés de pages dans le bloc MX principal
* @return booleen
*/
function mxPageKeywords($keywords, $compl=False)
{
if ( $GLOBALS["SYSTEM_TEMPLATE"]->isMxBloc("KEYWORDSLOAD") && isset($keywords) )
{
$GLOBALS["SYSTEM_TEMPLATE"]->MxBloc("KEYWORDSLOAD", "modify", $GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."headers/keywords.mxt");
$GLOBALS["SYSTEM_TEMPLATE"]->WithMxPath("KEYWORDSLOAD", "appe");
if( !$compl )
{
if( getMessage($keywords) )
$GLOBALS['SYSTEM_TEMPLATE']->MxText("keywords", getMessage($keywords));
else
$GLOBALS['SYSTEM_TEMPLATE']->MxText("keywords", $keywords);
} else
$GLOBALS['SYSTEM_TEMPLATE']->MxText("keywords", getMessage($keywords)." ".$compl);
$GLOBALS["SYSTEM_TEMPLATE"]->WithMxPath("");
return true;
} else {
$GLOBALS["SYSTEM_TEMPLATE"]->MxBloc("KEYWORDSLOAD", "modify", $GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."headers/keywords.mxt");
$GLOBALS['SYSTEM_TEMPLATE']->MxBloc("KEYWORDSLOAD", "delete");
return false;
}
}
/**
* fonction d'inclusion des descriptions de pages dans le bloc MX principal
* @return booleen
*/
function mxPageDescription($description, $compl=False)
{
if ( $GLOBALS["SYSTEM_TEMPLATE"]->isMxBloc("DESCRIPTIONLOAD") && isset($description) )
{
$GLOBALS["SYSTEM_TEMPLATE"]->MxBloc("DESCRIPTIONLOAD", "modify", $GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."headers/description.mxt");
$GLOBALS["SYSTEM_TEMPLATE"]->WithMxPath("DESCRIPTIONLOAD", "appe");
if( !$compl )
{
if( getMessage($description) )
$GLOBALS['SYSTEM_TEMPLATE']->MxText("description", getMessage($description));
else
$GLOBALS['SYSTEM_TEMPLATE']->MxText("description", $description);
} else
$GLOBALS['SYSTEM_TEMPLATE']->MxText("description", getMessage($description)." ".$compl);
$GLOBALS["SYSTEM_TEMPLATE"]->WithMxPath("");
return true;
} else {
$GLOBALS["SYSTEM_TEMPLATE"]->MxBloc("DESCRIPTIONLOAD", "modify", $GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."headers/description.mxt");
$GLOBALS['SYSTEM_TEMPLATE']->MxBloc("DESCRIPTIONLOAD", "delete");
return false;
}
}
/**
* fonction d'inclusion des descriptions de pages dans le bloc MX principal
* @return booleen
*/
function mxPageClassification($classification, $compl=False)
{
if ( $GLOBALS["SYSTEM_TEMPLATE"]->isMxBloc("CLASSIFICATIONLOAD") && isset($classification) )
{
$GLOBALS["SYSTEM_TEMPLATE"]->MxBloc("CLASSIFICATIONLOAD", "modify", $GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."headers/classification.mxt");
$GLOBALS["SYSTEM_TEMPLATE"]->WithMxPath("CLASSIFICATIONLOAD", "appe");
if( !$compl )
{
if( getMessage($classification) )
$GLOBALS['SYSTEM_TEMPLATE']->MxText("description", getMessage($classification));
else
$GLOBALS['SYSTEM_TEMPLATE']->MxText("description", $classification);
} else
$GLOBALS['SYSTEM_TEMPLATE']->MxText("description", getMessage($classification)." ".$compl);
$GLOBALS["SYSTEM_TEMPLATE"]->WithMxPath("");
return true;
} else {
$GLOBALS["SYSTEM_TEMPLATE"]->MxBloc("CLASSIFICATIONLOAD", "modify", $GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."headers/classification.mxt");
$GLOBALS['SYSTEM_TEMPLATE']->MxBloc("CLASSIFICATIONLOAD", "delete");
return false;
}
}
/**
* fonction d'inclusion des descriptions de pages dans le bloc MX principal
* @return booleen
*/
function mxPageAuthor($author, $compl=False)
{
if ( $GLOBALS["SYSTEM_TEMPLATE"]->isMxBloc("AUTHORLOAD") && isset($author) )
{
$GLOBALS["SYSTEM_TEMPLATE"]->MxBloc("AUTHORLOAD", "modify", $GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."headers/author.mxt");
$GLOBALS["SYSTEM_TEMPLATE"]->WithMxPath("AUTHORLOAD", "appe");
if( !$compl )
{
if( getMessage($author) )
$GLOBALS['SYSTEM_TEMPLATE']->MxText("description", getMessage($author));
else
$GLOBALS['SYSTEM_TEMPLATE']->MxText("description", $author);
} else
$GLOBALS['SYSTEM_TEMPLATE']->MxText("description", getMessage($author)." ".$compl);
$GLOBALS["SYSTEM_TEMPLATE"]->WithMxPath("");
return true;
} else {
$GLOBALS["SYSTEM_TEMPLATE"]->MxBloc("AUTHORLOAD", "modify", $GLOBALS['SYSTEM_TEMPLATE_PATH'].$GLOBALS['SYSTEM_TEMPLATE_DIR']."headers/author.mxt");
$GLOBALS['SYSTEM_TEMPLATE']->MxBloc("AUTHORLOAD", "delete");
return false;
}
}
/**
* fonction d'inclusion des headerss de pages dans le bloc MX principal
* @return booleen
*/
function mxPageHeaders($title, $keywords, $description, $classification, $author)
{
if( isset($title) && $title !="" && $title )
{
mxPageTitle($title);
return true;
} else {
return false;
}
if( isset($keywords) && is_array($keywords) )
{
mxPageKeywords($keywords);
return true;
} else {
return false;
}
if( isset($description) && $description !="" && $description )
{
mxPageDescription($description);
return true;
} else {
return false;
}
if( isset($classification) && is_array($classification) )
{
mxPageClassification($classification);
return true;
} else {
return false;
}
if( isset($author) && $author !="" && $author )
{
mxPageAuthor($author);
return true;
} else {
return false;
}
}
/** /**
* fonction d'inclusion des appels de feuilles de styles CSS * fonction d'inclusion des appels de feuilles de styles CSS
* @return booleen * @return booleen