From: Anthony Talarico Date: Thu, 26 May 2016 12:54:08 +0000 (-0400) Subject: added conditional to show message if no lists are found X-Git-Tag: v1.0.1^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=f65b21035bcf4d70ed8fbf9e4a60227d46f93ec0;p=WP-Plugins%2Fglm-gravityform-streamsend.git added conditional to show message if no lists are found --- diff --git a/class-streamsendfeedaddon.php b/class-streamsendfeedaddon.php index 75adfc6..464726c 100644 --- a/class-streamsendfeedaddon.php +++ b/class-streamsendfeedaddon.php @@ -115,6 +115,34 @@ class GFStreamSendAddOn extends GFFeedAddOn } array_unshift($lists,array('label'=>'Select a List', 'value'=>'')); + if(!empty($lists)){ + $listArray = array( + 'label' => 'Lists', + 'type' => 'select', + 'name' => 'lists', + 'tooltip' => 'Select a list to add the contact', + 'choices' => $lists + ); + } else { + $listArray = array( + 'label' => 'Lists', + 'type' => 'text', + 'name' => 'noLists', + 'value' => 'No lists detected' + ); + } + ?> + + 'StreamSend Form Settings', @@ -127,14 +155,7 @@ class GFStreamSendAddOn extends GFFeedAddOn 'tooltip' => esc_html__( 'Just a name', 'StreamSend' ), 'class' => 'small', ), - array( - 'label' => 'Lists', - 'type' => 'select', - 'name' => 'lists', - 'tooltip' => 'Select a list to add the contact', - 'choices' => $lists - - ), + $listArray, array( 'label' => 'Enable Opt-In', 'type' => 'checkbox',