Extended profile - don't show empty company entry in view

This commit is contained in:
Zach Copley 2011-03-16 01:26:53 -07:00
parent 17afe06805
commit 82023d388a

View File

@ -313,29 +313,32 @@ class ExtendedProfileWidget extends Form
{ {
$this->out->elementStart('div', 'experience-item'); $this->out->elementStart('div', 'experience-item');
$this->out->element('div', 'label', _m('Company')); $this->out->element('div', 'label', _m('Company'));
$this->out->element('div', 'field', $field['company']);
$this->out->element('div', 'label', _m('Start')); if (!empty($field['company'])) {
$this->out->element( $this->out->element('div', 'field', $field['company']);
'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 ($field['current']) { $this->out->element('div', 'label', _m('Start'));
$this->out->element( $this->out->element(
'div', 'div',
array('class' => 'field current'), array('class' => 'field date'),
'(' . _m('Current') . ')' 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 ($field['current']) {
$this->out->element(
'div',
array('class' => 'field current'),
'(' . _m('Current') . ')'
);
}
} }
$this->out->elementEnd('div'); $this->out->elementEnd('div');
} }