$company_id = $this->getCompanyId();
if (is_file(ENVIRONMENT_PATH . '/' . PUBLIC_FOLDER_NAME . '/logos/' . $company_id . ".$size.jpg")) {
return ROOT_URL . '/' . PUBLIC_FOLDER_NAME .'/logos/'. $company_id .".$size.jpg";
} else {
return ROOT_URL . '/' . PUBLIC_FOLDER_NAME ."/logos/default.$size.gif";
} // if
function getIconUrl($large = false) {
$size = $large ? '40x40' : '16x16';
$company_id = $this->getCompanyId();
if(is_file($this->getIconPath($large))) {
return ROOT_URL . '/projects_icons/' . $this->getId() . ".$size.gif";
} elseif(is_file(ENVIRONMENT_PATH . '/' . PUBLIC_FOLDER_NAME . '/logos/' . $company_id . ".$size.jpg")) {
return ROOT_URL . '/' . PUBLIC_FOLDER_NAME .'/logos/'. $company_id .".$size.jpg";
} else {
return ROOT_URL . "/projects_icons/default.$size.gif";
} // if
} // getAvatarUrl
It would save some time as it stands you add a client, add an image, and then have to add the same image for each project.