Vorlage:BasePanel: Unterschied zwischen den Versionen
Aus Afterbuy-Wiki
Admin (Diskussion | Beiträge) |
Admin (Diskussion | Beiträge) |
||
Zeile 1: | Zeile 1: | ||
− | < | + | <phptag> |
+ | if(is_array($argv) && !empty($argv)){ | ||
+ | array_shift($argv); | ||
+ | $text='informations'; | ||
+ | if(isset($argv['text']) && trim($argv['text'])!=""){ | ||
+ | $text=trim($argv['text']); | ||
+ | } | ||
+ | $type='info'; | ||
+ | if(isset($argv['type']) && trim($argv['type'])!=""){ | ||
+ | $type=trim($argv['type']); | ||
+ | } | ||
+ | $icon=''; | ||
+ | $class=''; | ||
+ | $style=''; | ||
+ | |||
+ | if ($type=='info'){ | ||
+ | $class='alert-info'; | ||
+ | $icon='fas fa-info-circle'; | ||
+ | } else if ($type=='tip'){ | ||
+ | $class='alert-success'; | ||
+ | $icon='fas fa-lightbulb'; | ||
+ | } else if ($type=='warning'){ | ||
+ | $class='alert-danger'; | ||
+ | $icon='fas fa-exclamation-circle'; | ||
+ | } else if ($type=='example'){ | ||
+ | $class='bg-light'; | ||
+ | } else if ($type=='quote'){ | ||
+ | $class='bg-light text-muted'; | ||
+ | $style='border-left: 6px solid #ddd;'; | ||
+ | } | ||
+ | |||
+ | $out='<div class="'.$class.' p-1 mx-0 my-3 shadow-sm" style="'.$style.'"><table class="p-0 m-0"><tr>'; | ||
+ | if($type=='example'){ | ||
+ | $out.='<td width="100%" class="mx-2 px-2 mb-2"><span class="badge badge-secondary">Beispiel</span></td></tr><tr>'; | ||
+ | } else { | ||
+ | if($icon!=""){ | ||
+ | $out.='<td width="1%" class="mx-2 px-2" valign="top"><i class="'.$icon.'"></i></td>'; | ||
+ | } | ||
+ | } | ||
+ | $out.='<td width="100%" class="mx-2 px-2">'.$text.'</td></tr></table></div>'; | ||
+ | echo $out; | ||
+ | } | ||
+ | </phptag> |
Version vom 16. April 2021, 09:20 Uhr
informations |