<?xml version="1.0" encoding="ISO-8859-1"?>
<module><name>FontToGif</name>
<description>&lt;Ihre Modulbeschreibung&gt;

Autor: Leonhard Bolschakow
Version: 1.0.0</description>
<type/>
<input>// Zeigt alle Daten im Ordner Upload an
  
function allDirRead($wert){
  
      
      // 1. Ordner Ebene

      $d = dir($wert);
      while($entry=$d-&gt;read()) {
 
         if(is_dir($wert.&quot;/&quot;.$entry)){

            // 2. Ordner Ebene 

             $d2 = dir($wert.&quot;/&quot;.$entry);
             while($entry2=$d2-&gt;read()) {


                  if(is_dir($wert.&quot;/&quot;.$entry.&quot;/&quot;.$entry2)){

                  // 3. Ordner Ebene

                  $d3 = dir($wert.&quot;/&quot;.$entry.&quot;/&quot;.$entry2);
                  while($entry3=$d3-&gt;read()) {
                        
                        $point3 = $entry.&quot;&quot;;
                        $point4 = $entry2.&quot;&quot;;
                        $point5 = $entry3.&quot;&quot;;

                        if(is_dir($wert.&quot;/&quot;.$entry.&quot;/&quot;.$entry2.&quot;/&quot;.$entry3) == true &amp;&amp; $point3 != &quot;.&quot; &amp;&amp; $point3 != &quot;..&quot;  &amp;&amp; $point4 != &quot;.&quot; &amp;&amp; $point4 != &quot;..&quot;  &amp;&amp; $point5 != &quot;.&quot; &amp;&amp; $point5 != &quot;..&quot; ){
                               $arrayOrder .= &quot;&lt;option value='&quot;.$entry.&quot;/&quot;.$entry2.&quot;/&quot;.$entry3.&quot;'&gt;&quot;.$entry.&quot;/&quot;.$entry2.&quot;/&quot;.$entry3.&quot;&lt;/option&gt;\n&quot;;
                               $pfadFiles .= $entry.&quot;/&quot;.$entry2.&quot;/&quot;.$entry3.&quot;:&quot;;
                        }

                  }
                  $d3-&gt;close();

                }

                  $point2 = $entry2.&quot;&quot;;
                  $point = $entry.&quot;&quot;;

                  if($point2 != &quot;.&quot; &amp;&amp; $point2 != &quot;..&quot; &amp;&amp; $point != &quot;.&quot; &amp;&amp; $point != &quot;..&quot;){

                  if(is_dir($wert.&quot;/&quot;.$entry.&quot;/&quot;.$entry2) == true){
                      $arrayOrder .= &quot;&lt;option value='&quot;.$entry.&quot;/&quot;.$entry2.&quot;'&gt;&quot;.$entry.&quot;/&quot;.$entry2.&quot;&lt;/option&gt;\n&quot;;
                      $pfadFiles .= $entry.&quot;/&quot;.$entry2.&quot;:&quot;;
                  }

                  }

             }

             $d2-&gt;close();
         }

         $point = $entry.&quot;&quot;;

         if($point != &quot;.&quot; &amp;&amp; $point != &quot;..&quot;){

             if(is_dir($wert.&quot;/&quot;.$entry) == true){
                 $arrayOrder .= &quot;&lt;option value='&quot;.$entry.&quot;'&gt;&quot;.$entry.&quot;&lt;/option&gt;\n&quot;;
                 $pfadFiles .= $entry.&quot;:&quot;;
             }

         }

     }
     $d-&gt;close();
  
     // return $arrayOrder;
     return $pfadFiles;

}


// Zeigt alle TrueType-Dateien in einem ausgewählten Ordner an
  
function allFileRead($wert){
  
      
      // 1. Ordner Ebene

      $d = dir($wert);

      while($entry=$d-&gt;read()){

       $point = $entry.&quot;&quot;;

       // echo $point;
         $ttf = strpos (strtolower($entry), &quot;.ttf&quot;);
         $pfb = strpos (strtolower($entry), &quot;.pfb&quot;);

         if(is_file($wert.&quot;/&quot;.$entry) == true &amp;&amp; $point != &quot;.&quot; &amp;&amp; $point != &quot;..&quot; &amp;&amp; ($ttf &gt; 0 or $pfb &gt; 0)){
             $arrayOrder .= &quot;&lt;option value='&quot;.$entry.&quot;'&gt;&quot;.$entry.&quot;&lt;/option&gt;\n&quot;;
             $pfadFiles .= $entry.&quot;:&quot;;
         }

      }
      $d-&gt;close();

      return $pfadFiles;

}


$pfad = $cfg['path']['frontend'].&quot;/cms/upload&quot;;

$dir = allDirRead($pfad);
$dirAll = explode(&quot;:&quot;, $dir);

$pfadImgOrdner = &quot;CMS_VALUE[1]&quot;;



echo '&lt;table&gt;';
echo '&lt;tr&gt;&lt;td width=&quot;150&quot;&gt;Ordner:&lt;/td&gt;&lt;td&gt;';

// alle Ordner im Upload-Ordner anzeigen

echo '&lt;select name=&quot;CMS_VAR[1]&quot; size=&quot;1&quot;&gt;';

if(&quot;CMS_VALUE[1]&quot; != &quot;&quot;){
     echo '&lt;option value=&quot;CMS_VALUE[1]&quot;&gt;CMS_VALUE[1]&lt;/option&gt;'; 
}else{
     echo '&lt;option value=&quot;&quot;&gt;- - - keine Abbildung - - -&lt;/option&gt;';
}

for($r=0;$r&lt;count($dirAll);$r++){
     if($dirAll[$r] != &quot;&quot;){
          echo &quot;&lt;option value='&quot;.$dirAll[$r].&quot;'&gt;&quot;;          
          echo $dirAll[$r];
          echo &quot;&lt;/option&gt;\n&quot;;
     }
}
echo &quot;&lt;/select&gt;&lt;br&gt;&quot;;
echo '&lt;/td&gt;&lt;/tr&gt;';
echo '&lt;tr&gt;&lt;td&gt;Datei:&lt;/td&gt;&lt;td&gt;';

// Ausgewählten Ordner anzeigen

if(is_dir($pfad.&quot;/&quot;.$pfadImgOrdner) == true){
     $files = allFileRead($pfad.&quot;/&quot;.$pfadImgOrdner);
     $filesAll = explode(&quot;:&quot;, $files);
}

echo '&lt;select name=&quot;CMS_VAR[2]&quot; size=&quot;1&quot; onchange=&quot;imageChange();&quot;&gt;';

if(&quot;CMS_VALUE[2]&quot; != &quot;&quot;){
     echo '&lt;option value=&quot;CMS_VALUE[2]&quot;&gt;CMS_VALUE[2]&lt;/option&gt;'; 
}else{
     echo '&lt;option value=&quot;&quot;&gt;- - - keine Abbildung - - -&lt;/option&gt;';
}

for($r=0;$r&lt;count($filesAll);$r++){
     if($filesAll[$r] != &quot;&quot;){
          echo &quot;&lt;option value='&quot;.$pfadImgOrdner.&quot;/&quot;.$filesAll[$r].&quot;'&gt;&quot;.$pfadImgOrdner.&quot;/&quot;.$filesAll[$r].&quot;&lt;/option&gt;\n&quot;;
     }
}

echo '&lt;/select&gt;';
echo '&lt;/td&gt;&lt;/tr&gt;';

$bildgroesseX = &quot;CMS_VALUE[3]&quot;;
$bildgroesseY = &quot;CMS_VALUE[4]&quot;;

echo '&lt;tr&gt;';
echo '&lt;td&gt;Bildgr&amp;ouml;&amp;szlig;e(x,y):&amp;nbsp;&lt;/td&gt;';
echo '&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;CMS_VAR[3]&quot; value=&quot;'.$bildgroesseX.'&quot; size=&quot;4&quot; maxlength=&quot;4&quot; border=&quot;0&quot;&gt;&amp;nbsp;,&amp;nbsp;&lt;input type=&quot;text&quot; name=&quot;CMS_VAR[4]&quot; value=&quot;'.$bildgroesseY.'&quot; size=&quot;4&quot; maxlength=&quot;4&quot; border=&quot;0&quot;&gt;&lt;/td&gt;';
echo '&lt;tr&gt;';

$schriftfarbeR = &quot;CMS_VALUE[5]&quot;;
$schriftfarbeG = &quot;CMS_VALUE[6]&quot;;
$schriftfarbeB = &quot;CMS_VALUE[7]&quot;;

echo '&lt;tr&gt;';
echo '&lt;td&gt;Schriftfarbe(R,G,B):&amp;nbsp;&lt;/td&gt;';
echo '&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;CMS_VAR[5]&quot; value=&quot;'.$schriftfarbeR.'&quot; size=&quot;3&quot; maxlength=&quot;3&quot; border=&quot;0&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;input type=&quot;text&quot; name=&quot;CMS_VAR[6]&quot; value=&quot;'.$schriftfarbeG.'&quot; size=&quot;3&quot; maxlength=&quot;3&quot; border=&quot;0&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;input type=&quot;text&quot; name=&quot;CMS_VAR[7]&quot; value=&quot;'.$schriftfarbeB.'&quot; size=&quot;3&quot; maxlength=&quot;3&quot; border=&quot;0&quot;&gt;&lt;/td&gt;';
echo '&lt;tr&gt;';

$hintergrundfarbeR = &quot;CMS_VALUE[8]&quot;;
$hintergrundfarbeG = &quot;CMS_VALUE[9]&quot;;
$hintergrundfarbeB = &quot;CMS_VALUE[10]&quot;;

echo '&lt;tr&gt;';
echo '&lt;td&gt;Hintergrundfarbe(R,G,B):&amp;nbsp;&lt;/td&gt;';
echo '&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;CMS_VAR[8]&quot; value=&quot;'.$hintergrundfarbeR.'&quot; size=&quot;3&quot; maxlength=&quot;3&quot; border=&quot;0&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;input type=&quot;text&quot; name=&quot;CMS_VAR[9]&quot; value=&quot;'.$hintergrundfarbeG.'&quot; size=&quot;3&quot; maxlength=&quot;3&quot; border=&quot;0&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;input type=&quot;text&quot; name=&quot;CMS_VAR[10]&quot; value=&quot;'.$hintergrundfarbeB.'&quot; size=&quot;3&quot; maxlength=&quot;3&quot; border=&quot;0&quot;&gt;&lt;/td&gt;';
echo '&lt;tr&gt;';

$schriftgroesse = &quot;CMS_VALUE[11]&quot;;

echo '&lt;tr&gt;';
echo '&lt;td&gt;Schriftgr&amp;ouml;&amp;szlig;e:&amp;nbsp;&lt;/td&gt;';
echo '&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;CMS_VAR[11]&quot; value=&quot;'.$schriftgroesse.'&quot; size=&quot;3&quot; maxlength=&quot;3&quot; border=&quot;0&quot;&gt;&lt;/td&gt;';
echo '&lt;tr&gt;';

$schriftposition = &quot;CMS_VALUE[12]&quot;;

echo '&lt;tr&gt;';
echo '&lt;td&gt;Schriftposition(x):&amp;nbsp;&lt;/td&gt;';
echo '&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;CMS_VAR[12]&quot; value=&quot;'.$schriftposition.'&quot; size=&quot;3&quot; maxlength=&quot;3&quot; border=&quot;0&quot;&gt;&lt;/td&gt;';
echo '&lt;tr&gt;';

$idcatFontTemplate = &quot;CMS_VALUE[13]&quot;;

echo '&lt;tr&gt;';
echo '&lt;td&gt;idcat FontTemplate:&amp;nbsp;&lt;/td&gt;';
echo '&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;CMS_VAR[13]&quot; value=&quot;'.$idcatFontTemplate.'&quot; size=&quot;3&quot; maxlength=&quot;3&quot; border=&quot;0&quot;&gt;&lt;/td&gt;';
echo '&lt;tr&gt;';

$datei = &quot;CMS_VALUE[2]&quot;;
$pfadKomplett = $pfad.$datei;

if($idcatFontTemplate != &quot;&quot;){

echo '&lt;tr&gt;';
echo '&lt;td colspan=&quot;2&quot;&gt;ausgew&amp;auml;hlter Schriftfont:&lt;/td&gt;';
echo '&lt;tr&gt;';
echo '&lt;tr&gt;';
echo '&lt;td colspan=&quot;2&quot;&gt;&lt;img src=&quot;../cms/front_content.php?idcat='.$idcatFontTemplate.'&quot; border=&quot;1&quot;&gt;&lt;/td&gt;';
echo '&lt;tr&gt;';

}

echo '&lt;/table&gt;';</input>
<output>&lt;?php

// Pfad zum Schriftfont

$datei = &quot;CMS_VALUE[2]&quot;;
$pfad = $cfg['path']['frontend'].&quot;/cms/upload&quot;;

$pfadKomplett = $pfad.&quot;/&quot;.$datei;

// Bildgroesse
$bildgroesseX = &quot;CMS_VALUE[3]&quot;;
$bildgroesseY = &quot;CMS_VALUE[4]&quot;;

// Schriftfarbe
$schriftfarbeR = &quot;CMS_VALUE[5]&quot;;
$schriftfarbeG = &quot;CMS_VALUE[6]&quot;;
$schriftfarbeB = &quot;CMS_VALUE[7]&quot;;

// Hintergrundfarbe
$hintergrundfarbeR = &quot;CMS_VALUE[8]&quot;;
$hintergrundfarbeG = &quot;CMS_VALUE[9]&quot;;
$hintergrundfarbeB = &quot;CMS_VALUE[10]&quot;;

// Schriftgroesse
$schriftgroesse = &quot;CMS_VALUE[11]&quot;;

// Schriftgroesse (x)
$schriftposition = &quot;CMS_VALUE[12]&quot;;

if(is_file($pfadKomplett)){

     Header(&quot;Content-type: image/gif&quot;);

     // Prueft, ob Bildgroesse definiert ist. Wenn nicht, wird ein Standard-Wert festgelegt(300x50).

     if($bildgroesseX &gt; 0 &amp;&amp; $bildgroesseY &gt; 0){
         $image = imagecreate($bildgroesseX,$bildgroesseY);
     }else{
         $image = imagecreate(300,50);
     }

     // Prueft, ob Hintergrundfarbe definiert ist. Wenn nicht, wird ein Standard-Wert festgelegt(Weiss).

     if(($hintergrundfarbeR != &quot;&quot; &amp;&amp; $hintergrundfarbeR &gt; -1 &amp;&amp; $hintergrundfarbeR &lt; 256) &amp;&amp; ($hintergrundfarbeG != &quot;&quot; &amp;&amp; $hintergrundfarbeG &gt; -1 &amp;&amp; $hintergrundfarbeG &lt; 256) &amp;&amp; ($hintergrundfarbeB != &quot;&quot; &amp;&amp; $hintergrundfarbeB &gt; -1 &amp;&amp; $hintergrundfarbeB &lt; 256)){
         $farbe_body=imagecolorallocate($image,$hintergrundfarbeR,$hintergrundfarbeG,$hintergrundfarbeB);
     }else{
         $farbe_body=imagecolorallocate($image,255,255,255);
     }

     imagecolortransparent($image,$farbe_body);

     // Prueft, ob Schriftfarbe definiert ist. Wenn nicht, wird ein Standard-Wert festgelegt(Schwarz).

     if(($schriftfarbeR != &quot;&quot; &amp;&amp; $schriftfarbeR &gt; -1 &amp;&amp; $schriftfarbeR &lt; 256) &amp;&amp; ($schriftfarbeG != &quot;&quot; &amp;&amp; $schriftfarbeG &gt; -1 &amp;&amp; $schriftfarbeG &lt; 256) &amp;&amp; ($schriftfarbeB != &quot;&quot; &amp;&amp; $schriftfarbeB &gt; -1 &amp;&amp; $schriftfarbeB &lt; 256)){
         $font_c=imagecolorallocate($image,$schriftfarbeR,$schriftfarbeG,$schriftfarbeB);
     }else{
         $font_c=imagecolorallocate($image,0,0,0);
     }


     if($_GET['text'] != &quot;&quot;){
        $text_b = urldecode($_GET['text']);
        // $text_b = $_GET['text'];
     }else{
        $text_b = &quot;Test&quot;;
     }

     if($schriftgroesse == &quot;&quot;){
          $schriftgroesse = 30;
     }

     if($schriftposition == &quot;&quot;){
          $schriftposition = 0;
     }

     $text_b = str_replace('\&quot;', '&quot;',$text_b); 

     Imagettftext($image, $schriftgroesse, 0, $schriftposition, $schriftgroesse, $font_c, &quot;$pfadKomplett&quot;, &quot;$text_b&quot;);
     Imagepng($image);
     ImageDestroy($image);

}
?&gt;</output>
</module>

