Subversion-Projekte lars-tiefland.content-management

Revision

Blame | Letzte Änderung | Log anzeigen | RSS feed

<?
        require_once "page_functions.php";
?>
<html>
<head>
<title>Content-Management-System - Webagentur Niewerth</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="author" content="Webagentur Niewerth - www.weban.de">
<meta name="revisit-after" content="30 days">
<meta name="language" content="deutsch, de">
<meta name="distribution" content="global">
<meta name="robots" content="all">
<link rel="stylesheet" href="redaktion.css" type="text/css">
<style type="text/css"><? require_once "redaktion.css"?></style>
<script language="javascript" src="Farb_Assistent.js"></script>
<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' muss eine E-Mail Adresse sein.\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' muss eine Zahl sein.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' muss eine Zahl zwischen '+min+' und '+max+' sein.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' wird benötigt.\n'; }
  } if (errors) alert('Folgende Fehler sind aufgetreten:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function go()
{
        MM_validateForm('Titel','','R','Dateiname','','R');
        if (document.MM_returnValue)
        {
                document.formname.submit();
        }
}

function check_filename(name)
{
        if (name != '')
        {
                for(i=0; i<=Dateinamen.length; i++)
                {
                        if (Dateinamen[i] == name)
                        {
                                alert('Es existiert bereits eine Datei mit diesem Namen!');
                                return '';
                                break;
                        }
                }
        }
return name;
}

<?
        $files=array();
        $result = mysql_query ("SELECT Dateiname FROM Files where site = '$site'") or die (mysql_errno().": ".mysql_error());
        while ($zeile=mysql_fetch_array($result))
        {
                array_push($files,"'$zeile[Dateiname]'");
        }
        $files=join(", ",$files);
?>
Dateinamen = new Array(<? echo $files ?>);
//-->
</script>
</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0 marginwidth="0" marginheight="0">
<?
        if ($ID)
        {
                $result = mysql_query ("SELECT * FROM $Tab where ID = $ID and site='$site'") or die (mysql_errno().": ".mysql_error());
                if (mysql_num_rows($result) == 0) {unset($ID);}
                $zeile=mysql_fetch_array($result);
        }
?>
<form method="post" action="<? echo $self ?>?redirect=true&File=<? echo $File; ?>" name="formname" enctype="multipart/form-data">
  <table border="1" cellspacing="0" cellpadding="0" bordercolorlight="#FFFFFF" bordercolordark="#999999" width="100%" height="100%">
    <tr> 
      <td bgcolor="#000099" class="headline" width="105">Titel: </td>
    <td class="small" colspan="2"> 
        <input type="text" name="Titel" size="30" maxlength="255" value="<? echo $zeile[Titel]?>">
    </td>
  </tr>
  <tr> 
      <td bgcolor="#000099" class="headline" width="105">Dateiname:</td>
    <td class="small" colspan="2"> 
<? 
        if (!$start_call) 
        {
?>      
<?
                if (!$ID)
                {
?>
<input type="text" name="Dateiname" size="30" maxlength="255" value="<? echo $zeile[Dateiname]?>" onChange="this.value=check_filename(this.value)">
<?
                }
                else
                {
?>
<? echo $zeile[Dateiname] ?>
<?
                }
        }
        else
        {
?>
                <input type="hidden" name="Dateiname" value="start.htm">start.htm
<?
        }
?>
    </td>
  </tr>
  <tr> 
      <td bgcolor="#000099" class="headline" rowspan="2" valign="top" width="105">&Uuml;berschrift:</td>
    <td colspan="2"><b> 
        <input type="text" name="Ueberschrift" size="30" maxlength="255" value="<? echo $zeile[Ueberschrift] ?>">
      </b> </td>
  </tr>
  <tr> 
      <td width="371"> 
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td nowrap><b>Farbe: # 
        <input type="text" name="Ueberschrift_Farbe" size="6" maxlength="6" value="<? echo $zeile[Ueberschrift_Farbe] ?>">
        <input type="button" value="Farb Assistent" onClick="Farb_Assistent(this.form.Ueberschrift_Farbe.value,'document.formname.Ueberschrift_Farbe.value');" name="button">
        </b></td>
            <td>
              <table width="24" height="10" border="1" cellspacing="0" cellpadding="0">
                <tr>
                  <td bgcolor="<? echo $zeile[Ueberschrift_Farbe] ?>">&nbsp;</td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
</td>
      <td width="519"><b> </b><b>Art: </b><b> 
        <select name="Ueberschrift_Art" size="1">
                <option value="Arial, Helvetica, sans-serif"<? if ($zeile[Ueberschrift_Art] == "Arial, Helvetica, sans-serif") {echo " selected";} ?>>Arial</option>
                <option value="Times New Roman, Times, serif"<? if ($zeile[Ueberschrift_Art] == "Times New Roman, Times, serif") {echo " selected";} ?>>Times New Roman</option>
                <option value="Courier New, Courier, mono"<? if ($zeile[Ueberschrift_Art] == "Courier New, Courier, mono") {echo " selected";} ?>>Courier</option>
                <option value="Verdana, Arial, Helvetica, sans-serif"<? if ($zeile[Ueberschrift_Art] == "Verdana, Arial, Helvetica, sans-serif") {echo " selected";} ?>>Verdana</option>
      </select>
      </b> <b>Gr&ouml;&szlig;e: 
<? if (!$zeile[Ueberschrift_Groesse]) {$zeile[Ueberschrift_Groesse]=2;} ?>
      <select name="Ueberschrift_Groesse" size="1">
                <option<? if ($zeile[Ueberschrift_Groesse] == "1") {echo " selected";} ?>>1</option>
                <option<? if ($zeile[Ueberschrift_Groesse] == "2") {echo " selected";} ?>>2</option>
                <option<? if ($zeile[Ueberschrift_Groesse] == "3") {echo " selected";} ?>>3</option>
                <option<? if ($zeile[Ueberschrift_Groesse] == "4") {echo " selected";} ?>>4</option>
                <option<? if ($zeile[Ueberschrift_Groesse] == "5") {echo " selected";} ?>>5</option>
                <option<? if ($zeile[Ueberschrift_Groesse] == "6") {echo " selected";} ?>>6</option>
      </select>
      </b></td>
  </tr>
  <tr> 
      <td bgcolor="#000099" class="headline" valign="top" width="105"><b><font face="Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">Hindergrund:</font></b></td>
      <td valign="top" width="371">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><b>Farbe: # 
        <input type="text" name="background_color" size="6" maxlength="6" value="<? echo $zeile[background_color] ?>">
        <input type="button" value="Farb Assistent" onClick="Farb_Assistent(this.form.background_color.value,'document.formname.background_color.value');" name="button">
        </b></td>
            <td>              
                                <table width="24" height="10" border="1" cellspacing="0" cellpadding="0">
                <tr>
                  <td bgcolor="<? echo $zeile[background_color] ?>">&nbsp;</td>
                </tr>
                </table>
                        </td>
          </tr>
        </table>
      </td>
      <td valign="top" bgcolor="#FFFFFF" width="519"> 
        <?
        $image_name="background";
        $image_Path="../$site/images/";
        if ($zeile[$image_name] != "")
        {
?>
        <input type="radio" name="_<? echo $image_name ?>" value="<? echo $zeile[$image_name]; ?>" <? if ($zeile[$image_name] != "") {echo "checked";}?>>
      <?
        echo "$zeile[$image_name]";
        $size= filesize ($image_Path.$zeile[$image_name]) >> 10;
        $imgsize = GetImageSize ($image_Path.$zeile[$image_name]);
        echo "&nbsp;( $size KB $imgsize[0]x$imgsize[1])<BR>";
        }
?>
      <input type="radio" name="_<? echo $image_name ?>" value="1" <? if ($zeile[$image_name] == "") {echo "checked";}?>>
      kein Bild<br>
      <input type="radio" name="_<? echo $image_name ?>" value="2">
      <input type="File" name="<? echo $image_name ?>" size="17" maxlength="255" onFocus="this.form._<? echo $image_name ?>[<? if ($zeile[$image_name] != "") {echo "2";} else {echo "1";} ?>].checked=true;">
      <input type="hidden" name="<? echo $image_name ?>_Pfad" value="<? echo $image_Path ?>">
    </td>
  </tr>
  <tr> 
      <td bgcolor="#000099" class="headline" nowrap valign="top" width="105">Inhalte:</td>
      <td colspan="2" align="center">
          <? if ($ID) { ?> 
        <input type="button" value="Inhalte &auml;ndern" onClick="parent.location='inhalt.php?File=<? echo $ID ?>'">
        &nbsp;&nbsp;&nbsp; 
        <input type="button" value="Inhalte einf&uuml;gen" onClick="parent.location='inhalt.php?action=edit&File=<? echo $ID ?>'">
        &nbsp;&nbsp;&nbsp; 
        <input type="button" value="Inhalte l&ouml;schen"onClick="parent.location='inhalt.php?action=delete&File=<? echo $ID ?>'">
                <? } else {?>&nbsp;<? } ?>
      </td>
  </tr>
</table>
<input type="hidden" name="site" value="<? echo $site ?>">
<input type="hidden" name="ID" value="<? echo $ID ?>">
<input type="hidden" name="action" value="update">
<input type="hidden" name="externeDatei" value="0">
<input type="hidden" name="Navigation" value="0">
</form>
<?
 if ($redirect) { ?>
<script language="javascript">
parent.formname.ID.value='<? echo $ID ?>';
parent.formname.submit();
</script>
<? } ?>
</body>
</html>