public function defineTableAttributes($source = null)
{
$attributes = array('id' => 'ID');
if (null === $source) {
foreach (craft()->formerly_forms->getAllForms() as $form) {
foreach ($form->getQuestions() as $question) {
if ($question->type != Formerly_QuestionType::MultilineText && $question->type != Formerly_QuestionType::CustomList && $question->type != Formerly_QuestionType::Assets && $question->type != Formerly_QuestionType::Checkboxes) {
$attributes[$question->handle] = $form->name . '-' . $question->name;
}
}
}
} else {
$form = craft()->formerly_forms->getFormByHandle(substr($source, 9));
foreach ($form->getQuestions() as $question) {
if ($question->type != Formerly_QuestionType::MultilineText && $question->type != Formerly_QuestionType::CustomList && $question->type != Formerly_QuestionType::Assets && $question->type != Formerly_QuestionType::Checkboxes) {
$attributes[$question->handle] = $question->name;
}
if (count($attributes) >= 5) {
break;
}
}
}
$attributes['dateCreated'] = Craft::t('Date Created');
return $attributes;
}