Vorlage:BasePanel: Unterschied zwischen den Versionen

Aus Afterbuy-Wiki
Wechseln zu:Navigation, Suche
(Die Seite wurde neu angelegt: „<div class="{{#switch: {{{type|info}}} | info=alert-info | tip=alert-success | warning=alert-danger | example=bg-light | quote=bg-light text-muted | alert-info…“)
 
 
(28 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
<div class="{{#switch: {{{type|info}}} | info=alert-info | tip=alert-success | warning=alert-danger | example=bg-light | quote=bg-light text-muted | alert-info }} p-1 mx-0 my-3 shadow-sm" style="{{#ifeq: {{{type|info}}} | quote | border-left: 6px solid #ddd;}}">
+
<phptag>
<table class="p-0 m-0">
+
if(is_array($argv) && !empty($argv)){
{{#ifeq: {{{type|info}}} | example |
+
array_shift($argv);
<tr>
+
$text='informations';
<td width="100%" class="mx-2 px-2 mb-2"><span class="badge badge-secondary">Beispiel</span></td>
+
if(isset($argv['text']) && trim($argv['text'])!=""){
</tr>
+
$text=trim($argv['text']);
<tr>
+
}
<td width="100%" class="mx-2 px-2">{{{text|informations}}}</td>
+
$type='info';
</tr>
+
if(isset($argv['type']) && trim($argv['type'])!=""){
|
+
$type=trim($argv['type']);
<tr>
+
}
<td width="1%" class="mx-2 px-2"><i class="{{#switch: {{{type|info}}} | info = fas fa-info-circle | tip = fas fa-lightbulb | warning = fas fa-exclamation-circle}}  "></i></td>
+
$icon='';
<td width="100%">{{{text|informations}}}</td>
+
$class='';
</tr>
+
$style='';
}}
+
        $contentclass='';
</table>
+
</div>
+
if ($type=='info'){
 +
$class='border border-info p-1';
 +
$icon='fas fa-info-circle text-info';
 +
} else if ($type=='tip'){
 +
$class='border border-success p-1';
 +
$icon='fas fa-lightbulb text-success';
 +
} else if ($type=='warning'){
 +
$class='border border-danger p-1';
 +
$icon='fas fa-exclamation-circle text-danger';
 +
} else if ($type=='example'){
 +
$class='flex-column bg-light p-1';
 +
} else if ($type=='quote'){
 +
$class='text-muted p-1';
 +
$style='border:1px solid #aaa;border-left: 8px solid #aaa!important;';
 +
} else if ($type=='faq'){
 +
$class='border border-info font-weight-bold h2 p-2';
 +
$icon='fas fa-question-circle text-info';
 +
                        //$style='font-weight:bold;font-size:25px;';
 +
} else if ($type=='wip'){
 +
$class='bg-warning p-1 px-2 rounded-pill';
 +
$icon='fas fa-tools text-dark';
 +
} else if ($type=='code' || $type=='codeexample'  ){
 +
$class='flex-column bg-light p-1';
 +
                        $contentclass='text-monospace text-dark';
 +
                        $text='<pre class="code font-weight-bold">'.$text.'</pre>';
 +
}
 +
 
 +
$out='<div class="d-flex '.$class.' mx-0 my-3" style="'.$style.'">';
 +
if($type=='example' || $type=='codeexample' ){
 +
                $head='Beispiel';
 +
                if(isset($argv['head']) && trim($argv['head'])!=""){
 +
  $head=trim($argv['head']);
 +
        }
 +
$out.='<p><span class="badge badge-secondary border-0">'.$head.'</span></p>';
 +
} else {
 +
if($icon!=""){
 +
$out.='<div class="px-1 mx-1"><i class="'.$icon.'"></i></div>';
 +
}
 +
}
 +
$out.='<div class="mx-1 px-1 border-0 flex-grow-1 '.$contentclass.'">'.$text.'</div></div>';
 +
echo $out;
 +
}
 +
</phptag>

Aktuelle Version vom 27. Oktober 2021, 08:57 Uhr

informations