private static function generate_html($atts) { /* * If we are only showing this to the user, and the user isn't logged in then display nothing */ if ($atts['show'] == 'user') { $user_id = get_current_user_id(); if ($user_id === 0) { /* * TODO: Log the error and return nothing */ return ''; } } /* * If the form_id isn't passed when don't show anything */ if (!$atts['form_id']) { /* * TODO: Log the error and return nothing */ return ''; } /* * Set our form object */ if (self::set_form_object($atts['form_id']) !== true) { return ''; } $html = ''; /* * Check if we have a message to display to the user */ if (strlen(self::$error) > 0) { /* * If font awesome is installed on the theme we will use it to enhance our message */ $html .= '<div class="gfpdfe_pdf_error"><i class="fa fa-2x icon-2x fa-info-circle icon-info-circle icon-info-sign"></i> ' . self::$error . '</div>'; self::$error = ''; } if (strlen(self::$message) > 0) { /* * If font awesome is installed on the theme we will use it to enhance our message */ $html .= '<div class="gfpdfe_pdf_message"><i class="fa fa-2x icon-2x fa-info-circle icon-info-circle icon-info-sign"></i> ' . self::$message . '</div>'; self::$message = ''; } /* * Build our SQL query */ $leads = GFPDFEWidgetsAndShortcode_Shortcode::build_sql($atts); if (sizeof($leads) > 0) { /* * Build our columns */ $html .= '<table class="gfpdfe_pdf_display">'; $html .= self::build_columns($atts); $html .= self::build_rows($leads, $atts); $html .= '</table>'; return $html; } /* * If we reach this stage the array is empty, so return our message */ return '<p>' . $atts['empty'] . '</p>'; }