. */ if (!defined('STATUSNET')) { exit(1); } class ExtendedProfileWidget extends Widget { const EDITABLE=true; protected $profile; protected $ext; public function __construct(XMLOutputter $out=null, Profile $profile=null, $editable=false) { parent::__construct($out); $this->profile = $profile; $this->ext = new ExtendedProfile($this->profile); $this->editable = $editable; } public function show() { $sections = $this->ext->getSections(); foreach ($sections as $name => $section) { $this->showExtendedProfileSection($name, $section); } } protected function showExtendedProfileSection($name, $section) { $this->out->element('h3', null, $section['label']); $this->out->elementStart('table', array('class' => 'extended-profile')); foreach ($section['fields'] as $fieldName => $field) { $this->showExtendedProfileField($fieldName, $field); } $this->out->elementEnd('table'); } protected function showExtendedProfileField($name, $field) { $this->out->elementStart('tr'); $this->out->element('th', null, $field['label']); $this->out->elementStart('td'); // @fixme field value $this->out->text($name); $this->out->elementEnd('td'); $this->out->elementEnd('tr'); } }