forked from extern/egroupware
Add a method to get an icon for a record, as specific to that record as possible
This commit is contained in:
parent
08708664b3
commit
ea8ff86854
@ -8,7 +8,7 @@
|
||||
* @link http://www.egroupware.org
|
||||
* @author Cornelius Weiss <nelius@cwtech.de>
|
||||
* @copyright Cornelius Weiss <nelius@cwtech.de>
|
||||
* @version $Id: class.egw_addressbook_record.inc.php 22827 2006-11-10 15:35:35Z nelius_weiss $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -105,6 +105,21 @@ class addressbook_egw_record implements importexport_iface_egw_record
|
||||
return $this->identifier ? $this->identifier : $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL icon representitive of the record
|
||||
* This could be as general as the application icon, or as specific as a contact photo
|
||||
*
|
||||
* @return string Full URL of an icon, or appname/icon_name
|
||||
*/
|
||||
public function get_icon() {
|
||||
$ui = new addressbook_ui();
|
||||
|
||||
// Type as default
|
||||
$ui->type_icon($this->owner, $this->private, $this->tid, $icon, $label);
|
||||
|
||||
// Specific photo
|
||||
return $this->jpegphoto ? egw_framework::link('/index.php',$ui->photo_src($this->identifier,$this->jpegphoto)):'addressbook/'.$icon;
|
||||
}
|
||||
/**
|
||||
* saves record into backend
|
||||
*
|
||||
|
@ -104,6 +104,16 @@ class admin_egw_group_record implements importexport_iface_egw_record
|
||||
return $this->identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL icon representitive of the record
|
||||
* This could be as general as the application icon, or as specific as a contact photo
|
||||
*
|
||||
* @return string Full URL of an icon, or appname/icon_name
|
||||
*/
|
||||
public function get_icon() {
|
||||
return 'group';
|
||||
}
|
||||
|
||||
/**
|
||||
* saves record into backend
|
||||
*
|
||||
|
@ -105,6 +105,16 @@ class admin_egw_user_record implements importexport_iface_egw_record
|
||||
return $this->identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL icon representitive of the record
|
||||
* This could be as general as the application icon, or as specific as a contact photo
|
||||
*
|
||||
* @return string Full URL of an icon, or appname/icon_name
|
||||
*/
|
||||
public function get_icon() {
|
||||
return 'user';
|
||||
}
|
||||
|
||||
/**
|
||||
* saves record into backend
|
||||
*
|
||||
|
@ -108,6 +108,16 @@ class calendar_egw_record implements importexport_iface_egw_record
|
||||
return $this->identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL icon representitive of the record
|
||||
* This could be as general as the application icon, or as specific as a contact photo
|
||||
*
|
||||
* @return string Full URL of an icon, or appname/icon_name
|
||||
*/
|
||||
public function get_icon() {
|
||||
return 'calendar/navbar';
|
||||
}
|
||||
|
||||
/**
|
||||
* saves record into backend
|
||||
*
|
||||
|
@ -257,6 +257,16 @@ class importexport_definition implements importexport_iface_egw_record {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the URL icon representitive of the record
|
||||
* This could be as general as the application icon, or as specific as a contact photo
|
||||
*
|
||||
* @return string Full URL of an icon, or appname/icon_name
|
||||
*/
|
||||
public function get_icon() {
|
||||
return self::_appname . '/navbar';
|
||||
}
|
||||
|
||||
/**
|
||||
* saves record into backend
|
||||
*
|
||||
|
@ -81,6 +81,13 @@ interface importexport_iface_egw_record
|
||||
*/
|
||||
public function get_identifier();
|
||||
|
||||
/**
|
||||
* Gets the URL icon representitive of the record
|
||||
* This could be as general as the application icon, or as specific as a contact photo
|
||||
*
|
||||
* @return string Full URL of an icon, or appname/icon_name
|
||||
*/
|
||||
public function get_icon();
|
||||
|
||||
/**
|
||||
* saves record into backend
|
||||
|
@ -108,6 +108,26 @@ class infolog_egw_record implements importexport_iface_egw_record
|
||||
return $this->identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL icon representitive of the record
|
||||
* This could be as general as the application icon, or as specific as a contact photo
|
||||
*
|
||||
* @return string Full URL of an icon, or appname/icon_name
|
||||
*/
|
||||
public function get_icon() {
|
||||
$icon = 'infolog/navbar';
|
||||
$ui = new infolog_ui();
|
||||
if (!($icon = $ui->icons['type'][$this->info_type]))
|
||||
{
|
||||
$icon = $ui->icons['status'][$this->info_status];
|
||||
}
|
||||
if (!$icon)
|
||||
{
|
||||
$icon = 'navbar';
|
||||
}
|
||||
return 'infolog/'.$icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* saves record into backend
|
||||
*
|
||||
|
@ -103,6 +103,21 @@ class resources_egw_record implements importexport_iface_egw_record
|
||||
return $this->identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL icon representitive of the record
|
||||
* This could be as general as the application icon, or as specific as a contact photo
|
||||
*
|
||||
* @return string Full URL of an icon, or appname/icon_name
|
||||
*/
|
||||
public function get_icon() {
|
||||
$bo = new resources_bo();
|
||||
if(!$icon = $bo->get_picture($this->identifier,$this->picture_src))
|
||||
{
|
||||
$icon = 'resources/navbar';
|
||||
}
|
||||
return $icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* saves record into backend
|
||||
*
|
||||
|
@ -116,6 +116,16 @@ class timesheet_egw_record implements importexport_iface_egw_record
|
||||
return $this->identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL icon representitive of the record
|
||||
* This could be as general as the application icon, or as specific as a contact photo
|
||||
*
|
||||
* @return string Full URL of an icon, or appname/icon_name
|
||||
*/
|
||||
public function get_icon() {
|
||||
return 'timesheet/navbar';
|
||||
}
|
||||
|
||||
/**
|
||||
* saves record into backend
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user