function contact_form($element) { extract($element['saved'][0]); $output = '<div class="span' . $dynamic_size . ' contact_form">'; if (!isset($dynamic_msg)) { $dynamic_msg = ''; } $attr = array("success" => '<p>' . $dynamic_msg . '</p>', "submit" => $dynamic_submit, "submit_class" => "btn-system", "form_class" => "standard-form", "action" => get_permalink(), "myemail" => themeple_get_option('email'), "myblogname" => get_option('blogname'), "autoresponder" => themeple_get_option('autoresponder'), "autoresponder_subject" => themeple_get_option('autoresponder_subject'), "autoresponder_email" => themeple_get_option('email')); $custom_elements = themeple_get_option('contact_elements'); $elements = array(); if (is_array($custom_elements)) { foreach ($custom_elements as $new_element) { $elements[strtolower($new_element['label'])] = $new_element; } } $contact_form = new themeple_form($attr); $contact_form->create_elements($elements); if (!empty($dynamic_title)) { $output .= '<div class="header"><h6>' . $dynamic_title . '</h6></div>'; } $output .= '<div class="row-fluid">'; $output .= '<div class="row-fluid">'; $output .= '<div class="span12">'; if (!empty($desc)) { $output .= '<p class="desc">' . $desc . '</p>'; } $output .= $contact_form->display_form(); $output .= '</div>'; $output .= '</div>'; $output .= '</div>'; $output .= '</div>'; return $output; }
/** * themeple_sc_contact_form() * * @param mixed $atts * @param mixed $content * @param string $shortcodename * @return */ function themeple_sc_contact_form_slider($atts, $content = null, $shortcodename = "") { extract(shortcode_atts(array('heading' => '', 'success' => '', 'submit_text' => ''), $atts)); $attr = array("success" => '<p>Your message has been sent</p>', "submit" => $submit_text, "form_class" => "slider_form", "submit_class" => "more-large", "action" => get_permalink(), "myemail" => themeple_get_option('email'), "myblogname" => get_option('blogname'), "autoresponder" => themeple_get_option('autoresponder'), "autoresponder_subject" => themeple_get_option('autoresponder_subject'), "autoresponder_email" => themeple_get_option('email')); $custom_elements = themeple_get_option('contact_elements'); $elements = array(); if (is_array($custom_elements)) { $i = 0; foreach ($custom_elements as $new_element) { $i++; if ($new_element['type'] != 'textarea') { $elements[strtolower($new_element['label'])] = $new_element; if ($i > 1) { $elements[strtolower($new_element['label'])]['class'] = 'half'; } if ($i == count($custom_elements)) { $elements[strtolower($new_element['label'])]['class'] = ''; } if ($i % 2 != 0 && $i == count($custom_elements)) { $elements[strtolower($new_element['label'])]['class'] = 'half'; } } } } $contact_form = new themeple_form($attr); $contact_form->create_elements($elements); return '<div class="row">' . $contact_form->display_form() . '</div>'; }