@@ -4,7 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | var $name = 'checkbox'; |
| 6 | 6 | |
| 7 | - var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains'); |
|
| 7 | + var $search_operators = array('is', 'in', 'not in', 'isnot', 'contains'); |
|
| 8 | 8 | |
| 9 | 9 | var $_gf_field_class_name = 'GF_Field_Checkbox'; |
| 10 | 10 | |
@@ -5,17 +5,17 @@ discard block |
||
| 5 | 5 | /* @var GravityView_Field[] */ |
| 6 | 6 | private static $_fields = array(); |
| 7 | 7 | |
| 8 | - public static function register( $field ) { |
|
| 9 | - if ( ! is_subclass_of( $field, 'GravityView_Field' ) ) { |
|
| 10 | - throw new Exception( 'Must be a subclass of GravityView_Field' ); |
|
| 8 | + public static function register($field) { |
|
| 9 | + if (!is_subclass_of($field, 'GravityView_Field')) { |
|
| 10 | + throw new Exception('Must be a subclass of GravityView_Field'); |
|
| 11 | 11 | } |
| 12 | - if ( empty( $field->type ) ) { |
|
| 13 | - throw new Exception( 'The type must be set' ); |
|
| 12 | + if (empty($field->type)) { |
|
| 13 | + throw new Exception('The type must be set'); |
|
| 14 | 14 | } |
| 15 | - if ( isset( self::$_fields[ $field->type ] ) ) { |
|
| 16 | - throw new Exception( 'Field type already registered: ' . $field->type ); |
|
| 15 | + if (isset(self::$_fields[$field->type])) { |
|
| 16 | + throw new Exception('Field type already registered: '.$field->type); |
|
| 17 | 17 | } |
| 18 | - self::$_fields[ $field->type ] = $field; |
|
| 18 | + self::$_fields[$field->type] = $field; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | /** |
@@ -23,15 +23,15 @@ discard block |
||
| 23 | 23 | * |
| 24 | 24 | * @return GravityView_Field | bool |
| 25 | 25 | */ |
| 26 | - public static function create( $properties ) { |
|
| 26 | + public static function create($properties) { |
|
| 27 | 27 | $type = isset($properties['type']) ? $properties['type'] : ''; |
| 28 | - $type = empty( $properties['inputType'] ) ? $type : $properties['inputType']; |
|
| 29 | - if ( empty($type) || ! isset( self::$_fields[ $type ] ) ) { |
|
| 30 | - return new GravityView_Field( $properties ); |
|
| 28 | + $type = empty($properties['inputType']) ? $type : $properties['inputType']; |
|
| 29 | + if (empty($type) || !isset(self::$_fields[$type])) { |
|
| 30 | + return new GravityView_Field($properties); |
|
| 31 | 31 | } |
| 32 | - $class = self::$_fields[ $type ]; |
|
| 33 | - $class_name = get_class( $class ); |
|
| 34 | - $field = new $class_name( $properties ); |
|
| 32 | + $class = self::$_fields[$type]; |
|
| 33 | + $class_name = get_class($class); |
|
| 34 | + $field = new $class_name($properties); |
|
| 35 | 35 | |
| 36 | 36 | return $field; |
| 37 | 37 | |
@@ -4,18 +4,18 @@ |
||
| 4 | 4 | |
| 5 | 5 | var $name = 'created_by'; |
| 6 | 6 | |
| 7 | - var $search_operators = array( 'is', 'isnot' ); |
|
| 7 | + var $search_operators = array('is', 'isnot'); |
|
| 8 | 8 | |
| 9 | - function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
|
| 9 | + function field_options($field_options, $template_id, $field_id, $context, $input_type) { |
|
| 10 | 10 | |
| 11 | - if( 'edit' === $context ) { |
|
| 11 | + if ('edit' === $context) { |
|
| 12 | 12 | return $field_options; |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | $field_options['name_display'] = array( |
| 16 | 16 | 'type' => 'select', |
| 17 | - 'label' => __( 'User Format', 'gravityview' ), |
|
| 18 | - 'desc' => __( 'How should the User information be displayed?', 'gravityview'), |
|
| 17 | + 'label' => __('User Format', 'gravityview'), |
|
| 18 | + 'desc' => __('How should the User information be displayed?', 'gravityview'), |
|
| 19 | 19 | 'choices' => array( |
| 20 | 20 | 'display_name' => __('Display Name (Example: "Ellen Ripley")', 'gravityview'), |
| 21 | 21 | 'user_login' => __('Username (Example: "nostromo")', 'gravityview'), |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | var $name = 'custom'; |
| 10 | 10 | |
| 11 | - var $contexts = array( 'single', 'multiple', 'edit' ); |
|
| 11 | + var $contexts = array('single', 'multiple', 'edit'); |
|
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | 14 | * @var bool |
@@ -22,19 +22,19 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | var $is_searchable = false; |
| 24 | 24 | |
| 25 | - function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
|
| 25 | + function field_options($field_options, $template_id, $field_id, $context, $input_type) { |
|
| 26 | 26 | |
| 27 | - unset ( $field_options['search_filter'], $field_options['show_as_link'] ); |
|
| 27 | + unset ($field_options['search_filter'], $field_options['show_as_link']); |
|
| 28 | 28 | |
| 29 | - if( 'edit' === $context ) { |
|
| 29 | + if ('edit' === $context) { |
|
| 30 | 30 | return $field_options; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | $new_fields = array( |
| 34 | 34 | 'content' => array( |
| 35 | 35 | 'type' => 'textarea', |
| 36 | - 'label' => __( 'Custom Content', 'gravityview' ), |
|
| 37 | - 'desc' => sprintf( __( 'Enter text or HTML. Also supports shortcodes. You can show or hide data using the %s shortcode (%slearn more%s).', 'gravityview' ), '<code>[gvlogic]</code>', '<a href="http://docs.gravityview.co/article/252-gvlogic-shortcode">', '</a>' ), |
|
| 36 | + 'label' => __('Custom Content', 'gravityview'), |
|
| 37 | + 'desc' => sprintf(__('Enter text or HTML. Also supports shortcodes. You can show or hide data using the %s shortcode (%slearn more%s).', 'gravityview'), '<code>[gvlogic]</code>', '<a href="http://docs.gravityview.co/article/252-gvlogic-shortcode">', '</a>'), |
|
| 38 | 38 | 'value' => '', |
| 39 | 39 | 'class' => 'code', |
| 40 | 40 | 'merge_tags' => 'force', |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | ), |
| 43 | 43 | 'wpautop' => array( |
| 44 | 44 | 'type' => 'checkbox', |
| 45 | - 'label' => __( 'Automatically add paragraphs to content', 'gravityview' ), |
|
| 46 | - 'tooltip' => __( 'Wrap each block of text in an HTML paragraph tag (recommended for text).', 'gravityview' ), |
|
| 45 | + 'label' => __('Automatically add paragraphs to content', 'gravityview'), |
|
| 46 | + 'tooltip' => __('Wrap each block of text in an HTML paragraph tag (recommended for text).', 'gravityview'), |
|
| 47 | 47 | 'value' => '', |
| 48 | 48 | ), |
| 49 | 49 | ); |
@@ -7,16 +7,16 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | var $name = 'email'; |
| 9 | 9 | |
| 10 | - var $search_operators = array( 'is', 'isnot', 'contains', 'starts_with', 'ends_with' ); |
|
| 10 | + var $search_operators = array('is', 'isnot', 'contains', 'starts_with', 'ends_with'); |
|
| 11 | 11 | |
| 12 | 12 | var $_gf_field_class_name = 'GF_Field_Email'; |
| 13 | 13 | |
| 14 | - function field_options( $field_options, $template_id = '', $field_id = '', $context = '', $input_type = '' ) { |
|
| 14 | + function field_options($field_options, $template_id = '', $field_id = '', $context = '', $input_type = '') { |
|
| 15 | 15 | |
| 16 | 16 | // It makes no sense to use this as the link. |
| 17 | - unset( $field_options['show_as_link'] ); |
|
| 17 | + unset($field_options['show_as_link']); |
|
| 18 | 18 | |
| 19 | - if( 'edit' === $context ) { |
|
| 19 | + if ('edit' === $context) { |
|
| 20 | 20 | return $field_options; |
| 21 | 21 | } |
| 22 | 22 | |
@@ -24,29 +24,29 @@ discard block |
||
| 24 | 24 | 'emailmailto' => array( |
| 25 | 25 | 'type' => 'checkbox', |
| 26 | 26 | 'value' => true, |
| 27 | - 'label' => __( 'Link the Email Address', 'gravityview' ), |
|
| 28 | - 'desc' => __( 'Clicking the link will generate a new email.', 'gravityview' ), |
|
| 27 | + 'label' => __('Link the Email Address', 'gravityview'), |
|
| 28 | + 'desc' => __('Clicking the link will generate a new email.', 'gravityview'), |
|
| 29 | 29 | ), |
| 30 | 30 | 'emailsubject' => array( |
| 31 | 31 | 'type' => 'text', |
| 32 | - 'label' => __( 'Email Subject', 'gravityview' ), |
|
| 32 | + 'label' => __('Email Subject', 'gravityview'), |
|
| 33 | 33 | 'value' => '', |
| 34 | - 'desc' => __( 'Set the default email subject line.', 'gravityview' ), |
|
| 34 | + 'desc' => __('Set the default email subject line.', 'gravityview'), |
|
| 35 | 35 | 'merge_tags' => 'force', |
| 36 | 36 | ), |
| 37 | 37 | 'emailbody' => array( |
| 38 | 38 | 'type' => 'textarea', |
| 39 | - 'label' => __( 'Email Body', 'gravityview' ), |
|
| 39 | + 'label' => __('Email Body', 'gravityview'), |
|
| 40 | 40 | 'value' => '', |
| 41 | - 'desc' => __( 'Set the default email content.', 'gravityview' ), |
|
| 41 | + 'desc' => __('Set the default email content.', 'gravityview'), |
|
| 42 | 42 | 'merge_tags' => 'force', |
| 43 | 43 | 'class' => 'widefat', |
| 44 | 44 | ), |
| 45 | 45 | 'emailencrypt' => array( |
| 46 | 46 | 'type' => 'checkbox', |
| 47 | 47 | 'value' => true, |
| 48 | - 'label' => __( 'Encrypt Email Address', 'gravityview' ), |
|
| 49 | - 'desc' => __( 'Make it harder for spammers to get email addresses from your entries. Email addresses will not be visible with Javascript disabled.', 'gravityview' ) |
|
| 48 | + 'label' => __('Encrypt Email Address', 'gravityview'), |
|
| 49 | + 'desc' => __('Make it harder for spammers to get email addresses from your entries. Email addresses will not be visible with Javascript disabled.', 'gravityview') |
|
| 50 | 50 | ) |
| 51 | 51 | ); |
| 52 | 52 | |
@@ -7,15 +7,15 @@ |
||
| 7 | 7 | |
| 8 | 8 | var $name = 'date_created'; |
| 9 | 9 | |
| 10 | - var $search_operators = array( 'less_than', 'greater_than', 'is', 'isnot' ); |
|
| 10 | + var $search_operators = array('less_than', 'greater_than', 'is', 'isnot'); |
|
| 11 | 11 | |
| 12 | - function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
|
| 12 | + function field_options($field_options, $template_id, $field_id, $context, $input_type) { |
|
| 13 | 13 | |
| 14 | - if( 'edit' === $context ) { |
|
| 14 | + if ('edit' === $context) { |
|
| 15 | 15 | return $field_options; |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | - $this->add_field_support('date_display', $field_options ); |
|
| 18 | + $this->add_field_support('date_display', $field_options); |
|
| 19 | 19 | |
| 20 | 20 | return $field_options; |
| 21 | 21 | } |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | var $name = 'entry_link'; |
| 9 | 9 | |
| 10 | - var $contexts = array( 'multiple' ); |
|
| 10 | + var $contexts = array('multiple'); |
|
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * @var bool |
@@ -22,24 +22,24 @@ discard block |
||
| 22 | 22 | var $is_searchable = false; |
| 23 | 23 | |
| 24 | 24 | public function __construct() { |
| 25 | - $this->label = esc_attr__( 'Link to Entry', 'gravityview' ); |
|
| 25 | + $this->label = esc_attr__('Link to Entry', 'gravityview'); |
|
| 26 | 26 | $this->description = __('A dedicated link to the single entry with customizable text.', 'gravityview'); |
| 27 | 27 | parent::__construct(); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
|
| 30 | + function field_options($field_options, $template_id, $field_id, $context, $input_type) { |
|
| 31 | 31 | |
| 32 | 32 | // Always a link! |
| 33 | - unset( $field_options['show_as_link'], $field_options['search_filter'] ); |
|
| 33 | + unset($field_options['show_as_link'], $field_options['search_filter']); |
|
| 34 | 34 | |
| 35 | - if( 'edit' === $context ) { |
|
| 35 | + if ('edit' === $context) { |
|
| 36 | 36 | return $field_options; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | $add_options = array(); |
| 40 | 40 | $add_options['entry_link_text'] = array( |
| 41 | 41 | 'type' => 'text', |
| 42 | - 'label' => __( 'Link Text:', 'gravityview' ), |
|
| 42 | + 'label' => __('Link Text:', 'gravityview'), |
|
| 43 | 43 | 'desc' => NULL, |
| 44 | 44 | 'value' => __('View Details', 'gravityview'), |
| 45 | 45 | 'merge_tags' => true, |
@@ -16,21 +16,21 @@ discard block |
||
| 16 | 16 | var $label = 'File Upload'; |
| 17 | 17 | |
| 18 | 18 | public function __construct() { |
| 19 | - $this->label = esc_attr__( 'File Upload', 'gravityview' ); |
|
| 19 | + $this->label = esc_attr__('File Upload', 'gravityview'); |
|
| 20 | 20 | parent::__construct(); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
|
| 23 | + function field_options($field_options, $template_id, $field_id, $context, $input_type) { |
|
| 24 | 24 | |
| 25 | - unset( $field_options['search_filter'] ); |
|
| 25 | + unset($field_options['search_filter']); |
|
| 26 | 26 | |
| 27 | - if( 'edit' === $context ) { |
|
| 27 | + if ('edit' === $context) { |
|
| 28 | 28 | return $field_options; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | $add_options['link_to_file'] = array( |
| 32 | 32 | 'type' => 'checkbox', |
| 33 | - 'label' => __( 'Display as a Link:', 'gravityview' ), |
|
| 33 | + 'label' => __('Display as a Link:', 'gravityview'), |
|
| 34 | 34 | 'desc' => __('Display the uploaded files as links, rather than embedded content.', 'gravityview'), |
| 35 | 35 | 'value' => false, |
| 36 | 36 | 'merge_tags' => false, |
@@ -52,28 +52,28 @@ discard block |
||
| 52 | 52 | * @param string $gv_class Field class to add to the output HTML |
| 53 | 53 | * @return array Array of file output, with `file_path` and `html` keys (see comments above) |
| 54 | 54 | */ |
| 55 | - static function get_files_array( $value, $gv_class ) { |
|
| 55 | + static function get_files_array($value, $gv_class) { |
|
| 56 | 56 | |
| 57 | 57 | $gravityview_view = GravityView_View::getInstance(); |
| 58 | 58 | |
| 59 | - extract( $gravityview_view->getCurrentField() ); |
|
| 59 | + extract($gravityview_view->getCurrentField()); |
|
| 60 | 60 | |
| 61 | 61 | $output_arr = array(); |
| 62 | 62 | |
| 63 | 63 | // Get an array of file paths for the field. |
| 64 | - $file_paths = rgar( $field , 'multipleFiles' ) ? json_decode( $value ) : array( $value ); |
|
| 64 | + $file_paths = rgar($field, 'multipleFiles') ? json_decode($value) : array($value); |
|
| 65 | 65 | |
| 66 | 66 | // Process each file path |
| 67 | - foreach( $file_paths as $file_path ) { |
|
| 67 | + foreach ($file_paths as $file_path) { |
|
| 68 | 68 | |
| 69 | 69 | // If the site is HTTPS, use HTTPS |
| 70 | - if(function_exists('set_url_scheme')) { $file_path = set_url_scheme($file_path); } |
|
| 70 | + if (function_exists('set_url_scheme')) { $file_path = set_url_scheme($file_path); } |
|
| 71 | 71 | |
| 72 | 72 | // This is from Gravity Forms's code |
| 73 | 73 | $file_path = esc_attr(str_replace(" ", "%20", $file_path)); |
| 74 | 74 | |
| 75 | 75 | // If the field is set to link to the single entry, link to it. |
| 76 | - $link = !empty( $field_settings['show_as_link'] ) ? GravityView_API::entry_link( $entry, $field ) : $file_path; |
|
| 76 | + $link = !empty($field_settings['show_as_link']) ? GravityView_API::entry_link($entry, $field) : $file_path; |
|
| 77 | 77 | |
| 78 | 78 | // Get file path information |
| 79 | 79 | $file_path_info = pathinfo($file_path); |
@@ -95,20 +95,20 @@ discard block |
||
| 95 | 95 | $content = $image->html(); |
| 96 | 96 | |
| 97 | 97 | // The new default content is the image, if it exists. If not, use the file name as the content. |
| 98 | - $content = !empty( $content ) ? $content : $file_path_info['basename']; |
|
| 98 | + $content = !empty($content) ? $content : $file_path_info['basename']; |
|
| 99 | 99 | |
| 100 | 100 | // If pathinfo() gave us the extension of the file, run the switch statement using that. |
| 101 | - $extension = empty( $file_path_info['extension'] ) ? NULL : strtolower( $file_path_info['extension'] ); |
|
| 101 | + $extension = empty($file_path_info['extension']) ? NULL : strtolower($file_path_info['extension']); |
|
| 102 | 102 | |
| 103 | 103 | |
| 104 | - switch( true ) { |
|
| 104 | + switch (true) { |
|
| 105 | 105 | |
| 106 | 106 | // Audio file |
| 107 | - case in_array( $extension, wp_get_audio_extensions() ): |
|
| 107 | + case in_array($extension, wp_get_audio_extensions()): |
|
| 108 | 108 | |
| 109 | 109 | $disable_lightbox = true; |
| 110 | 110 | |
| 111 | - if( shortcode_exists( 'audio' ) ) { |
|
| 111 | + if (shortcode_exists('audio')) { |
|
| 112 | 112 | |
| 113 | 113 | $disable_wrapped_link = true; |
| 114 | 114 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | * @since 1.2 |
| 118 | 118 | * @param array $audio_settings Array with `src` and `class` keys |
| 119 | 119 | */ |
| 120 | - $audio_settings = apply_filters( 'gravityview_audio_settings', array( |
|
| 120 | + $audio_settings = apply_filters('gravityview_audio_settings', array( |
|
| 121 | 121 | 'src' => $file_path, |
| 122 | 122 | 'class' => 'wp-audio-shortcode gv-audio gv-field-id-'.$field_settings['id'] |
| 123 | 123 | )); |
@@ -127,18 +127,18 @@ discard block |
||
| 127 | 127 | * @see http://codex.wordpress.org/Audio_Shortcode |
| 128 | 128 | * @see https://developer.wordpress.org/reference/functions/wp_audio_shortcode/ |
| 129 | 129 | */ |
| 130 | - $content = wp_audio_shortcode( $audio_settings ); |
|
| 130 | + $content = wp_audio_shortcode($audio_settings); |
|
| 131 | 131 | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | break; |
| 135 | 135 | |
| 136 | 136 | // Video file |
| 137 | - case in_array( $extension, wp_get_video_extensions() ): |
|
| 137 | + case in_array($extension, wp_get_video_extensions()): |
|
| 138 | 138 | |
| 139 | 139 | $disable_lightbox = true; |
| 140 | 140 | |
| 141 | - if( shortcode_exists( 'video' ) ) { |
|
| 141 | + if (shortcode_exists('video')) { |
|
| 142 | 142 | |
| 143 | 143 | $disable_wrapped_link = true; |
| 144 | 144 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | * @since 1.2 |
| 148 | 148 | * @param array $video_settings Array with `src` and `class` keys |
| 149 | 149 | */ |
| 150 | - $video_settings = apply_filters( 'gravityview_video_settings', array( |
|
| 150 | + $video_settings = apply_filters('gravityview_video_settings', array( |
|
| 151 | 151 | 'src' => $file_path, |
| 152 | 152 | 'class' => 'wp-video-shortcode gv-video gv-field-id-'.$field_settings['id'] |
| 153 | 153 | )); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * @see http://codex.wordpress.org/Video_Shortcode |
| 158 | 158 | * @see https://developer.wordpress.org/reference/functions/wp_video_shortcode/ |
| 159 | 159 | */ |
| 160 | - $content = wp_video_shortcode( $video_settings ); |
|
| 160 | + $content = wp_video_shortcode($video_settings); |
|
| 161 | 161 | |
| 162 | 162 | } |
| 163 | 163 | |
@@ -167,12 +167,12 @@ discard block |
||
| 167 | 167 | case $extension === 'pdf': |
| 168 | 168 | |
| 169 | 169 | // PDF needs to be displayed in an IFRAME |
| 170 | - $link = add_query_arg( array( 'TB_iframe' => 'true' ), $link ); |
|
| 170 | + $link = add_query_arg(array('TB_iframe' => 'true'), $link); |
|
| 171 | 171 | |
| 172 | 172 | break; |
| 173 | 173 | |
| 174 | 174 | // if not image, do not set the lightbox (@since 1.5.3) |
| 175 | - case !in_array( $extension, array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' ) ): |
|
| 175 | + case !in_array($extension, array('jpg', 'jpeg', 'jpe', 'gif', 'png')): |
|
| 176 | 176 | |
| 177 | 177 | $disable_lightbox = true; |
| 178 | 178 | |
@@ -182,10 +182,10 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | // If using Link to File, override the content. |
| 184 | 184 | // (We do this here so that the $disable_lightbox can be set. Yes, there's a little more processing time, but oh well.) |
| 185 | - if( !empty( $field_settings['link_to_file'] ) ) { |
|
| 185 | + if (!empty($field_settings['link_to_file'])) { |
|
| 186 | 186 | |
| 187 | 187 | // Force the content to be the file name |
| 188 | - $content = $file_path_info["basename"]; |
|
| 188 | + $content = $file_path_info["basename"]; |
|
| 189 | 189 | |
| 190 | 190 | // Restore the wrapped link |
| 191 | 191 | $disable_wrapped_link = false; |
@@ -193,14 +193,14 @@ discard block |
||
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | // Whether to use lightbox or not |
| 196 | - if( $disable_lightbox || empty( $gravityview_view->atts['lightbox'] ) || !empty( $field_settings['show_as_link'] ) ) { |
|
| 196 | + if ($disable_lightbox || empty($gravityview_view->atts['lightbox']) || !empty($field_settings['show_as_link'])) { |
|
| 197 | 197 | |
| 198 | - $link_atts = empty( $field_settings['show_as_link'] ) ? array( 'target' => '_blank' ) : array(); |
|
| 198 | + $link_atts = empty($field_settings['show_as_link']) ? array('target' => '_blank') : array(); |
|
| 199 | 199 | |
| 200 | 200 | } else { |
| 201 | 201 | |
| 202 | 202 | $link_atts = array( |
| 203 | - 'rel' => sprintf( "%s-%s", $gv_class, $entry['id'] ), |
|
| 203 | + 'rel' => sprintf("%s-%s", $gv_class, $entry['id']), |
|
| 204 | 204 | 'target' => '_blank', |
| 205 | 205 | 'class' => 'thickbox', |
| 206 | 206 | ); |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | * @param array|string $link_atts Array or attributes string |
| 213 | 213 | * @param array $field Current GravityView field array |
| 214 | 214 | */ |
| 215 | - $link_atts = apply_filters( 'gravityview/fields/fileupload/link_atts', $link_atts, $gravityview_view->getCurrentField() ); |
|
| 215 | + $link_atts = apply_filters('gravityview/fields/fileupload/link_atts', $link_atts, $gravityview_view->getCurrentField()); |
|
| 216 | 216 | |
| 217 | 217 | /** |
| 218 | 218 | * @filter `gravityview/fields/fileupload/disable_link` Filter to alter the default behaviour of wrapping images (or image names) with a link to the content object |
@@ -221,10 +221,10 @@ discard block |
||
| 221 | 221 | * @param array $gravityview_view->field_data |
| 222 | 222 | * @see GravityView_API:field_value() for info about $gravityview_view->field_data |
| 223 | 223 | */ |
| 224 | - $disable_wrapped_link = apply_filters( 'gravityview/fields/fileupload/disable_link', $disable_wrapped_link, $gravityview_view->getCurrentField() ); |
|
| 224 | + $disable_wrapped_link = apply_filters('gravityview/fields/fileupload/disable_link', $disable_wrapped_link, $gravityview_view->getCurrentField()); |
|
| 225 | 225 | |
| 226 | 226 | // If the HTML output hasn't been overridden by the switch statement above, use the default format |
| 227 | - if( !empty( $content ) && empty( $disable_wrapped_link ) ) { |
|
| 227 | + if (!empty($content) && empty($disable_wrapped_link)) { |
|
| 228 | 228 | |
| 229 | 229 | /** |
| 230 | 230 | * Modify the link text (defaults to the file name) |
@@ -234,9 +234,9 @@ discard block |
||
| 234 | 234 | * @param string $content The existing anchor content. Could be `<img>` tag, audio/video embed or the file name |
| 235 | 235 | * @param array $field GravityView array of the current field being processed |
| 236 | 236 | */ |
| 237 | - $content = apply_filters( 'gravityview/fields/fileupload/link_content', $content, $gravityview_view->getCurrentField() ); |
|
| 237 | + $content = apply_filters('gravityview/fields/fileupload/link_content', $content, $gravityview_view->getCurrentField()); |
|
| 238 | 238 | |
| 239 | - $content = gravityview_get_link( $link, $content, $link_atts ); |
|
| 239 | + $content = gravityview_get_link($link, $content, $link_atts); |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | $output_arr[] = array( |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | * @type string $content The generated output for the file \n |
| 255 | 255 | * @param array $field GravityView array of the current field being processed |
| 256 | 256 | */ |
| 257 | - $output_arr = apply_filters( 'gravityview/fields/fileupload/files_array', $output_arr, $gravityview_view->getCurrentField() ); |
|
| 257 | + $output_arr = apply_filters('gravityview/fields/fileupload/files_array', $output_arr, $gravityview_view->getCurrentField()); |
|
| 258 | 258 | |
| 259 | 259 | return $output_arr; |
| 260 | 260 | } |
@@ -10,20 +10,20 @@ |
||
| 10 | 10 | var $label = 'Quiz Score'; |
| 11 | 11 | |
| 12 | 12 | public function __construct() { |
| 13 | - $this->label = esc_attr__( 'Quiz Score', 'gravityview' ); |
|
| 13 | + $this->label = esc_attr__('Quiz Score', 'gravityview'); |
|
| 14 | 14 | parent::__construct(); |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | - function field_options( $field_options, $template_id, $field_id, $context, $input_type ) { |
|
| 17 | + function field_options($field_options, $template_id, $field_id, $context, $input_type) { |
|
| 18 | 18 | |
| 19 | - if( 'edit' === $context ) { |
|
| 19 | + if ('edit' === $context) { |
|
| 20 | 20 | return $field_options; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | $new_fields = array( |
| 24 | 24 | 'quiz_use_max_score' => array( |
| 25 | 25 | 'type' => 'checkbox', |
| 26 | - 'label' => __( 'Show Max Score?', 'gravityview' ), |
|
| 26 | + 'label' => __('Show Max Score?', 'gravityview'), |
|
| 27 | 27 | 'desc' => __('Display score as the a fraction: "[score]/[max score]". If unchecked, will display score.', 'gravityview'), |
| 28 | 28 | 'value' => true, |
| 29 | 29 | 'merge_tags' => false, |