[ Index ]

PHP Cross Reference of phpwcms V1.4.3 _r380 (23.11.09)

title

Body

[close]

/include/inc_module/mod_graphical_text/inc_tmpl/ -> gt.fonts.tmpl.php (source)

   1  <?php
   2  // ----------------------------------------------------------------
   3  // obligate check for phpwcms constants
   4  if (!defined('PHPWCMS_ROOT')) {
   5     die("You Cannot Access This Script Directly, Have a Nice Day.");
   6  }
   7  // ----------------------------------------------------------------
   8  
   9  
  10      // Array mit allen bisher in der DB eingetragenen Fonts erstellen
  11      $query = "SELECT * FROM ".DB_PREPEND."phpwcms_fonts";
  12      $result = mysql_query($query, $db) or die ("Graphical Text MOD - Error in query: $query");
  13      
  14      $fontcount = 0;
  15      while ($row = mysql_fetch_assoc($result))
  16      {
  17          ++$fontcount;
  18          $font_array[$fontcount]["font_id"] = $row["font_id"];
  19          $font_array[$fontcount]["font_name"] = $row["font_name"];
  20          $font_array[$fontcount]["font_shortname"] = $row["font_shortname"];
  21          $font_array[$fontcount]["font_filename"] = $row["font_filename"];
  22      }
  23  ?>
  24  <table width="538" border="0" cellpadding="0" cellspacing="0" summary="">
  25      <tr><td colspan="4" class="title"><img src="img/leer.gif" alt="" width="1" height="5" /></td>
  26      </tr>
  27      <tr><td colspan="4" class="title"><?php echo $BL['be_gt_fonts_title']; ?></td></tr>
  28      <tr><td colspan="4" class="title"><img src="img/leer.gif" alt="" width="1" height="5" /></td>
  29      </tr>
  30      <tr><td colspan="4" ><img src="img/lines/l538_70.gif" alt="" width="538" height="1" /></td>
  31      </tr>
  32      <tr><td colspan="4" ><img src="img/leer.gif" alt="" width="1" height="5" /></td>
  33      </tr>
  34      <tr>
  35          <td><strong><?php echo $BL['be_gt_font_name'] ?></strong></td>
  36          <td><strong><?php echo $BL['be_gt_font_shortname'] ?></strong></td>
  37          <td><strong><?php echo $BL['be_gt_font_filename'] ?></strong></td>
  38          <td>&nbsp;</td>
  39      </tr>
  40      <tr><td colspan="4"><img src="img/leer.gif" alt="" width="1" height="5" /></td>
  41      </tr>
  42      <tr><td colspan="4"><img src="img/lines/l538_70.gif" alt="" width="538" height="1" /></td>
  43      </tr>
  44      <tr><td colspan="4"><img src="img/leer.gif" alt="" width="1" height="5" /></td>
  45      </tr>
  46      
  47  <?php
  48          $font_dir = PHPWCMS_ROOT."/include/inc_module/mod_graphical_text/inc_fonts/";
  49          
  50          // Directory-Handle geifen
  51          $handle = opendir($font_dir);
  52          
  53          $i = 0;
  54          
  55          while (false !== ($file = readdir($handle)))    // von php.net abgeguckt
  56          {
  57              $font_ext = which_ext($file);
  58              
  59              if(strpos($file, '.') === 0 || ($font_ext != 'ttf' && $font_ext != 'otf')) {
  60                  continue;    
  61              }
  62  
  63              if (fmod($i, 2) == 0)
  64              {
  65                  $bgcolor = "F5F9FA";
  66                  $bgcolor2 = "E5E9EA";
  67              }
  68              else
  69              {
  70                  $bgcolor = "FFFFFF";
  71                  $bgcolor2 = "F8F8F8";
  72              }
  73              
  74              // Den aktuellen Wert mit dem Array vergleichen. Wenn der Wert im Array ist, dann ist 
  75              // der Font schon erfasst und darf normal angezeigt werden. Ansonsten wird er rot 
  76              // dargestellt (oder so).
  77              
  78              $found = false;
  79              
  80              if (!empty($font_array))
  81              {
  82                  foreach ($font_array as $font)
  83                  {
  84                      if ($font["font_filename"] == $file)
  85                      {
  86                          $found = true;
  87                          $font_id = $font["font_id"];
  88                          $font_name = $font["font_name"];
  89                          $font_shortname = $font["font_shortname"];
  90                      }
  91                  }
  92              }
  93  
  94              //if(0)
  95              //{
  96                  $font_filename = $file;
  97              
  98                  echo "<tr style=\"background: #$bgcolor;\">\n";
  99                  if ($found == false)
 100                  {
 101                      echo "  <td valign=\"top\"><span style=\"color:#FF0000\">".$BL["be_gt_font_not_yet_added"]."</span></td>\n";
 102                      echo "  <td valign=\"top\">&nbsp;</td>\n";
 103                      echo "  <td valign=\"top\">".html_specialchars($file)."</td>\n";
 104                      echo "  <td  valign=\"top\" align=\"right\"><a href=\"phpwcms.php?do=modules&amp;p=2&amp;s=fonts&amp;t=add&amp;font_filename=".rawurlencode($font_filename)."\" title=\"".$BL['be_gt_font_add']."\">";
 105                      echo "<img src=\"include/inc_module/mod_graphical_text/img/button/add_22x11.gif\" width=\"22\" height=\"11\" border=\"0\" alt=\"\" /></a></td>\n";
 106                  }
 107                  else
 108                  {
 109                      echo "  <td valign=\"top\">".html_specialchars($font_name)."<br />";
 110                      echo show_picture($file, $font_name, "1", "12", "#111111", "0", $bgcolor, "0", "0", "png") ."</td>\n";
 111                      echo "  <td valign=\"top\">".html_specialchars($font_shortname)."</td>\n";
 112                      echo "  <td valign=\"top\">".html_specialchars($file)."</td>\n";
 113                      echo "  <td  valign=\"top\" align=\"right\"><a href=\"phpwcms.php?do=modules&amp;p=2&amp;s=fonts&amp;t=update&amp;font_filename=".rawurlencode($font_filename)."&amp;font_id=$font_id\" title=\"".$BL['be_gt_font_edit']."\"><img src=\"img/button/edit_22x11.gif\" width=\"22\" height=\"11\" border=\"0\" alt=\"\" /></a></td>\n";
 114                  }
 115                  echo "</tr>\n";
 116                  echo "<tr bgcolor=\"#AAAAAA\"><td colspan=\"4\"><img src=\"img/leer.gif\" width=\"1\" height=\"1\" alt=\"\" /></td></tr>\n";
 117              //}
 118              ++$i;
 119              $found = false;
 120              $font_id = "";
 121              $font_name = "";
 122              $font_shortname = "";
 123          }
 124  ?>    
 125      <tr><td colspan="4"><img src="img/leer.gif" width="1" height="5" alt="" /></td></tr>
 126      <tr><td colspan="4"><img src="img/lines/l538_70.gif" width="538" height="1" alt="" /></td></tr>
 127  </table>


Generated: Wed Dec 30 05:55:15 2009 Cross-referenced by PHPXref 0.7