[ Index ]

MailPress 7.1

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-includes/class/ -> MP_form_field_type_.class.php (source)

   1  <?php
   2  abstract class MP_form_field_type_
   3  {
   4      var $field  = null;
   5      var $prefix = MailPress_form::prefix;
   6  
   7  	function __construct( $desc )
   8      {
   9          $this->desc = $desc;
  10          $this->settings     = dirname( $this->file ) . '/settings.xml';
  11  
  12          add_filter( 'MailPress_form_field_types_register',                array( &$this, 'register' ),         8, 1 );
  13          add_filter( "MailPress_form_field_type_{$this->id}_have_file",        array( &$this, 'have_file' ),         8, 1 );
  14  
  15          add_filter( "MailPress_form_field_type_{$this->id}_submitted",        array( &$this, 'submitted' ),         8, 1 );
  16  
  17          add_filter( "MailPress_form_field_type_{$this->id}_get_tag",        array( &$this, 'get_tag' ),     8, 2 );
  18          add_filter( "MailPress_form_field_type_{$this->id}_get_id",        array( &$this, 'get_id' ),         8, 1 );
  19          add_filter( "MailPress_form_field_type_{$this->id}_get_name",        array( &$this, 'get_name' ),         8, 1 );
  20  
  21          add_action( "MailPress_form_field_type_{$this->id}_settings_form",    array( &$this, 'settings_form' ),8, 1 );
  22          add_filter( "MailPress_form_field_type_{$this->id}_settings_help",    array( &$this, 'settings_help' ),8, 2 );
  23      }
  24  
  25  	function register( $field_types )
  26      {
  27          $field_types[$this->id] = array( 'desc' => $this->desc, 'order' => $this->order );
  28          return $field_types;
  29      }
  30  
  31  	function have_file( $have_file )
  32      {
  33          return $have_file;
  34      }
  35  
  36  	function submitted( $field )
  37      {
  38          $this->field = $field;
  39  
  40          $value = $this->get_value();
  41  
  42          if ( !isset( $value ) ) return $this->field;
  43  
  44          $this->field->submitted['value'] = $value;
  45          $this->field->submitted['text']  = stripslashes( $value );
  46          return $this->field;
  47      }
  48  
  49  	function get_value()
  50      {
  51          $post_ = filter_input_array( INPUT_POST );
  52  
  53          return ( !isset( $post_[$this->prefix][$this->field->form_id][$this->field->id] ) ) ? null : $post_[$this->prefix][$this->field->form_id][$this->field->id];
  54      }
  55  
  56  	function get_tag( $field, $no_reset )
  57      {
  58          unset( $this->field );
  59  
  60          $this->field = $field;
  61  
  62          $this->attributes_filter( $no_reset );
  63  
  64          return $this->build_tag();
  65      }
  66  
  67  	function get_formats( $default = '' )
  68      {
  69          $form_template = MP_Form::get_template( $this->field->form_id );
  70          if ( !$form_template ) return $default;
  71  
  72          $form_templates = new MP_Form_templates();
  73          $f = $form_templates->get_composite_template( $form_template, $this->id );
  74          return ( is_array( $f ) ) ? array_merge( $default, $f ) : ( ( !empty( $f ) ) ? $f : $default );
  75      }
  76  
  77  	function attributes_filter( $no_reset ) 
  78      {
  79          $post_ = filter_input_array( INPUT_POST );
  80  
  81          if ( $no_reset ) $this->field->settings['attributes']['value'] = esc_attr( stripslashes( $post_[$this->prefix][$this->field->form_id][$this->field->id] ) );
  82  
  83          $this->attributes_filter_css();
  84      }
  85  
  86  	function attributes_filter_css() 
  87      {
  88          if ( !isset( $this->field->submitted['on_error'] ) ) return;
  89          $_classes = ( isset( $this->field->settings['controls']['class'] ) ) ? trim( $this->field->settings['controls']['class'] ) : '';
  90          if ( !empty( $_classes ) )
  91          {
  92              $add = $remove = array();
  93              $error_classes = explode( ' ', $_classes );
  94              $classes       = explode( ' ', $this->field->settings['attributes']['class'] );
  95              foreach ( $classes       as $k => $v ) $classes[$k] = trim( $v );
  96              foreach ( $error_classes as $k => $v ) { $v = trim( $v ); switch ( $v[0] ) { case '+' : $add[] = substr( $v, 1 ); break; case '-' : $remove[] = substr( $v, 1 ); break; default : $add[] = $v; break; } }
  97              $this->field->settings['attributes']['class'] = implode( ' ', array_merge( array_diff( $classes, $remove ), $add ) );
  98          }
  99          $_style = ( isset( $this->field->settings['controls']['style'] ) ) ? trim( $this->field->settings['controls']['style'] ) : '';
 100          if ( !empty( $_style ) ) $this->field->settings['attributes']['style'] .= $_style;
 101      }
 102  
 103  	function build_tag()
 104      {
 105          $tag_content = $misc = '';
 106      // opening tag
 107          $tag  = '<';
 108          $tag .= ( isset( $this->field_not_input ) ) ? $this->field->type : 'input';
 109      // id
 110          $this->field->settings['attributes']['id']   = $this->get_id( $this->field );
 111      // name
 112          $this->field->settings['attributes']['name'] = $this->get_name( $this->field );
 113      // other attributes
 114          foreach ( $this->field->settings['attributes'] as $attribute => $value )
 115          {
 116  /*
 117              if ( 'tag_content' == $attribute ) { $tag_content = $value; continue; }
 118              if ( 'misc'        == $attribute ) { $misc = trim( $value ); if ( '' != $misc ) $misc = " $misc"; continue; }
 119              if ( ''            != trim( $value ) ) $tag .= $this->get_attribute( $attribute, trim( $value ) );
 120  */
 121              switch( $attribute )
 122              {
 123                  case 'tag_content' :
 124                      $tag_content = $value;
 125                  break;
 126                  case 'misc' :
 127                      $misc = trim( $value );
 128                      if ( '' != $misc ) $misc = " $misc";
 129                  break;
 130                  default :
 131                      if ( '' != trim( $value ) ) $tag .= $this->get_attribute( $attribute, trim( $value ) );
 132                  break;
 133              }
 134          } 
 135      // closing tag
 136          return $tag . ( ( isset( $this->field_not_input ) ) ? "$misc >$tag_content</" . $this->field->type . '>' : "$misc />" );
 137      }
 138  
 139  	function get_attribute( $attr, $value )
 140      {
 141          if ( 'value' == $attr ) $value = esc_attr( $value );
 142          $quote = ( false !== strpos( $value, '"' ) ) ? "'" : '"';
 143          return " $attr=$quote$value$quote";
 144      }
 145  
 146  	function get_name( $field )
 147      {
 148          $this->field = $field;
 149          return ( isset( $this->field->settings['attributes']['name'] ) ) ?  $this->prefix . '[' . $this->field->form_id.'][' . $this->prefix . $this->field->settings['attributes']['name'] . ']'    : $this->prefix.'[' . $this->field->form_id . '][' . $this->field->id . ']';
 150      }
 151  
 152  	function get_id( $field )
 153      {
 154          $this->field = $field;
 155          return ( isset( $this->field->settings['attributes']['id'] ) )   ?  $this->prefix  .  $this->field->form_id . '_' . $this->field->settings['attributes']['id']                     : $this->prefix . $this->field->form_id . '_' . $this->field->id; 
 156      }
 157  
 158  	function settings_help( $content, $field )
 159      {
 160          $this->field = $field;
 161  
 162          $style = ( $this->id == $this->field->type ) ? '' : ' style="display:none;"';
 163  
 164          $content .= '<div id="field_type_' . $this->id . '_help" class="field_type_help"' . $style . '>';
 165          $content .= $this->desc;
 166          $content .= '</div>';
 167          return $content;
 168      }
 169  
 170  	function settings_form( $field )
 171      {
 172          $this->field = $field;
 173          $this->type_ok = ( $this->id == $this->field->type );
 174          $protected = ( isset( $this->field->settings['options']['protected'] ) && $this->field->settings['options']['protected'] );
 175          $has_controls = $has_controls_checked = false;
 176          if ( method_exists( $this, 'build_settings_form' ) ) return $this->build_settings_form();
 177  
 178          ob_start();
 179              include( $this->settings );
 180              $xml = trim( ob_get_contents() );
 181          ob_end_clean();
 182  
 183          $xml = simplexml_load_string( $xml, 'SimpleXMLElement', LIBXML_NOCDATA );
 184  
 185          foreach ( $xml->children() as $child )
 186          {
 187              $tabs[$child->getName()] = ( string ) $child->tab;
 188          }
 189  
 190          if ( isset( MP_AdminPage::$get_['action'] ) && ( 'edit' == MP_AdminPage::$get_['action'] ) && $this->type_ok ) { $tabs['html'] = __( 'Html', 'MailPress' ); }
 191  
 192          if ( empty( $tabs ) ) return;
 193  
 194          $style = ( $this->type_ok ) ? '' : ' style="display:none;"';
 195  
 196  // help
 197          $help = "\n\n\n";
 198          $help .= '<div class="field-type-help" data-id="field_type_' . $this->id . '_help"><ul>';
 199          foreach( $tabs as $tab_type => $tab )
 200          {
 201              $help .= '<li><a href="#help_tab_' . $this->id . '_' . $tab_type . '"><span>' . $tab . '</span></a></li>';
 202          }
 203          $help .= '</ul><div style="clear:both;">';
 204          foreach( $tabs as $tab_type => $tab ) 
 205          {
 206              $help .= '<div id="help_tab_' . $this->id . '_' . $tab_type . '" class="help_form_tabs mp_help_tabs help_' . $tab_type . '">';
 207  
 208              switch ( $tab_type )
 209              {
 210                  case 'html' :
 211                      if ( !isset( $form ) ) $form = MP_Form::get( $this->field->form_id );
 212                      $help .= sprintf( __('This is the html generated, mixing your different settings with the %s selected.', 'MailPress' ), sprintf('<a href="' . esc_url( MP_AdminPage::url( MailPress_templates, array( 'action' => 'edit', 'template' => $form->template ) ) ) . '">%s</a>', __('Template/Subtemplate', 'MailPress' ) ) );
 213                  break;
 214                  default :
 215                      $help .= (string) $xml->{$tab_type}->help;
 216                  break;
 217              }
 218              $help .= '</div>';
 219          }
 220          $help .= "</div></div>\n\n\n";
 221  
 222  // out
 223          $this->out = "\n\n\n";
 224          $this->out .= '<div id="field_type_' . $this->id . '_settings" class="field_type_settings"' . $style . '>';
 225          $this->out .= '<ul>';
 226          foreach ( $tabs as $tab_type => $tab )
 227          {
 228              $this->out .= '<li><a href="#settings_tab_' . $this->id . '_' . $tab_type . '"><span>' . $tab . '</span></a></li>';
 229          }
 230          $this->out .= '</ul>';
 231          $this->out .= '<div style="clear:both;" >';
 232          foreach ( $tabs as $tab_type => $tab ) 
 233          {
 234              $this->out .= '<div id="settings_tab_' . $this->id . '_' . $tab_type . '" class="ui-tabs settings_form_tabs settings_' . $tab_type . '">';
 235              switch ( $tab_type )
 236              {
 237                  case 'html' :
 238                      if ( !isset( $form ) ) $form = MP_Form::get( $this->field->form_id );
 239                      $this->out .= '<textarea disabled="disabled" rows="5" cols="40">' . htmlspecialchars( MP_Form::get_field( $this->field, false, $form->template ), ENT_QUOTES ) . '</textarea>';
 240                      $this->out .= '<p><small>' . sprintf( __( 'Templates : %1$s/%2$s', 'MailPress' ), $form->template, $field->template ) . '</small></p>';
 241                  break;
 242                  default :
 243                      foreach ( $xml->{$tab_type}->items as $items )
 244                      {
 245                          foreach ( $items->children() as $child )
 246                          {
 247                              $attribute = $child->getName();
 248                              foreach ( $child->children() as $tags )
 249                              {
 250                                  switch ( $tags->getName() )
 251                                  {
 252                                      case 'checkbox' :
 253                                          $checked = $this->settings_checkbox( $tab_type, $attribute, $tags->value, (int) $tags->disabled, ( ( isset( $tags->class ) ) ? $tags->class : false ), ( ( isset( $tags->forced ) ) ? $tags->forced : false )  );
 254                                          if ( isset( $tags->class ) && ( 'controls' == (string) $tags->class ) ) $has_controls = true;
 255                                          if ( $checked ) $has_controls_checked = true;
 256                                          $this->out .= '<label for="' . $this->prefix . $this->id . '_settings_' . $tab_type . '_' . $attribute . '_' . $tags->value . '" class="inline" ><span class="description"><small>' . $tags->text . '</small></span></label>&#160;';
 257                                      break;
 258                                      case 'hidden' :
 259                                          $this->settings_hidden_value( $tab_type, $attribute, $tags->value );
 260                                      break;
 261                                      case 'is' :
 262                                          $this->settings_description( __( 'initial state : ', 'MailPress' ) );
 263                                          $values = unserialize( $tags->values );
 264                                          $disabled = unserialize( $tags->disabled );
 265                                          foreach ( $values as $attribute ) 
 266                                          { 
 267                                              $this->settings_checkbox( $tab_type, $attribute, $attribute, ( in_array( $attribute, $disabled ) ) );
 268                                              $this->out .= '<label for="' . $this->prefix . $this->id . '_settings_' . $tab_type . '_' . $attribute . '_' . $attribute . '" class="inline" ><span class="description"><small>' . $attribute . '</small></span></label>&#160;';
 269                                          }
 270                                      break;
 271                                      case 'misc' :
 272                                          $this->settings_text( 'attributes', 'misc', false, '', 39 );
 273                                          $this->out .= '<br /><span class="description"><i style="color:#666;font-size:8px;">' . ( (string) $tags ) . '</i></span><br />';
 274                                      break;
 275                                      case 'only_text' :
 276                                          $this->out .= '<span class="description">' . (string) $tags . '</span>';
 277                                      break;
 278                                      case 'radio' :
 279                                          $this->settings_description( $tags->text );
 280                                          $values = unserialize( $tags->values );
 281                                          $disabled = unserialize( $tags->disabled );
 282                                          foreach ( $values as $value => $value_text )
 283                                          {
 284                                              $this->settings_radio( $tab_type, $attribute, $value, $value_text, $tags->default, in_array( $value, $disabled ) );
 285                                          }
 286                                      break;
 287                                      case 'select_num' :
 288                                          $this->out .= '<span class="description"><small>' . $tags->text;
 289                                          $this->out .=  ( 'attributes' == $tab_type ) ? '"' : '';
 290                                          $this->settings_select_num( $tab_type, $attribute, (int) $tags->min, (int) $tags->max, (int) $tags->default ); 
 291                                          $this->out .=  ( 'attributes' == $tab_type ) ? '"' : '';
 292                                          $this->out .= '</small></span>&#160;';
 293                                      break;
 294                                      case 'select_opt' :
 295                                          $values = unserialize( $tags->values );
 296                                          $this->out .= '<span class="description"><small>' . $tags->text;
 297                                          $this->settings_select_opt( $tab_type, $attribute, $values, $tags->default ); 
 298                                          $this->out .= '</small></span>&#160;';
 299                                      break;
 300                                      case 'text' :
 301                                          $this->out .= '<span class="description"><small>';
 302                                          $this->out .= ( isset( $tags->text ) ) ? $tags->text : $attribute; 
 303                                          $this->out .= ( 'attributes' == $tab_type ) ? '="' : '';
 304                                          $this->out .= '</small></span>';
 305                                          $this->settings_text( $tab_type, $attribute, ( isset( $tags->disabled ) ) ? (string) $tags->disabled : false, ( isset( $tags->default ) ) ? $tags->default : '', ( isset( $tags->size ) ) ? (string) $tags->size : 32 );
 306                                          if ( 'attributes' == $tab_type ) $this->out .= '<span class="description"><small>"</small></span>';
 307                                      break;
 308                                      case 'textarea' :
 309                                          $this->settings_attributes_textarea( $tags->text, $attribute );
 310                                          if ( isset( $tags->desc ) ) $this->out .= '<br /><span class="description"><small style="color:#666;">' . $tags->desc . '</small></span>';
 311                                      break;
 312                                  }
 313                              }
 314                          }
 315                          $this->out .= '<br />';
 316                      }
 317                      if ( ( $has_controls ) && ( 'controls' == $tab_type ) )
 318                      {
 319                          $style = ( $has_controls_checked ) ? '' : ' style="display:none;"'; 
 320                          $this->out .= '<div id="field_type_controls_' . $this->id . '"' . $style . ' class="field_type_controls">';
 321                          $this->out .= '<hr style="border: 0pt none ; margin: 1px 5px 5px 1px; color: rgb( 223, 223, 223 ); background-color: rgb( 223, 223, 223 ); height: 1px;" />';
 322                          $this->out .= __( 'On error <small>(to remove a class : -name_of_class)</small>', 'MailPress' );
 323                          $this->out .= '<br /><div>';
 324                          foreach ( array( 'class', 'style' ) as $attribute )
 325                          {
 326                              $this->out .= '<span class="description"><small>' . $attribute . '="</small></span>"';
 327                              $this->settings_text( $tab_type, $attribute );
 328                              $this->out .= '<span class="description"><small>"</small></span><br />';
 329                          }
 330                          $this->out .= '</div>';
 331                          $this->out .= '</div>';
 332                      }
 333                  break;
 334              }
 335              if ( isset( $xml->{$tab_type}->hiddens ) )
 336              {
 337                  foreach( $xml->{$tab_type}->hiddens->children() as $hidden )
 338                  {
 339                      $attribute = (string) $hidden->getName();
 340                      if ( isset( $hidden->value ) )    $this->settings_hidden_value( $tab_type, $attribute, $hidden->value );
 341                      else                        $this->settings_hidden( $tab_type, $attribute );
 342                  }
 343              }
 344              $this->out .= '</div>';
 345          }
 346          $this->out .= '</div></div>'; // clearboth + tabdiv
 347          $this->out .= "\n\n\n";
 348  
 349          echo $this->out;
 350          echo $help;
 351      }
 352  
 353  	function settings_description( $text ) 
 354      {
 355          $this->out .= '<span class="description"><small>' . $text . '</small></span>';
 356      }
 357  
 358  	function settings_hidden( $setting, $attribute )
 359      {
 360          $tags = array (
 361              'type'     => 'hidden',
 362              'name'     => $this->prefix . $this->id . "[settings][$setting][$attribute]",
 363              'value'     => ($this->type_ok && isset($this->field->settings[$setting][$attribute])) ? $this->field->settings[$setting][$attribute] : '',
 364          );
 365          $this->out .= $this->settings_tag( 'input', $tags );
 366      }
 367  
 368  	function settings_hidden_value( $setting, $attribute, $value )
 369      {
 370          $tags = array (
 371              'type'     => 'hidden',
 372              'name'     => $this->prefix . $this->id . "[settings][$setting][$attribute]",
 373              'value'     => $value,
 374          );
 375  
 376          $this->out .= $this->settings_tag( 'input', $tags );
 377      }
 378  
 379  	function settings_text( $setting, $attribute, $disabled = false, $default = '', $size = 32 )
 380      {
 381          $tags = array (
 382              'type'     => 'text',
 383              'name'     => $this->prefix . $this->id . "[settings][$setting][$attribute]",
 384              'id'         => $this->prefix . $this->id . '_settings_' . $setting . '_' . $attribute,
 385              'value'     => ( ( $this->type_ok && isset( $this->field->settings[$setting][$attribute] ) ) ? $this->field->settings[$setting][$attribute] : $default ),
 386              'size'     => $size,
 387          );
 388  
 389          $this->out .= $this->settings_tag( 'input', $tags );
 390      }
 391  
 392  	function settings_checkbox( $setting, $attribute, $value, $disabled = false, $class = false, $forced = false )
 393      {
 394          $tags = array (
 395              'type'     => 'checkbox',
 396              'name'     => $this->prefix . $this->id . "[settings][$setting][$attribute]",
 397              'id'         => $this->prefix . $this->id . '_settings_' . $setting . '_' . $attribute . '_' . $value,
 398              'value'     => $value,
 399              'style'     => 'width:auto;',
 400          );
 401          if ( $class ) $tags['class'] = 'class';
 402          if ( $disabled )
 403          {
 404              $tags['disabled'] = 'disabled';
 405              unset( $tags['name'] );
 406          }
 407  
 408          if ( $forced !== false )
 409          {
 410              $tags['checked'] = 'checked';
 411          }
 412          else
 413          {
 414              $value = (string) $value;
 415              $v =  (string) ( $this->type_ok && isset( $this->field->settings[$setting][$attribute] ) ) ? $this->field->settings[$setting][$attribute] : null;
 416              if ( $value == $v ) $tags['checked'] = 'checked';
 417          }
 418  
 419          $this->out .= $this->settings_tag( 'input', $tags );
 420  
 421          return ( isset( $tags['checked'] ) ) ;
 422      }
 423  
 424  	function settings_radio( $setting, $attribute, $value, $value_text, $default, $disabled = false )
 425      {
 426          $tags = array (
 427              'type'     => 'radio',
 428              'name'     => $this->prefix . $this->id . "[settings][$setting][$attribute]",
 429              'id'         => $this->prefix . $this->id . '_settings_' . $setting . '_' . $attribute . '_' . $value,
 430              'value'     => $value,
 431              'style'     => 'width:auto;',
 432          );
 433          if ( $disabled )
 434          {
 435              $tags['disabled'] = 'disabled';
 436              unset( $tags['name'] );
 437          }
 438  
 439          $v = (string) ( $this->type_ok && isset( $this->field->settings[$setting][$attribute] ) ) ? $this->field->settings[$setting][$attribute] : $default;
 440          $value = (string) $value;
 441  
 442          if ( $value == $v ) $tags['checked'] = 'checked';
 443  
 444          $this->out .= $this->settings_tag( 'input', $tags );
 445  
 446          $style = ( $disabled ) ? ' style="color:#888;"' : ''; 
 447          $this->out .= '<label class="inline" for="' . $tags['id'] . '"><span class="description"><small' . $style . '>' . $value_text . '</small></span></label>&#160;';
 448      }
 449  
 450  	function settings_select_num( $setting, $attribute, $min, $max, $default )
 451      {
 452          $tags = array (
 453              'name'     => $this->prefix . $this->id . "[settings][$setting][$attribute]",
 454              'id'         => $this->prefix . $this->id . '_settings_' . $setting . '_' . $attribute,
 455          );
 456          $v = ( $this->type_ok && isset( $this->field->settings[$setting][$attribute] ) ) ? $this->field->settings[$setting][$attribute] : $default;
 457  
 458          $this->out .= $this->settings_tag( 'select', $tags );
 459          $this->out .= MP_AdminPage::select_number( $min, $max, $v, 1, false );
 460          $this->out .= '</select>';
 461      }
 462  
 463  	function settings_select_opt( $setting, $attribute, $values, $default )
 464      {
 465          $tags = array (
 466              'name'     => $this->prefix . $this->id . "[settings][$setting][$attribute]",
 467              'id'         => $this->prefix . $this->id . '_settings_' . $setting . '_' . $attribute,
 468          );
 469          $v = ( $this->type_ok && isset( $this->field->settings[$setting][$attribute] ) ) ? $this->field->settings[$setting][$attribute] : $default;
 470  
 471          $this->out .= $this->settings_tag( 'select', $tags );
 472          $this->out .= MP_AdminPage::select_option( $values, $v, false );
 473          $this->out .= '</select>';
 474      }
 475  
 476  	function settings_attributes_textarea( $text, $option )
 477      {
 478          $tags = array (
 479              'type'     => 'hidden',
 480              'name'     => $this->prefix . $this->id . '[textareas][]',
 481              'value'     => $option,
 482          );
 483  
 484          $this->out .= $this->settings_tag( 'input', $tags );
 485          $this->settings_description( $text );
 486          $this->out .= '<br />';
 487          $tags = array (
 488              'name'     => $this->prefix . $this->id . "[settings][attributes][$option]",
 489              'id'         => $this->prefix . $this->id . '_settings_attributes_' . $option,
 490              'cols'     => 40,
 491              'rows'     => 4,
 492          );
 493          $this->out .= $this->settings_tag( 'textarea', $tags );
 494          $this->out .= ( $this->type_ok && isset( $this->field->settings['attributes']['tag_content'] ) ) ? esc_attr( trim( base64_decode( $this->field->settings['attributes']['tag_content'] ) ) ) : '';
 495          $this->out .= '</textarea>';
 496      }
 497  
 498  	function settings_tag( $type, $tags )
 499      {
 500          $o = '<' . $type;
 501          foreach( $tags as $attr => $v )
 502          {
 503              if ( ( 'value' != $attr ) && !$v ) continue;
 504                  if ( empty( $v ) ) $v = (string) '';
 505              $o .= ' ' . $attr . '="' . esc_attr( $v ) .'"';
 506          }
 507          $o.= ( 'input' == $type ) ? ' />' : '>';
 508          return $o;
 509      }
 510  }


Generated: Mon Mar 11 18:33:33 2019 Cross-referenced by PHPXref 0.7.1