svn:eol-style got murdered on some files for whatever reason so it gets resurrected now, also set some svn:keywords

This commit is contained in:
Robert Foerster (Dessa)
2010-01-27 08:54:31 +00:00
parent 30f2de8f9e
commit 883963d2e2
190 changed files with 34136 additions and 34136 deletions

View File

@@ -1,99 +1,99 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Prints Question on screen
*
* @param string The question
* @param string File which will be called with POST if user clicks yes
* @param array Values which will be given to $yesfile. Format: array(variable1=>value1, variable2=>value2, variable3=>value3)
* @param string Name of the target eg Domain or eMail address etc.
* @author Florian Lippert <flo@syscp.org>
*/
function ask_yesno($text, $yesfile, $params = array(), $targetname = '')
{
global $userinfo, $db, $s, $header, $footer, $lng;
/*
// For compatibility reasons (if $params contains a string like "field1=value1;field2=value2") this will convert it into a usable array
if(!is_array($params))
{
$params_tmp=explode(';',$params);
unset($params);
$params=array();
while(list(,$param_tmp)=each($params_tmp))
{
$param_tmp=explode('=',$param_tmp);
$params[$param_tmp[0]]=$param_tmp[1];
}
}
*/
$hiddenparams = '';
if(is_array($params))
{
foreach($params as $field => $value)
{
$hiddenparams.= '<input type="hidden" name="' . htmlspecialchars($field) . '" value="' . htmlspecialchars($value) . '" />' . "\n";
}
}
if(isset($lng['question'][$text]))
{
$text = $lng['question'][$text];
}
$text = strtr($text, array('%s' => $targetname));
eval("echo \"" . getTemplate('misc/question_yesno', '1') . "\";");
exit;
}
function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $targetname = '')
{
global $userinfo, $db, $s, $header, $footer, $lng;
$hiddenparams = '';
if(is_array($params))
{
foreach($params as $field => $value)
{
$hiddenparams.= '<input type="hidden" name="' . htmlspecialchars($field) . '" value="' . htmlspecialchars($value) . '" />' . "\n";
}
}
if(isset($lng['question'][$text]))
{
$text = $lng['question'][$text];
}
if(isset($lng['question'][$chk_text]))
{
$chk_text = $lng['question'][$chk_text];
}
$checkbox = makecheckbox('delete_userfiles', $chk_text, '1', false, '0', true, true);
$text = strtr($text, array('%s' => $targetname));
eval("echo \"" . getTemplate('misc/question_yesno_checkbox', '1') . "\";");
exit;
}
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Prints Question on screen
*
* @param string The question
* @param string File which will be called with POST if user clicks yes
* @param array Values which will be given to $yesfile. Format: array(variable1=>value1, variable2=>value2, variable3=>value3)
* @param string Name of the target eg Domain or eMail address etc.
* @author Florian Lippert <flo@syscp.org>
*/
function ask_yesno($text, $yesfile, $params = array(), $targetname = '')
{
global $userinfo, $db, $s, $header, $footer, $lng;
/*
// For compatibility reasons (if $params contains a string like "field1=value1;field2=value2") this will convert it into a usable array
if(!is_array($params))
{
$params_tmp=explode(';',$params);
unset($params);
$params=array();
while(list(,$param_tmp)=each($params_tmp))
{
$param_tmp=explode('=',$param_tmp);
$params[$param_tmp[0]]=$param_tmp[1];
}
}
*/
$hiddenparams = '';
if(is_array($params))
{
foreach($params as $field => $value)
{
$hiddenparams.= '<input type="hidden" name="' . htmlspecialchars($field) . '" value="' . htmlspecialchars($value) . '" />' . "\n";
}
}
if(isset($lng['question'][$text]))
{
$text = $lng['question'][$text];
}
$text = strtr($text, array('%s' => $targetname));
eval("echo \"" . getTemplate('misc/question_yesno', '1') . "\";");
exit;
}
function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $targetname = '')
{
global $userinfo, $db, $s, $header, $footer, $lng;
$hiddenparams = '';
if(is_array($params))
{
foreach($params as $field => $value)
{
$hiddenparams.= '<input type="hidden" name="' . htmlspecialchars($field) . '" value="' . htmlspecialchars($value) . '" />' . "\n";
}
}
if(isset($lng['question'][$text]))
{
$text = $lng['question'][$text];
}
if(isset($lng['question'][$chk_text]))
{
$chk_text = $lng['question'][$chk_text];
}
$checkbox = makecheckbox('delete_userfiles', $chk_text, '1', false, '0', true, true);
$text = strtr($text, array('%s' => $targetname));
eval("echo \"" . getTemplate('misc/question_yesno_checkbox', '1') . "\";");
exit;
}

View File

@@ -1,122 +1,122 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Build Navigation Sidebar
* @param array navigation data
* @param array userinfo the userinfo of the user
* @return string the content of the navigation bar
*
* @author Florian Lippert <flo@syscp.org>
*/
function buildNavigation($navigation, $userinfo)
{
$returnvalue = '';
foreach($navigation as $box)
{
if((!isset($box['show_element']) || $box['show_element'] === true) &&
(!isset($box['required_resources']) || $box['required_resources'] == '' || (isset($userinfo[$box['required_resources']]) && ((int)$userinfo[$box['required_resources']] > 0 || $userinfo[$box['required_resources']] == '-1'))))
{
$navigation_links = '';
foreach($box['elements'] as $element_id => $element)
{
if((!isset($element['show_element']) || $element['show_element'] === true) &&
(!isset($element['required_resources']) || $element['required_resources'] == '' || (isset($userinfo[$element['required_resources']]) && ((int)$userinfo[$element['required_resources']] > 0 || $userinfo[$element['required_resources']] == '-1'))))
{
if(isset($element['url']) && trim($element['url']) != '')
{
// append sid only to local
if(!preg_match('/^https?\:\/\//', $element['url'])
&& (isset($userinfo['hash']) && $userinfo['hash'] != ''))
{
// generate sid with ? oder &
if(strpos($element['url'], '?') !== false)
{
$element['url'].= '&s=' . $userinfo['hash'];
}
else
{
$element['url'].= '?s=' . $userinfo['hash'];
}
}
$target = '';
if(isset($element['new_window']) && $element['new_window'] == true)
{
$target = ' target="_blank"';
}
$completeLink = '<a href="' . htmlspecialchars($element['url']) . '"' . $target . ' class="menu">' . $element['label'] . '</a>';
}
else
{
$completeLink = $element['label'];
}
eval("\$navigation_links .= \"" . getTemplate("navigation_link", 1) . "\";");
}
}
if($navigation_links != '')
{
if(isset($box['url']) && trim($box['url']) != '')
{
// append sid only to local
if(!preg_match('/^https?\:\/\//', $box['url'])
&& (isset($userinfo['hash']) && $userinfo['hash'] != ''))
{
// generate sid with ? oder &
if(strpos($box['url'], '?') !== false)
{
$box['url'].= '&s=' . $userinfo['hash'];
}
else
{
$box['url'].= '?s=' . $userinfo['hash'];
}
}
$target = '';
if(isset($box['new_window']) && $box['new_window'] == true)
{
$target = ' target="_blank"';
}
$completeLink = '<a href="' . htmlspecialchars($box['url']) . '"' . $target . ' class="menu">' . $box['label'] . '</a>';
}
else
{
$completeLink = $box['label'];
}
eval("\$returnvalue .= \"" . getTemplate("navigation_element", 1) . "\";");
}
}
}
return $returnvalue;
}
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Build Navigation Sidebar
* @param array navigation data
* @param array userinfo the userinfo of the user
* @return string the content of the navigation bar
*
* @author Florian Lippert <flo@syscp.org>
*/
function buildNavigation($navigation, $userinfo)
{
$returnvalue = '';
foreach($navigation as $box)
{
if((!isset($box['show_element']) || $box['show_element'] === true) &&
(!isset($box['required_resources']) || $box['required_resources'] == '' || (isset($userinfo[$box['required_resources']]) && ((int)$userinfo[$box['required_resources']] > 0 || $userinfo[$box['required_resources']] == '-1'))))
{
$navigation_links = '';
foreach($box['elements'] as $element_id => $element)
{
if((!isset($element['show_element']) || $element['show_element'] === true) &&
(!isset($element['required_resources']) || $element['required_resources'] == '' || (isset($userinfo[$element['required_resources']]) && ((int)$userinfo[$element['required_resources']] > 0 || $userinfo[$element['required_resources']] == '-1'))))
{
if(isset($element['url']) && trim($element['url']) != '')
{
// append sid only to local
if(!preg_match('/^https?\:\/\//', $element['url'])
&& (isset($userinfo['hash']) && $userinfo['hash'] != ''))
{
// generate sid with ? oder &
if(strpos($element['url'], '?') !== false)
{
$element['url'].= '&s=' . $userinfo['hash'];
}
else
{
$element['url'].= '?s=' . $userinfo['hash'];
}
}
$target = '';
if(isset($element['new_window']) && $element['new_window'] == true)
{
$target = ' target="_blank"';
}
$completeLink = '<a href="' . htmlspecialchars($element['url']) . '"' . $target . ' class="menu">' . $element['label'] . '</a>';
}
else
{
$completeLink = $element['label'];
}
eval("\$navigation_links .= \"" . getTemplate("navigation_link", 1) . "\";");
}
}
if($navigation_links != '')
{
if(isset($box['url']) && trim($box['url']) != '')
{
// append sid only to local
if(!preg_match('/^https?\:\/\//', $box['url'])
&& (isset($userinfo['hash']) && $userinfo['hash'] != ''))
{
// generate sid with ? oder &
if(strpos($box['url'], '?') !== false)
{
$box['url'].= '&s=' . $userinfo['hash'];
}
else
{
$box['url'].= '?s=' . $userinfo['hash'];
}
}
$target = '';
if(isset($box['new_window']) && $box['new_window'] == true)
{
$target = ' target="_blank"';
}
$completeLink = '<a href="' . htmlspecialchars($box['url']) . '"' . $target . ' class="menu">' . $box['label'] . '</a>';
}
else
{
$completeLink = $box['label'];
}
eval("\$returnvalue .= \"" . getTemplate("navigation_element", 1) . "\";");
}
}
}
return $returnvalue;
}

View File

@@ -1,54 +1,54 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Returns full style user details "Name, Firstname | Company"
*
* @param array An array with keys firstname, name and company
* @return string The full details
*
* @author Florian Lippert <flo@syscp.org>
*/
function getCorrectFullUserDetails($userinfo)
{
$returnval = '';
if(isset($userinfo['firstname']) && isset($userinfo['name']) && isset($userinfo['company']))
{
if($userinfo['company'] == '')
{
$returnval = $userinfo['name'] . ', ' . $userinfo['firstname'];
}
else
{
if($userinfo['name'] != ''
&& $userinfo['firstname'] != '')
{
$returnval = $userinfo['name'] . ', ' . $userinfo['firstname'] . ' | ' . $userinfo['company'];
}
else
{
$returnval = $userinfo['company'];
}
}
}
return $returnval;
}
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Returns full style user details "Name, Firstname | Company"
*
* @param array An array with keys firstname, name and company
* @return string The full details
*
* @author Florian Lippert <flo@syscp.org>
*/
function getCorrectFullUserDetails($userinfo)
{
$returnval = '';
if(isset($userinfo['firstname']) && isset($userinfo['name']) && isset($userinfo['company']))
{
if($userinfo['company'] == '')
{
$returnval = $userinfo['name'] . ', ' . $userinfo['firstname'];
}
else
{
if($userinfo['name'] != ''
&& $userinfo['firstname'] != '')
{
$returnval = $userinfo['name'] . ', ' . $userinfo['firstname'] . ' | ' . $userinfo['company'];
}
else
{
$returnval = $userinfo['company'];
}
}
}
return $returnval;
}

View File

@@ -1,48 +1,48 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Returns correct user salutation, either "Firstname Name" or "Company"
*
* @param array An array with keys firstname, name and company
* @return string The correct salutation
*
* @author Florian Lippert <flo@syscp.org>
*/
function getCorrectUserSalutation($userinfo)
{
$returnval = '';
if(isset($userinfo['firstname']) && isset($userinfo['name']) && isset($userinfo['company']))
{
// Always prefer firstname name
if($userinfo['company'] != '' && $userinfo['name'] == '' && $userinfo['firstname'] == '')
{
$returnval = $userinfo['company'];
}
else
{
$returnval = $userinfo['firstname'] . ' ' . $userinfo['name'];
}
}
return $returnval;
}
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Returns correct user salutation, either "Firstname Name" or "Company"
*
* @param array An array with keys firstname, name and company
* @return string The correct salutation
*
* @author Florian Lippert <flo@syscp.org>
*/
function getCorrectUserSalutation($userinfo)
{
$returnval = '';
if(isset($userinfo['firstname']) && isset($userinfo['name']) && isset($userinfo['company']))
{
// Always prefer firstname name
if($userinfo['company'] != '' && $userinfo['name'] == '' && $userinfo['firstname'] == '')
{
$returnval = $userinfo['company'];
}
else
{
$returnval = $userinfo['firstname'] . ' ' . $userinfo['name'];
}
}
return $returnval;
}

View File

@@ -1,63 +1,63 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Get template from filesystem
*
* @param string Templatename
* @param string noarea If area should be used to get template
* @return string The Template
* @author Florian Lippert <flo@syscp.org>
*/
function getTemplate($template, $noarea = 0)
{
global $templatecache;
if($noarea != 1)
{
$template = AREA . '/' . $template;
}
if(!isset($templatecache[$template]))
{
$filename = './templates/' . $template . '.tpl';
if(file_exists($filename)
&& is_readable($filename))
{
$templatefile = addcslashes(file_get_contents($filename), '"\\');
// loop through template more than once in case we have an "if"-statement in another one
while(preg_match('/<if[ \t]*(.*)>(.*)(<\/if>|<else>(.*)<\/if>)/Uis', $templatefile))
{
$templatefile = preg_replace('/<if[ \t]*(.*)>(.*)(<\/if>|<else>(.*)<\/if>)/Uis', '".( ($1) ? ("$2") : ("$4") )."', $templatefile);
}
}
else
{
$templatefile = 'TEMPLATE NOT FOUND: ' . $filename;
}
$templatecache[$template] = $templatefile;
}
return $templatecache[$template];
}
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Get template from filesystem
*
* @param string Templatename
* @param string noarea If area should be used to get template
* @return string The Template
* @author Florian Lippert <flo@syscp.org>
*/
function getTemplate($template, $noarea = 0)
{
global $templatecache;
if($noarea != 1)
{
$template = AREA . '/' . $template;
}
if(!isset($templatecache[$template]))
{
$filename = './templates/' . $template . '.tpl';
if(file_exists($filename)
&& is_readable($filename))
{
$templatefile = addcslashes(file_get_contents($filename), '"\\');
// loop through template more than once in case we have an "if"-statement in another one
while(preg_match('/<if[ \t]*(.*)>(.*)(<\/if>|<else>(.*)<\/if>)/Uis', $templatefile))
{
$templatefile = preg_replace('/<if[ \t]*(.*)>(.*)(<\/if>|<else>(.*)<\/if>)/Uis', '".( ($1) ? ("$2") : ("$4") )."', $templatefile);
}
}
else
{
$templatefile = 'TEMPLATE NOT FOUND: ' . $filename;
}
$templatecache[$template] = $templatefile;
}
return $templatecache[$template];
}

View File

@@ -1,64 +1,64 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Return HTML Code for a checkbox
*
* @param string The fieldname
* @param string The captions
* @param string The Value which will be returned
* @param bool Add a <br /> at the end of the checkbox
* @param string Values which will be selected by default
* @param bool Whether the title may contain html or not
* @param bool Whether the value may contain html or not
* @return string HTML Code
* @author Michael Kaufmann <mkaufmann@nutime.de>
*/
function makecheckbox($name, $title, $value, $break = false, $selvalue = NULL, $title_trusted = false, $value_trusted = false)
{
if($selvalue !== NULL
&& $value == $selvalue)
{
$checked = 'checked="checked"';
}
else
{
$checked = '';
}
if(!$title_trusted)
{
$title = htmlspecialchars($title);
}
if(!$value_trusted)
{
$value = htmlspecialchars($value);
}
$checkbox = '<input type="checkbox" name="' . $name . '" value="' . $value . '" ' . $checked . ' />&nbsp;' . $title;
if($break)
{
$checkbox.= '<br />';
}
return $checkbox;
}
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Return HTML Code for a checkbox
*
* @param string The fieldname
* @param string The captions
* @param string The Value which will be returned
* @param bool Add a <br /> at the end of the checkbox
* @param string Values which will be selected by default
* @param bool Whether the title may contain html or not
* @param bool Whether the value may contain html or not
* @return string HTML Code
* @author Michael Kaufmann <mkaufmann@nutime.de>
*/
function makecheckbox($name, $title, $value, $break = false, $selvalue = NULL, $title_trusted = false, $value_trusted = false)
{
if($selvalue !== NULL
&& $value == $selvalue)
{
$checked = 'checked="checked"';
}
else
{
$checked = '';
}
if(!$title_trusted)
{
$title = htmlspecialchars($title);
}
if(!$value_trusted)
{
$value = htmlspecialchars($value);
}
$checkbox = '<input type="checkbox" name="' . $name . '" value="' . $value . '" ' . $checked . ' />&nbsp;' . $title;
if($break)
{
$checkbox.= '<br />';
}
return $checkbox;
}

View File

@@ -1,56 +1,56 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Return HTML Code for an option within a <select>
*
* @param string The caption
* @param string The Value which will be returned
* @param string Values which will be selected by default.
* @param bool Whether the title may contain html or not
* @param bool Whether the value may contain html or not
* @return string HTML Code
* @author Florian Lippert <flo@syscp.org>
*/
function makeoption($title, $value, $selvalue = NULL, $title_trusted = false, $value_trusted = false)
{
if($selvalue !== NULL
&& ((is_array($selvalue) && in_array($value, $selvalue)) || $value == $selvalue))
{
$selected = 'selected="selected"';
}
else
{
$selected = '';
}
if(!$title_trusted)
{
$title = htmlspecialchars($title);
}
if(!$value_trusted)
{
$value = htmlspecialchars($value);
}
$option = '<option value="' . $value . '" ' . $selected . ' >' . $title . '</option>';
return $option;
}
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Return HTML Code for an option within a <select>
*
* @param string The caption
* @param string The Value which will be returned
* @param string Values which will be selected by default.
* @param bool Whether the title may contain html or not
* @param bool Whether the value may contain html or not
* @return string HTML Code
* @author Florian Lippert <flo@syscp.org>
*/
function makeoption($title, $value, $selvalue = NULL, $title_trusted = false, $value_trusted = false)
{
if($selvalue !== NULL
&& ((is_array($selvalue) && in_array($value, $selvalue)) || $value == $selvalue))
{
$selected = 'selected="selected"';
}
else
{
$selected = '';
}
if(!$title_trusted)
{
$title = htmlspecialchars($title);
}
if(!$value_trusted)
{
$value = htmlspecialchars($value);
}
$option = '<option value="' . $value . '" ' . $selected . ' >' . $title . '</option>';
return $option;
}

View File

@@ -1,35 +1,35 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Returns HTML Code for two radio buttons with two choices: yes and no
*
* @param string Name of HTML-Variable
* @param string Value which will be returned if user chooses yes
* @param string Value which will be returned if user chooses no
* @param string Value which is chosen by default
* @return string HTML Code
* @author Florian Lippert <flo@syscp.org>
*/
function makeyesno($name, $yesvalue, $novalue = '', $yesselected = '')
{
global $lng;
return '<select class="dropdown_noborder" name="' . $name . '"><option value="' . $yesvalue . '"' . ($yesselected ? ' selected="selected"' : '') . '>' . $lng['panel']['yes'] . '</option><option value="' . $novalue . '"' . ($yesselected ? '' : ' selected="selected"') . '>' . $lng['panel']['no'] . '</option></select>';
}
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Returns HTML Code for two radio buttons with two choices: yes and no
*
* @param string Name of HTML-Variable
* @param string Value which will be returned if user chooses yes
* @param string Value which will be returned if user chooses no
* @param string Value which is chosen by default
* @return string HTML Code
* @author Florian Lippert <flo@syscp.org>
*/
function makeyesno($name, $yesvalue, $novalue = '', $yesselected = '')
{
global $lng;
return '<select class="dropdown_noborder" name="' . $name . '"><option value="' . $yesvalue . '"' . ($yesselected ? ' selected="selected"' : '') . '>' . $lng['panel']['yes'] . '</option><option value="' . $novalue . '"' . ($yesselected ? '' : ' selected="selected"') . '>' . $lng['panel']['no'] . '</option></select>';
}

View File

@@ -1,92 +1,92 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Sends an header ( 'Location ...' ) to the browser.
*
* @param string Destination
* @param array Get-Variables
* @param boolean if the target we are creating for a redirect
* should be a relative or an absolute url
*
* @return boolean false if params is not an array
*
* @author Florian Lippert <flo@syscp.org>
* @author Martin Burchert <eremit@syscp.org>
*
* @changes martin@2005-01-29
* - added isRelative parameter
* - speed up the url generation
* - fixed bug #91
*/
function redirectTo($destination, $get_variables = array(), $isRelative = false)
{
$params = array();
if(is_array($get_variables))
{
foreach($get_variables as $key => $value)
{
$params[] = urlencode($key) . '=' . urlencode($value);
}
$params = '?' . implode($params, '&');
if($isRelative)
{
$protocol = '';
$host = '';
$path = './';
}
else
{
if(isset($_SERVER['HTTPS'])
&& strtolower($_SERVER['HTTPS']) == 'on')
{
$protocol = 'https://';
}
else
{
$protocol = 'http://';
}
$host = $_SERVER['HTTP_HOST'];
if(dirname($_SERVER['PHP_SELF']) == '/')
{
$path = '/';
}
else
{
$path = dirname($_SERVER['PHP_SELF']) . '/';
}
}
header('Location: ' . $protocol . $host . $path . $destination . $params);
exit;
}
elseif($get_variables == null)
{
header('Location: ' . $destination);
exit;
}
return false;
}
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Sends an header ( 'Location ...' ) to the browser.
*
* @param string Destination
* @param array Get-Variables
* @param boolean if the target we are creating for a redirect
* should be a relative or an absolute url
*
* @return boolean false if params is not an array
*
* @author Florian Lippert <flo@syscp.org>
* @author Martin Burchert <eremit@syscp.org>
*
* @changes martin@2005-01-29
* - added isRelative parameter
* - speed up the url generation
* - fixed bug #91
*/
function redirectTo($destination, $get_variables = array(), $isRelative = false)
{
$params = array();
if(is_array($get_variables))
{
foreach($get_variables as $key => $value)
{
$params[] = urlencode($key) . '=' . urlencode($value);
}
$params = '?' . implode($params, '&');
if($isRelative)
{
$protocol = '';
$host = '';
$path = './';
}
else
{
if(isset($_SERVER['HTTPS'])
&& strtolower($_SERVER['HTTPS']) == 'on')
{
$protocol = 'https://';
}
else
{
$protocol = 'http://';
}
$host = $_SERVER['HTTP_HOST'];
if(dirname($_SERVER['PHP_SELF']) == '/')
{
$path = '/';
}
else
{
$path = dirname($_SERVER['PHP_SELF']) . '/';
}
}
header('Location: ' . $protocol . $host . $path . $destination . $params);
exit;
}
elseif($get_variables == null)
{
header('Location: ' . $destination);
exit;
}
return false;
}

View File

@@ -1,67 +1,67 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Prints one ore more errormessages on screen
*
* @param array Errormessages
* @param string A %s in the errormessage will be replaced by this string.
* @author Florian Lippert <flo@syscp.org>
* @author Ron Brand <ron.brand@web.de>
*/
function standard_error($errors = '', $replacer = '')
{
global $db, $userinfo, $s, $header, $footer, $lng;
$replacer = htmlentities($replacer);
if(!is_array($errors))
{
$errors = array(
$errors
);
}
$error = '';
foreach($errors as $single_error)
{
if(isset($lng['error'][$single_error]))
{
$single_error = $lng['error'][$single_error];
$single_error = strtr($single_error, array('%s' => $replacer));
}
else
{
$error = 'Unknown Error (' . $single_error . '): ' . $replacer;
break;
}
if(empty($error))
{
$error = $single_error;
}
else
{
$error.= ' ' . $single_error;
}
}
eval("echo \"" . getTemplate('misc/error', '1') . "\";");
exit;
}
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Prints one ore more errormessages on screen
*
* @param array Errormessages
* @param string A %s in the errormessage will be replaced by this string.
* @author Florian Lippert <flo@syscp.org>
* @author Ron Brand <ron.brand@web.de>
*/
function standard_error($errors = '', $replacer = '')
{
global $db, $userinfo, $s, $header, $footer, $lng;
$replacer = htmlentities($replacer);
if(!is_array($errors))
{
$errors = array(
$errors
);
}
$error = '';
foreach($errors as $single_error)
{
if(isset($lng['error'][$single_error]))
{
$single_error = $lng['error'][$single_error];
$single_error = strtr($single_error, array('%s' => $replacer));
}
else
{
$error = 'Unknown Error (' . $single_error . '): ' . $replacer;
break;
}
if(empty($error))
{
$error = $single_error;
}
else
{
$error.= ' ' . $single_error;
}
}
eval("echo \"" . getTemplate('misc/error', '1') . "\";");
exit;
}

View File

@@ -1,57 +1,57 @@
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Prints one ore more errormessages on screen
*
* @param array Errormessages
* @param string A %s in the errormessage will be replaced by this string.
* @author Florian Lippert <flo@syscp.org>
*/
function standard_success($success_message = '', $replacer = '', $params = array())
{
global $s, $header, $footer, $lng;
if(isset($lng['success'][$success_message]))
{
$success_message = strtr($lng['success'][$success_message], array('%s' => htmlentities($replacer)));
}
if(is_array($params) && isset($params['filename']))
{
$redirect_url = $params['filename'] . '?s=' . $s;
unset($params['filename']);
foreach($params as $varname => $value)
{
if($value != '')
{
$redirect_url .= '&amp;' . $varname . '=' . $value;
}
}
}
else
{
$redirect_url = '';
}
eval("echo \"" . getTemplate('misc/success', '1') . "\";");
exit;
}
<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2003-2009 the SysCP Team (see authors).
* 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 Florian Lippert <flo@syscp.org> (2003-2009)
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Functions
* @version $Id$
*/
/**
* Prints one ore more errormessages on screen
*
* @param array Errormessages
* @param string A %s in the errormessage will be replaced by this string.
* @author Florian Lippert <flo@syscp.org>
*/
function standard_success($success_message = '', $replacer = '', $params = array())
{
global $s, $header, $footer, $lng;
if(isset($lng['success'][$success_message]))
{
$success_message = strtr($lng['success'][$success_message], array('%s' => htmlentities($replacer)));
}
if(is_array($params) && isset($params['filename']))
{
$redirect_url = $params['filename'] . '?s=' . $s;
unset($params['filename']);
foreach($params as $varname => $value)
{
if($value != '')
{
$redirect_url .= '&amp;' . $varname . '=' . $value;
}
}
}
else
{
$redirect_url = '';
}
eval("echo \"" . getTemplate('misc/success', '1') . "\";");
exit;
}