diff --git a/e107_admin/image.php b/e107_admin/image.php index 889a9346e..5caec101f 100644 --- a/e107_admin/image.php +++ b/e107_admin/image.php @@ -729,7 +729,7 @@ class media_admin_ui extends e_admin_ui 'other' => e_MEDIA_FILE ); - protected $fieldpref = array( 'media_id', 'media_title', 'media_caption', 'media_category', 'media_datestamp','media_userclass', 'options'); + protected $fieldpref = array( 'media_id', 'media_name', 'media_caption', 'media_category', 'media_datestamp','media_userclass', 'options'); diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index b16941117..6a0fb995d 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -2017,7 +2017,7 @@ class e_form function optgroup_open($label, $disabled = false, $options = null) { - return ""; + return "\n"; } /** @@ -2034,42 +2034,26 @@ class e_form if(false === $value) $value = ''; $options = $this->format_options('option', '', $options); $options['selected'] = $selected; //comes as separate argument just for convenience - + return ""; } /** - * Use selectbox() instead. + * Use selectbox() instead. */ function option_multi($option_array, $selected = false, $options = array()) { if(is_string($option_array)) parse_str($option_array, $option_array); $text = ''; + foreach ($option_array as $value => $label) { if(is_array($label)) { - $text .= $this->optgroup_open($value); - foreach($label as $val => $lab) - { - - if(is_array($lab)) - { - $text .= $this->optgroup_open($val,null,array('class'=>'level-2')); // Not valid HTML5 - but appears to work in modern browsers. - foreach($lab as $k=>$v) - { - $text .= $this->option($v, $k, (is_array($selected) ? in_array($k, $selected) : $selected == $k), $options)."\n"; - } - $text .= $this->optgroup_close($val); - } - else - { - $text .= $this->option($lab, $val, (is_array($selected) ? in_array($val, $selected) : $selected == $val), $options)."\n"; - } - } - $text .= $this->optgroup_close(); + $text .= $this->optgroup($value,$label,$selected,$options, 1); + } else { @@ -2080,9 +2064,46 @@ class e_form return $text; } + + /** + * No compliant, but it works. + * @param $value + * @param $label + * @param $selected + * @param $options + * @param int $level + * @return string + */ + private function optgroup($value, $label, $selected, $options, $level=1) + { + $level++; + $text = $this->optgroup_open($value, null, array('class'=>'level-'.$level)); + + foreach($label as $val => $lab) + { + if(is_array($lab)) + { + $text .= $this->optgroup($val,$lab,$selected,$options,$level); + } + else + { + $text .= $this->option($lab, $val, (is_array($selected) ? in_array($val, $selected) : $selected == $val), $options)."\n"; + } + + } + + $text .= $this->optgroup_close(); + + return $text; + } + + + + + function optgroup_close() { - return ""; + return "\n"; } function select_close() diff --git a/e107_handlers/media_class.php b/e107_handlers/media_class.php index 186a08ae9..03dc49f92 100644 --- a/e107_handlers/media_class.php +++ b/e107_handlers/media_class.php @@ -1034,7 +1034,7 @@ class e_media } $this->log("Line: ".__LINE__." Couldn't find the file: ".$oldpath); $mes->addError("Couldn't find the file: ".$oldpath); - return; + return false; } $img_data = $this->mediaData($oldpath); // Basic File Info only diff --git a/e107_plugins/social/e_comment.php b/e107_plugins/social/e_comment.php index 1a1578d47..ab38fc8ea 100644 --- a/e107_plugins/social/e_comment.php +++ b/e107_plugins/social/e_comment.php @@ -19,7 +19,7 @@ class social_comment { $social = e107::pref('core','social_login'); - if(!empty($social)) + if(!empty($social) && is_array($social)) { $this->facebookActive = vartrue($social['Facebook']['keys']['id']); }