display phperror below fixed header in sparkle theme; fix wrong parameter-list and ignorance of in makePathfield

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-12-16 11:32:25 +01:00
parent 37a242a679
commit 6ed02e593c
2 changed files with 16 additions and 27 deletions

View File

@@ -23,7 +23,6 @@
* @param string path The path to start searching in * @param string path The path to start searching in
* @param integer uid The uid which must match the found directories * @param integer uid The uid which must match the found directories
* @param integer gid The gid which must match the found direcotries * @param integer gid The gid which must match the found direcotries
* @param string fieldType Either "Manual" or "Dropdown"
* @param string value the value for the input-field * @param string value the value for the input-field
* *
* @return string The html tag for the choosen $fieldType * @return string The html tag for the choosen $fieldType
@@ -31,9 +30,8 @@
* @author Martin Burchert <martin.burchert@syscp.de> * @author Martin Burchert <martin.burchert@syscp.de>
* @author Manuel Bernhardt <manuel.bernhardt@syscp.de> * @author Manuel Bernhardt <manuel.bernhardt@syscp.de>
*/ */
function makePathfield($path, $uid, $gid, $value = '', $dom = false) {
function makePathfield($path, $uid, $gid, $fieldType, $value = '', $dom = false)
{
global $lng; global $lng;
$value = str_replace($path, '', $value); $value = str_replace($path, '', $value);
@@ -47,41 +45,34 @@ function makePathfield($path, $uid, $gid, $fieldType, $value = '', $dom = false)
$value = '/'.$value; $value = '/'.$value;
} }
if($fieldType == 'Manual') $fieldType = Settings::Get('panel.pathedit');
{
if ($fieldType == 'Manual') {
$field = array( $field = array(
'type' => 'text', 'type' => 'text',
'value' => htmlspecialchars($value) 'value' => htmlspecialchars($value)
); );
} } elseif($fieldType == 'Dropdown') {
elseif($fieldType == 'Dropdown')
{
$dirList = findDirs($path, $uid, $gid);
$dirList = findDirs($path, $uid, $gid);
natcasesort($dirList); natcasesort($dirList);
if(sizeof($dirList) > 0) if (sizeof($dirList) > 0) {
{ if (sizeof($dirList) <= 100) {
if(sizeof($dirList) <= 100)
{
$_field = ''; $_field = '';
foreach($dirList as $key => $dir) foreach ($dirList as $key => $dir) {
{ if (strpos($dir, $path) === 0) {
if(strpos($dir, $path) === 0)
{
$dir = makeCorrectDir(substr($dir, strlen($path))); $dir = makeCorrectDir(substr($dir, strlen($path)));
} }
$_field.= makeoption($dir, $dir, $value); $_field.= makeoption($dir, $dir, $value);
} }
$field = array( $field = array(
'type' => 'select', 'type' => 'select',
'value' => $_field 'value' => $_field
); );
} } else {
else
{
// remove starting slash we added // remove starting slash we added
// for the Dropdown, #225 // for the Dropdown, #225
$value = substr($value, 1); $value = substr($value, 1);
@@ -92,9 +83,7 @@ function makePathfield($path, $uid, $gid, $fieldType, $value = '', $dom = false)
'note' => $lng['panel']['toomanydirs'] 'note' => $lng['panel']['toomanydirs']
); );
} }
} } else {
else
{
//$field = $lng['panel']['dirsmissing']; //$field = $lng['panel']['dirsmissing'];
//$field = '<input type="hidden" name="path" value="/" />'; //$field = '<input type="hidden" name="path" value="/" />';
$field = array( $field = array(

View File

@@ -1,4 +1,4 @@
<div class="messagewrapperfull"> <div class="messagewrapperfull" style="margin-top:50px;margin-bottom:-55px">
<div class="warningcontainer bradius"> <div class="warningcontainer bradius">
<div class="warningtitle">PHP warning/error</div> <div class="warningtitle">PHP warning/error</div>
<div class="warning"> <div class="warning">