diff --git a/admin/includes/tag-generator.php b/admin/includes/tag-generator.php index 92b07d7a..c433de04 100644 --- a/admin/includes/tag-generator.php +++ b/admin/includes/tag-generator.php @@ -1,5 +1,8 @@ '; @@ -75,6 +90,10 @@ public function print_buttons() { echo ''; } + + /** + * Renders form-tag generator dialog panels (hidden until called). + */ public function print_panels( WPCF7_ContactForm $contact_form ) { foreach ( (array) $this->panels as $id => $panel ) { $callback = $panel['callback']; @@ -120,14 +139,25 @@ public function print_panels( WPCF7_ContactForm $contact_form ) { } +/** + * Class helps to implement a form-tag generator content. + */ class WPCF7_TagGeneratorGenerator { private $key = ''; + + /** + * The constructor. + */ public function __construct( $key ) { $this->key = $key; } + + /** + * Returns a unique reference ID. + */ public function ref( $suffix = '' ) { $ref = sprintf( '%s-%s', $this->key, $suffix ); $ref = strtolower( $ref ); @@ -137,12 +167,20 @@ public function ref( $suffix = '' ) { return $ref; } + + /** + * Calls one of the template methods. + */ public function print( $part, $options = '' ) { if ( is_callable( array( $this, $part ) ) ) { call_user_func( array( $this, $part ), $options ); } } + + /** + * Template method for field type field. + */ private function field_type( $options = '' ) { $options = wp_parse_args( $options, array( 'with_required' => false, @@ -178,6 +216,10 @@ private function field_type( $options = '' ) { '', @@ -236,6 +278,10 @@ private function field_name( $options = '' ) {