Select Git revision
act_htmltest.php
act_htmltest.php 4.40 KiB
<?php
/* ######################################################################
IML DEPLOYMENT
webgui - build a package
---------------------------------------------------------------------
2014-11-14 Axel <axel.hahn@iml.unibe.ch> selector for branches
2014-02-14 Axel <axel.hahn@iml.unibe.ch> build was "ajaxified"
2013-11-08 Axel <axel.hahn@iml.unibe.ch>
###################################################################### */
require_once("./classes/project.class.php");
/**
* helper: render html code for a table row
* @global htmlguielements $oHtml
* @param string $sDescr description
* @param string $sCode php code
* @return string
*/
function addHtmltestTest($sDescr, $sCode){
$oHtml=new htmlguielements();
$sOut='??';
eval("\$sOut=$sCode;");
return '<tr>'
. '<td>'
. $sDescr
. '</td>'
. '<td style="padding: 0 1em;"><pre>'
. htmlentities($sCode)
. '</pre></td>'
. '<td style="padding: 0 1em;">'
.$sOut
. '</td>'
. '<td style="padding: 0 1em;"><pre>'
.str_replace('>', '><br>',htmlentities($sOut))
. '</pre></td>'
. '</tr>';
}
// ----------------------------------------------------------------------
// MAIN
// ----------------------------------------------------------------------
$oHtml=new htmlguielements();
// generate a List of al icons
$sIconlist='';
$sIconlist.='<strong>Buttons</strong><br>';
foreach ($oHtml->aCfg['buttons'] as $sLabel=>$aItems){
$sIconlist.=$oHtml->getIcon($aItems['icon']).' - '.$sLabel.' - '.$aItems['icon'].'<br>';
}
$sIconlist.='<br><strong>Icons</strong><br>';
foreach ($oHtml->aCfg['icons'] as $sLabel=>$sIcon){
$sIconlist.=$oHtml->getIcon($sIcon).' - '.$sLabel.': '.$sIcon.'<br>';
}
$sRows=''
. addHtmltestTest("Box zeichnen - Fehler", "\$oHtml->getBox('error', 'errormessage')")
. addHtmltestTest("Box zeichnen - Warnung", "\$oHtml->getBox('warning', 'Message')")
. addHtmltestTest("Box zeichnen - Info", "\$oHtml->getBox('info', 'Message')")
. addHtmltestTest("Box zeichnen - OK", "\$oHtml->getBox('success', 'Message')")
. addHtmltestTest("Icon - Fontawesome", "\$oHtml->getIcon('fa-close');")
. addHtmltestTest("Icon - Glyphicon", "\$oHtml->getIcon('glyphicon-user');")