/** * @inheritDoc IElementType::getTableAttributeHtml() * * @param BaseElementModel $element * @param string $attribute * * @return mixed|null|string */ public function getTableAttributeHtml(BaseElementModel $element, $attribute) { // First give plugins a chance to set this $pluginAttributeHtml = craft()->plugins->callFirst('getEntryTableAttributeHtml', array($element, $attribute), true); if ($pluginAttributeHtml !== null) { return $pluginAttributeHtml; } switch ($attribute) { case 'author': $author = $element->getAuthor(); if ($author) { return craft()->templates->render('_elements/element', array('element' => $author)); } else { return ''; } case 'section': $section = $element->getSection(); return $section ? Craft::t($section->name) : ''; case 'type': $entryType = $element->getType(); return $entryType ? Craft::t($entryType->name) : ''; default: return parent::getTableAttributeHtml($element, $attribute); } }