From: Zach Copley Date: Wed, 16 Mar 2011 08:26:53 +0000 (-0700) Subject: Extended profile - don't show empty company entry in view X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=82023d388a5a060b2b10964bf0cace27fa0a1ae5;p=quix0rs-gnu-social.git Extended profile - don't show empty company entry in view --- diff --git a/plugins/ExtendedProfile/extendedprofilewidget.php b/plugins/ExtendedProfile/extendedprofilewidget.php index d4a3f21a52..fb519cfffc 100644 --- a/plugins/ExtendedProfile/extendedprofilewidget.php +++ b/plugins/ExtendedProfile/extendedprofilewidget.php @@ -313,29 +313,32 @@ class ExtendedProfileWidget extends Form { $this->out->elementStart('div', 'experience-item'); $this->out->element('div', 'label', _m('Company')); - $this->out->element('div', 'field', $field['company']); - $this->out->element('div', 'label', _m('Start')); - $this->out->element( - 'div', - array('class' => 'field date'), - date('j M Y', strtotime($field['start']) - ) - ); - $this->out->element('div', 'label', _m('End')); - $this->out->element( - 'div', - array('class' => 'field date'), - date('j M Y', strtotime($field['end']) - ) - ); + if (!empty($field['company'])) { + $this->out->element('div', 'field', $field['company']); - if ($field['current']) { + $this->out->element('div', 'label', _m('Start')); + $this->out->element( + 'div', + array('class' => 'field date'), + date('j M Y', strtotime($field['start']) + ) + ); + $this->out->element('div', 'label', _m('End')); $this->out->element( 'div', - array('class' => 'field current'), - '(' . _m('Current') . ')' + array('class' => 'field date'), + date('j M Y', strtotime($field['end']) + ) ); + + if ($field['current']) { + $this->out->element( + 'div', + array('class' => 'field current'), + '(' . _m('Current') . ')' + ); + } } $this->out->elementEnd('div'); }