function formatDataForList($value, $handle, $entry_id)
 {
     $this->clickable = true;
     // make urls clickable
     $this->striphtml = true;
     // remove html tags as a security precaution
     $this->length = 100;
     // truncate to a maximum of 100 characters, and append ... on the end
     $value = strtoupper($value);
     // just as an example, we'll uppercase all text when displaying in a list
     return parent::formatDataForList($value);
     // always return the result of formatDataForList through the parent class (where the properties you set here are enforced)
 }
 function formatDataForList($value, $handle, $entry_id)
 {
     $this->clickable = true;
     // make urls clickable
     $this->striphtml = true;
     // remove html tags as a security precaution
     $this->length = 35;
     // truncate to a maximum of 100 characters, and append ... on the end
     return parent::formatDataForList($value);
     // always return the result of formatDataForList through the parent class (where the properties you set here are enforced)
 }
Example #3
0
 function formatDataForList($value, $handle, $entry_id)
 {
     $this->clickable = true;
     // make urls clickable
     $this->striphtml = true;
     // remove html tags as a security precaution
     $this->length = 100;
     // truncate to a maximum of 100 characters, and append ... on the end
     $timeParts = explode(":", $value);
     if ($timeParts[0] > 12) {
         $value = $timeParts[0] - 12 . ":" . $timeParts[1] . "PM";
     } elseif ($timeParts[0] == "00") {
         $value = "12:" . $timeParts[1] . "AM";
     } elseif ($value) {
         $value = $timeParts[0] . ":" . $timeParts[1] . "AM";
     }
     return parent::formatDataForList($value);
     // always return the result of formatDataForList through the parent class (where the properties you set here are enforced)
 }
 function formatDataForList($value, $handle, $entry_id)
 {
     return parent::formatDataForList($value);
 }
 function formatDataForList($value, $handle, $entry_id)
 {
     $this->clickable = false;
     // make urls clickable
     $this->striphtml = false;
     // remove html tags as a security precaution
     $this->length = 1000;
     // truncate to a maximum of 1000 characters, and append ... on the end
     $value = unserialize($value);
     // file upload elements have a serialized array as their data value, and there's not a lot we can do with that except unserialize it here.  Without putting a hook of some kind in the display function, we have no way of knowing when we should be unserializing the values that we are packaging up when the display function is called.
     $displayName = $this->getFileDisplayName($value['name']);
     $value = $value['isfile'] ? $this->createDownloadLink($this->get($handle), $entry_id, $value['name'], $displayName) : $value['name'];
     return parent::formatDataForList($value);
     // always return the result of formatDataForList through the parent class (where the properties you set here are enforced)
 }