public static function get_instance()
 {
     if (self::$_instance == null) {
         self::$_instance = new GFSignature();
     }
     return self::$_instance;
 }
function gf_signature()
{
    return GFSignature::get_instance();
}
Beispiel #3
0
 /**
  * Trigger hooks that are normally run in the admin for Addons, but need to be triggered manually because we're not in the admin
  * @return void
  */
 private function addon_specific_hooks()
 {
     if (class_exists('GFSignature') && is_callable(array('GFSignature', 'get_instance'))) {
         add_filter('gform_admin_pre_render', array(GFSignature::get_instance(), 'edit_lead_script'));
     }
 }
Beispiel #4
0
<?php

/**
 * Display the signature field type
 *
 * @package GravityView
 * @subpackage GravityView/templates/fields
 */
$gravityview_view = GravityView_View::getInstance();
extract($gravityview_view->getCurrentField());
// If empty, there's no signature to show
if (empty($value)) {
    return;
}
if (!class_exists('GFSignature')) {
    do_action('gravityview_log_error', '[fields/signature.php] GFSignature not loaded.');
    return;
}
$image_atts = array('src' => GFSignature::get_instance()->get_signature_url($value), 'width' => rgblank(rgget("boxWidth", $field)) ? '300' : rgar($field, "boxWidth"), 'height' => '180', 'validate_src' => false, 'alt' => '');
echo new GravityView_Image($image_atts);
Beispiel #5
0
function all_fields_extra_options($value, $merge_tag, $options, $field, $raw_value)
{
    if ($merge_tag != 'all_fields') {
        return $value;
    }
    // usage: {all_fields:include[ID],exclude[ID,ID]}
    $include = preg_match("/include\\[(.*?)\\]/", $options, $include_match);
    $include_array = explode(',', rgar($include_match, 1));
    $exclude = preg_match("/exclude\\[(.*?)\\]/", $options, $exclude_match);
    $exclude_array = explode(',', rgar($exclude_match, 1));
    $log = "all_fields_extra_options(): {$field['label']}({$field['id']} - {$field['type']}) - ";
    if ($include && in_array($field['id'], $include_array)) {
        switch ($field['type']) {
            case 'html':
                $value = $field['content'];
                break;
            case 'section':
                $value .= sprintf('<tr bgcolor="#FFFFFF">
                                                        <td width="20">&nbsp;</td>
                                                        <td>
                                                            <font style="font-family: sans-serif; font-size:12px;">%s</font>
                                                        </td>
                                                   </tr>
                                                   ', $field['description']);
                break;
            case 'signature':
                $url = GFSignature::get_signature_url($raw_value);
                $value = "<img alt='signature' src='{$url}'/>";
                break;
        }
        GFCommon::log_debug($log . 'included.');
    }
    if ($exclude && in_array($field['id'], $exclude_array)) {
        GFCommon::log_debug($log . 'excluded.');
        return false;
    }
    return $value;
}