mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 15:33:23 +01:00
Avoid some PHP warnings
- Undefined array keys - Undefined class variables - Passing null to string functions
This commit is contained in:
parent
f16cfd45fe
commit
492993e78e
@ -114,7 +114,7 @@ class Date extends Transformer
|
||||
return $value;
|
||||
} // otherwise we will get current date or 1970-01-01 instead of an empty value
|
||||
|
||||
$format = $this->attrs['dataFormat'] ?? $this->attrs['data_format'];
|
||||
$format = $this->attrs['dataFormat'] ?? $this->attrs['data_format'] ?? "";
|
||||
// for DateTime objects (regular PHP and Api\DateTime ones), set user timezone
|
||||
if($value instanceof \DateTime)
|
||||
{
|
||||
|
@ -189,9 +189,9 @@ class Grid extends Box
|
||||
foreach(array_merge(array($direct_child), $n ? array() : $direct_child->children) as $child)
|
||||
{
|
||||
$pat = $child->id;
|
||||
while(($patstr = strstr($pat, '$')))
|
||||
while($pat && ($patstr = strstr($pat, '$')))
|
||||
{
|
||||
$pat = substr($patstr,$patstr[1] == '{' ? 2 : 1);
|
||||
$pat = substr($patstr, $patstr[1] == '{' ? 2 : 1);
|
||||
|
||||
switch ($this->type)
|
||||
{
|
||||
|
@ -136,7 +136,7 @@ class Nextmatch extends Etemplate\Widget
|
||||
}
|
||||
|
||||
// Check for sort preference. We only apply this on first load so it can be changed
|
||||
if($GLOBALS['egw_info']['user']['preferences'][$app][$this->attrs['template'] . "_sort"])
|
||||
if(array_key_exists($this->attrs['template'] . "_sort", $GLOBALS['egw_info']['user']['preferences'][$app]))
|
||||
{
|
||||
$send_value['sort'] = $GLOBALS['egw_info']['user']['preferences'][$app][$this->attrs['template'] . "_sort"];
|
||||
}
|
||||
|
@ -644,7 +644,7 @@ class Select extends Etemplate\Widget
|
||||
}
|
||||
// Legacy / static support
|
||||
// Have to do this explicitly, since legacy options is not defined on class level
|
||||
$legacy_options = explode(',',$_legacy_options);
|
||||
$legacy_options = explode(',', $_legacy_options ?? "");
|
||||
foreach($legacy_options as &$field)
|
||||
{
|
||||
$field = self::expand_name($field, 0, 0,'','',self::$cont);
|
||||
|
@ -261,12 +261,16 @@ class Hooks
|
||||
// some apps have setup_info for more then themselfs (eg. api for groupdav)
|
||||
foreach($setup_info as $appname => $data)
|
||||
{
|
||||
if(!array_key_exists('hooks', $data))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
foreach((array)$data['hooks'] as $location => $methods)
|
||||
{
|
||||
if (is_int($location))
|
||||
{
|
||||
$location = $methods;
|
||||
$methods = '/'.$appname.'/inc/hook_'.$methods.'.inc.php';
|
||||
$methods = '/' . $appname . '/inc/hook_' . $methods . '.inc.php';
|
||||
}
|
||||
$locations[$location][$appname] = (array)$methods;
|
||||
}
|
||||
|
@ -51,6 +51,10 @@ class importexport_definitions_ui
|
||||
* @var object
|
||||
*/
|
||||
var $plugin;
|
||||
private Etemplate $etpl;
|
||||
private string $clock;
|
||||
private array $steps;
|
||||
private $wizard_content_template;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
@ -60,7 +64,7 @@ class importexport_definitions_ui
|
||||
$GLOBALS['egw_info']['flags']['currentapp'] = self::_appname;
|
||||
|
||||
$this->etpl = new Etemplate();
|
||||
$this->clock = Api\Html::image(self::_appname,'clock');
|
||||
$this->clock = Api\Html::image(self::_appname, 'clock');
|
||||
$this->steps = array(
|
||||
'wizard_step10' => lang('Choose an application'),
|
||||
'wizard_step20' => lang('Choose a plugin'),
|
||||
|
Loading…
Reference in New Issue
Block a user