Skip to content

Instantly share code, notes, and snippets.

@jerome
Created February 9, 2012 17:30
Show Gist options
  • Save jerome/1781428 to your computer and use it in GitHub Desktop.
Save jerome/1781428 to your computer and use it in GitHub Desktop.
participants-database diff for twitter bootstrap
diff --git a/wp-content/plugins/participants-database/classes/FormElement.class.php b/wp-content/plugins/participants-database/classes/FormElement.class.php
index 1d0ff6a..d83bf29 100644
--- a/wp-content/plugins/participants-database/classes/FormElement.class.php
+++ b/wp-content/plugins/participants-database/classes/FormElement.class.php
@@ -614,7 +614,7 @@ class FormElement {
*/
private function _submit_button() {
- $this->_addline( $this->_input_tag( 'submit' ) );
+ $this->_addline( '<button type="submit" class="btn btn-primary" id="'.$this->name.'">'.$this->value.'</button>' );
}
diff --git a/wp-content/plugins/participants-database/classes/FormValidation.class.php b/wp-content/plugins/participants-database/classes/FormValidation.class.php
index 61eb743..7bf4a00 100644
--- a/wp-content/plugins/participants-database/classes/FormValidation.class.php
+++ b/wp-content/plugins/participants-database/classes/FormValidation.class.php
@@ -174,19 +174,19 @@ class FormValidation {
case 'empty':
$error_messages[] = sprintf( $this->empty_message, $field_atts->title );
- $this->error_class = 'pdb-error';
+ $this->error_class = 'alert alert-error';
break;
case 'invalid':
$error_messages[] = sprintf( $this->invalid_message, $field_atts->title );
- $this->error_class = 'pdb-error';
+ $this->error_class = 'alert alert-error';
break;
default:
$error_messages[] = $error;
- $this->error_class = empty( $field ) ? 'pdb-message' :'pdb-error' ;
+ $this->error_class = empty( $field ) ? 'alert alert-success' :'alert alert-error' ;
}
@@ -214,13 +214,7 @@ class FormValidation {
*/
private function _error_html( $error_CSS, $error_messages ) {
- if ( ! empty ( $error_CSS ) ) $output = '<style type="text/css">'.implode( ', ',$error_CSS ).'{ '.$this->error_style.' }</style>';
-
- else $output = '';
-
- $output .= '<div class="'.$this->error_class.'"><p>'.implode( '</p><p>', $error_messages ).'</p></div>';
-
- return $output;
+ return '<div class="'.$this->error_class.'"><p>'.implode( '</p><p>', $error_messages ).'</p></div>';
}
diff --git a/wp-content/plugins/participants-database/classes/Signup.class.php b/wp-content/plugins/participants-database/classes/Signup.class.php
index 81cdf5e..0119ca8 100644
--- a/wp-content/plugins/participants-database/classes/Signup.class.php
+++ b/wp-content/plugins/participants-database/classes/Signup.class.php
@@ -221,11 +221,11 @@ class Signup {
}
?>
- <form method="post" enctype="multipart/form-data" >
+ <form method="post" enctype="multipart/form-data" class="form-horizontal">
<?php
FormElement::print_hidden_fields( array( 'action'=>'signup', 'source'=>Participants_Db::PLUGIN_NAME, 'shortcode_page' => basename( $_SERVER['REQUEST_URI'] ), 'thanks_page' => $this->submission_page ) );
?>
- <table class="form-table pdb-signup">
+ <fieldset>
<?php
// get the columns and output form
@@ -245,9 +245,9 @@ class Signup {
}
?>
- <tr id="<?php echo $column->name?>" class="<?php echo $column->form_element?>">
- <th><?php echo $column->title?></th>
- <td>
+ <div id="<?php echo $column->name?>" class="control-group <?php echo $column->form_element?>">
+ <label for="<?php echo $column->name?>"><?php echo $column->title?></label>
+ <div class="controls">
<?php
// unserialize it if the default is an array
@@ -270,34 +270,32 @@ class Signup {
) );
if ( ! empty( $column->help_text ) ) :
?>
- <span class="helptext"><?php echo trim( $column->help_text )?></span>
+ <p class="help-block"><?php echo trim( $column->help_text )?></p>
<?php
endif;
?>
- </td>
- </tr>
+ </div>
+ </div>
<?php
endforeach;
if ( $captcha = $this->_add_captcha( $this->captcha_type ) ) :
?>
- <tr>
- <td colspan="2"><?php echo $captcha?></td>
- </tr>
+ <div class="control-group">
+ <div class="controls"><?php echo $captcha?></div>
+ </div>
<?php endif ?>
- <tr>
- <td colspan="2" class="submit-buttons">
+ <div class="form-actions">
<?php
$options = get_option(Participants_Db::$participants_db_options);
FormElement::print_element( array(
'type' => 'submit',
'value' => $options['signup_button_text'],
'name' => 'submit',
- 'class' => 'button-primary',
+ 'class' => 'btn button-primary',
) );
?>
- </td>
- </tr>
- </table>
+ </div>
+ </fieldset>
</form>
</div>
<?php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment