[ 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.style.update.tmpl.php (source)

   1  <?php
   2  
   3  // ----------------------------------------------------------------
   4  // obligate check for phpwcms constants
   5  if (!defined('PHPWCMS_ROOT')) {
   6     die("You Cannot Access This Script Directly, Have a Nice Day.");
   7  }
   8  // ----------------------------------------------------------------
   9  
  10      $gtarray = gt2array($db);
  11      $action = empty($_GET["t"]) ? '' : clean_slweg($_GET["t"]);
  12      $sendbutton = ($action == "add") ? $BL['be_gt_button_add'] : $BL['be_gt_button_update'];
  13      $style_id = empty($_GET["style_id"]) ? 0 : intval($_GET["style_id"]);
  14      
  15      $fgtransparency            = 0;
  16      $bgtransparency         = 0;
  17      $style_antialiasing     = 0;
  18      $style_fgtransparency    = 0;
  19      $style_bgtransparency    = 0;
  20      $style_name                = '';
  21      $style_format            = 'png';
  22      $style_font                = 0;
  23      $style_fgcolor            = '';
  24      $style_bgcolor            = 0;
  25      $tr_visibility            = 'visible';
  26      $style_size                = '10';
  27      $style_rotation            = 'default';
  28      
  29      
  30      if (isset($_GET["doit"]) && intval($_GET["doit"]) == 1)
  31      {
  32          $style_name = clean_slweg($_POST["name"]);
  33          
  34          
  35          if (clean_slweg($_POST["format"]) != "jpg")
  36          {
  37              $fgtransparency = empty($_POST["fgtransparency"]) ? 0 : 1;
  38              $bgtransparency = empty($_POST["bgtransparency"]) ? 0 : 1;
  39          }
  40          
  41          $line_width= empty($_POST["linewidth"]) ? 0 : intval($_POST["linewidth"]);
  42          
  43          $style_info  = clean_slweg($_POST["font"]);
  44          $style_info .= ":";
  45          $style_info .= clean_slweg($_POST["antialiasing"]);
  46          $style_info .= ":";
  47          $style_info .= clean_slweg($_POST["size"]);
  48          $style_info .= ":";
  49          $style_info .= clean_slweg($_POST["fgcolor"]);
  50          $style_info .= ":";
  51          $style_info .= $fgtransparency;
  52          $style_info .= ":";
  53          $style_info .= clean_slweg($_POST["bgcolor"]);
  54          $style_info .= ":";
  55          $style_info .= $bgtransparency;
  56          $style_info .= ":";
  57          $style_info .= $line_width;
  58          $style_info .= ":";
  59          $style_info .= clean_slweg($_POST["format"]);
  60          
  61          //add new enhanced settings to font
  62          $style_info .= ":";
  63          $style_info .= intval($_POST["start_x"]);
  64          $style_info .= ":";
  65          $style_info .= intval($_POST["start_y"]);
  66          $style_info .= ":";
  67          $style_info .= intval($_POST["height"]);
  68          $style_info .= ":";
  69          $style_info .= clean_slweg($_POST["rotation"]);
  70          
  71          if ($action == "add") {
  72              $query  = "INSERT INTO ".DB_PREPEND."phpwcms_fonts_styles SET style_name = '";
  73              $query .= aporeplace($style_name)."', style_info = '".aporeplace($style_info)."'";
  74          } else {
  75              $query  = "UPDATE ".DB_PREPEND."phpwcms_fonts_styles SET style_name = '";
  76              $query .= aporeplace($style_name)."', style_info = '".aporeplace($style_info)."' WHERE style_id = ".$style_id;
  77          }
  78          
  79          $result = mysql_query($query, $db);
  80          
  81          header('Location:'.PHPWCMS_URL.'phpwcms.php?do=modules&p=2&s=styles');
  82      }
  83  
  84      
  85      if (!empty($style_id))
  86      {
  87          $style = $gtarray["styles_id"][$style_id];
  88  
  89          $style_name = $style["name"];
  90          $style_font = $style["font"];
  91          $style_antialiasing = $style["antialiasing"];
  92          $style_size = $style["size"];
  93          $style_fgcolor = $style["fgcolor"];
  94          $style_bgcolor = $style["bgcolor"];
  95          $style_format = $style["format"];
  96          $style_fgtransparency = $style["fgtransparency"];
  97          $style_bgtransparency = $style["bgtransparency"];
  98          $style_line_width = $style["line_width"];
  99          
 100          $style_x = $style["start_x"];
 101          $style_y = $style["start_y"];
 102          $style_height = $style["height"];
 103          $style_rotation = $style["rotation"];
 104          
 105          if ($style_format != "jpg") {
 106              $tr_visibility = "visible";
 107          } else {
 108              $tr_visibility = "hidden";
 109          }
 110      }
 111  ?>
 112  
 113  <form action="phpwcms.php?do=modules&amp;p=2&amp;s=styles&amp;t=<?php echo $action; ?>&amp;style_id=<?php echo $style_id;?>&amp;doit=1" method="post" name="gt_styles" id="gt_styles">
 114      <table width="538" border="0" cellpadding="0" cellspacing="0" summary="">
 115          <tr><td colspan="2" class="title"><img src="img/leer.gif" alt="" width="1" height="5" /></td>
 116          </tr>
 117          <tr><td colspan="2" class="title"><?php echo $BL['be_gt_style_edit_title']; ?></td></tr>
 118          <tr><td colspan="2" class="title"><img src="img/leer.gif" alt="" width="1" height="5" /></td>
 119          </tr>
 120          <tr><td colspan="2"><img src="img/lines/l538_70.gif" alt="" width="538" height="1" /></td>
 121          </tr>
 122          <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td>
 123          </tr>
 124          <tr>
 125              <td align="right" class="chatlist" nowrap="nowrap"><?php echo $BL['be_gt_style_name'] ?>:&nbsp;</td>
 126              <td><input name="name" type="text" id="name" class="f11b" style="width: 350px" value="<?php echo html_specialchars($style_name); ?>" size="50" maxlength="16" /></td>
 127          </tr>
 128          <tr><td colspan="2"><img src="img/leer.gif" width="1" height="3" alt="" /></td></tr>
 129          <tr>
 130              <td align="right" class="chatlist" nowrap="nowrap"><?php echo $BL['be_gt_output_format'] ?>:&nbsp;</td>
 131              <td>
 132                  <select name="format" class="f11b" onchange="toggletransparency()">
 133                      <?php
 134                          $sel_png = "";
 135                          $sel_gif = "";
 136                          $sel_jpg = "";
 137                          
 138                          switch ($style_format)
 139                          {
 140                              case "png": $sel_png='selected="selected"'; break;
 141                              case "jpg": $sel_jpg='selected="selected"'; break;
 142                              case "gif": $sel_gif='selected="selected"'; break;
 143                          }
 144  
 145                          if (imagetypes() & IMG_PNG)
 146                                 echo "<option value=\"png\" $sel_png >PNG</option>";
 147                          if (ImageTypes() & IMG_JPG)
 148                          {
 149                                 echo "<option value=\"jpg\" $sel_jpg >JPG</option>";
 150                          }
 151                          if (imagetypes() & IMG_GIF)
 152                                 echo "<option value=\"gif\" $sel_gif >GIF</option>";
 153                      ?>
 154                  </select>
 155              </td>
 156          </tr>
 157          <tr><td colspan="2"><img src="img/leer.gif" width="1" height="3" alt="" /></td></tr>
 158          <tr>
 159              <td align="right" class="chatlist" nowrap="nowrap"><?php echo $BL['be_gt_style_font'] ?>:&nbsp;</td>
 160              <td>
 161                  <select name="font" class="f11b">
 162                      <option value="0" class="f11b">&nbsp;</option>
 163                      <?php
 164                          foreach($gtarray["fonts_id"] as $key)
 165                          {
 166                              if(intval($key["id"]) == intval($style_font)) {
 167                                  echo "<option value=\"".$key["id"]."\" class=\"f11b\" selected=\"selected\">".$key["name"]."</option>\n";
 168                              } else {
 169                                  echo "<option value=\"".$key["id"]."\" class=\"f11b\">".$key["name"]."</option>\n";
 170                              }
 171                          }
 172                      ?>
 173                  </select>
 174              </td>
 175          </tr>
 176          <tr><td colspan="2"><img src="img/leer.gif" width="1" height="3" alt="" /></td></tr>
 177          <tr>
 178              <td align="right" class="chatlist" nowrap="nowrap" valign="top"><?php echo $BL['be_gt_style_antialiasing']; ?>:&nbsp;</td>
 179              <td>
 180                  <?php
 181                  if (intval($style_antialiasing) != 0)
 182                  { ?>
 183                      <input name="antialiasing" type="radio" id="antialiasing_1" value="1" checked="checked" /> <?php echo $BL['be_gt_style_antialiasing_yes']; ?>&nbsp;&nbsp;&nbsp;
 184                      <input name="antialiasing" type="radio" id="antialiasing_0" value="0" /> <?php echo $BL['be_gt_style_antialiasing_no']; ?>
 185                  <?php }
 186                  else
 187                  { ?>
 188                      <input name="antialiasing" type="radio" id="antialiasing_1" value="1" /> <?php echo $BL['be_gt_style_antialiasing_yes']; ?>&nbsp;&nbsp;&nbsp;
 189                      <input name="antialiasing" type="radio" id="antialiasing_0" value="0" checked="checked" /> <?php echo $BL['be_gt_style_antialiasing_no']; ?>
 190                  <?php } ?>
 191              </td>
 192          </tr>
 193          <tr><td colspan="2"><img src="img/leer.gif" width="1" height="3" alt="" /></td></tr>
 194          <tr>
 195              <td align="right" class="chatlist" nowrap="nowrap"><?php echo $BL['be_gt_style_size'] ?>:&nbsp;</td>
 196              <td><input name="size" type="text" id="size" class="f11b" style="width: 50px" value="<?php echo $style_size; ?>" size="10" maxlength="3" /></td>
 197          </tr>
 198          <tr><td colspan="2"><img src="img/leer.gif" width="1" height="3" alt="" /></td></tr>
 199          <tr>
 200              <td align="right" class="chatlist" nowrap="nowrap"><?php echo $BL['be_gt_style_underline'] ?>:&nbsp;</td>
 201              <td class="chatlist"><input name="linewidth" type="text" id="linewidth" class="f11b" style="width: 50px" value="<?php echo @$style_line_width; ?>" size="10" maxlength="3" />
 202               <?php echo $BL['be_gt_style_underline_desc'] ?></td>
 203          </tr>
 204          <tr><td colspan="2"><img src="img/leer.gif" width="1" height="3" alt="" /></td></tr>
 205          
 206          <tr>
 207              <td align="right" class="chatlist" nowrap="nowrap">X:&nbsp;</td>
 208              <td class="chatlist"><input name="start_x" type="text" id="start_x" class="f11b" style="width: 50px" value="<?php echo @$style_x; ?>" size="10" maxlength="3" /></td>
 209          </tr>
 210          <tr><td colspan="2"><img src="img/leer.gif" width="1" height="3" alt="" /></td></tr>
 211          
 212          <tr>
 213              <td align="right" class="chatlist" nowrap="nowrap">Y:&nbsp;</td>
 214              <td class="chatlist"><input name="start_y" type="text" id="start_y" class="f11b" style="width: 50px" value="<?php echo @$style_y; ?>" size="10" maxlength="3" /></td>
 215          </tr>
 216          <tr><td colspan="2"><img src="img/leer.gif" width="1" height="3" alt="" /></td></tr>
 217          
 218          <tr>
 219              <td align="right" class="chatlist" nowrap="nowrap"><?php echo $BL['be_gt_style_height'] ?>:&nbsp;</td>
 220              <td class="chatlist"><input name="height" type="text" id="height" class="f11b" style="width: 50px" value="<?php echo @$style_height; ?>" size="10" maxlength="3" /></td>
 221          </tr>
 222          <tr><td colspan="2"><img src="img/leer.gif" width="1" height="3" alt="" /></td></tr>
 223          
 224          <tr>
 225              <td align="right" class="chatlist" nowrap="nowrap"><?php echo $BL['be_gt_style_fgcolor']; ?>:&nbsp;</td>
 226              <td class="chatlist">
 227                  <select name="fgcolor" class="f11b">
 228                      <option value="0" class="f11b">&nbsp;</option>
 229                      <?php
 230                          foreach($gtarray["colors_id"] as $key)
 231                          {
 232                              if ($key["value"] > "EEEEEE") {
 233                                  $option_bgcolor = "#555555";
 234                              } else {
 235                                  $option_bgcolor = "#FFFFFF";
 236                              }
 237                              
 238                              if($key["id"] == $style_fgcolor) {
 239                                  echo "<option value=\"".$key["id"]."\"  class=\"f11b\" style=\"color:#".$key["value"].";background-color:$option_bgcolor\" selected=\"selected\">".$key["name"]."</option>\n";
 240                              } else {
 241                                  echo "<option value=\"".$key["id"]."\"  class=\"f11b\" style=\"color:#".$key["value"].";background-color:$option_bgcolor\">".$key["name"]."</option>\n";
 242                              }
 243                          }
 244                      ?>
 245                  </select> <span id="fgt" class="<?php echo $tr_visibility; ?>">
 246                  <?php
 247                      
 248                      echo '<input type="checkbox" name="fgtransparency" id="fgtransparency" value="1"'.is_checked(1, $style_fgtransparency, 1, 0).' />';
 249                      
 250                      echo $BL['be_gt_style_transparency'];
 251                  ?></span>            </td>
 252          </tr>
 253          <tr><td colspan="2"><img src="img/leer.gif" width="1" height="3" alt="" /></td></tr>
 254          <tr>
 255              <td align="right" class="chatlist" nowrap="nowrap"><?php echo $BL['be_gt_style_bgcolor']; ?>:&nbsp;</td>
 256              <td class="chatlist">
 257                  <select name="bgcolor" class="f11b">
 258                      <option value="0" class="f11b">&nbsp;</option>
 259                      <?php
 260                          foreach($gtarray["colors_id"] as $key)
 261                          {
 262                              if ($key["value"] > "EEEEEE") {
 263                                  $option_bgcolor = "#555555";
 264                              } else {
 265                                  $option_bgcolor = "#FFFFFF";
 266                              }
 267                                  
 268                              if(intval($key["id"]) == intval($style_bgcolor)) {
 269                                  echo "<option value=\"".$key["id"]."\"  class=\"f11b\" style=\"color:#".$key["value"].";background-color:$option_bgcolor\" selected=\"selected\">".$key["name"]."</option>\n";
 270                              } else {
 271                                  echo "<option value=\"".$key["id"]."\"  class=\"f11b\" style=\"color:#".$key["value"].";background-color:$option_bgcolor\">".$key["name"]."</option>\n";
 272                              }
 273                          }
 274                      ?>
 275                  </select> <span id="bgt" class="<?php echo $tr_visibility; ?>">
 276                  <?php
 277                      echo '<input type="checkbox" name="bgtransparency" id="bgtransparency" value="1"'.is_checked(1, $style_bgtransparency, 1, 0).' />';
 278                      echo $BL['be_gt_style_transparency'];
 279                  ?></span>            </td>
 280          </tr>
 281          
 282          <tr><td colspan="2"><img src="img/leer.gif" width="1" height="3" alt="" /></td></tr>
 283          <tr>
 284              <td align="right" class="chatlist" nowrap="nowrap"><?php echo $BL['be_gt_style_rotation']; ?>:&nbsp;</td>
 285              <td class="chatlist"><select name="rotation" class="f11b">
 286                      
 287                      <option value="default"<?php is_selected('default', $style_rotation) ?>><?php echo html_entities($BL['be_gt_style_rotation_default']); ?></option>
 288                      <option value="cw"<?php is_selected('cw', $style_rotation) ?>><?php echo html_entities($BL['be_gt_style_rotation_cw']); ?></option>
 289                      <option value="hcw"<?php is_selected('hcw', $style_rotation) ?>><?php echo html_entities($BL['be_gt_style_rotation_hcw']); ?></option>
 290                      <option value="ccw"<?php is_selected('ccw', $style_rotation) ?>><?php echo html_entities($BL['be_gt_style_rotation_ccw']); ?></option>
 291                      
 292                  </select></td>
 293          </tr>
 294          
 295          
 296          <tr><td colspan="2"><img src="img/leer.gif" width="1" height="10" alt="" /></td></tr>
 297          <tr>
 298              <td class="chatlist"></td>
 299              <td><input name="Submit" type="submit" class="button10" value="<?php echo $sendbutton ?>" />
 300              &nbsp;&nbsp;
 301              <input name="donotsubmit" type="button" class="button10" value="<?php echo $BL['be_gt_button_cancel'] ?>" onclick="location.href='phpwcms.php?do=modules&amp;p=2&amp;s=styles'" /></td>
 302          </tr>
 303          <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td>
 304          </tr>
 305          <tr><td colspan="2"><img src="img/lines/l538_70.gif" alt="" width="538" height="1" /></td>
 306          </tr>
 307          <tr><td colspan="2"><?php subnavback($BL['be_gt_style_back'], "phpwcms.php?do=modules&amp;p=2&amp;s=styles", 6) ?></td></tr>
 308      </table>
 309  </form>


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