Location: PHPKode > projects > Netautor Professional > netautor/napro4/appl/mediapool/mp_head.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  	<hide@address.com>					  |
   +----------------------------------------------------------------------+*/

   /**
    * Kopf mit OrdnerAuswahl und setlist etc. für den Medienpool
	*
	* @version 	$Revision: 1.5 $
	* @author	Helli Kleinhans
	*/

  	require_once('../../include/init.inc');

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

	$LOCALE->textdomain('mediapool');

	includeNaPro('file');

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

	$newDir				= strval($_POST['newDir']);
	$deleteDir			= strval($_POST['deleteDir']);

	if(!empty($newDir))
	{
		$status = mkdir($location_path.'/'.$location_folder.'/'.$newDir,0775);
	}

	if(!empty($deleteDir))
	{
		$status = rmdir($location_path.'/'.$location_folder);
	}


?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title>/digiconcept/netautor/mediapool.main</title>
	<link href="../../include/netautor.css" rel="stylesheet" type="text/css" src="../include/netautor.css">
</head>
<style type="text/css">
<!--

body {
	background-color:#d4d4d4;
	background-image:url("../../grafik/imgpool_head_bg.jpg");
	background-repeat:y-repeat;
	margin:0px;
}
-->
</style>
<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>
<tr>
	<td colspan="2"><img src="../../grafik/pixel.gif" height="4" width="500"></td>
</tr>
</table>
<table width="100%">
<tr>
	<td>
		<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('title') ); ?>&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;
						}

						if(!empty($display_paths)):?>
						<select class="select" onChange="this.form.submit();" name="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>
					<?php
					if (!empty($location_path))
					{
						$location_path = str_replace('\\','/',$location_path);
						if (substr($location_path,-1) != '/') $location_path.='/';

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

						if (!empty($dirs2))
						{
						?>
						<select class="select" onChange="this.form.submit();" name="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>');
							}
						?>
						</select>
						<?php
						}
					}
					?>
				</td>
				<td>
					<script>
						function newDir()
						{
							dirname = prompt('Bitte geben Sie den Ordnernamen an.');
							if(dirname && dirname.length > 0)
							{
								document.forms[0].elements['newDir'].value=dirname;
								document.forms[0].submit();
							}
						}

						function deleteDir()
						{
							if(confirm("Wollen Sie den Ordner wirklich löschen?"))
							{
								document.forms[0].elements['deleteDir'].value = 'yes';
								document.forms[0].submit();
							}
						}
					</script>
					&nbsp;
					<a href="javascript:newDir()" title="Neuen Ordner anlegen"><img src="../../grafik/mediapool/new_folder.gif" border="0" alt="Neues Verzeichnis erzeugen"></a>
					&nbsp;
					<a href="javascript:deleteDir()" title="Ordner löschen"><img src="../../grafik/mediapool/del_folder.gif" border="0" alt="Verzeichnis löschen"></a>
				</td>
			</tr>
		</table>
		<input type="hidden" name="newDir" 	value="">
		<input type="hidden" name="deleteDir" 	value="">
	</td>
	<td align="right">
		<table border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td align="left" valign="center" class="text">
					<input type="text" class="input123" name="files_mask" value="<?php echo $files_mask; ?>" ><br>
				</td>
				<td align="left" valign="center" class="text">
					&nbsp;<input
							type="button"
							value="<?php echo( $LOCALE->gettext('button_search') ); ?>"
							class="go" onClick="document.getElementById('mp_form').submit();"><br>
				</td>
				<td align="left" valign="center" class="text">
					<img src="../../grafik/pixel.gif" width="21" height="1"><br>
				</td>
			</tr>
		</table>
	</td>
</tr>
</table>
<?php
	$files_base	= $location_path.$location_folder.'/';

	$params			=	array	(	'match_file'	=> $files_mask,
									'only_files'	=> 1
								);
	$files			= File_readDirectory($files_base, 1 , $params  );
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr height="22">
		<td align="center" valign="center" style="background-color:#BDBDBD;">
			<input type="hidden"	id="files_set_pos" name="files_set_pos" value="<?php echo intval($files_set_pos);?>">
			<script language="JavaScript" type="text/javascript">
			<!--
				function mp_setPos(pos)
				{
					document.getElementById('files_set_pos').value = pos;
					document.getElementById('mp_form').submit();
				}
			//-->
			</script>
			<span class="setlist">
			<?php echo( $LOCALE->gettext('set') ); ?>: <?php

			$files_count	=	count($files);
			$files_set_size =	20;

			?><!-- <a href="#" class="setprevnext">&nbsp;&laquo;&nbsp;</a>--><?php
			for ($index = 0; $index < ( ceil($files_count/$files_set_size) ); $index++ )
			{
				$class	= (	$index == $files_set_pos ?'setact' : 'setlist');
				echo "<a href='#' class='$class' onClick='mp_setPos({$index});' >&nbsp;".(1+ $index)."&nbsp;</a>";
			}
			?><!-- <a href="#" class="setprevnext">&nbsp;&raquo;&nbsp;</a>--> <br>
			</span>
		</td>
	</tr>
</table>
<table width="100%" 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="313" 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="313" height="1"><br>

		</td>
		<td width="84" align="right" valign="center" class="imgpooltd11">
			<span class="text">
			<?php echo( $LOCALE->gettext('file_size') ); ?><img src="../../grafik/pixel.gif" width="12" height="1"><br>
			</span>
			<img src="../../grafik/pixel.gif" width="84" height="1"><br>
		</td>
		<td width="52" align="center" valign="center" class="imgpooltd12">
			<span class="text">
			<?php echo( $LOCALE->gettext('file_type') ); ?><br>
			</span>
			<img src="../../grafik/pixel.gif" width="52" height="1"><br>
		</td>
		<td width="90%" align="left" valign="center" class="imgpooltd11">
			<span class="text">
			<img src="../../grafik/pixel.gif" width="12" height="1"><?php echo( $LOCALE->gettext('file_created') ); ?><br>
			</span>
		</td>
	</tr>
</table>
</form>
<script>
<?
	$url = 'mp_list.php?location_name='.rawurlencode($location_name);
	$url.= '&location_path='.rawurlencode($location_path);
	$url.= '&location_folder='.rawurlencode($location_folder);
	$url.= '&files_mask='.rawurlencode($files_mask);
    $url.= '&files_set_pos='.$files_set_pos;
	$url.= '&files_set_size='.$files_set_size;

	echo("parent.document.getElementById('mp_main').src='{$url};'");
?>
</script>
</body>
</html>
Return current item: Netautor Professional