Item: new method get_thumb

This commit is contained in:
Domovoy 2012-08-11 17:04:07 +02:00
parent 56cae53e50
commit 1ffca59a9e

View file

@ -49,8 +49,6 @@ class Item extends BaseObject {
$dropping = false; $dropping = false;
$star = false; $star = false;
$isstarred = "unstarred"; $isstarred = "unstarred";
$photo = $item['photo'];
$thumb = $item['thumb'];
$indent = ''; $indent = '';
$osparkle = ''; $osparkle = '';
$lastcollapsed = false; $lastcollapsed = false;
@ -99,7 +97,7 @@ class Item extends BaseObject {
if(($normalised != 'mailbox') && (x($a->contacts,$normalised))) if(($normalised != 'mailbox') && (x($a->contacts,$normalised)))
$profile_avatar = $a->contacts[$normalised]['thumb']; $profile_avatar = $a->contacts[$normalised]['thumb'];
else else
$profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $a->get_cached_avatar_image($thumb)); $profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $a->get_cached_avatar_image($this->get_thumb()));
$locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => ''); $locate = array('location' => $item['location'], 'coord' => $item['coord'], 'html' => '');
call_hooks('render_location',$locate); call_hooks('render_location',$locate);
@ -334,6 +332,10 @@ class Item extends BaseObject {
public function get_uid() { public function get_uid() {
return $this->get_data_value('uid'); return $this->get_data_value('uid');
} }
public function get_thumb() {
return $this->get_data_value('thumb');
}
/** /**
* Get raw data * Get raw data
@ -352,7 +354,7 @@ class Item extends BaseObject {
* _ false on failure * _ false on failure
*/ */
private function get_data_value($name) { private function get_data_value($name) {
if(!x($this->data[$name])) { if(!x($this->data, $name)) {
logger('[ERROR] Item::get_data_value : Item has no value name "'. $name .'".', LOGGER_DEBUG); logger('[ERROR] Item::get_data_value : Item has no value name "'. $name .'".', LOGGER_DEBUG);
return false; return false;
} }
@ -413,8 +415,10 @@ class Item extends BaseObject {
* Set template * Set template
*/ */
private function set_template($name) { private function set_template($name) {
if(!x($this->available_templates, $name)) if(!x($this->available_templates, $name)) {
logger('[ERROR] Item::set_template : Template not available ("'. $name .'").', LOGGER_DEBUG);
return false; return false;
}
$this->template = $this->available_templates[$name]; $this->template = $this->available_templates[$name];
} }