Vorlage:Target: Unterschied zwischen den Versionen

Aus Afterbuy-Wiki
Wechseln zu:Navigation, Suche
 
(3 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
 
<phptag>
 
<phptag>
 
if(isset($argv) && !empty($argv) && isset($argv[1]) && !empty($argv[1])){
 
if(isset($argv) && !empty($argv) && isset($argv[1]) && !empty($argv[1])){
  $parts=$argv;
+
$parts=$argv;
  $headline=trim($argv[1]);
+
$headline=trim($argv[1]);
  unset($parts[0],$parts[1]);
+
unset($parts[0],$parts[1]);
  $stepnumber=1;
+
$stepnumber=1;
  $steps=[];
+
$laststep=$stepnumber;
  foreach($parts as $steptext){
+
$steps=[];
      if(trim($steptext)!=""){
+
foreach($parts as $steptext){
        $steps[$stepnumber]=trim($steptext);         
+
if(trim($steptext)!=""){
        $stepnumber++;
+
$steps[$stepnumber]=trim($steptext);         
      }
+
$laststep=$stepnumber;
  }
+
$stepnumber++;
  if($headline!='' && $steps!=''){
 
      echo '<div class="h6 mt-3">'.$headline.'</div><table>';
 
      foreach($steps as $number=>$step){
 
        if(trim($step)!=""){
 
  $out='<tr class="border-bottom mb-2 pb-2"><td width="1%" class="p-3 m-3" valign="top"><span class="fa-stack fa-lg" style="color:#edb800"><span class="fa fa-circle fa-stack-2x" style="color:#edb800"></span><strong class="fa-stack-1x" style="color:white;font-size:20px;">'.intval($number).'</strong></span></td><td>';
 
  $out.=trim($step).'</td></tr>';
 
  echo $out;
 
  }
 
 
}
 
}
        echo '</table>';
+
}
  }
+
if($headline!='' && $steps!=''){
 +
$out= '<div class="h6 mt-5">'.$headline.'</div><table>';
 +
if(count($steps)>1){
 +
foreach($steps as $number=>$step){
 +
 +
if(trim($step)!=""){
 +
$borderclass="border-bottom ";
 +
if($number==$laststep){
 +
$borderclass="";
 +
}
 +
$out.='<tr class="'.$borderclass.' mb-2 pb-2"><td width="1%" class="p-3 m-3" valign="top"><span class="fa-stack fa-lg" style="color:#edb800"><span class="fa fa-circle fa-stack-2x" style="color:#edb800"></span><strong class="fa-stack-1x" style="color:white;font-size:20px;">'.intval($number).'</strong></span></td><td>';
 +
$out.=trim($step).'</td></tr>';
 +
}
 +
}
 +
} else {
 +
foreach($steps as $number=>$step){
 +
if(trim($step)!=""){
 +
$out.='<tr class="mb-2 pb-2"><td>';
 +
$out.=trim($step).'</td></tr>';
 +
}
 +
}
 +
}
 +
$out.='</table>';
 +
echo $out;
 +
}
 
}
 
}
 +
 +
 
</phptag>
 
</phptag>

Aktuelle Version vom 19. November 2021, 12:17 Uhr