Skip to content

Commit

Permalink
Added test if all contents of multifield are empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
johndwells committed Aug 7, 2012
1 parent d4dd543 commit 2094ce0
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -382,7 +382,10 @@ function replace_tag($multifielddata, $params=array(), $tagdata=FALSE) {


// Merge in the labels // Merge in the labels
$fieldoutputdata = array(); $fieldoutputdata = array();
$is_empty_test = '';
foreach($multifielddata as $key=>$row) { foreach($multifielddata as $key=>$row) {

$is_empty_test .= trim($row);
if(isset($fieldsettings[$key])) { // checks that key still exists in settings if(isset($fieldsettings[$key])) { // checks that key still exists in settings
if('textarea' == $fieldsettings[$key]['type']) { // if it's a textarea, run it through the typography class if('textarea' == $fieldsettings[$key]['type']) { // if it's a textarea, run it through the typography class
$fieldoutputdata[$key] = $this->EE->typography->auto_typography($row,TRUE); $fieldoutputdata[$key] = $this->EE->typography->auto_typography($row,TRUE);
Expand All @@ -396,6 +399,9 @@ function replace_tag($multifielddata, $params=array(), $tagdata=FALSE) {
$fieldoutputdata[$ktype] = $fieldsettings[$key]['type']; $fieldoutputdata[$ktype] = $fieldsettings[$key]['type'];
} }
} }

// quick is empty test
if($is_empty_test == '') return '';


// Parse the tag // Parse the tag
if (!$tagdata) { // Single tag if (!$tagdata) { // Single tag
Expand Down

0 comments on commit 2094ce0

Please sign in to comment.