]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Extended profile - don't show empty company entry in view
authorZach Copley <zach@status.net>
Wed, 16 Mar 2011 08:26:53 +0000 (01:26 -0700)
committerZach Copley <zach@status.net>
Wed, 16 Mar 2011 08:27:18 +0000 (01:27 -0700)
plugins/ExtendedProfile/extendedprofilewidget.php

index d4a3f21a525bbbdf781382ea35b3ba38a392209d..fb519cfffc9dfaff13e10db660d20356cfedbd88 100644 (file)
@@ -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');
     }