1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-28 18:30:53 +02:00

PHP Notice fixes.

This commit is contained in:
Cameron
2016-02-13 12:57:34 -08:00
parent e8c1b055fe
commit 1ceabc69f3
5 changed files with 41 additions and 7 deletions

View File

@@ -647,6 +647,7 @@ class news_admin_ui extends e_admin_ui
'news_meta_description' , 'news_meta_description' ,
'news_ping', 'news_ping',
'news_email_notify',
'news_allow_comments' , 'news_allow_comments' ,
'news_start' , 'news_start' ,
'news_end' , 'news_end' ,
@@ -655,6 +656,7 @@ class news_admin_ui extends e_admin_ui
'news_sticky', 'news_sticky',
'news_comment_total' , 'news_comment_total' ,
'submitted_id',
'options' ); 'options' );
@@ -672,10 +674,11 @@ class news_admin_ui extends e_admin_ui
$order = array_flip($newOrder); $order = array_flip($newOrder);
if ($order[$a] == $order[$b]) if($order[$a] == $order[$b])
{ {
return 0; return 0;
} }
return ($order[$a] < $order[$b]) ? -1 : 1; return ($order[$a] < $order[$b]) ? -1 : 1;
} }

View File

@@ -5519,7 +5519,7 @@ class e_admin_ui extends e_admin_controller_ui
unset($_parms); unset($_parms);
} }
if($att['data'] == 'array' && ($this->getAction() == 'inline')) // FIX for arrays being saved incorrectly with inline editing. if(!empty($att['data']) && $att['data'] == 'array' && ($this->getAction() == 'inline')) // FIX for arrays being saved incorrectly with inline editing.
{ {
$att['data'] = 'set'; $att['data'] = 'set';
} }

View File

@@ -1267,6 +1267,11 @@ class e_form
if(is_string($options)) parse_str($options, $options); if(is_string($options)) parse_str($options, $options);
// auto-height support // auto-height support
if(empty($options['class']))
{
$options['class'] = '';
}
if(vartrue($options['size']) && !is_numeric($options['size'])) if(vartrue($options['size']) && !is_numeric($options['size']))
{ {
$options['class'] .= " form-control input-".$options['size']; $options['class'] .= " form-control input-".$options['size'];
@@ -1300,6 +1305,7 @@ class e_form
//size - large|medium|small //size - large|medium|small
//width should be explicit set by current admin theme //width should be explicit set by current admin theme
// $size = 'input-large'; // $size = 'input-large';
$height = '';
switch($size) switch($size)
{ {
@@ -1746,7 +1752,15 @@ class e_form
if(vartrue($options['size']) && !is_numeric($options['size'])) if(vartrue($options['size']) && !is_numeric($options['size']))
{ {
$options['class'] .= " input-".$options['size']; if(!empty($options['class']))
{
$options['class'] .= " input-".$options['size'];
}
else
{
$options['class'] = "input-".$options['size'];
}
unset($options['size']); // don't include in html 'size='. unset($options['size']); // don't include in html 'size='.
} }
$options = $this->format_options('select', $name, $options); $options = $this->format_options('select', $name, $options);
@@ -4105,7 +4119,15 @@ class e_form
{ {
$sefSource = $this->name2id($parms['sef']); $sefSource = $this->name2id($parms['sef']);
$sefTarget = $this->name2id($key); $sefTarget = $this->name2id($key);
$parms['tdClassRight'] .= 'input-group'; if(!empty($parms['tdClassRight']))
{
$parms['tdClassRight'] .= 'input-group';
}
else
{
$parms['tdClassRight'] = 'input-group';
}
$parms['post'] = "<span class='form-inline input-group-btn pull-left'><a class='e-sef-generate btn btn-default' data-src='".$sefSource."' data-target='".$sefTarget."' data-confirm=\"".LAN_WILL_OVERWRITE_SEF." ".LAN_JSCONFIRM."\">".LAN_GENERATE."</a></span>"; $parms['post'] = "<span class='form-inline input-group-btn pull-left'><a class='e-sef-generate btn btn-default' data-src='".$sefSource."' data-target='".$sefTarget."' data-confirm=\"".LAN_WILL_OVERWRITE_SEF." ".LAN_JSCONFIRM."\">".LAN_GENERATE."</a></span>";
} }
@@ -4785,7 +4807,16 @@ class e_form
if(!empty($writeParms['sef'])) // group sef generate button with input element. if(!empty($writeParms['sef'])) // group sef generate button with input element.
{ {
$writeParms['tdClassRight'] .= 'input-group'; if(empty($writeParms['tdClassRight']))
{
$writeParms['tdClassRight'] = 'input-group';
}
else
{
$writeParms['tdClassRight'] .= ' input-group';
}
} }
if('hidden' === $att['type']) if('hidden' === $att['type'])

View File

@@ -2044,7 +2044,7 @@ class e_front_model extends e_model
{ {
$d = $this->getDataFields(); $d = $this->getDataFields();
if($d[$key] == 'array') if(!empty($d[$key]) && ($d[$key] == 'array'))
{ {
return e107::unserialize($this->getData((string) $key, $default, $index)); return e107::unserialize($this->getData((string) $key, $default, $index));
} }

View File

@@ -17,7 +17,7 @@
if (!defined('e107_INIT')) { exit; } if (!defined('e107_INIT')) { exit; }
$caption = "Newspost Help"; $caption = "Newspost Help";
if (e_QUERY) list($action,$junk) = explode('.',e_QUERY); else $action = 'list'; $action = varset($_GET['action']);
switch ($action) switch ($action)
{ {
case 'create' : case 'create' :