Plugin Directory

Changeset 371752


Ignore:
Timestamp:
04/11/2011 10:07:05 PM (15 years ago)
Author:
truthmedia
Message:

Updated to allow form tags to be used as CSS classes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • formbuilder/tags/0.87/formbuilder.php

    r371672 r371752  
    610610        if($module_status !== false)
    611611        {
    612             $formDisplay = "\n<form class='formBuilderForm' id='formBuilder$formID' " .
     612            // Retrieve the tags for the form and use as additional CSS classes in order to allow forms with specific tags to use alternate stylesheets.
     613            $formTags = array();
     614            $sql = "SELECT * FROM " . FORMBUILDER_TABLE_TAGS . " WHERE form_id = '{$form_id}' ORDER BY tag ASC;";
     615            $results = $wpdb->get_results($sql, ARRAY_A);
     616            foreach($results as $r)
     617            {
     618                $formTags[] = preg_replace('/[^a-z0-9]/isU', '', $r['tag']);
     619            }
     620            $formTags = implode(' FormBuilder', $formTags);
     621
     622            $formDisplay = "\n<form class='formBuilderForm $formTags' id='formBuilder$formID' " .
    613623                    "action='" . $form['action_target'] . "' method='" . strtolower($form['method']) . "' onsubmit='return fb_disableForm(this);'>" .
    614624                    "<input type='hidden' name='formBuilderForm[FormBuilderID]' value='" . $form_id . "' />";
Note: See TracChangeset for help on using the changeset viewer.