X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fprofileblock.php;h=432df0da5a89242e83b4e578d915fba515751910;hb=2e4ec0df0ecc4fc8e41dea46ddfe4bd1796208ff;hp=7fcc11ef1a844cd6896259b53586f4968c6a97cb;hpb=051e374792ae24467632282c7c0c30279f6dc9c0;p=quix0rs-gnu-social.git diff --git a/lib/profileblock.php b/lib/profileblock.php index 7fcc11ef1a..432df0da5a 100644 --- a/lib/profileblock.php +++ b/lib/profileblock.php @@ -4,7 +4,7 @@ * Copyright (C) 2011, StatusNet, Inc. * * Superclass for profile blocks - * + * * PHP version 5 * * This program is free software: you can redistribute it and/or modify @@ -50,65 +50,81 @@ abstract class ProfileBlock extends Widget abstract function avatar(); abstract function name(); abstract function url(); - abstract function canEdit(); - abstract function editUrl(); - abstract function editText(); abstract function location(); abstract function homepage(); abstract function description(); function show() { - $this->out->elementStart('div', 'profile_block'); + $this->showActions(); + $this->showAvatar(); + $this->showName(); + $this->showLocation(); + $this->showHomepage(); + $this->showDescription(); + $this->showTags(); + } + function showAvatar() + { $size = $this->avatarSize(); - $this->out->element('img', array('src' => $this->avatar(), - 'class' => 'profile_block_avatar', - 'alt' => $this->name(), - 'width' => $size, - 'height' => $size)); - - if ($this->canEdit()) { - $this->out->element('a', array('href' => $this->editUrl()), - $this->editText()); - } + $this->out->element( + 'img', + array( + 'src' => $this->avatar(), + 'class' => 'ur_face', + 'alt' => $this->name(), + 'width' => $size, + 'height' => $size + ) + ); + } + function showName() + { $name = $this->name(); if (!empty($name)) { + $this->out->elementStart('p', 'profile_block_name'); $url = $this->url(); if (!empty($url)) { $this->out->element('a', array('href' => $url), $name); } else { - $this->out->element('span', 'profile_block_name', $name); + $this->out->text($name); } + $this->out->elementEnd('p'); } + } + + function showDescription() + { + $description = $this->description(); + + if (!empty($description)) { + $this->out->element( + 'p', + 'profile_block_description', + $description + ); + } + } + function showLocation() + { $location = $this->location(); if (!empty($location)) { - $this->out->element('span', 'profile_block_location', $location); + $this->out->element('p', 'profile_block_location', $location); } + } - $homepage = $this->homepage(); - + function showHomepage() + { if (!empty($homepage)) { $this->out->element('a', 'profile_block_homepage', $homepage); } - - $description = $this->description(); - - if (!empty($description)) { - $this->out->element('p', - 'profile_block_description', - $description); - } - - $this->showActions(); - - $this->out->elementEnd('div'); } function avatarSize() @@ -116,6 +132,10 @@ abstract class ProfileBlock extends Widget return AVATAR_PROFILE_SIZE; } + function showTags() + { + } + function showActions() { }