Location: PHPKode > projects > Netautor Professional > netautor/napro4/appl/mediapool/mp_head_upload.php
<?php
/* +----------------------------------------------------------------------+
   | Netautor Professional Application Server                             |
   +----------------------------------------------------------------------+
   | Copyright (C) 1998-2005 digiconcept GmbH. <www.digiconcept.net>      |
   +----------------------------------------------------------------------+
   | This file is subject to license, that is bundled with this package   |
   | in the file LICENSE.TXT, and is available at through the             |
   | world-wide-web at http://www.netautor.com/license/                   |
   |                                                                      |
   | If you did not receive a copy of the license and are unable to       |
   | obtain it through the world-wide-web, please send a note to          |
   | hide@address.com so we can mail you a copy.                      |
   +----------------------------------------------------------------------+
   | Authors: Stefan Rottensteiner <hide@address.com>    |
   |          Marek  Kadziela      <hide@address.com>	      |
   |          Gregor Wollner                                              |
   |          Christian Unger                                             |
   |          Helli  Kleinhans  									      |
   +----------------------------------------------------------------------+*/

   /**
    * @version	$Revision: 1.5 $
	*/
   	require_once('../../include/init.inc');

	if(!$USER->check_feature('Admin') && !$USER->check_feature('ac_mediapool'))
	{
		$USER->login_call();
	}

	$LOCALE->textdomain('mediapool');

	$location_path		= strval($_POST['location_path']);
	$location_folder	= strval($_POST['location_folder']);
	$files_mask			= strval($_POST['files_mask']);
	$file_name			= strval($_POST['file_name']);

	//	include necessary functions
	includeNaPro('filetype,file');

?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>/digiconcept/netautor/mediapool/upload.index</title>
		<link href="../../include/netautor.css" rel="stylesheet" type="text/css" src="../include/netautor.css">
	<style type="text/css">
	<!--
	body{
		background-color:#d4d4d4;
		background-image:url("../../grafik/imgpool_head_bg.jpg");
		background-repeat:y-repeat;
		margin:0px;
	}
	-->
	</style>
	</head>
<body>
<form method="post" id="mp_form" name="mp_form" >
<table width="100%" height="33" border="0" cellspacing="0" cellpadding="0">
<tr>
	<td><img src="../../grafik/imgpool_head_left.jpg" 	align="left"></td>
	<td><img src="../../grafik/imgpool_head_right.jpg" align="right"></td>
</tr>
</table>
<form	method="post" >
<img src="../../grafik/imgpool_head_upload.gif" width="700" height="60"><br>
<table width="700" height="33" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td width="500" height="32" align="left" valign="center" style="background-color:#D4D4D4;">
			<table border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td align="left" valign="center" class="text">
						<img src="../../grafik/pixel.gif" width="14" height="1"><br>
					</td>
					<td align="left" valign="center" class="text">
						<?php echo( $LOCALE->gettext('file_save_to') ); ?>&nbsp;&nbsp;<br>
					</td>
					<td align="left" valign="center" class="text">
						<?php
							$temp	=	$GLOBALS['USER']->get_feature_value('display_path');
							foreach ($temp as $index => $data)
							{
								if (strpos($data,'='))
								{
									list($name,$path) = explode('=',$data);
								}
								else
								{
									$name = $path = $data;
								}
								$display_paths[ $name ] = $path;
							}
						?>
						<?php if(!empty($display_paths)):?>
							<select class="select" onChange="this.form.submit();" name="location_path" id="location_path" >
								<?php
									foreach ($display_paths as $name => $path )
									{
										if (empty($location_path)) $location_path = $path;
										if ($path == $location_path)
										{
											$selected		= 'selected';
											$location_name	= $name;
										}
										else
										{
											$selected 	= '';
										}

										echo "<option $selected value='{$path}'>{$name}</option>";
									}
								?>
							</select>
						<?php endif; ?>					</td>
					<td align="left" valign="center" class="text">
						<?php
						if (!empty($location_path))
						{
							$location_path = str_replace('\\','/',$location_path);
							if (substr($location_path,-1) != '/') $location_path.='/';
							$dirs = File_getDirs($location_path);

							$dirs2 = get_tree($location_path);
							array_pop($dirs2);
							krsort($dirs2);

							if (!empty($dirs))
							{
							?>
							<select class="select" name="location_folder" id="location_folder" >
								<option></option>
							<?php

								$basepos = strlen($location_path);
								foreach($dirs2 as $idx=>$werte)
								{
									$value = substr($werte['url'],$basepos);
									$text  = substr($value,0,-1);
									$selected	= ($location_folder == $value ? 'selected' : '' );

									echo('<option value="'.$value.'" '.$selected.'>'.$text.'</option>');
								}

						/*		foreach ($dirs as $index => $text )
								{
									$value 		= $text;
									$selected	= ($location_folder == $value ? 'selected' : '' );
								?><option <?php echo $selected; ?> value="<?php echo $value; ?>"><?php echo $text; ?></option>
								<?php
								}*/
							?>
							</select>
							<?php
							}
						}

						if(empty($dirs) || empty($location_path))
						{
							echo('<input type="hidden" name="location_folder" id="location_folder" value="">');
						}	?>
					</td>
				</tr>
			</table>
		</td>
		<td width="200" height="32" align="right" valign="center" style="background-color:#D4D4D4;">
			<table border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td align="left" valign="center" class="text">
						<br>
					</td>
					<td align="left" valign="center" class="text">
						<img src="../../grafik/pixel.gif" width="21" height="1"><br>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td colspan="2" width="700" height="1" style="background-color:#A7A7A7;">
			<img src="../../grafik/pixel.gif" width="700" height="1"><br>
		</td>
	</tr>
</table>
<table width="700" border="0" cellspacing="0" cellpadding="0">
	<tr height="22">
		<td width="24" align="left" valign="center" class="imgpooltd12">
			<img src="../../grafik/pixel.gif" width="24" height="1"><br>
		</td>
		<td width="78" align="center" valign="center" class="imgpooltd11">
			<img src="../../grafik/pixel.gif" width="78" height="1"><br>
		</td>
		<td width="522" align="left" valign="center" class="imgpooltd12">
			<span class="text">
			<img src="../../grafik/pixel.gif" width="12" height="1"><?php echo( $LOCALE->gettext('file_name') ); ?><br>
			</span>
			<img src="../../grafik/pixel.gif" width="522" height="1"><br>
		</td>
		<td width="76" align="center" valign="center" class="imgpooltd11">
			<img src="../../grafik/pixel.gif" width="76" height="1"><br>
		</td>
	</tr>
</table>
</form>
</body>
</html>
Return current item: Netautor Professional