Esempio n. 1
0
 /**
  * Get the value of the form element formatted in HTML
  *
  * @param string $separator The separator to join array types
  * @return string
  */
 public function getValueHtml($separator = '<br />')
 {
     $filteredValue = $this->getValue();
     $value = '';
     if (is_scalar($filteredValue)) {
         $value = nl2br(Quform::escape($filteredValue));
     } else {
         if (is_array($filteredValue)) {
             foreach ($filteredValue as $val) {
                 if (is_scalar($val)) {
                     $value .= nl2br(Quform::escape($val)) . $separator;
                 }
             }
         }
     }
     return $value;
 }
 /**
  * Get the formatted value
  *
  * The value can be formatted into HTML or plain text, arrays
  * are joined by $separator
  *
  * @param string $format plain or html
  * @param string $separator
  */
 public function getFormattedValue($format = 'plain', $separator = ', ')
 {
     $filteredValue = $this->getValue();
     $value = '';
     if ($format == 'html') {
         if (is_scalar($filteredValue)) {
             $value = nl2br(Quform::escape($filteredValue));
         } else {
             if (is_array($filteredValue)) {
                 foreach ($filteredValue as $val) {
                     if (is_scalar($val)) {
                         $value .= nl2br(Quform::escape($val)) . $separator;
                     }
                 }
             }
         }
     } else {
         if (is_scalar($filteredValue)) {
             $value = (string) $filteredValue;
         } else {
             if (is_array($filteredValue)) {
                 foreach ($filteredValue as $val) {
                     if (is_scalar($val)) {
                         $value .= (string) $val . $separator;
                     }
                 }
             }
         }
     }
     return $value;
 }
Esempio n. 3
0
        if (count($result['elementErrors'])) {
            ?>
                            <div class="quform-errors-outer quform-cf">
                                <?php 
            foreach ($result['elementErrors'] as $name => $info) {
                ?>
                                    <?php 
                if (count($info['errors'])) {
                    ?>
                                        <div class="quform-error-wrap quform-cf">
                                            <div class="quform-error-label"><?php 
                    echo Quform::escape($info['label']);
                    ?>
</div>
                                            <div class="quform-errors quform-cf"><div class="quform-error"><?php 
                    echo Quform::escape($info['errors'][0]);
                    ?>
</div></div>
                                        </div>
                                    <?php 
                }
                ?>
                                <?php 
            }
            ?>
                            </div>
                        <?php 
        }
        ?>
                    <?php 
    } elseif ($result['type'] == 'success') {
                            </tr>
                        <?php 
    }
    ?>
                    <?php 
}
?>
                    <?php 
if (isset($config['extra']) && is_array($config['extra']) && count($config['extra'])) {
    ?>
                        <?php 
    foreach ($config['extra'] as $key => $value) {
        ?>
                            <tr>
                                <td valign="top" style="font-family: Helvetica, Arial, sans-serif; font-size: 17px; font-weight: bold; color: #282828; width: 25%;"><?php 
        echo Quform::escape($key);
        ?>
</td>
                                <td valign="top" style="font-family: Helvetica, Arial, sans-serif; color: #282828; line-height: 130%; width: 75%;"><?php 
        echo $value;
        ?>
</td>
                            </tr>
                        <?php 
    }
    ?>
                    <?php 
}
?>
                </table>
                </td>
<?php

if (!defined('QUFORM_ROOT')) {
    exit;
}
?>
<html>
<body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
    <tr>
        <td valign="top" style="padding: 25px;"><table width="600" cellpadding="0" cellspacing="0" border="0" style="font: 14px Helvetica, Arial, sans-serif;">
            <tr>
                <td valign="top" style="font-family: Helvetica, Arial, sans-serif; font-size: 25px; font-weight: bold; color: #282828; padding-bottom: 10px;"><?php 
echo Quform::escape($mailer->Subject);
?>
</td>
            </tr>
            <tr>
                <td valign="top">Just to let you know we received your message and we will get back to you as soon as possible.</td>
            </tr>
        </table></td>
    </tr>
</table>
</body>
</html>