Edit page placeholder, link on main profile to details
This commit is contained in:
parent
7a97243abf
commit
59f4734985
|
@ -95,4 +95,14 @@ class ExtendedProfilePlugin extends Plugin
|
|||
$widget->showMenuItem('profiledetailsettings',_m('Details'),$title);
|
||||
return true;
|
||||
}
|
||||
|
||||
function onEndProfilePageProfileElements(HTMLOutputter $out, Profile $profile) {
|
||||
$user = User::staticGet('id', $profile->id);
|
||||
if ($user) {
|
||||
$url = common_local_url('profiledetail', array('nickname' => $user->nickname));
|
||||
$out->element('a', array('href' => $url), _m('More details...'));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -63,10 +63,40 @@ class ExtendedProfileWidget extends Widget
|
|||
$this->out->element('th', null, $field['label']);
|
||||
|
||||
$this->out->elementStart('td');
|
||||
// @fixme field value
|
||||
$this->out->text($name);
|
||||
if ($this->editable) {
|
||||
$this->showEditableField($name, $field);
|
||||
} else {
|
||||
$this->showFieldValue($name, $field);
|
||||
}
|
||||
$this->out->elementEnd('td');
|
||||
|
||||
$this->out->elementEnd('tr');
|
||||
}
|
||||
|
||||
protected function showFieldValue($name, $field)
|
||||
{
|
||||
$this->out->text($name);
|
||||
}
|
||||
|
||||
protected function showEditableField($name, $field)
|
||||
{
|
||||
$out = $this->out;
|
||||
//$out = new HTMLOutputter();
|
||||
// @fixme
|
||||
$type = strval(@$field['type']);
|
||||
$id = "extprofile-" . $name;
|
||||
$value = 'placeholder';
|
||||
|
||||
switch ($type) {
|
||||
case '':
|
||||
case 'text':
|
||||
$out->input($id, null, $value);
|
||||
break;
|
||||
case 'textarea':
|
||||
$out->textarea($id, null, $value);
|
||||
break;
|
||||
default:
|
||||
$out->input($id, null, "TYPE: $type");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ class ProfileDetailAction extends ProfileAction
|
|||
$this->elementEnd('div');
|
||||
}
|
||||
|
||||
$widget = new ExtendedProfileWidget($this, $this->profile, ExtendedProfileWidget::EDITABLE);
|
||||
$widget = new ExtendedProfileWidget($this, $this->profile);
|
||||
$widget->show();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user