* @license http://www.contenido.org/license/LIZENZ.txt
* @link http://www.4fb.de
* @link http://www.contenido.org
* @since file available since contenido release <= 4.6
*
* {@internal
* created 2003-04-01
* modified 2008-06-27, Frederic Schneider, add security fix
*
* $Id$:
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
cInclude("includes", "functions.con.php");
cInclude("includes", "functions.str.php");
cInclude("includes", "functions.upl.php");
$tpl->set('s', 'FORMACTION', '');
$sDisplayPath = '';
if (isset($_REQUEST['path'])) {
$sDisplayPath = $_REQUEST['path'];
} else {
$sDisplayPath = $sCurrentPathInfo;
}
$sDisplayPath = generateDisplayFilePath($sDisplayPath, 35);
$tpl->set('s', 'CAPTION2', $sDisplayPath);
#display notification, if there is no client
if ((int) $client == 0) {
$sNoClientNotification = '
'.i18n('No Client selected').'
';
$tpl->set('s', 'NOTIFICATION', $sNoClientNotification);
} else {
$tpl->set('s', 'NOTIFICATION', '');
}
#####################
# Form for 'Search'
#####################
if ($appendparameters != 'filebrowser' && (int) $client > 0) {
$search = new cHTMLTextbox("searchfor", $_REQUEST['searchfor'], 26);
$search->setStyle("width:170px;");
$sSearch = $search->render();
$form = new UI_Form("search");
$form->add("search", '');
$form->setVar("area", $area);
$form->setVar("frame", $frame);
$form->setVar("contenido", $sess->id);
$form->setVar("appendparameters", $appendparameters);
$tpl->set('s', 'SEARCHFORM', $form->render());
$tpl->set('s', 'SEARCHTITLE', i18n("Search for"));
$tpl->set('s', 'DISPLAY_SEARCH', 'block');
} else {
$tpl->set('s', 'SEARCHFORM', '');
$tpl->set('s', 'SEARCHTITLE', '');
$tpl->set('s', 'DISPLAY_SEARCH', 'none');
}
if ($perm->have_perm_area_action("upl", "upl_mkdir") && (int) $client > 0)
{
$sCurrentPathInfo = "";
if ($sess->is_registered("upl_last_path") && !isset($path))
{
$path = $upl_last_path;
}
if ($path == "" || is_dbfs($path))
{
$sCurrentPathInfo = $path;
}
else
{
$sCurrentPathInfo = str_replace($cfgClient[$client]['upl']['path'], "", $path);
}
###########################
# Form for 'New Directory'
###########################
$inputfield = '
';
$tpl->set('s', 'ACTION', $inputfield);
$sessURL = $sess->url("main.php?area=upl_mkdir&frame=2&appendparameters=$appendparameters");
$tpl->set('s', 'TARGET', 'onsubmit="parent.frames[2].location.href=\''.$sess->url("main.php?area=upl&action=upl_mkdir&frame=2&appendparameters=$appendparameters").
'&path=\'+document.newdir.path.value+\'&foldername=\'+document.newdir.foldername.value;"');
$tpl->set('s', 'SUBMIT', '');
$tpl->set('s', 'CAPTION', i18n("Create directory in"));
$tpl->set('s', 'DEBUG', '');
$tpl->set('s', 'DISPLAY_DIR', 'block');
}
// No permission with current rights
else
{
$tpl->set('s', 'CAPTION', '');
$tpl->set('s', 'CAPTION2', '');
$inputfield = '';
$tpl->set('s', 'TARGET', '');
$tpl->set('s', 'SUBMIT', '');
$tpl->set('s', 'ACTION', '');
$tpl->set('s', 'DISPLAY_DIR', 'none');
}
#############
# Searching
#############
if ($searchfor != "")
{
$items = uplSearch($searchfor);
$tmp_mstr = 'conMultiLink(\'%s\', \'%s\', \'%s\', \'%s\')';
$mstr = sprintf($tmp_mstr,
'right_bottom',
$sess->url("main.php?area=upl_search_results&frame=4&searchfor=$searchfor&appendparameters=$appendparameters"),
'right_top',
$sess->url("main.php?area=$area&frame=3&appendparameters=$appendparameters"));
$refreshMenu = "\n".'if (top.content.left.left_bottom) top.content.left.left_bottom.refreshMenu()';
$tpl->set('s', 'RESULT', $mstr.$refreshMenu);
}
else
{
$tpl->set('s', 'RESULT', '');
}
# create javascript multilink
$tmp_mstr = '%s';
$mstr = sprintf($tmp_mstr, 'right_top', $sess->url("main.php?area=$area&frame=3&path=$pathstring&appendparameters=$appendparameters"), 'right_bottom', $sess->url("main.php?area=$area&frame=4&path=$pathstring&appendparameters=$appendparameters"), ''.$file);
$tpl->set('d', 'PATH', $pathstring);
$tpl->set('d', 'BGCOLOR', $bgcolor);
$tpl->set('d', 'INDENT', 3);
$tpl->set('d', 'DIRNAME', $mstr);
$tpl->set('d', 'EDITBUTTON', '');
$tpl->set('d', 'DELETEBUTTON', '');
$tpl->set('d', 'COLLAPSE', '');
$tpl->next();
$tpl->generate($cfg['path']['templates'] . $cfg['templates']['upl_left_top']);
?>