Merged brach redesign to master

Signed-off-by: Florian Aders (EleRas) <eleras@froxlor.org>
This commit is contained in:
Florian Aders (EleRas)
2011-02-27 13:06:31 +01:00
653 changed files with 12582 additions and 2924 deletions

View File

@@ -36,11 +36,15 @@ function makePathfield($path, $uid, $gid, $fieldType, $value = '')
{
global $lng;
$value = str_replace($path, '', $value);
$field = '';
$field = array();
if($fieldType == 'Manual')
{
$field = '<input type="text" name="path" value="' . htmlspecialchars($value) . '" />';
$field = array(
'type' => 'text',
'value' => htmlspecialchars($value)
);
}
elseif($fieldType == 'Dropdown')
{
@@ -58,7 +62,7 @@ function makePathfield($path, $uid, $gid, $fieldType, $value = '')
{
if(sizeof($dirList) <= 100)
{
$field = '<select name="path">';
$_field = '';
foreach($dirList as $key => $dir)
{
if(strpos($dir, $path) === 0)
@@ -66,23 +70,35 @@ function makePathfield($path, $uid, $gid, $fieldType, $value = '')
$dir = makeCorrectDir(substr($dir, strlen($path)));
}
$field.= makeoption($dir, $dir, $value);
$_field.= makeoption($dir, $dir, $value);
}
$field.= '</select>';
$field = array(
'type' => 'select',
'value' => $_field
);
}
else
{
// remove starting slash we added
// for the Dropdown, #225
$value = substr($value, 1);
$field = $lng['panel']['toomanydirs'];
$field.= '<br /><input type="text" name="path" value="' . htmlspecialchars($value) . '" />';
//$field = $lng['panel']['toomanydirs'];
$field = array(
'type' => 'text',
'value' => htmlspecialchars($value),
'note' => $lng['panel']['toomanydirs']
);
}
}
else
{
$field = $lng['panel']['dirsmissing'];
$field.= '<input type="hidden" name="path" value="/" />';
//$field = $lng['panel']['dirsmissing'];
$field = '<input type="hidden" name="path" value="/" />';
$field = array(
'type' => 'hidden',
'value' => '/',
'note' => $lng['panel']['dirsmissing']
);
}
}

View File

@@ -123,11 +123,11 @@ function getCronjobsLastRun()
if($row['lastrun'] > 0) {
$lastrun = date('d.m.Y H:i:s', $row['lastrun']);
}
$cronjobs_last_run .= '<tr>
<td class="field_name_border_left">'.$lng['crondesc'][$row['desc_lng_key']].':</td>
<td class="field_display">'.$lastrun.'</td>
</tr>';
$text = $lng['crondesc'][$row['desc_lng_key']];
$value = $lastrun;
eval("\$cronjobs_last_run .= \"" . getTemplate("index/overview_item") . "\";");
}
return $cronjobs_last_run;
@@ -153,10 +153,7 @@ function getOutstandingTasks()
$query = "SELECT * FROM `".TABLE_PANEL_TASKS."` ORDER BY `type` ASC";
$result = $db->query($query);
$outstanding_tasks = '<tr>
<td class="field_name_border_left">'.$lng['tasks']['outstanding_tasks'].':</td>
<td class="field_display" colspan="2"><ul>';
$value = '<ul class="cronjobtask">';
$tasks = '';
while($row = $db->fetch_array($result))
{
@@ -272,12 +269,14 @@ function getOutstandingTasks()
}
if(trim($tasks) == '') {
$outstanding_tasks .= '<li>'.$lng['tasks']['noneoutstanding'].'</li>';
$value .= '<li>'.$lng['tasks']['noneoutstanding'].'</li>';
} else {
$outstanding_tasks .= $tasks;
$value .= $tasks;
}
$outstanding_tasks .= '</ul></td></tr>';
$value .= '</ul>';
$text = $lng['tasks']['outstanding_tasks'];
eval("\$outstanding_tasks = \"" . getTemplate("index/overview_item") . "\";");
return $outstanding_tasks;
}

View File

@@ -0,0 +1,45 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id: function.getThemes.php 5 2010-11-08 09:35:26Z d00p $
*/
/**
* returns an array for the settings-array
*
* @return array
*/
function getThemes()
{
$themespath = makeCorrectDir(dirname(dirname(dirname(dirname(__FILE__)))).'/templates/');
$themes_available = array();
if (is_dir($themespath))
{
$its = new DirectoryIterator($themespath);
foreach ($its as $it)
{
if ($it->isDir()
&& $it->getFilename() != '.'
&& $it->getFilename() != '..'
&& $it->getFilename() != '.svn'
&& $it->getFilename() != 'misc'
) {
$themes_available[] = $it->getFilename();
}
}
}
return $themes_available;
}

View File

@@ -332,14 +332,15 @@ function updateCounters($returndebuginfo = false)
$admin_resources[$admin['adminid']]['aps_packages_used'] = 0;
}
$admin['aps_packages_used_new'] = $admin_resources[$admin['adminid']]['aps_packages_used'];
$admin['subdomains_used_new'] = $admin_resources[$admin['adminid']]['subdomains_used'];
if(!isset($admin_resources[$admin['adminid']]['aps_packages_used']))
{
$admin_resources[$admin['adminid']]['aps_packages_used'] = 0;
}
$admin['subdomains_used_new'] = $admin_resources[$admin['adminid']]['subdomains_used'];
$admin['aps_packages_used_new'] = $admin_resources[$admin['adminid']]['aps_packages_used'];
$db->query('UPDATE
`' . TABLE_PANEL_ADMINS . '`
SET

View File

@@ -28,16 +28,21 @@
function getTemplate($template, $noarea = 0)
{
global $templatecache;
global $templatecache, $theme;
if(!isset($theme) || $theme == '')
{
$theme = 'Froxlor';
}
if($noarea != 1)
{
$template = AREA . '/' . $template;
}
if(!isset($templatecache[$template]))
if(!isset($templatecache[$theme][$template]))
{
$filename = './templates/' . $template . '.tpl';
$filename = './templates/' . $theme . '/' . $template . '.tpl';
if(file_exists($filename)
&& is_readable($filename))
@@ -56,8 +61,9 @@ function getTemplate($template, $noarea = 0)
$templatefile = 'TEMPLATE NOT FOUND: ' . $filename;
}
$templatecache[$template] = $templatefile;
$output = $templatefile; // Minify_HTML::minify($templatefile, array('cssMinifier', 'jsMinifier'));
$templatecache[$theme][$template] = $output;
}
return $templatecache[$template];
return $templatecache[$theme][$template];
}

View File

@@ -39,5 +39,5 @@ function makeyesno($name, $yesvalue, $novalue = '', $yesselected = '', $disabled
} else {
$d = '';
}
return '<select class="dropdown_noborder" name="' . $name . '"'.$d.'><option value="' . $yesvalue . '"' . ($yesselected ? ' selected="selected"' : '') . '>' . $lng['panel']['yes'] . '</option><option value="' . $novalue . '"' . ($yesselected ? '' : ' selected="selected"') . '>' . $lng['panel']['no'] . '</option></select>';
return '<select class="dropdown_noborder" id="' . $name . '" name="' . $name . '"'.$d.'><option value="' . $yesvalue . '"' . ($yesselected ? ' selected="selected"' : '') . '>' . $lng['panel']['yes'] . '</option><option value="' . $novalue . '"' . ($yesselected ? '' : ' selected="selected"') . '>' . $lng['panel']['no'] . '</option></select>';
}