From: Chuck Scott Date: Tue, 19 May 2015 17:49:24 +0000 (-0400) Subject: initial commit X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=HEAD;p=WP-Plugins%2Fswpm-form-builder.git initial commit --- b5d19e2644c717577290e62ea504da9a81c569c0 diff --git a/classes/class.swpm-fb-admin-custom-fields.php b/classes/class.swpm-fb-admin-custom-fields.php new file mode 100644 index 0000000..f67c6d2 --- /dev/null +++ b/classes/class.swpm-fb-admin-custom-fields.php @@ -0,0 +1,70 @@ +fields = array(); + $this->membership_level = $membership_level; + $form_table_name = $wpdb->prefix . 'swpm_form_builder_forms'; + $field_table = $wpdb->prefix . 'swpm_form_builder_fields'; + $query = $wpdb->prepare("SELECT form_id FROM $form_table_name WHERE form_type = 1 AND " + . " (form_membership_level= %d OR form_membership_level=0 )" + . " ORDER BY form_membership_level DESC", $membership_level); + $form_id = $wpdb->get_var($query); + $this->form_id = $form_id; + if (empty($form_id)) {return; } + $query = $wpdb->prepare( + "SELECT + field_id AS id, + form_id, + field_key AS _key, + field_type AS type, + field_options AS options, + field_description AS description, + field_name AS name, + field_sequence AS sequence, + field_parent AS parent, + field_validation AS validation, + field_required AS required, + field_size AS size, + field_css AS css, + field_layout AS layout, + field_default AS _default, + field_readonly As readonly, + field_adminonly AS adminonly, + reg_field_id AS reg_field_id + FROM $field_table WHERE form_id= %d and field_key='custom' ORDER BY field_sequence ASC", + $form_id + ); + $data = $wpdb->get_results($query); + foreach ($data as $field){ + $obj = new SwpmFbFieldmeta(); + $obj->load($field); + $this->fields[] = $obj; + } + } + public function admin_ui(){ +// if (!(BUtils::is_admin() && is_admin())) {return '';} + $custom = new SwpmFbFormCustom(); + $member_id = filter_input(INPUT_GET, 'member_id'); + if (empty($member_id)){return'';} + $custom->init($member_id); + return $custom->admin_ui($this->fields); + } + public function save($user_id){ + $custom = new SwpmFbFormCustom(); + $custom->init($user_id); + $custom->process_custom($this->fields); + if ($custom->is_valid()){ + $custom->save(); + } + + } +} diff --git a/classes/class.swpm-fb-fieldmeta.php b/classes/class.swpm-fb-fieldmeta.php new file mode 100644 index 0000000..272e643 --- /dev/null +++ b/classes/class.swpm-fb-fieldmeta.php @@ -0,0 +1,622 @@ +table = $wpdb->prefix . 'swpm_form_builder_fields'; + $this->mtable = $wpdb->prefix . 'swpm_form_builder_multivalue'; + } + + public function save() { + global $wpdb; + $data = array( + 'form_id' => $this->form_id, + 'field_key' => $this->key, + 'field_type' => $this->type, + 'field_name' => $this->name, + 'field_description' => $this->description, + 'field_size' => $this->size, + 'field_required' => $this->required, + 'field_parent' => $this->parent, + 'field_sequence' => $this->sequence, + 'field_options' => $this->options, + 'field_validation' => $this->validation, + 'field_css' => $this->css, + 'field_layout' => $this->layout, + 'field_default' => $this->default, + 'field_readonly' => $this->readnly, + 'field_adminonly' => $this->adminonly, + 'reg_field_id' => $this->reg_field_id + ); + // todo: validate here + if (empty($this->id)) { + $wpdb->insert($this->table, $data); + } else { + $wpdb->update($this->table, $data, array('field_id', $this->id)); + } + } + + public function load($field) { + foreach ($field as $key => $value) { + if ($key == '_key') { + $this->key = $value; + } elseif ($key == '_default') { + $this->default = $value; + } else { + $this->$key = $value; + } + } + } + + public function load_from_db($field_id) { + global $wpdb; + $query = $wpdb->prepare( + "SELECT + field_id AS id, + form_id, + field_key AS _key, + field_type AS type, + field_options AS options, + field_description AS description, + field_name AS name, + field_sequence AS sequence, + field_parent AS parent, + field_validation AS validation, + field_required AS required, + field_size AS size, + field_css AS css, + field_layout AS layout, + field_default AS _default, + field_readonly AS readonly, + field_adminonly AS adminonly, + reg_field_id AS reg_field_id + FROM $this->table WHERE field_id= %d", $field_id + ); + $data = $wpdb->get_row($query); + $this->load($data); + } + + public function validate() { + + } + + public function get_unique_value_id() { + return empty($this->reg_field_id) ? $this->id : $this->reg_field_id; + } + + public function toHTML($value = null, $form_type = 0, $label_align = "") { + switch ($this->type) { + case 'text': + return $this->text($value, $form_type, $label_align); + break; + case 'select': + return $this->select($value, $form_type, $label_align); + break; + case 'radio': + return $this->radio($value, $form_type, $label_align); + break; + case 'fieldset': + return $this->fieldset($form_type, $label_align); + break; + case 'section': + return $this->section($form_type, $label_align); + break; + case 'secret': + return $this->secret($form_type, $label_align); + break; + case 'submit': + return $this->submit($form_type, $label_align); + break; + case 'verification': + return $this->verification($form_type, $label_align); + break; + case 'email': + return $this->email($value, $form_type, $label_align); + break; + case 'url': + return $this->url($value, $form_type, $label_align); + break; + case 'currency': + return $this->currency($value, $form_type, $label_align); + break; + case 'number': + return $this->number($value, $form_type, $label_align); + break; + case 'phone': + return $this->phone($value, $form_type, $label_align); + break; + case 'password': + return $this->password($form_type, $label_align); + break; + case 'textarea': + return $this->textarea($value, $form_type, $label_align); + break; + case 'checkbox': + return $this->checkbox($value, $form_type, $label_align); + break; + case 'address': + return $this->address($value, $form_type, $label_align); + break; + case 'date': + return $this->date($value, $form_type, $label_align); + break; + case 'time': + return $this->time($value, $form_type, $label_align); + break; + case 'html': + return $this->html($value, $form_type, $label_align); + break; + case 'file-upload': + return $this->file_upload($value, $form_type, $label_align); + break; + case 'instructions': + return $this->instructions($form_type, $label_align); + break; + } + } + + private function text($value = null, $form_type = 0, $label_align = "") { + $options = $this->get_sanitized_options(); + $value = empty($value) ? $options['default'] : $value; + $key = str_replace('-', '_', $this->key); + switch ($key) { + case 'membership_level': + return $this->membership_level($value, $form_type, $label_align); + default: + } + // HTML5 types + if (in_array($this->type, array('email', 'url'))) { + $type = esc_attr($this->type); + } elseif ('phone' == $this->type) { + $type = 'tel'; + } else { + $type = 'text'; + } + $form_item = sprintf( + '', $options['field_id'], $options['id_attr'], stripslashes($value), $options['size'], $options['required'], $options['validation'], $options['css'], $type, $options['readonly'] ? 'disabled' : '' + ); + if ($form_type == SwpmFbForm::PROFILE) { + switch ($key) { + case 'user_name': + $form_item = '' . $value . ''; + break; + } + } + return (!empty($options['description']) ) ? + sprintf('%1$s', $form_item, $options['description']) : $form_item; + } + + private function membership_level($level, $form_type = 0, $label_align = "") { + $options = $this->get_sanitized_options(); + $value = BPermission::get_instance($level)->get('alias'); + $id = BPermission::get_instance($level)->get('id'); + $type = 'hidden'; + $form_item = sprintf( + '', $options['field_id'], $options['id_attr'], $id, $options['size'], $options['required'], $options['validation'], $options['css'], $type, $options['readonly'] ? 'disabled' : '' + ); + $form_item .= sprintf('
%1$s
', $value); + return (!empty($options['description']) ) ? + sprintf('%1$s', $form_item, $options['description']) : $form_item; + } + + private function select($value = null, $form_type = 0, $label_align = "") { + extract($this->get_sanitized_options()); + $field_options = maybe_unserialize($this->options); + $options = ''; + $value = empty($value) ? $default : $value; + // Loop through each option and output + foreach ($field_options as $option => $tvalue) { + $options .= sprintf('', esc_attr(trim(stripslashes($tvalue))), selected($tvalue, $value, 0)); + } + + $form_item = sprintf( + '', $field_id, $id_attr, $size, $required, $css, $options + ); + + return (!empty($description) ) ? + sprintf('%1$s', $form_item, $description) : $form_item; + } + + private function radio($value = null, $form_type = 0, $label_align = "") { + extract($this->get_sanitized_options()); + $field_options = maybe_unserialize($this->options); + + $options = ''; + $value = empty($value) ? $default : $value; + // Loop through each option and output + foreach ($field_options as $option => $tvalue) { + $options .= sprintf( + '
', $field_id, $id_attr, $option, $required, $css, esc_attr(trim(stripslashes($tvalue))), wp_specialchars_decode(stripslashes($tvalue)), checked($tvalue, $value, 0) + ); + } + + $form_item = $options; + + $output = '
'; + + $output .= (!empty($description) ) ? sprintf('%1$s', $form_item, $description) : $form_item; + + $output .= '
'; + return $output; + } + + private function fieldset($form_type = 0, $label_align = "") { + + } + + private function section($form_type = 0, $label_align = "") { + + } + + private function secret($form_type = 0, $label_align = "") { + + } + + private function submit($form_type = 0, $label_align = "") { + extract($this->get_sanitized_options()); + return sprintf( + '
  • + + ' . BUtils::delete_account_button() . ' +
  • ', $field_id, $id_attr, wp_specialchars_decode(esc_html($field_name), ENT_QUOTES), $css + ); + } + + private function verification($form_type = 0) { + + } + + private function email($value = null, $form_type = 0) { + $options = $this->get_sanitized_options(); + $value = empty($value) ? $options['default'] : $value; + // HTML5 types + $type = esc_attr($this->type); + $form_item = sprintf( + '', $options['field_id'], $options['id_attr'], stripslashes($value), $options['size'], $options['required'], $options['validation'], $options['css'], $type, $options['readonly'] ? 'disabled' : '' + ); + + return (!empty($options['description']) ) ? + sprintf('%1$s', $form_item, $options['description']) : $form_item; + } + + private function url($value = null, $form_type = 0, $label_align = "") { + $options = $this->get_sanitized_options(); + $value = empty($value) ? $options['default'] : $value; + // HTML5 types + $type = esc_attr($this->type); + $form_item = sprintf( + '', $options['field_id'], $options['id_attr'], $value, $options['size'], $options['required'], $options['validation'], $options['css'], $type, $options['readonly'] ? 'disabled' : '' + ); + + return (!empty($options['description']) ) ? + sprintf('%1$s', $form_item, $options['description']) : $form_item; + } + + private function currency($value = null, $form_type = 0, $label_align = "") { + $options = $this->get_sanitized_options(); + $value = empty($value) ? $options['default'] : $value; + // HTML5 types + $type = 'text'; + $form_item = sprintf( + '', $options['field_id'], $options['id_attr'], $value, $options['size'], $options['required'], $options['validation'], $options['css'], $type, $options['readonly'] ? 'disabled' : '' + ); + + return (!empty($options['description']) ) ? + sprintf('%1$s', $form_item, $options['description']) : $form_item; + } + + private function number($value = null, $form_type = 0, $label_align = "") { + $options = $this->get_sanitized_options(); + $value = empty($value) ? $options['default'] : $value; + // HTML5 types + $type = 'text'; + $form_item = sprintf( + '', $options['field_id'], $options['id_attr'], $value, $options['size'], $options['required'], $options['validation'], $options['css'], $type, $options['readonly'] ? 'disabled' : '' + ); + + return (!empty($options['description']) ) ? + sprintf('%1$s', $form_item, $options['description']) : $form_item; + } + + private function phone($value = null, $form_type = 0, $label_align = "") { + $options = $this->get_sanitized_options(); + $value = empty($value) ? $options['default'] : $value; + // HTML5 types + $type = 'tel'; + $form_item = sprintf( + '', $options['field_id'], $options['id_attr'], $value, $options['size'], $options['required'], $options['validation'], $options['css'], $type, $options['readonly'] ? 'disabled' : '' + ); + + return (!empty($options['description']) ) ? + sprintf('%1$s', $form_item, $options['description']) : $form_item; + } + + private function password($form_type = 0, $label_align = "") { + extract($this->get_sanitized_options()); + $required = $form_type == SwpmFbForm::PROFILE ? '' : $required; + $form_item = sprintf( + '
    ', $field_id, $id_attr, $default, $size, $required, $validation, $css + ); + $form_item .= sprintf( + '
    ', $field_id, $id_attr, $default, $size, $required, $validation, $css + ); + + return (!empty($description) ) ? + sprintf('
    %1$s
    ', $form_item, $description) : $form_item; + } + + private function textarea($value = null, $form_type = 0, $label_align = "") { + extract($this->get_sanitized_options()); + $value = empty($value) ? $default : $value; + $form_item = sprintf( + '', $field_id, $id_attr, $value, $size, $required, $css + ); + + $output = '
    '; + + $output .= (!empty($description) ) ? + sprintf('%1$s', $form_item, $description) : $form_item; + + $output .= '
    '; + return $output; + } + + private function checkbox($value = null, $form_type = 0, $label_align = "") { + extract($this->get_sanitized_options()); + $field_options = maybe_unserialize($this->options); + + $options = ''; + $saved_value = maybe_unserialize(empty($value) ? $default : $value); + // Loop through each option and output + $indexes = array_keys((array) $saved_value); + foreach ($field_options as $option => $value) { + $options .= sprintf( + '
    ', $field_id, $id_attr, $option, $css, esc_attr(trim(stripslashes($value))), wp_specialchars_decode(stripslashes($value)), checked(in_array($option, $indexes) ? $option : -1, $option, 0) + ); + } + + $form_item = $options; + + $output = sprintf('
    ', empty($required) ? "" : "swpm-checkbox-required"); + + $output .= (!empty($description) ) ? sprintf('%1$s', $form_item, $description) : $form_item; + + $output .= '
    '; + return $output; + } + + private function address($value = array(), $form_type = 0, $label_align = "") { + extract($this->get_sanitized_options()); + $address = ''; + $swpm_settings = get_option('swpm-settings'); + + // Settings - Place Address labels above fields + $settings_address_labels = isset($swpm_settings['address-labels']) ? false : true; + $address_parts = array( + 'address' => array( + 'label' => __('Street Address', 'swpm-form-builder'), + 'layout' => 'full', + 'value' => isset($value['address']) ? $value['address'] : '' + ), + 'address-2' => array( + 'label' => __('Apt, Suite, Bldg. (optional)', 'swpm-form-builder'), + 'layout' => 'full', + 'value' => isset($value['address-2']) ? $value['address-2'] : '' + ), + 'city' => array( + 'label' => __('City', 'swpm-form-builder'), + 'layout' => 'left', + 'value' => isset($value['city']) ? $value['city'] : '' + ), + 'state' => array( + 'label' => __('State / Province / Region', 'swpm-form-builder'), + 'layout' => 'right', + 'value' => isset($value['state']) ? $value['state'] : '' + ), + 'zip' => array( + 'label' => __('Postal / Zip Code', 'swpm-form-builder'), + 'layout' => 'left', + 'value' => isset($value['zip']) ? $value['zip'] : '' + ), + 'country' => array( + 'label' => __('Country', 'swpm-form-builder'), + 'layout' => 'right', + 'value' => isset($value['country']) ? $value['country'] : $default + ) + ); + + $address_parts = apply_filters('swpm_address_labels', $address_parts, $this->form_id); + $label_placement = apply_filters('swpm_address_labels_placement', $settings_address_labels, $this->form_id); + $placement_bottom = ( $label_placement ) ? '' : ''; + $placement_top = (!$label_placement ) ? '' : ''; + + foreach ($address_parts as $parts => $part) : + + // Make sure the second address line is not required + $addr_required = ( 'address-2' !== $parts ) ? $required : ''; + + if ('country' == $parts) : + + $options = ''; + + foreach (SwpmFbUtils::$countries as $country) { + $options .= sprintf('', $country, selected($part['value'], $country, 0)); + } + + $address .= sprintf( + '' . $placement_top . '' . $placement_bottom . '', $field_id, $id_attr, esc_attr($part['layout']), esc_attr($parts), esc_html($part['label']), $options, $addr_required, $css + ); + + else : + + $address .= sprintf( + '' . $placement_top . '' . $placement_bottom . '', $field_id, $id_attr, esc_attr($part['layout']), esc_attr($parts), esc_html($part['label']), $size, $addr_required, $css + ); + + endif; + + endforeach; + + $output = '
    '; + + $output .=!empty($description) ? "$address" : $address; + + $output .= '
    '; + return $output; + } + + private function date($value = null, $form_type = 0, $label_align = "") { + extract($this->get_sanitized_options()); + // Load jQuery UI datepicker library + wp_enqueue_script('jquery-ui-datepicker'); + wp_enqueue_script('swpm-datepicker-i18n'); + + $options = maybe_unserialize($this->options); + $dateFormat = ( $options ) ? $options['dateFormat'] : ''; + $value = empty($value) ? $default : $value; + $form_item = sprintf( + '', $field_id, $id_attr, $value, $size, $required, $css, $dateFormat + ); + + $output = (!empty($description) ) ? sprintf('%1$s', $form_item, $description) : $form_item; + return $output; + } + + private function time($value = null, $form_type = 0, $label_align = "") { + extract($this->get_sanitized_options()); + $hour = $minute = $ampm = ''; + + // Get the time format (12 or 24) + $time_format = str_replace('time-', '', $validation); + + $time_format = apply_filters('swpm_time_format', $time_format, $this->form_id); + $total_mins = apply_filters('swpm_time_min_total', 55, $this->form_id); + $min_interval = apply_filters('swpm_time_min_interval', 5, $this->form_id); + + // Set whether we start with 0 or 1 and how many total hours + $hour_start = ( $time_format == '12' ) ? 1 : 0; + $hour_total = ( $time_format == '12' ) ? 12 : 23; + + // Hour + for ($i = $hour_start; $i <= $hour_total; $i++) { + $hour .= sprintf('', $i); + } + + // Minute + for ($i = 0; $i <= $total_mins; $i += $min_interval) { + $minute .= sprintf('', $i); + } + + // AM/PM + if ($time_format == '12') { + $ampm = sprintf( + '', $field_id, $id_attr, $hour, $minute, $required, $css + ); + } + + $form_item = sprintf( + '' . + '' . + '%7$s', $field_id, $id_attr, $hour, $minute, $required, $css, $ampm + ); + + $output = (!empty($description) ) ? sprintf('%1$s', $form_item, $description) : $form_item; + + $output .= '
    '; + return $output; + } + + private function html($value = null, $form_type = 0, $label_align = "") { + extract($this->get_sanitized_options()); + //Load CKEditor library + wp_enqueue_script('swpm-ckeditor'); + $value = empty($value) ? $default : $value; + $form_item = sprintf( + '', $field_id, $id_attr, $value, $size, $required, $css + ); + + $output = '
    '; + + $output .= (!empty($description) ) ? sprintf('%1$s', $form_item, $description) : $form_item; + + $output .= '
    '; + return $output; + } + + private function file_upload($value = null, $form_type = 0, $label_align = "") { + extract($this->get_sanitized_options()); + $options = maybe_unserialize($this->options); + $accept = (!empty($options[0]) ) ? " {accept:'$options[0]'}" : ''; + $form_item = sprintf( + '
    ', $field_id, $id_attr, $default, $size, (($form_type == SwpmFbForm::PROFILE) && !empty($value) ) ? "" : $required, $validation, $css, $accept + ); + + $section = (!empty($description) ) ? sprintf('%1$s', $form_item, $description) : $form_item; + if ($this->key == 'profile_image') { + $url = wp_get_attachment_url($value); + $profile_image = empty($url) ? get_avatar("", 100, "mm") : sprintf('', $url); + $section = '
    ' . $profile_image . '
    ' . $section; + } + return '
    ' . $section . '
    '; + } + + private function instructions($form_type = 0, $label_align = "") { + extract($this->get_sanitized_options()); + return wp_specialchars_decode(esc_html(stripslashes($description)), ENT_QUOTES); + } + + public function get_sanitized_options() { + $css = is_admin() ? ((in_array($this->type, array('text', 'password', 'email'))) ? 'regular-text' : '') : $this->css; + $description = $this->description; + return array( + 'field_id' => absint($this->id), + 'field_type' => esc_html($this->type), + 'field_name' => esc_html(stripslashes($this->name)), + 'required_span' => (!empty($this->required) && $this->required === 'yes' ) ? ' *' : '', + 'required' => (!empty($this->required) && $this->required === 'yes' ) ? esc_attr(' required') : '', + 'validation' => (!empty($this->validation) ) ? esc_attr(" $this->validation") : '', + 'css' => (!empty($css) ) ? esc_attr(" $css") : '', + 'id_attr' => "swpm-" . absint($this->id), + 'size' => (!empty($this->size) ) ? esc_attr(" swpm-$this->size") : '', + 'layout' => (!empty($this->layout) ) ? esc_attr(" swpm-$this->layout") : '', + 'default' => (!empty($this->default) ) ? wp_specialchars_decode(esc_html(stripslashes($this->default)), ENT_QUOTES) : '', + 'description' => (!empty($description) ) ? wp_specialchars_decode(esc_html(stripslashes($description)), ENT_QUOTES) : '', + 'readonly' => ( $this->readonly == 'yes') ? true : false, + 'adminonly' => ( $this->adminonly == 'yes') ? true : false, + ); + } + +} diff --git a/classes/class.swpm-fb-form-custom.php b/classes/class.swpm-fb-form-custom.php new file mode 100644 index 0000000..b7514ea --- /dev/null +++ b/classes/class.swpm-fb-form-custom.php @@ -0,0 +1,278 @@ +spam_score = 0; + $this->error = array(); + $this->custom_info = array(); + $this->custom = array(); + } + + protected function get_custom($member_id) { + global $wpdb; + $query = 'SELECT * FROM ' . $wpdb->prefix . 'swpm_form_builder_custom WHERE user_id= %d'; + $query = $wpdb->prepare($query, $member_id); + foreach ($wpdb->get_results($query) as $row) { + $id = empty($row->reg_field_id) ? $row->field_id : $row->reg_field_id; + $this->custom_info[$id] = $row; + } + } + + public function is_valid() { + return empty($this->error); + } + + public function admin_ui($fields) { + $html = '

    Custom Fields

    '; + $html .= ''; + foreach ($fields as $field) { + $id = $field->get_unique_value_id(); + $value = isset($this->custom_info[$id]) ? $this->custom_info[$id]->value : ''; + $html .= ''; + } + return $html . '
    '; + $html .= $field->toHTML($value, SwpmFbForm::PROFILE); + $html .= '
    '; + } + + public function init($member_id) { + $this->get_custom($member_id); + $this->member_id = $member_id; + } + + public function process_custom($fields) { + foreach ($fields as $field) { + $type = str_replace('-', '_', $field->type); + if (method_exists($this, $type)) { + $this->$type($field); + } + } + } + + protected function text($meta) { + $value = filter_input(INPUT_POST, 'swpm-' . $meta->id); + if ($meta->required == 'yes' && empty($value)) { + $this->error[$meta->id] = $meta->name . BUtils::_(' Field is required'); + return; + } + $this->custom[$meta->get_unique_value_id()] = sanitize_text_field($value); + $this->spam_score += SwpmFbUtils::calculate_spam_score($value); + } + + protected function checkbox($meta) { + $args = array('swpm-' . $meta->id => array( + 'filter' => FILTER_SANITIZE_STRING, + 'flags' => FILTER_REQUIRE_ARRAY, + )); + $value = filter_input_array(INPUT_POST, $args); + $value = $value['swpm-' . $meta->id]; + if ($meta->required == 'yes' && empty($value)) { + $this->error[$meta->id] = $meta->name . BUtils::_(' Field is required'); + return; + } + $this->custom[$meta->get_unique_value_id()] = $value; + } + + protected function radio($meta) { + $value = filter_input(INPUT_POST, 'swpm-' . $meta->id); + if ($meta->required == 'yes' && empty($value)) { + $this->error[$meta->id] = $meta->name . BUtils::_(' Field is required'); + return; + } + $this->custom[$meta->get_unique_value_id()] = wp_kses_data($value); + $this->spam_score += SwpmFbUtils::calculate_spam_score($value); + } + + protected function select($meta) { + $value = filter_input(INPUT_POST, 'swpm-' . $meta->id); + if ($meta->required == 'yes' && empty($value)) { + $this->error[$meta->id] = $meta->name . BUtils::_(' Field is required'); + return; + } + $this->custom[$meta->get_unique_value_id()] = wp_kses_data($value); + $this->spam_score += SwpmFbUtils::calculate_spam_score($value); + } + + protected function date($meta) { + $value = filter_input(INPUT_POST, 'swpm-' . $meta->id); + if ($meta->required == 'yes' && empty($value)) { + $this->error[$meta->id] = $meta->name . BUtils::_(' Field is required'); + return; + } + // todo: check date format. + $this->custom[$meta->get_unique_value_id()] = wp_kses_data($value); + $this->spam_score += SwpmFbUtils::calculate_spam_score($value); + } + + protected function time($meta) { + $value = filter_input(INPUT_POST, 'swpm-' . $meta->id); + if ($meta->required == 'yes' && empty($value)) { + $this->error[$meta->id] = $meta->name . BUtils::_(' Field is required'); + return; + } + //todo: check format. + $this->custom[$meta->get_unique_value_id()] = wp_kses_data($value); + $this->spam_score += SwpmFbUtils::calculate_spam_score($value); + } + + protected function phone($meta) { + $value = filter_input(INPUT_POST, 'swpm-' . $meta->id); + if ($meta->required == 'yes' && empty($value)) { + $this->error[$meta->id] = BUtils::_($meta->name . ' Field is required'); + return; + } + //todo: phone number format validation + $this->custom[$meta->get_unique_value_id()] = wp_kses_data($value); + $this->spam_score += SwpmFbUtils::calculate_spam_score($value); + } + + protected function url($meta) { + $value = filter_input(INPUT_POST, 'swpm-' . $meta->id); + if ($meta->required == 'yes' && empty($value)) { + $this->error[$meta->id] = $meta->name . BUtils::_(' Field is required'); + return; + } + if (!empty($value) && !preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $value)) { + $this->error[$meta->id] = $meta->name . BUtils::_(' not a valid url'); + return; + } + $this->custom[$meta->get_unique_value_id()] = wp_kses_data($value); + $this->spam_score += SwpmFbUtils::calculate_spam_score($value); + } + + protected function number($meta) { + $value = filter_input(INPUT_POST, 'swpm-' . $meta->id); + if ($meta->required == 'yes' && empty($value)) { + $this->error[$meta->id] = $meta->name . BUtils::_(' Field is required'); + return; + } + if (!is_numeric($value)) { + $this->error[$meta->id] = $meta->name . BUtils::_(' must be a valid number'); + return; + } + if (strlen($value) <= 9 || !preg_match('/^((\+)?[1-9]{1,2})?([-\s\.])?((\(\d{1,4}\))|\d{1,4})(([-\s\.])?[0-9]{1,12}){1,2}$/', $value)) { + $this->error[$meta->id] = $meta->name . BUtils::_(' not a valid phone number'); + return; + } + $this->custom[$meta->get_unique_value_id()] = wp_kses_data($value); + $this->spam_score += SwpmFbUtils::calculate_spam_score($value); + } + + protected function file_upload($meta) { + $value = ( isset($_FILES['swpm-' . $meta->id]) ) ? $_FILES['swpm-' . $meta->id] : ''; + if (is_array($value) && $value['size'] > 0) { + $status = SwpmFbUtils::handle_file_upload($value); + if (isset($status['error'])) { + $this->error[$meta->id] = $status['error']; + return; + } + $this->custom[$meta->get_unique_value_id()] = $status['file']; + } + if ($this->formmeta->type == self::PROFILE) { + // unlink existing image. + } + } + + protected function address($meta) { + if (isset($_POST['swpm-' . $meta->id])) { + $address = $_POST['swpm-' . $meta->id]; + $allowed_html = array('br' => array()); + $address['address'] = wp_kses($address['address'], $allowed_html); + $address['address'] = wp_kses($address['address-2'], $allowed_html); + $address['city'] = wp_kses($address['city'], $allowed_html); + $address['state'] = wp_kses($address['state'], $allowed_html); + $address['zip'] = wp_kses($address['zip'], $allowed_html); + $address['country'] = wp_kses($address['country'], $allowed_html); + $this->custom[$meta->get_unique_value_id()] = json_encode($address); + //todo: spam score + } else if ($meta->required == 'yes') { + $this->error[$meta->id] = BUtils::_($meta->name . ' Field is required'); + } + } + + protected function textarea($meta) { + $value = filter_input(INPUT_POST, 'swpm-' . $meta->id); + if ($meta->required == 'yes' && empty($value)) { + $this->error[$meta->id] = $meta->name . BUtils::_(' Field is required'); + return; + } + $this->custom[$meta->get_unique_value_id()] = wp_strip_all_tags($value); + $this->spam_score += SwpmFbUtils::calculate_spam_score($value); + } + + protected function currency($meta) { + $value = filter_input(INPUT_POST, 'swpm-' . $meta->id); + if ($meta->required == 'yes' && empty($value)) { + $this->error[$meta->id] = $meta->name . BUtils::_(' Field is required'); + return; + } + if (!is_numeric($value)) { + $this->error[$meta->id] = $meta->name . BUtils::_(' must be a valid number'); + return; + } + $this->custom[$meta->get_unique_value_id()] = wp_kses_data($value); + $this->spam_score += SwpmFbUtils::calculate_spam_score($value); + } + + protected function html($meta) { + $value = filter_input(INPUT_POST, 'swpm-' . $meta->id); + if ($meta->required == 'yes' && empty($value)) { + $this->error[$meta->id] = $meta->name . BUtils::_(' Field is required'); + return; + } + $this->custom[$meta->get_unique_value_id()] = wp_kses_data($value); + $this->spam_score += SwpmFbUtils::calculate_spam_score($value); + } + + protected function email($meta) { + $value = filter_input(INPUT_POST, 'swpm-' . $meta->id); + if ($meta->required == 'yes' && empty($value)) { + $this->error[$meta->id] = $meta->name . BUtils::_(' Field is required'); + return; + } + $this->custom[$meta->get_unique_value_id()] = sanitize_email($value); + $this->spam_score += SwpmFbUtils::calculate_spam_score($value); + } + + public function error($key = '', $value = '') { + if (empty($key)) { + return $this->error; + } + $this->error[$key] = $value; + } + + public function save() { + global $wpdb; + foreach ($this->custom as $field_id => $value) { + $v = is_array($value) ? serialize($value) : $value; + if (isset($this->custom_info[$field_id])) { + $wpdb->update($wpdb->prefix . 'swpm_form_builder_custom', array( + 'value' => $v + ), array('value_id' => $this->custom_info[$field_id]->value_id)); + } else { + $wpdb->insert($wpdb->prefix . 'swpm_form_builder_custom', array( + 'value' => $v, + 'user_id' => $this->member_id, + 'field_id' => $field_id + )); + } + } + } + +} diff --git a/classes/class.swpm-fb-form.php b/classes/class.swpm-fb-form.php new file mode 100644 index 0000000..0351fa9 --- /dev/null +++ b/classes/class.swpm-fb-form.php @@ -0,0 +1,483 @@ +fatal = array(); + $this->data = array(); + $this->member_info = new stdClass(); + $this->required_fields_count = 0; + parent::__construct(); + } + + public function init_by_id($form_id) { + if (BUtils::is_paid_registration()) { + $this->member_info = BUtils::get_paid_member_info(); + if (empty($this->member_info)) { + $form->error[] = BUtils::_('Error! Invalid Request. Could not find a match for the given security code and the user ID.'); + } else { + $membership_level = $this->member_info->membership_level; + } + } else { + $membership_level = BUtils::get_free_level(); + if (empty($membership_level)) { + $joinuspage_link = 'Join us'; + $this->fatal[] = BUtils::_('Free membership is disabled on this site. Please make a payment from the ' . $joinuspage_link . ' page to pay for a premium membership.'); + return; + } + } + $this->membership_level_info = BPermission::get_instance($membership_level); + $this->init($form_id); + } + + public function init_by_level_for_registration($membership_level) { + if (BUtils::is_paid_registration()) { + $this->member_info = BUtils::get_paid_member_info(); + if (empty($this->member_info)) { + $form->error[] = BUtils::_('Error! Invalid Request. Could not find a match for the given security code and the user ID.'); + } else { + $membership_level = $this->member_info->membership_level; + } + } + $this->membership_level_info = BPermission::get_instance($membership_level); + $level = $this->membership_level_info->get('id'); + + if (empty($level)) { + $joinuspage_link = 'Join us'; + $this->fatal[] = BUtils::_('Free membership is disabled on this site. Please make a payment from the ' . $joinuspage_link . ' page to pay for a premium membership.'); + return; + } + global $wpdb; + $query = $wpdb->prepare("SELECT form_id FROM {$wpdb->prefix}swpm_form_builder_forms WHERE form_type = 0 AND " + . " (form_membership_level = %d OR form_membership_level = 0 ) " + . " ORDER BY form_membership_level DESC", $level); + $form_id = $wpdb->get_var($query); + if (empty($form_id)) { + $this->fatal[] = BUtils::_('Error! Form not found.'); + return; + } + + $this->init($form_id); + } + + public function get_level_info($key) { + return $this->membership_level_info->get($key); + } + + public function init_by_level_for_profile() { + global $wpdb; + $auth = BAuth::get_instance(); + if (!$auth->is_logged_in()) { + $this->fatal[] = BUtils::_('Please login to edit profile.'); + } + + $membership_level = $auth->get('membership_level'); + $this->membership_level_info = BPermission::get_instance($membership_level); + $query = $wpdb->prepare("SELECT form_id FROM {$wpdb->prefix}swpm_form_builder_forms WHERE form_type = 1 AND " + . " (form_membership_level= %d OR form_membership_level=0 )" + . " ORDER BY form_membership_level DESC", $this->membership_level_info->get('id')); + $form_id = $wpdb->get_var($query); + parent::init($auth->get('member_id')); // load custom fields when editing profile. + if (empty($form_id)) { + $this->fatal[] = BUtils::_('Form Build Error! Form not found.'); + return; + } + $this->init($form_id); + $this->member_info = $auth->userData; + } + + public function init($form_id) { + $this->formmeta = new SwpmFbFormmeta(); + $this->formmeta->load($form_id, true); + return true; + } + + public function is_valid() { + if ($this->formmeta->type == SwpmFbForm::REGISTRATION && $this->required_fields_count != 3) { + return false; + } + return empty($this->error); + } + + public function get_field_value($field) { + if (isset($_POST['swpm-' . $field->id])) { + return $_POST['swpm-' . $field->id]; + } + $key = str_replace('-', '_', $field->key); + if ($this->formmeta->type == self::REGISTRATION) { + if ($key == 'membership_level') { + return $this->membership_level_info->get('id'); + } + return ''; + } + if ($this->formmeta->type == self::PROFILE) { + $id = $field->get_unique_value_id(); + if ($key == 'custom' && isset($this->custom_info[$id])) { + if ($field->type == 'address') { + return json_decode($this->custom_info[$id]->value, true); + } + return $this->custom_info[$id]->value; + } + if ($key == 'primary_address') { + $address = explode(',', $this->member_info->address_street); + return array('address' => $address[0], + 'address-2' => isset($address[1]) ? $address[1] : '', + 'city' => $this->member_info->address_city, + 'state' => $this->member_info->address_state, + 'zip' => $this->member_info->address_zipcode, + 'country' => $this->member_info->country + ); + } + if (isset($this->member_info->{$field->type})) { + return $this->member_info->{$field->type}; + } + if (isset($this->member_info->{$key})) { + return $this->member_info->{$key}; + } + } + return ''; + } + + public function process() { + if ($this->is_fatal()) { + return; // if already got fatal error. + } + // mandatory fields + foreach ($this->formmeta->fields as $field) { + $key = str_replace('-', '_', $field->key); + $type = str_replace('-', '_', $field->type); + if (method_exists($this, $key)) { + $this->$key($field); + } else if (method_exists($this, $type)) { + $this->$type($field); + } + } + if ($this->spam_score > self::SPAM_SENSITIVITY) { + $this->error["Spam Words"] = BUtils::_(' Information You submitted contains too many spam word. Cannot continue.'); + } + /* if ($this->is_valid()){ + $this->save(); + return true; + } + return false; */ + } + + private function password($meta) { + if ($this->formmeta->type == self::REGISTRATION) { + $this->required_fields_count += 1; + } + $value = filter_input(INPUT_POST, 'swpm-' . $meta->id); + if (empty($value)) { + if ($this->formmeta->type == self::PROFILE) { + return; + } + $this->error[$meta->id] = BUtils::_($meta->name . ' Field is required'); + return; + } + $value_re = filter_input(INPUT_POST, 'swpm-' . $meta->id . '_re'); + if ($value == $value_re) { + include_once(ABSPATH . WPINC . '/class-phpass.php'); + $wp_hasher = new PasswordHash(8, TRUE); + //$this->sanitized['plain_password'] = $password; + $this->data['password'] = $wp_hasher->HashPassword(trim($value)); + $this->data['plain_password'] = $value; + //$this->data['password'] = sanitize_text_field($value); + return; + } + $this->error[$meta->name] = BUtils::_($meta->name . ' Password doesn\'t match'); + } + + private function user_name($meta) { + $value = filter_input(INPUT_POST, 'swpm-' . $meta->id); + if ($this->formmeta->type == SwpmFbForm::REGISTRATION) { + if (empty($value)) { + $this->error[$meta->id] = BUtils::_($meta->name . ' Field is required'); + return; + } + if (preg_match("/^[a-zA-Z0-9!@#$%&*+\/=?^_`{|}~\.-]+$/", $value) === 0) { + $this->error[$meta->id] = BUtils::_($meta->name . ' Field has invalid character'); + return; + } + $this->required_fields_count += 1; + global $wpdb; + $query = $wpdb->prepare('SELECT 1 as yes FROM ' . $wpdb->prefix . 'swpm_members_tbl WHERE user_name=%s', $value); + + $exists = $wpdb->get_var($query); + if (!empty($exists)) { + $this->error[$meta->id] = $value . ' ' . BUtils::_('Already taken.'); + return; + } + $this->data['user_name'] = sanitize_text_field($value); + $this->spam_score += SwpmFbUtils::calculate_spam_score($value); + } + } + + private function first_name($meta) { + $value = filter_input(INPUT_POST, 'swpm-' . $meta->id); + if ($meta->required == 'yes' && empty($value)) { + $this->error[$meta->id] = BUtils::_($meta->name . ' Field is required'); + return; + } + $this->data['first_name'] = sanitize_text_field($value); + $this->spam_score += SwpmFbUtils::calculate_spam_score($value); + } + + private function last_name($meta) { + $value = filter_input(INPUT_POST, 'swpm-' . $meta->id); + if ($meta->required == 'yes' && empty($value)) { + $this->error[$meta->id] = BUtils::_($meta->name . ' Field is required'); + return; + } + $this->data['last_name'] = sanitize_text_field($value); + $this->spam_score += SwpmFbUtils::calculate_spam_score($value); + } + + private function gender($meta) { + $value = filter_input(INPUT_POST, 'swpm-' . $meta->id); + if ($meta->required == 'yes' && empty($value)) { + $this->error[$meta->id] = BUtils::_($meta->name . ' Field is required'); + return; + } + $this->data['gender'] = strtolower(wp_kses_data($value)); + $this->spam_score += SwpmFbUtils::calculate_spam_score($value); + } + + private function title($meta) { + $value = filter_input(INPUT_POST, 'swpm-' . $meta->id); + if ($meta->required == 'yes' && empty($value)) { + $this->error[$meta->id] = BUtils::_($meta->name . ' Field is required'); + return; + } + $this->data['title'] = strtolower(wp_kses_data($value)); + $this->spam_score += SwpmFbUtils::calculate_spam_score($value); + } + + private function primary_address($meta) { + if (isset($_POST['swpm-' . $meta->id])) { + $address = $_POST['swpm-' . $meta->id]; + $allowed_html = array('br' => array()); + $this->data['address_street'] = wp_kses($address['address'] . ', ' . $address['address-2'], $allowed_html); + $this->data['address_city'] = wp_kses($address['city'], $allowed_html); + $this->data['address_state'] = wp_kses($address['state'], $allowed_html); + $this->data['address_zipcode'] = wp_kses($address['zip'], $allowed_html); + $this->data['country'] = wp_kses($address['country'], $allowed_html); + //todo: spam score + } else if ($meta->required == 'yes') { + $this->error[$meta->id] = BUtils::_($meta->name . ' Field is required'); + } + } + + private function primary_phone($meta) { + $value = filter_input(INPUT_POST, 'swpm-' . $meta->id); + if ($meta->required == 'yes' && empty($value)) { + $this->error[$meta->id] = BUtils::_($meta->name . ' Field is required'); + return; + } + //todo: phone number format validation + $this->data['phone'] = wp_kses_data($value); + $this->spam_score += SwpmFbUtils::calculate_spam_score($value); + } + + private function primary_email($meta) { + if ($this->formmeta->type == self::REGISTRATION) { + $this->required_fields_count += 1; + } + $value = filter_input(INPUT_POST, 'swpm-' . $meta->id); + if (empty($value)) { + $this->error[$meta->id] = BUtils::_($meta->name . ' Field is required'); + return; + } + if (!is_email($value)) { + $this->error[$meta->id] = $value . ' ' . BUtils::_('Invalid email.'); + return; + } + + if ($this->formmeta->type == SwpmFbForm::PROFILE && $value == $this->member_info->email) { + return; // same email address. doesn't require storing in db again. + } + global $wpdb; + $query = $wpdb->prepare('SELECT email FROM ' . $wpdb->prefix . 'swpm_members_tbl WHERE email=%s', $value); + $exists = $wpdb->get_var($query); + if (!empty($exists)) { + $this->error[$meta->id] = $value . ' ' . BUtils::_('Already taken.'); + return; + } + $this->data['email'] = sanitize_email($value); + $this->spam_score += SwpmFbUtils::calculate_spam_score($value); + } + + private function membership_level($meta) { + if (!is_admin() && $this->formmeta->type == SwpmFbFormCustom::PROFILE) { + return; + } + if (BUtils::is_paid_registration()) { + return; + } + $free = BUtils::get_free_level(); + + if (empty($free)) { + return; + } + + $this->data['membership_level'] = $free; + } + + private function profile_image($meta) { + $value = ( isset($_FILES['swpm-' . $meta->id]) ) ? $_FILES['swpm-' . $meta->id] : ''; + if ($meta->required == 'yes') { + if ($this->formmeta->type == self::REGISTRATION && empty($value)) { + $this->error[$meta->id] = BUtils::_($meta->name . ' Field is required'); + return; + } + if ($this->formmeta->type == self::PROFILE && empty($value) && empty($this->member_info->profile_image)) { + $this->error[$meta->id] = BUtils::_($meta->name . ' Field is required'); + return; + } + } + + if (is_array($value) && $value['size'] > 0) { + $status = SwpmFbUtils::handle_file_upload($value); + if (isset($status['error'])) { + $this->error[$meta->id] = $status['error']; + return; + } + $this->data['profile_image'] = $status['attachment_id']; + if ($this->formmeta->type == self::PROFILE) { + //delete previously stored one. + wp_delete_attachment($this->member_info->profile_image, true); + } + } + } + + public function fatal($key = '', $value = '') { + if (empty($key)) { + return $this->fatal; + } + $this->fatal[$key] = $value; + } + + public function is_fatal() { + return !empty($this->fatal); + } + + public function save() { + global $wpdb; + + $account_status = BSettings::get_instance()->get_value('default-account-status', 'active'); + $auth = BAuth::get_instance(); + if ($this->formmeta->type == self::REGISTRATION) { + $plain_password = $this->data['plain_password']; + unset($this->data['plain_password']); + $this->data['account_state'] = $account_status; + if (isset($this->member_info->member_id)) { + $this->data['reg_code'] = ''; + $wpdb->update($wpdb->prefix . "swpm_members_tbl", $this->data, array('member_id' => $this->member_info->member_id)); + $user_id = $this->member_info->member_id; + } else { + $this->data['member_since'] = (date("Y-m-d")); + $this->data['subscription_starts'] = date("Y-m-d"); + $this->data['last_accessed_from_ip'] = BTransfer::get_real_ip_addr(); + $this->data['last_accessed'] = date("Y-m-d H:i:s"); + $wpdb->insert($wpdb->prefix . "swpm_members_tbl", $this->data); + $user_id = $wpdb->insert_id; + } + $query = "SELECT role FROM " . $wpdb->prefix . "swpm_membership_tbl WHERE id = " . $this->data['membership_level']; + $wp_user_info = array(); + $wp_user_info['user_nicename'] = implode('-', explode(' ', $this->data['user_name'])); + $wp_user_info['display_name'] = $this->data['user_name']; + $wp_user_info['user_email'] = $this->data['email']; + $wp_user_info['nickname'] = $this->data['user_name']; + $wp_user_info['first_name'] = $this->data['first_name']; + $wp_user_info['last_name'] = $this->data['last_name']; + $wp_user_info['user_login'] = $this->data['user_name']; + $wp_user_info['password'] = $plain_password; + $wp_user_info['role'] = $wpdb->get_var($query); + $wp_user_info['user_registered'] = date('Y-m-d H:i:s'); + BUtils::create_wp_user($wp_user_info); + $this->data['plain_password'] = $plain_password; + $this->send_reg_email(); + } else if (!$auth->is_logged_in()) { // must be profile edit/must be logged in. + return; + } + + if ($this->formmeta->type == self::PROFILE) { + $user_id = $auth->get('member_id'); + $plain_password = ''; + if (isset($this->data['plain_password'])) { + $plain_password = $this->data['plain_password']; + unset($this->data['plain_password']); + } + $wpdb->update($wpdb->prefix . "swpm_members_tbl", $this->data, array('member_id' => $user_id)); + $wp_data = $this->data; + if (!empty($plain_password)) { + $wp_data['plain_password'] = $plain_password; + } + Butils::update_wp_user($auth->get('user_name'), $wp_data); + + $wp_user = get_user_by('login', $auth->get('user_name')); + if ($wp_user) { + BUtils::update_wp_user_Role($wp_user->ID, $auth->get('role')); + } + } + parent::init($user_id); // load custom fields. + parent::save(); // save custom fields + } + + protected function send_reg_email() { + global $wpdb; + if (empty($this->data)) { + return false; + } + $member_info = $this->data; + $settings = BSettings::get_instance(); + $subject = empty($this->formmeta->notification_setting) ? + $settings->get_value('reg-complete-mail-subject') : stripslashes($this->formmeta->notification_subject); + + $body = empty($this->formmeta->notification_setting) ? + $settings->get_value('reg-complete-mail-body') : stripslashes(html_entity_decode(wp_kses_stripslashes(($this->formmeta->notification_message)))); + $from_address = empty($this->formmeta->notification_setting) ? + $settings->get_value('email-from') : stripslashes($this->formmeta->notification_email_name); + + $login_link = $settings->get_value('login-page-url'); + $headers = 'From: ' . $from_address . "\r\n"; + $headers .= "MIME-Version: 1.0\r\n"; + if (!empty($this->formmeta->notification_setting)) { + $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; + } + $query = "SELECT alias FROM " . $wpdb->prefix . "swpm_membership_tbl WHERE id = " . $member_info['membership_level']; + $member_info['membership_level_name'] = $wpdb->get_var($query); + $member_info['password'] = $member_info['plain_password']; + $member_info['login_link'] = $login_link; + $values = array_values($member_info); + $keys = array_map('swpm_enclose_var', array_keys($member_info)); + $body = str_replace($keys, $values, $body); + + $email = sanitize_email($this->formmeta->type == self::REGISTRATION ? $this->data['email'] : $this->member_info->email); +// if (!empty($this->formmeta->notification_setting)) { + wp_mail(trim($email), $subject, $body, $headers); +// } + if ($settings->get_value('enable-admin-notification-after-reg')) { + $subject = "Notification of New Member Registration"; + $body = "A new member has registered. The following email was sent to the member." . + "\n\n-------Member Email----------\n" . $body . + "\n\n------End------\n"; + wp_mail($from_address, $subject, $body, $headers); + } + return true; + } + +} diff --git a/classes/class.swpm-fb-formmeta.php b/classes/class.swpm-fb-formmeta.php new file mode 100644 index 0000000..9ae208c --- /dev/null +++ b/classes/class.swpm-fb-formmeta.php @@ -0,0 +1,138 @@ +error = array(); + $this->data = array(); + $this->custom = array(); + $this->table = $wpdb->prefix . 'swpm_form_builder_forms'; + $this->ftable = $wpdb->prefix . 'swpm_form_builder_fields'; + } + public function create(){ + + } + public function save(){ + global $wpdb; + $out = true; + $data = array( + 'form_key' => $this->key, + 'form_title' => $this->title, + 'form_type' => $this->type, + 'form_membership_level' => $this->for_level, + 'form_success_type' => $this->success_type, + 'form_success_message' => $this->success_message, + 'form_notification_email_name'=> $this->notification_email_name, + 'form_notification_subject'=> $this->notification_subject, + 'form_notification_message'=> $this->notification_message + ); + // todo: validate here + if (empty($this->id)){ + // Create the form + $out = $wpdb->insert($this->table, $data); + // Get form ID to add our first field + $this->id = $wpdb->insert_id; + for($i = 0; $i< count($this->fields); $i++){ + $field = $this->fields[$i]; + $field->form_id = $this->id; + //todo: set parent; + $field->save(); + } + } + else{ + $wpdb->update($this->table, $data, array('form_id'=>$this->id)); + for($i = 0; $i< count($this->fields); $i++){ + $field = $this->fields[$i]; + $field->form_id = $this->id; + //todo: set parent; + $field->save(); + } + } + return $out; + } + public function load($form_id, $load_fields=true){ + global $wpdb; + $query = $wpdb->prepare("SELECT + form_id AS id, + form_key AS _key, + form_title AS title, + form_type AS type, + form_membership_level AS for_level, + form_success_type AS success_type, + form_success_message AS success_message, + form_notification_setting AS notification_setting, + form_notification_email_name AS notification_email_name, + form_notification_subject AS notification_subject, + form_notification_message AS notification_message, + form_label_alignment AS label_alignment + FROM $this->table WHERE form_id=%d", $form_id); + $data = $wpdb->get_row($query); + foreach($data as $key=>$value){ + if ($key == '_key'){$this->key = $value; continue;} + $this->$key = $value; + } + if ($load_fields){ + $query = $wpdb->prepare( + "SELECT + field_id AS id, + form_id, + field_key AS _key, + field_type AS type, + field_options AS options, + field_description AS description, + field_name AS name, + field_sequence AS sequence, + field_parent AS parent, + field_validation AS validation, + field_required AS required, + field_size AS size, + field_css AS css, + field_layout AS layout, + field_default AS _default, + field_readonly As readonly, + field_adminonly AS adminonly, + reg_field_id AS reg_field_id + FROM $this->ftable WHERE form_id= %d ORDER BY field_sequence ASC", + $form_id + ); + $data = $wpdb->get_results($query); + foreach ($data as $field){ + $obj = new SwpmFbFieldmeta(); + $obj->load($field); + $this->fields[] = $obj; + } + } + } + public function validate(){ + + } + public static function get_registration_form_id_by_level($level){ + global $wpdb; + $query = $wpdb->prepare('SELECT form_id FROM ' . + $wpdb->prefix . 'swpm_form_builder_forms WHERE form_type = %d AND form_membership_level=%d', + SwpmFbFormCustom::REGISTRATION, $level + ); + + $form_id = $wpdb->get_var($query); + return $form_id; + } +} diff --git a/classes/class.swpm-fb-forms-list.php b/classes/class.swpm-fb-forms-list.php new file mode 100644 index 0000000..024e293 --- /dev/null +++ b/classes/class.swpm-fb-forms-list.php @@ -0,0 +1,421 @@ +field_table_name = $wpdb->prefix . 'swpm_form_builder_fields'; + $this->form_table_name = $wpdb->prefix . 'swpm_form_builder_forms'; + $this->multivalue_table_name = $wpdb->prefix . 'swpm_form_builder_multivalue'; + + // Set parent defaults + parent::__construct(array( + 'singular' => 'form', + 'plural' => 'forms', + 'ajax' => false + )); + + // Handle our bulk actions + $this->process_bulk_action(); + } + + /** + * Display column names + * + * @since 1.2 + * @returns $item string Column name + */ + function column_default($item, $column_name) { + global $wpdb; + switch ($column_name) { + case 'form_type': + return ($item[$column_name] == '0') ? __('Registration', 'swpm-form-builder') : __('Profile', 'swpm-form-builder'); + case 'form_membership_level': + if ($item[$column_name] == '0') + return __('All', 'swpm-form-builder'); + return $wpdb->get_var($wpdb->prepare("SELECT alias FROM " . $wpdb->prefix . "swpm_membership_tbl WHERE id =%d", $item[$column_name])); + case 'id': + case 'form_id' : + return $item[$column_name]; + } + } + + /** + * Builds the on:hover links for the Form column + * + * @since 1.2 + */ + function column_form_title($item) { + + $actions = array(); + + // Edit Form + $form_title = sprintf('%s', $_REQUEST['page'], $item['form_id'], $item['form_title']); + $actions['edit'] = sprintf('%s', $_REQUEST['page'], 'edit', $item['form_id'], __('Edit', 'swpm-form-builder')); + + // Duplicate Form + $actions['copy'] = sprintf('%s', wp_nonce_url(admin_url('admin.php?page=swpm-form-builder'), 'copy-form-' . $item['form_id']), 'copy_form', $item['form_id'], __('Duplicate', 'swpm-form-builder')); + + // Delete Form + $actions['delete'] = sprintf('%s', wp_nonce_url(admin_url('admin.php?page=swpm-form-builder'), 'delete-form-' . $item['form_id']), 'delete_form', $item['form_id'], __('Delete', 'swpm-form-builder')); + + return sprintf('%1$s %2$s', $form_title, $this->row_actions($actions)); + } + + /** + * Used for checkboxes and bulk editing + * + * @since 1.2 + */ + function column_cb($item) { + return sprintf('', $this->_args['singular'], $item['form_id']); + } + + /** + * Builds the actual columns + * + * @since 1.2 + */ + function get_columns() { + $columns = array( + 'cb' => '', //Render a checkbox instead of text + 'form_title' => __('Form', 'swpm-form-builder'), + 'form_id' => __('Form ID', 'swpm-form-builder'), + 'form_type' => __('Form Type', 'swpm-form-builder'), + 'form_membership_level' => __('For Membership Level', 'swpm-form-builder'), + ); + + return $columns; + } + + /** + * A custom function to get the entries and sort them + * + * @since 1.2 + * @returns array() $cols SQL results + */ + function get_forms($orderby = 'form_id', $order = 'ASC', $per_page, $offset = 0, $search = '') { + global $wpdb; + + // Set OFFSET for pagination + $offset = ( $offset > 0 ) ? "OFFSET $offset" : ''; + + $where = apply_filters('swpm_pre_get_forms', ''); + + // If the form filter dropdown is used + if ($this->current_filter_action()) + $where .= ' AND forms.form_id = ' . $this->current_filter_action(); + + $sql_order = sanitize_sql_orderby("$orderby $order"); + $cols = $wpdb->get_results("SELECT forms.form_id, forms.form_title, forms.form_type, forms.form_membership_level FROM " + . "$this->form_table_name AS forms WHERE 1=1 $where $search ORDER BY $sql_order LIMIT $per_page $offset", ARRAY_A); + return $cols; + } + + /** + * Build the different views for the entries screen + * + * @since 2.7.6 + * @returns array $status_links Status links with counts + */ + function get_views() { + $status_links = array(); + $num_forms = $this->get_forms_count(); + $class = ''; + $link = '?page=swpm-form-builder'; + + $stati = array( + 'all' => _n_noop('All (%s)', 'All (%s)'), + ); + + $entry_status = isset($_REQUEST['form_status']) ? $_REQUEST['form_status'] : 'all'; + + foreach ($stati as $status => $label) { + $class = ( $status == $entry_status ) ? ' class="current"' : ''; + + if (!isset($num_forms->$status)) + $num_forms->$status = 10; + + $link = add_query_arg('form_status', $status, $link); + + $status_links[$status] = "
  • " . sprintf( + translate_nooped_plural($label, $num_forms->$status), number_format_i18n($num_forms->$status) + ) . ''; + } + + return $status_links; + } + + /** + * Get the number of forms + * + * @since 2.2.7 + * @returns int $count Form count + */ + function get_forms_count() { + global $wpdb; + + $stats = array(); + + $count = $wpdb->get_var("SELECT COUNT(*) FROM $this->form_table_name"); + + $stats['all'] = $count; + + $stats = (object) $stats; + + return $stats; + } + + /** + * Setup which columns are sortable. Default is by Date. + * + * @since 1.2 + * @returns array() $sortable_columns Sortable columns + */ + function get_sortable_columns() { + $sortable_columns = array( + 'id' => array('id', false), + 'form_id' => array('form_id', false), + 'form_title' => array('form_title', true), + ); + + return $sortable_columns; + } + + /** + * Define our bulk actions + * + * @since 1.2 + * @returns array() $actions Bulk actions + */ + function get_bulk_actions() { + $actions = array(); + + // Build the row actions + $actions['delete'] = __('Delete Permanently', 'swpm-form-builder'); + + return $actions; + } + + /** + * Process ALL actions on the Entries screen, not only Bulk Actions + * + * @since 1.2 + */ + function process_bulk_action() { + global $wpdb; + + $form_id = ''; + + // Set the Entry ID array + if (isset($_REQUEST['form'])) { + if (is_array($_REQUEST['form'])) + $form_id = $_REQUEST['form']; + else + $form_id = (array) $_REQUEST['form']; + } + + switch ($this->current_action()) { + case 'trash' : + foreach ($form_id as $id) { + $id = absint($id); + $wpdb->update($this->form_table_name, array('form_approved' => 'trash'), array('form_id' => $id)); + } + break; + + case 'delete' : + foreach ($form_id as $id) { + $id = absint($id); + $wpdb->query($wpdb->prepare("DELETE FROM $this->form_table_name WHERE form_id = %d", $id)); + $wpdb->query($wpdb->prepare("DELETE FROM $this->field_table_name WHERE form_id = %d", $id)); + $wpdb->query($wpdb->prepare("DELETE FROM $this->entries_table_name WHERE form_id = %d", $id)); + } + break; + } + } + + /** + * Set our forms filter action + * + * @since 1.2 + * @returns int Form ID + */ + function current_filter_action() { + if (isset($_REQUEST['form-filter']) && -1 != $_REQUEST['form-filter']) + return $_REQUEST['form-filter']; + + return false; + } + + /** + * Display Search box + * + * @since 1.4 + * @returns html Search Form + */ + function search_box($text, $input_id) { + parent::search_box($text, $input_id); + } + + /** + * Prepares our data for display + * + * @since 1.2 + */ + function prepare_items() { + global $wpdb; + /* + // get the current user ID + $user = get_current_user_id(); + + // get the current admin screen + $screen = get_current_screen(); + + // retrieve the "per_page" option + $screen_option = $screen->get_option( 'per_page', 'option' ); + */ + // retrieve the value of the option stored for the current user + $per_page = 10; //get_user_meta( $user, $screen_option, true ); + // get the default value if none is set + if (empty($per_page) || $per_page < 1) + $per_page = $screen->get_option('per_page', 'default'); + + // Get the date/time format that is saved in the options table + $date_format = get_option('date_format'); + $time_format = get_option('time_format'); + + // What page are we looking at? + $current_page = $this->get_pagenum(); + + // Use offset for pagination + $offset = ( $current_page - 1 ) * $per_page; + + // Get column headers + $columns = $this->get_columns(); + $hidden = get_hidden_columns($this->screen); + + // Get sortable columns + $sortable = $this->get_sortable_columns(); + + // Build the column headers + $this->_column_headers = array($columns, $hidden, $sortable); + + // Get entries search terms + $search_terms = (!empty($_REQUEST['s']) ) ? explode(' ', $_REQUEST['s']) : array(); + + $searchand = $search = ''; + // Loop through search terms and build query + foreach ($search_terms as $term) { + $term = esc_sql(like_escape($term)); + + $search .= "{$searchand}((forms.form_title LIKE '%{$term}%') OR (forms.form_key LIKE '%{$term}%') OR (forms.form_email_subject LIKE '%{$term}%'))"; + $searchand = ' AND '; + } + + $search = (!empty($search) ) ? " AND ({$search}) " : ''; + + // Set our ORDER BY and ASC/DESC to sort the entries + $orderby = (!empty($_REQUEST['orderby']) ) ? $_REQUEST['orderby'] : 'form_id'; + $order = (!empty($_REQUEST['order']) ) ? $_REQUEST['order'] : 'desc'; + + // Get the sorted entries + $forms = $this->get_forms($orderby, $order, $per_page, $offset, $search); + + // How many forms do we have? + $total_items = $this->get_forms_count(); + + // Add sorted data to the items property + $this->items = (array) $forms; + + // Register our pagination + $this->set_pagination_args(array( + 'total_items' => $total_items->all, + 'per_page' => $per_page, + 'total_pages' => ceil($total_items->all / $per_page) + )); + } + + /** + * Display the pagination. + * Customize default function to work with months and form drop down filters + * + * @since 3.1.0 + * @access protected + */ + function pagination($which) { + + if (empty($this->_pagination_args)) + return; + + extract($this->_pagination_args, EXTR_SKIP); + + $output = '' . sprintf(_n('1 form', '%s forms', $total_items), number_format_i18n($total_items)) . ''; + + $current = $this->get_pagenum(); + + $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; + + $current_url = remove_query_arg(array('hotkeys_highlight_last', 'hotkeys_highlight_first'), $current_url); + + $page_links = array(); + + // Added to pick up the months dropdown + $m = isset($_REQUEST['m']) ? (int) $_REQUEST['m'] : 0; + + $disable_first = $disable_last = ''; + if ($current == 1) + $disable_first = ' disabled'; + if ($current == $total_pages) + $disable_last = ' disabled'; + + $page_links[] = sprintf("%s", 'first-page' . $disable_first, esc_attr__('Go to the first page'), esc_url(remove_query_arg('paged', $current_url)), '«' + ); + + // Modified the add_query_args to include my custom dropdowns + $page_links[] = sprintf("%s", 'prev-page' . $disable_first, esc_attr__('Go to the previous page'), esc_url(add_query_arg(array('paged' => max(1, $current - 1), 'm' => $m, 'form-filter' => $this->current_filter_action()), $current_url)), '‹' + ); + + if ('bottom' == $which) + $html_current_page = $current; + else + $html_current_page = sprintf("", esc_attr__('Current page'), $current, strlen($total_pages) + ); + + $html_total_pages = sprintf("%s", number_format_i18n($total_pages)); + $page_links[] = '' . sprintf(_x('%1$s of %2$s', 'paging'), $html_current_page, $html_total_pages) . ''; + + $page_links[] = sprintf("%s", 'next-page' . $disable_last, esc_attr__('Go to the next page'), esc_url(add_query_arg(array('paged' => min($total_pages, $current + 1), 'm' => $m, 'form-filter' => $this->current_filter_action()), $current_url)), '›' + ); + + // Modified the add_query_args to include my custom dropdowns + $page_links[] = sprintf("%s", 'last-page' . $disable_last, esc_attr__('Go to the last page'), esc_url(add_query_arg(array('paged' => $total_pages, 'm' => $m, 'form-filter' => $this->current_filter_action()), $current_url)), '»' + ); + + $pagination_links_class = 'pagination-links'; + if (!empty($infinite_scroll)) + $pagination_links_class = ' hide-if-js'; + $output .= "\n" . join("\n", $page_links) . ''; + + if ($total_pages) + $page_class = $total_pages < 2 ? ' one-page' : ''; + else + $page_class = ' no-pages'; + + $this->_pagination = "
    $output
    "; + + echo $this->_pagination; + } + +} diff --git a/classes/class.swpm-fb-installer.php b/classes/class.swpm-fb-installer.php new file mode 100644 index 0000000..3de8ae3 --- /dev/null +++ b/classes/class.swpm-fb-installer.php @@ -0,0 +1,73 @@ +prefix . 'swpm_form_builder_fields'; + $form_table = $wpdb->prefix . 'swpm_form_builder_forms'; + $custom_table = $wpdb->prefix . 'swpm_form_builder_custom'; + + // Explicitly set the character set and collation when creating the tables + $charset = ( defined('DB_CHARSET' && '' !== DB_CHARSET) ) ? DB_CHARSET : 'utf8'; + $collate = ( defined('DB_COLLATE' && '' !== DB_COLLATE) ) ? DB_COLLATE : 'utf8_general_ci'; + + require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); + + $field_sql = "CREATE TABLE $field_table ( + field_id BIGINT(20) NOT NULL AUTO_INCREMENT, + form_id BIGINT(20) NOT NULL, + field_key VARCHAR(255) NOT NULL, + field_type VARCHAR(25) NOT NULL, + field_options TEXT, + field_description TEXT, + field_name TEXT NOT NULL, + field_sequence BIGINT(20) DEFAULT '0', + field_parent BIGINT(20) DEFAULT '0', + field_validation VARCHAR(25), + field_required VARCHAR(25), + field_size VARCHAR(25) DEFAULT 'medium', + field_css VARCHAR(255), + field_layout VARCHAR(255), + field_default TEXT, + field_adminonly TINYINT DEFAULT 0, + field_readonly TINYINT DEFAULT 0, + reg_field_id BIGINT(20) NOT NULL DEFAULT 0, + PRIMARY KEY (field_id) + ) DEFAULT CHARACTER SET $charset COLLATE $collate;"; + + $form_sql = "CREATE TABLE $form_table ( + form_id BIGINT(20) NOT NULL AUTO_INCREMENT, + form_key TINYTEXT NOT NULL, + form_title TEXT NOT NULL, + form_type TINYINT DEFAULT 0, + form_membership_level INT DEFAULT 0, + form_success_type VARCHAR(25) DEFAULT 'text', + form_success_message TEXT, + form_notification_setting VARCHAR(25), + form_notification_email_name VARCHAR(255), + form_notification_subject VARCHAR(255), + form_notification_message TEXT, + form_label_alignment VARCHAR(25), + UNIQUE KEY form_unique_key_id (form_type,form_membership_level), + PRIMARY KEY (form_id) + ) DEFAULT CHARACTER SET $charset COLLATE $collate;"; + + $custom_sql = "CREATE TABLE $custom_table ( + value_id BIGINT(20) NOT NULL AUTO_INCREMENT, + field_id BIGINT(20) NOT NULL, + user_id INT NOT NULL, + value TEXT, + PRIMARY KEY (value_id) + ) DEFAULT CHARACTER SET $charset COLLATE $collate;"; + + // Create or Update database tables + dbDelta($field_sql); + dbDelta($form_sql); + dbDelta($custom_sql); + } +} diff --git a/classes/class.swpm-fb-profile-formmeta.php b/classes/class.swpm-fb-profile-formmeta.php new file mode 100644 index 0000000..e5581a8 --- /dev/null +++ b/classes/class.swpm-fb-profile-formmeta.php @@ -0,0 +1,18 @@ +id = null; // force to save it as new form. + $this->type = SwpmFbFormCustom::PROFILE; + $this->success_message = '

    ' . BUtils::_("Profile Updated.") . '

    '; + foreach($this->fields as &$value){ + $value->reg_field_id = $value->id; + $value->id = null; + } + return $this->save(); + } +} diff --git a/classes/class.swpm-fb-registration-formmeta.php b/classes/class.swpm-fb-registration-formmeta.php new file mode 100644 index 0000000..4d30a5c --- /dev/null +++ b/classes/class.swpm-fb-registration-formmeta.php @@ -0,0 +1,84 @@ +key = 'fieldset'; + $field->type = 'fieldset'; + $field->name = 'Fieldset'; + $field->sequence = 0; + $this->fields[$field->sequence] = $field; + + $field = new SwpmFbFieldmeta(); + $field->key = 'user_name'; + $field->type = 'text'; + $field->name = 'User Name'; + $field->description = 'User Name'; + $field->size = 'medium'; + $field->required = 'yes'; + $field->sequence = 1; + $this->fields[$field->sequence] = $field; + + $field = new SwpmFbFieldmeta(); + $field->key = 'password'; + $field->type = 'password'; + $field->name = 'Password'; + $field->description = 'Password'; + $field->size = 'medium'; + $field->required = 'yes'; + $field->sequence = 2; + $this->fields[$field->sequence] = $field; + + $field = new SwpmFbFieldmeta(); + $field->key = 'membership_level'; + $field->type = 'text'; + $field->name = 'Membership Level'; + $field->description = ''; + $field->size = 'medium'; + $field->required = 'yes'; + $field->readnly = 'yes'; + $field->sequence = 3; + $this->fields[$field->sequence] = $field; + + $field = new SwpmFbFieldmeta(); + $field->key = 'primary_email'; + $field->type = 'email'; + $field->name = 'Email'; + $field->description = 'Email'; + $field->size = 'medium'; + $field->required = 'yes'; + $field->sequence = 4; + $this->fields[$field->sequence] = $field; + $field = new SwpmFbFieldmeta(); + $field->key = 'verification'; + $field->type = 'verification'; + $field->name = 'Verification'; + $field->description = '(This is for preventing spam)'; + $field->sequence = 5; + $this->fields[$field->sequence] = $field; + + $field = new SwpmFbFieldmeta(); + $field->key = 'secret'; + $field->type = 'secret'; + $field->name = 'Please enter any two digits'; + $field->description = 'Example: 12'; + $field->size = 'medium'; + $field->required = 'yes'; + $field->sequence = 6; + $this->fields[$field->sequence] = $field; + $field = new SwpmFbFieldmeta(); + $field->key = 'submit'; + $field->type = 'submit'; + $field->name = 'Submit'; + $field->sequence = 7; + $this->fields[$field->sequence] = $field; + + $this->type = SwpmFbFormCustom::REGISTRATION; + $this->success_message = '

    ' . BUtils::_("Registration is complete") . '

    '; + return $this->save(); + } +} diff --git a/classes/class.swpm-fb-utils.php b/classes/class.swpm-fb-utils.php new file mode 100644 index 0000000..7a57801 --- /dev/null +++ b/classes/class.swpm-fb-utils.php @@ -0,0 +1,228 @@ +add_help_tab(array( + 'id' => 'swpm-help-tab-getting-started', + 'title' => 'Getting Started', + 'content' => '' + )); + + $screen->add_help_tab(array( + 'id' => 'swpm-help-tab-item-config', + 'title' => 'Form Item Configuration', + 'content' => "" + )); + + $screen->add_help_tab(array( + 'id' => 'swpm-help-tab-validation', + 'title' => 'Validation', + 'content' => "

    Visual Form Builder uses the jQuery Form Validation plugin to perform clientside form validation.

    + " + )); + + $screen->add_help_tab(array( + 'id' => 'swpm-help-tab-confirmation', + 'title' => 'Confirmation', + 'content' => "

    Each form allows you to customize the confirmation by selecing either a Text Message, a WordPress Page, or to Redirect to a URL.

    + " + )); + + $screen->add_help_tab(array( + 'id' => 'swpm-help-tab-notification', + 'title' => 'Notification', + 'content' => "

    Send a customized notification email to the user when the form has been successfully submitted.

    + " + )); + + $screen->add_help_tab(array( + 'id' => 'swpm-help-tab-tips', + 'title' => 'Tips', + 'content' => "" + )); + return $screen; + } + public static function is_mandatory_field($key){ + return in_array($key, array('user_name', 'primary_email', 'password', 'membership_level')); + } + public static function handle_file_upload($value, $destination = null){ + $status = array(); + // Settings - Max Upload Size + $settings_max_upload = 25; + if ( is_array( $value) && $value['size'] > 0 ) { + // 25MB is the max size allowed + $size = apply_filters( 'swpm_max_file_size', $settings_max_upload ); // change file size limit using filter. + $max_attach_size = $size * 1048576; + + // Display error if file size has been exceeded + if ( $value['size'] > $max_attach_size ){ + $status['error'] = sprintf( BUtils::_( "File size exceeds %dMB. Please decrease the file size and try again.", 'swpm-form-builder' ), $size ); + return $status; + } + + // Options array for the wp_handle_upload function. 'test_form' => false + $upload_overrides = array( 'test_form' => false ); + + // We need to include the file that runs the wp_handle_upload function + require_once( ABSPATH . 'wp-admin/includes/file.php' ); + + // Handle the upload using WP's wp_handle_upload function. Takes the posted file and an options array + $uploaded_file = wp_handle_upload( $value, $upload_overrides ); + + // If the wp_handle_upload call returned a local path for the image + if ( isset( $uploaded_file['file'] ) ) { + // Retrieve the file type from the file name. Returns an array with extension and mime type + $wp_filetype = wp_check_filetype( basename( $uploaded_file['file'] ), null ); + + // Return the current upload directory location + $wp_upload_dir = wp_upload_dir(); + + $media_upload = array( + 'guid' => $wp_upload_dir['url'] . '/' . basename( $uploaded_file['file'] ), + 'post_mime_type' => $wp_filetype['type'], + 'post_title' => preg_replace( '/\.[^.]+$/', '', basename( $uploaded_file['file'] ) ), + 'post_content' => '', + 'post_status' => 'inherit' + ); + + // Insert attachment into Media Library and get attachment ID + $attach_id = wp_insert_attachment( $media_upload, $uploaded_file['file'] ); + + // Include the file that runs wp_generate_attachment_metadata() + require_once( ABSPATH . 'wp-admin/includes/image.php' ); + require_once( ABSPATH . 'wp-admin/includes/media.php' ); + + // Setup attachment metadata + $attach_data = wp_generate_attachment_metadata( $attach_id, $uploaded_file['file'] ); + + // Update the attachment metadata + wp_update_attachment_metadata( $attach_id, $attach_data ); + + /*$attachments[ 'swpm-' . $field->id ] = $uploaded_file['file']; + + $data[] = array( + 'id' => $field->id, + 'slug' => $field->key, + 'name' => $field->name, + 'type' => $field->type, + 'options' => $field->options, + 'parent_id' => $field->parent, + 'value' => $uploaded_file['url'] + ); + + $body .= sprintf( + ' + %1$s: + %2$s + ' . "\n", + stripslashes( $field->name ), + $uploaded_file['url'] + );*/ + return array('attachment_id'=>$attach_id); + } + $status['error'] = BUtils::_('File not found.'); + }else{ + $status['error'] = BUtils::_('Invalid file.'); + } + return $status; + } +} diff --git a/classes/class.swpm-form-builder.php b/classes/class.swpm-form-builder.php new file mode 100644 index 0000000..48b7fd4 --- /dev/null +++ b/classes/class.swpm-form-builder.php @@ -0,0 +1,1357 @@ +field_table_name = $wpdb->prefix . 'swpm_form_builder_fields'; + $this->form_table_name = $wpdb->prefix . 'swpm_form_builder_forms'; + $this->custom_table_name = $wpdb->prefix . 'swpm_form_builder_custom'; + + if (class_exists('SimpleWpMembership')) { + // Add suffix to load dev files + $this->load_dev_files = ( defined('SWPMFB_SCRIPT_DEBUG') && SWPMFB_SCRIPT_DEBUG ) ? '' : '.min'; + + // Saving functions + add_action('admin_init', array(&$this, 'admin_init')); + + // Build options and settings pages. + add_action('admin_menu', array(&$this, 'admin_menu')); + + // Register AJAX functions + $actions = array( + // Form Builder + 'sort_field', + 'create_field', + 'delete_field', + 'form_settings', + // Media button + ); + + // Add all AJAX functions + foreach ($actions as $name) { + add_action("wp_ajax_swpm_form_builder_$name", array(&$this, "ajax_$name")); + } + + // Adds a Dashboard widget + //add_action('wp_dashboard_setup', array(&$this, 'add_dashboard_widget')); + // Adds a Settings link to the Plugins page + add_filter('plugin_action_links', array(&$this, 'plugin_action_links'), 10, 2); + + // Display update messages + add_action('admin_notices', array(&$this, 'admin_notices')); + + // Print meta keyword + add_action('wp_head', array(&$this, 'add_meta_keyword')); + + add_action('init', array(&$this, 'init'), 10); + + // Add CSS to the front-end + add_action('wp_enqueue_scripts', array(&$this, 'css')); + add_filter('swpm_registration_form_override', array(&$this, 'registration_override'), 10, 2); + add_filter('swpm_profile_form_override', array(&$this, 'profile_override')); + add_filter('swpm_admin_custom_fields', array(&$this, 'admin_profile_override'), 10, 2); + add_action('swpm_admin_edit_custom_fields', array(&$this, 'admin_save_custom_fields')); + } + } + + public function admin_save_custom_fields($member) { + $custom = new SwpmFbAdminCustomFields(); + $custom->init($member['membership_level']); + $custom->save($member['member_id']); + } + + public function admin_profile_override($output, $membership_level) { + $custom = new SwpmFbAdminCustomFields(); + $custom->init($membership_level); + return $custom->admin_ui(); + } + + public function profile_override($output = '') { + $this->form->init_by_level_for_profile(); + require( SWPM_FORM_BUILDER_PATH . 'includes/form-output.php' ); + return $output; + } + + public function registration_override($output, $membership_level) { + if ($membership_level == 1 || $membership_level == md5(1)) { + wp_die('Invalid membership level!'); + } + $this->form->init_by_level_for_registration($membership_level); + require( SWPM_FORM_BUILDER_PATH . 'includes/form-output.php' ); + return $output; + } + + public function admin_menu() { + $this->add_admin(); + $this->additional_plugin_setup(); + } + + public function admin_init() { + $this->save_add_new_form(); + $this->save_update_form(); + $this->save_trash_delete_form(); + $this->save_copy_form(); + $this->save_settings(); + } + + public function init() { + $this->form = new SwpmFbForm(); + $this->languages(); + $this->email(); + $this->confirmation(); + } + + /** + * Allow for additional plugin code to be run during admin_init + * which is not available during the plugin __construct() + * + * @since 2.7 + */ + public function additional_plugin_setup() { + + $page_main = $this->_admin_pages['swpm']; + + if (!get_option('swpm_dashboard_widget_options')) { + $widget_options['swpm_dashboard_recent_entries'] = array( + 'items' => 5, + ); + update_option('swpm_dashboard_widget_options', $widget_options); + } + } + + /** + * Output plugin version number to help with troubleshooting + * + * @since 2.7.5 + */ + public function add_meta_keyword() { + // Get global settings + $swpm_settings = get_option('swpm-settings'); + + // Settings - Disable meta tag version + $settings_meta = isset($swpm_settings['show-version']) ? '' : '' . "\n"; + + echo apply_filters('swpm_show_version', $settings_meta); + } + + /** + * Load localization file + * + * @since 2.7 + */ + public function languages() { + load_plugin_textdomain('swpm-form-builder', false, 'swpm-form-builder/languages'); + } + + public function include_forms_list() { + global $forms_list; + + // Load the Forms List class + require_once( SWPM_FORM_BUILDER_PATH . 'classes/class.swpm-fb-forms-list.php' ); + $forms_list = new SwpmFbFormsList(); + } + + /** + * Add Settings link to Plugins page + * + * @since 1.8 + * @return $links array Links to add to plugin name + */ + public function plugin_action_links($links, $file) { + if ($file == plugin_basename(__FILE__)) + $links[] = '' . __('Settings', 'swpm-form-builder') . ''; + + return $links; + } + + /** + * Adds the dashboard widget + * + * @since 2.7 + */ + public function add_dashboard_widget() { + wp_add_dashboard_widget('swpm-dashboard', __('Recent Visual Form Builder Entries', 'swpm-form-builder'), array(&$this, 'dashboard_widget'), array(&$this, 'dashboard_widget_control')); + } + + /** + * Displays the dashboard widget content + * + * @since 2.7 + */ + public function dashboard_widget() { + global $wpdb; + + // Get the date/time format that is saved in the options table + $date_format = get_option('date_format'); + $time_format = get_option('time_format'); + + $widgets = get_option('swpm_dashboard_widget_options'); + $total_items = isset($widgets['swpm_dashboard_recent_entries']) && isset($widgets['swpm_dashboard_recent_entries']['items']) ? + absint($widgets['swpm_dashboard_recent_entries']['items']) : 5; + + $forms = $wpdb->get_var("SELECT COUNT(*) FROM {$this->form_table_name}"); + + if (!$forms) : + echo sprintf( + '

    %1$s %3$s

    ', __('You currently do not have any forms.', 'swpm-form-builder'), esc_url(admin_url('admin.php?page=swpm-add-new')), __('Get started!', 'swpm-form-builder') + ); + + return; + endif; + + $entries = $wpdb->get_results($wpdb->prepare("SELECT forms.form_title, entries.entries_id, entries.form_id, " + . "entries.sender_name, entries.sender_email, entries.date_submitted FROM $this->form_table_name " + . "AS forms INNER JOIN $this->entries_table_name AS entries ON entries.form_id = forms.form_id ORDER BY " + . "entries.date_submitted DESC LIMIT %d", $total_items)); + + if (!$entries) : + echo sprintf('

    %1$s

    ', __('You currently do not have any entries.', 'swpm-form-builder')); + else : + + $content = ''; + + foreach ($entries as $entry) : + + $content .= sprintf( + '
  • %4$s via %5$s %6$s%3$s
  • ', esc_url(add_query_arg(array('action' => 'view', 'entry' => absint($entry->entries_id)), admin_url('admin.php?page=swpm-entries'))), esc_url(add_query_arg('form-filter', absint($entry->form_id), admin_url('admin.php?page=swpm-entries'))), esc_html($entry->sender_name), esc_html($entry->sender_email), esc_html($entry->form_title), date("$date_format $time_format", strtotime($entry->date_submitted)) + ); + + endforeach; + + echo "
    "; + + endif; + } + + /** + * Displays the dashboard widget form control + * + * @since 2.7 + */ + public function dashboard_widget_control() { + if (!$widget_options = get_option('swpm_dashboard_widget_options')) + $widget_options = array(); + + if (!isset($widget_options['swpm_dashboard_recent_entries'])) + $widget_options['swpm_dashboard_recent_entries'] = array(); + + if ('POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['swpm-widget-recent-entries'])) { + $number = absint($_POST['swpm-widget-recent-entries']['items']); + $widget_options['swpm_dashboard_recent_entries']['items'] = $number; + update_option('swpm_dashboard_widget_options', $widget_options); + } + + $number = isset($widget_options['swpm_dashboard_recent_entries']['items']) ? (int) $widget_options['swpm_dashboard_recent_entries']['items'] : ''; + + echo sprintf( + '

    + + +

    ', __('Number of entries to show:', 'swpm-form-builder'), $number + ); + } + + /** + * Register contextual help. This is for the Help tab dropdown + * + * @since 1.0 + */ + public function help() { + $screen = get_current_screen(); + SwpmFbUtils::help($screen); + } + + /** + * Adds the Screen Options tab to the Entries screen + * + * @since 1.0 + */ + public function screen_options() { + $screen = get_current_screen(); + + $page_main = $this->_admin_pages['swpm']; + + switch ($screen->id) { + case $page_main : + + if (isset($_REQUEST['form'])) : + add_screen_option('layout_columns', array( + 'max' => 2, + 'default' => 2 + )); + else : + add_screen_option('per_page', array( + 'label' => __('Forms per page', 'swpm-form-builder'), + 'default' => 20, + 'option' => 'swpm_forms_per_page' + )); + endif; + + break; + } + } + + /** + * Saves the Screen Options + * + * @since 1.0 + */ + public function save_screen_options($status, $option, $value) { + if ($option == 'swpm_forms_per_page') + return $value; + } + + /** + * Add meta boxes to form builder screen + * + * @since 1.8 + */ + public function add_meta_boxes() { + global $current_screen; + + $page_main = $this->_admin_pages['swpm']; + + if ($current_screen->id == $page_main && isset($_REQUEST['form'])) { + add_meta_box('swpm_form_items_meta_box', __('Form Items', 'swpm-form-builder'), array(&$this, 'meta_box_form_items'), $page_main, 'side', 'high'); + } + } + + /** + * Output for Form Items meta box + * + * @since 1.8 + */ + public function meta_box_form_items() { + include_once (SWPM_FORM_BUILDER_PATH . 'views/button_palette_metabox.php'); + } + + /** + * Queue plugin scripts for sorting form fields + * + * @since 1.0 + */ + public function admin_scripts() { + wp_enqueue_script('jquery-ui-sortable'); + wp_enqueue_script('postbox'); + wp_enqueue_script('jquery-form-validation', SWPM_FORM_BUILDER_URL . '/js/jquery.validate.min.js', array('jquery'), '1.9.0', true); + wp_enqueue_script('swpm-admin', SWPM_FORM_BUILDER_URL . "/js/swpm-admin$this->load_dev_files.js", array('jquery', 'jquery-form-validation'), '20140412', true); + wp_enqueue_script('nested-sortable', SWPM_FORM_BUILDER_URL . "/js/jquery.ui.nestedSortable$this->load_dev_files.js", array('jquery', 'jquery-ui-sortable'), '1.3.5', true); + + wp_enqueue_style('swpm-form-builder-style', SWPM_FORM_BUILDER_URL . "/css/swpm-form-builder-admin$this->load_dev_files.css", array(), '20140412'); + + wp_localize_script('swpm-admin', 'SwpmAdminPages', array('swpm_pages' => $this->_admin_pages)); + } + + /** + * Queue form validation scripts + * + * Scripts loaded in form-output.php, when field is present: + * jQuery UI date picker + * CKEditor + * + * @since 1.0 + */ + public function scripts() { + // Make sure scripts are only added once via shortcode + $this->add_scripts = true; + + wp_register_script('jquery-form-validation', SWPM_FORM_BUILDER_URL . '/js/jquery.validate.min.js', array('jquery'), '1.9.0', true); + wp_register_script('swpm-form-builder-validation', SWPM_FORM_BUILDER_URL . "/js/swpm-validation$this->load_dev_files.js", array('jquery', 'jquery-form-validation'), '20140412', true); + wp_register_script('swpm-form-builder-metadata', SWPM_FORM_BUILDER_URL . '/js/jquery.metadata.js', array('jquery', 'jquery-form-validation'), '2.0', true); + wp_register_script('swpm-ckeditor', SWPM_FORM_BUILDER_URL . '/js/ckeditor/ckeditor.js', array('jquery'), '4.1', true); + + wp_enqueue_script('jquery-form-validation'); + wp_enqueue_script('swpm-form-builder-validation'); + wp_enqueue_script('swpm-form-builder-metadata'); + + $locale = get_locale(); + $translations = array( + 'cs_CS', // Czech + 'de_DE', // German + 'el_GR', // Greek + 'en_US', // English (US) + 'en_AU', // English (AU) + 'en_GB', // English (GB) + 'es_ES', // Spanish + 'fr_FR', // French + 'he_IL', // Hebrew + 'hu_HU', // Hungarian + 'id_ID', // Indonseian + 'it_IT', // Italian + 'ja_JP', // Japanese + 'ko_KR', // Korean + 'nl_NL', // Dutch + 'pl_PL', // Polish + 'pt_BR', // Portuguese (Brazilian) + 'pt_PT', // Portuguese (European) + 'ro_RO', // Romanian + 'ru_RU', // Russian + 'sv_SE', // Swedish + 'tr_TR', // Turkish + 'zh_CN', // Chinese + 'zh_TW', // Chinese (Taiwan) + ); + + // Load localized vaidation and datepicker text, if translation files exist + if (in_array($locale, $translations)) { + wp_register_script('swpm-validation-i18n', SWPM_FORM_BUILDER_URL . "/js/i18n/validate/messages-$locale.js", array('jquery-form-validation'), '1.9.0', true); + wp_register_script('swpm-datepicker-i18n', SWPM_FORM_BUILDER_URL . "/js/i18n/datepicker/datepicker-$locale.js", array('jquery-ui-datepicker'), '1.0', true); + + wp_enqueue_script('swpm-validation-i18n'); + } + // Otherwise, load English translations + else { + wp_register_script('swpm-validation-i18n', SWPM_FORM_BUILDER_URL . "/js/i18n/validate/messages-en_US.js", array('jquery-form-validation'), '1.9.0', true); + wp_register_script('swpm-datepicker-i18n', SWPM_FORM_BUILDER_URL . "/js/i18n/datepicker/datepicker-en_US.js", array('jquery-ui-datepicker'), '1.0', true); + + wp_enqueue_script('swpm-validation-i18n'); + } + } + + /** + * Add form CSS to wp_head + * + * @since 1.0 + */ + public function css() { + $swpm_settings = get_option('swpm-settings'); + wp_register_style('swpm-jqueryui-css', apply_filters('swpm-date-picker-css', SWPM_FORM_BUILDER_URL . '/css/smoothness/jquery-ui-1.10.3.min.css'), array(), '20131203'); + wp_register_style('swpm-form-builder-css', apply_filters('swpm-form-builder-css', SWPM_FORM_BUILDER_URL . "/css/swpm-form-builder$this->load_dev_files.css"), array(), '20140412'); + + // Settings - Always load CSS + //if (isset($swpm_settings['always-load-css'])) { + wp_enqueue_style('swpm-form-builder-css'); + wp_enqueue_style('swpm-jqueryui-css'); + return; + //} + // Settings - Disable CSS + if (isset($swpm_settings['disable-css'])) + return; + + // Get active widgets + $widget = is_active_widget(false, false, 'swpm_widget'); + + // If no widget is found, test for shortcode + if (empty($widget)) { + // If WordPress 3.6, use internal function. Otherwise, my own + if (function_exists('has_shortcode')) { + global $post; + + // If no post exists, exit + if (!$post) + return; + + if (!has_shortcode($post->post_content, 'swpm')) + return; + } elseif (!$this->has_shortcode('swpm')) { + return; + } + } + + wp_enqueue_style('swpm-form-builder-css'); + wp_enqueue_style('swpm-jqueryui-css'); + } + + /** + * Save new forms on the VFB Pro > Add New page + * + * @access public + * @since 2.8.1 + * @return void + */ + public function save_add_new_form() { + $page = filter_input(INPUT_GET, 'page'); + $action = filter_input(INPUT_POST, 'action'); + + if ('swpm-form-builder' !== $page || 'create_form' !== $action) { + return; + } + $level = absint(filter_input(INPUT_POST, 'form_for_level')); + $type = absint(filter_input(INPUT_POST, 'form_type')); + check_admin_referer('create_form'); + if ($type == SwpmFbFormCustom::REGISTRATION) { + $form = new SwpmFbRegistrationFormmeta(); + } else if ($type == SwpmFbFormCustom::PROFILE) { + $form = new SwpmFbProfileFormmeta(); + $reg_form_id = SwpmFbFormmeta::get_registration_form_id_by_level($level); + if (empty($reg_form_id)) { + return; + } + $form->load($reg_form_id); + } + + $form->key = sanitize_title(filter_input(INPUT_POST, 'form_title')); + $form->title = esc_html(filter_input(INPUT_POST, 'form_title')); + $form->for_level = $level; + $success = $form->create(); + // Redirect to keep the URL clean (use AJAX in the future?) + if ($success) { + wp_redirect('admin.php?page=swpm-form-builder&action=edit&form=' . $form->id); + exit(); + } + } + + private function get_submitted_form_definition(&$form_id) { + $form_id = absint($_REQUEST['form_id']); + $form_key = sanitize_title($_REQUEST['form_title'], $form_id); + $form_title = $_REQUEST['form_title']; + + $form_notification_message = isset($_REQUEST['form_notification_message']) ? wp_richedit_pre($_REQUEST['form_notification_message']) : ''; + $form_notification_subject = isset($_REQUEST['form_notification_subject']) ? $_REQUEST['form_notification_subject'] : ''; + $form_notification_email_name = isset($_REQUEST['form_notification_email_name']) ? $_REQUEST['form_notification_email_name'] : ''; + $form_notification_setting = isset($_REQUEST['form_notification_setting']) ? $_REQUEST['form_notification_setting'] : ''; + $form_success_type = $_REQUEST['form_success_type']; + $form_label_alignment = $_REQUEST['form_label_alignment']; + + // Add confirmation based on which type was selected + switch ($form_success_type) { + case 'text' : + $form_success_message = wp_richedit_pre($_REQUEST['form_success_message_text']); + break; + case 'page' : + $form_success_message = $_REQUEST['form_success_message_page']; + break; + case 'redirect' : + $form_success_message = $_REQUEST['form_success_message_redirect']; + break; + } + + return array( + 'form_key' => $form_key, + 'form_title' => $form_title, + 'form_success_type' => $form_success_type, + 'form_success_message' => $form_success_message, + 'form_notification_setting' => $form_notification_setting, + 'form_notification_email_name' => $form_notification_email_name, + 'form_notification_subject' => $form_notification_subject, + 'form_notification_message' => $form_notification_message, + 'form_label_alignment' => $form_label_alignment + ); + } + + private function get_submitted_field_details($id) { + $id = absint($id); + + $field_name = ( isset($_REQUEST['field_name-' . $id]) ) ? trim($_REQUEST['field_name-' . $id]) : ''; + //$field_key = sanitize_key(sanitize_title($field_name, $id)); + $field_desc = ( isset($_REQUEST['field_description-' . $id]) ) ? trim($_REQUEST['field_description-' . $id]) : ''; + $field_options = ( isset($_REQUEST['field_options-' . $id]) ) ? serialize(array_map('trim', $_REQUEST['field_options-' . $id])) : ''; + $field_validation = ( isset($_REQUEST['field_validation-' . $id]) ) ? $_REQUEST['field_validation-' . $id] : ''; + $field_required = ( isset($_REQUEST['field_required-' . $id]) ) ? $_REQUEST['field_required-' . $id] : ''; + $field_size = ( isset($_REQUEST['field_size-' . $id]) ) ? $_REQUEST['field_size-' . $id] : ''; + $field_css = ( isset($_REQUEST['field_css-' . $id]) ) ? $_REQUEST['field_css-' . $id] : ''; + $field_layout = ( isset($_REQUEST['field_layout-' . $id]) ) ? $_REQUEST['field_layout-' . $id] : ''; + $field_default = ( isset($_REQUEST['field_default-' . $id]) ) ? trim($_REQUEST['field_default-' . $id]) : ''; + + return array( + 'field_name' => $field_name, + 'field_description' => $field_desc, + 'field_options' => $field_options, + 'field_validation' => $field_validation, + 'field_required' => $field_required, + 'field_size' => $field_size, + 'field_css' => $field_css, + 'field_layout' => $field_layout, + 'field_default' => $field_default + ); + } + + /** + * Save the form + * + * @access public + * @since 2.8.1 + * @return void + */ + public function save_update_form() { + global $wpdb; + $page = filter_input(INPUT_GET, 'page'); + $action = filter_input(INPUT_POST, 'action'); + if (empty($page) || empty($action)) + return; + + if ('swpm-form-builder' !== $page) + return; + + if ('update_form' !== $_REQUEST['action']) + return; + + check_admin_referer('swpm_update_form'); + + $form_id = 0; + $form_data = $this->get_submitted_form_definition($form_id); + + $where = array('form_id' => $form_id); + + // Update form details + $wpdb->update($this->form_table_name, $form_data, $where); + + $field_ids = array(); + + // Get max post vars, if available. Otherwise set to 1000 + $max_post_vars = ( ini_get('max_input_vars') ) ? intval(ini_get('max_input_vars')) : 1000; + + // Set a message to be displayed if we've reached a limit + if (count($_POST, COUNT_RECURSIVE) > $max_post_vars) + $this->post_max_vars = true; + + foreach ($_REQUEST['field_id'] as $fields) : + $field_ids[] = $fields; + endforeach; + + // Initialize field sequence + $field_sequence = 0; + $query = $wpdb->prepare("SELECT form_id FROM $this->form_table_name WHERE form_type= 1 AND `form_membership_level` = " + . " (SELECT `form_membership_level` FROM $this->form_table_name WHERE `form_id` = %d)", $form_id); + $edit_form = $wpdb->get_var($query); + + // Loop through each field and update + foreach ($field_ids as $id) : + $field_data = $this->get_submitted_field_details($id); + + $where = array( + 'form_id' => $form_id, + 'field_id' => $id + ); + + + if (!empty($edit_form)) { + $form_data['form_id'] = $edit_form; + $this->create_field($field_data, $id); + } + // Update all fields + + $wpdb->update($this->field_table_name, $field_data, $where); + + $field_sequence++; + endforeach; + } + + /** + * Handle trashing and deleting forms + * + * This is a placeholder function since all processing is handled in includes/class-forms-list.php + * + * @access public + * @since 2.8.1 + * @return void + */ + public function save_trash_delete_form() { + global $wpdb; + + if (!isset($_REQUEST['action']) || !isset($_GET['page'])) + return; + + if ('swpm-form-builder' !== $_GET['page']) + return; + + if ('delete_form' !== $_REQUEST['action']) + return; + + $id = absint($_REQUEST['form']); + + check_admin_referer('delete-form-' . $id); + + // Delete form and all fields + $wpdb->query($wpdb->prepare("DELETE FROM $this->form_table_name WHERE form_id = %d", $id)); + $wpdb->query($wpdb->prepare("DELETE FROM $this->field_table_name WHERE form_id = %d", $id)); + + // Redirect to keep the URL clean (use AJAX in the future?) + wp_redirect(add_query_arg('action', 'deleted', 'admin.php?page=swpm-form-builder')); + exit(); + } + + /** + * Handle form duplication + * + * @access public + * @since 2.8.1 + * @return void + */ + public function save_copy_form() { + global $wpdb; + + if (!isset($_REQUEST['action']) || !isset($_GET['page'])) + return; + + if ('swpm-form-builder' !== $_GET['page']) + return; + + if ('copy_form' !== $_REQUEST['action']) + return; + + $id = absint($_REQUEST['form']); + + check_admin_referer('copy-form-' . $id); + + // Get all fields and data for the request form + $fields = $wpdb->get_results($wpdb->prepare("SELECT * FROM $this->field_table_name WHERE form_id = %d", $id)); + $forms = $wpdb->get_results($wpdb->prepare("SELECT * FROM $this->form_table_name WHERE form_id = %d", $id)); + $override = $wpdb->get_var($wpdb->prepare("SELECT form_email_from_override, form_email_from_name_override, " + . "form_notification_email FROM $this->form_table_name WHERE form_id = %d", $id)); + $from_name = $wpdb->get_var(null, 1); + $notify = $wpdb->get_var(null, 2); + + // Copy this form and force the initial title to denote a copy + foreach ($forms as $form) { + $data = (array) $form; + $data['form_key'] = sanitize_title($form->form_key . ' copy'); + $data['form_title'] = form_title . ' Copy'; + $wpdb->insert($this->form_table_name, $data); + } + + // Get form ID to add our first field + $new_form_selected = $wpdb->insert_id; + + // Copy each field and data + foreach ($fields as $field) { + $data = (array) $field; + $data['form_id'] = $new_form_selected; + $wpdb->insert($this->field_table_name, $data); + + // If a parent field, save the old ID and the new ID to update new parent ID + if (in_array($field->field_type, array('fieldset', 'section', 'verification'))) + $parents[$field->field_id] = $wpdb->insert_id; + + if ($override == $field->field_id) + $wpdb->update($this->form_table_name, array('form_email_from_override' => $wpdb->insert_id), array('form_id' => $new_form_selected)); + + if ($from_name == $field->field_id) + $wpdb->update($this->form_table_name, array('form_email_from_name_override' => $wpdb->insert_id), array('form_id' => $new_form_selected)); + + if ($notify == $field->field_id) + $wpdb->update($this->form_table_name, array('form_notification_email' => $wpdb->insert_id), array('form_id' => $new_form_selected)); + } + + // Loop through our parents and update them to their new IDs + foreach ($parents as $k => $v) { + $wpdb->update($this->field_table_name, array('field_parent' => $v), array('form_id' => $new_form_selected, 'field_parent' => $k)); + } + } + + /** + * Save options on the VFB Pro > Settings page + * + * @access public + * @since 2.8.1 + * @return void + */ + public function save_settings() { + + if (!isset($_REQUEST['action']) || !isset($_GET['page'])) + return; + + if ('swpm-settings' !== $_GET['page']) + return; + + if ('swpm_settings' !== $_REQUEST['action']) + return; + + check_admin_referer('swpm-update-settings'); + + $data = array(); + + foreach ($_POST['swpm-settings'] as $key => $val) { + $data[$key] = esc_html($val); + } + + update_option('swpm-settings', $data); + } + + /** + * The jQuery field sorting callback + * + * @since 1.0 + */ + public function ajax_sort_field() { + global $wpdb; + + $data = array(); + + foreach ($_REQUEST['order'] as $k) : + if ('root' !== $k['item_id'] && !empty($k['item_id'])) : + $data[] = array( + 'field_id' => $k['item_id'], + 'parent' => $k['parent_id'] + ); + endif; + endforeach; + + foreach ($data as $k => $v) : + // Update each field with it's new sequence and parent ID + $wpdb->update($this->field_table_name, array( + 'field_sequence' => $k, + 'field_parent' => $v['parent']), array('field_id' => $v['field_id']), '%d' + ); + endforeach; + + die(1); + } + + /** + * The jQuery create field callback + * + * @since 1.9 + */ + public function ajax_create_field() { + global $wpdb; + + $data = array(); + $field_options = $field_validation = ''; + + foreach ($_REQUEST['data'] as $k) { + $data[$k['name']] = $k['value']; + } + + check_ajax_referer('create-field-' . $data['form_id'], 'nonce'); + + $form_id = absint($data['form_id']); + $field_key = esc_html($_REQUEST['field_key']); + $field_name = esc_html(str_replace('_', ' ', $field_key)); + $field_type = strtolower(sanitize_title($_REQUEST['field_type'])); + $field_description = str_replace('_', ' ', $field_key); + + // Set defaults for validation + switch ($field_type) { + case 'select' : + if ($field_key == 'gender') { + $field_options = serialize(array('male' => 'Male', 'female' => 'Female', 'not specified' => 'Not Specified')); + } else if ($field_key == 'title') { + $field_options = serialize(array('mr' => 'Mr', 'mrs' => 'Mrs', 'ms' => 'Ms', 'dr' => 'Dr', 'not specified' => 'Not Specified')); + } else { + $field_options = serialize(array('Option 1', 'Option 2', 'Option 3')); + } + break; + case 'radio' : + case 'checkbox' : + $field_options = serialize(array('Option 1', 'Option 2', 'Option 3')); + break; + case 'email' : + case 'url' : + case 'phone' : + $field_validation = $field_type; + break; + + case 'currency' : + $field_validation = 'number'; + break; + + case 'number' : + $field_validation = 'digits'; + break; + + case 'time' : + $field_validation = 'time-12'; + break; + + case 'file-upload' : + $field_options = serialize(array('png|jpe?g|gif')); + break; + } + + $newdata = array( + 'form_id' => $form_id, + 'field_key' => $field_key, + 'field_name' => $field_name, + 'field_type' => $field_type, + 'field_options' => $field_options, + 'field_validation' => $field_validation, + 'field_description' => $field_description + ); + + $insert_id = $this->create_field($newdata); + + $query = $wpdb->prepare("SELECT form_id FROM $this->form_table_name WHERE form_type= 1 AND `form_membership_level` = " + . " (SELECT `form_membership_level` FROM $this->form_table_name WHERE form_type= 0 AND `form_id` = %d)", $form_id); + $edit_form = $wpdb->get_var($query); + if (!empty($edit_form)) { + $newdata['form_id'] = $edit_form; + $this->create_field($newdata, $insert_id); + } + + echo $this->field_output($form_id, $insert_id); + + die(1); + } + + private function create_field($form_data, $reg_field_id = 0) { + global $wpdb; + $form_id = $form_data['form_id']; + $insert_id = 0; + if (!empty($reg_field_id)) { + $form_data['reg_field_id'] = $reg_field_id; + $query = $wpdb->prepare("SELECT field_id FROM $this->field_table_name WHERE reg_field_id = %d", $reg_field_id); + $insert_id = $wpdb->get_var($query); + } + + if (!empty($insert_id)) { + $wpdb->update($this->field_table_name, $form_data, array('field_id' => $insert_id)); + } else { + // Get the last row's sequence that isn't a Verification + $sequence_last_row = $wpdb->get_var( + $wpdb->prepare( + "SELECT field_sequence FROM $this->field_table_name WHERE form_id = %d AND field_type = 'verification' ORDER BY field_sequence DESC LIMIT 1", $form_id)); + + // If it's not the first for this form, add 1 + $field_sequence = (!empty($sequence_last_row) ) ? $sequence_last_row : 0; + $form_data['field_sequence'] = $field_sequence; + // Create the field + $wpdb->insert($this->field_table_name, $form_data); + $insert_id = $wpdb->insert_id; + // VIP fields + $vip_fields = array('verification', 'secret', 'submit'); + + // Move the VIPs + foreach ($vip_fields as $update) { + $field_sequence++; + $where = array('form_id' => absint($form_id), 'field_type' => $update); + $wpdb->update($this->field_table_name, array('field_sequence' => $field_sequence), $where); + } + } + + return $insert_id; + } + + /** + * The jQuery delete field callback + * + * @since 1.9 + */ + public function ajax_delete_field() { + global $wpdb; + + if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'swpm_form_builder_delete_field') { + $form_id = absint($_REQUEST['form']); + $field_id = absint($_REQUEST['field']); + + check_ajax_referer('delete-field-' . $form_id, 'nonce'); + + $field_key = $wpdb->get_var($wpdb->prepare("SELECT field_key FROM $this->field_table_name WHERE field_id=%d", $field_id)); + if (SwpmFbUtils::is_mandatory_field($field_key)) { + die('0'); // don't delete required fields + } + if (isset($_REQUEST['child_ids'])) { + foreach ($_REQUEST['child_ids'] as $children) { + $parent = absint($_REQUEST['parent_id']); + + // Update each child item with the new parent ID + $wpdb->update($this->field_table_name, array('field_parent' => $parent), array('field_id' => $children)); + } + } + + // Delete the field + $wpdb->query($wpdb->prepare("DELETE FROM $this->field_table_name WHERE field_id = %d", $field_id)); + } + + die(1); + } + + /** + * The jQuery form settings callback + * + * @since 2.2 + */ + public function ajax_form_settings() { + global $current_user; + get_currentuserinfo(); + + if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'swpm_form_builder_form_settings') { + $form_id = absint($_REQUEST['form']); + $status = isset($_REQUEST['status']) ? $_REQUEST['status'] : 'opened'; + $accordion = isset($_REQUEST['accordion']) ? $_REQUEST['accordion'] : 'general-settings'; + $user_id = $current_user->ID; + + $form_settings = get_user_meta($user_id, 'swpm-form-settings', true); + + $array = array( + 'form_setting_tab' => $status, + 'setting_accordion' => $accordion + ); + + // Set defaults if meta key doesn't exist + if (!$form_settings || $form_settings == '') { + $meta_value[$form_id] = $array; + + update_user_meta($user_id, 'swpm-form-settings', $meta_value); + } else { + $form_settings[$form_id] = $array; + + update_user_meta($user_id, 'swpm-form-settings', $form_settings); + } + } + + die(1); + } + + /** + * All Forms output in admin + * + * @since 2.5 + */ + public function all_forms() { + $searched = isset($_REQUEST['s']) && !empty($_REQUEST['s']) ? true : false; + global $wpdb, $forms_list; + require( SWPM_FORM_BUILDER_PATH . 'views/all_forms.php' ); + } + + /** + * Build field output in admin + * + * @since 1.9 + */ + public function field_output($form_nav_selected_id, $field_id = NULL) { + require( SWPM_FORM_BUILDER_PATH . 'includes/admin-field-options.php' ); + } + + /** + * Display admin notices + * + * @since 1.0 + */ + public function admin_notices() { + if (!isset($_REQUEST['action']) || !isset($_GET['page'])) + return; + + if (!in_array($_GET['page'], array('swpm-form-builder', + 'swpm-add-new', + 'swpm-email-design', + 'swpm-reports', + 'swpm-settings'))) + return; + + switch ($_REQUEST['action']) { + case 'create_form' : + echo '

    ' . + __('Error! Combination of membership level and form type must be unique.', 'swpm-form-builder') . '

    '; + $form_type = absint(filter_input(INPUT_POST, 'form_type')); + if ($form_type == SwpmFbFormCustom::PROFILE) { + echo '

    ' . __('You must create a registration form before creating edit profile form.', 'swpm-form-builder') . '

    '; + } + echo '
    '; + break; + + case 'update_form' : + echo '

    ' . + __('Form updated.', 'swpm-form-builder') . '

    '; + + if ($this->post_max_vars) : + // Get max post vars, if available. Otherwise set to 1000 + $max_post_vars = ( ini_get('max_input_vars') ) ? intval(ini_get('max_input_vars')) : 1000; + + echo '

    ' . + sprintf(__('Error saving form. The maximum amount of data allowed by your server has been reached. ' + . 'Please update max_input_vars in your php.ini ' + . 'file to allow more data to be saved. Current limit is %d', 'swpm-form-builder'), 'http://www.php.net/manual/en/info.configuration.php#ini.max-input-vars', $max_post_vars) . '

    '; + endif; + break; + + case 'deleted' : + echo '

    ' . + __('Item permanently deleted.', 'swpm-form-builder') . '

    '; + break; + + case 'copy_form' : + echo '

    ' . + __('Item successfully duplicated.', 'swpm-form-builder') . '

    '; + break; + + case 'swpm_settings' : + echo sprintf('

    %s

    ', __('Settings saved.', 'swpm-form-builder')); + break; + } + } + + /** + * Add options page to Settings menu + * + * + * @since 1.0 + * @uses add_options_page() Creates a menu item under the Settings menu. + */ + public function add_admin() { + $current_pages = array(); + + $current_pages['swpm'] = add_submenu_page('simple_wp_membership', __('Form Builder', 'swpm-form-builder'), __('Form Builder', 'swpm-form-builder'), 'manage_options', 'swpm-form-builder', array(&$this, 'admin')); + // All plugin page load hooks + foreach ($current_pages as $key => $page) { + // Load the jQuery and CSS we need if we're on our plugin page + add_action("load-$page", array(&$this, 'admin_scripts')); + + // Load the Help tab on all pages + add_action("load-$page", array(&$this, 'help')); + } + // Save pages array for filter/action use throughout plugin + $this->_admin_pages = $current_pages; + + // Adds a Screen Options tab to the Entries screen + add_action('load-' . $current_pages['swpm'], array(&$this, 'screen_options')); + + // Add meta boxes to the form builder admin page + add_action('load-' . $current_pages['swpm'], array(&$this, 'add_meta_boxes')); + + add_action('load-' . $current_pages['swpm'], array(&$this, 'include_forms_list')); + } + + /** + * Display Add New Form page + * + * + * @since 2.7.2 + */ + public function admin_add_new() { + ?> +
    +

    + +
    + +
    +

    + +
    +

    '; + BUtils::e('Simple Membership Form Builder'); + echo '

    '; + // Save current user ID + $user_id = $current_user->ID; + $current_tab = empty($action) ? '' : $action; + $tabs = array('' => "Form List", 'add' => 'New Form', 'license' => 'Product License'); + echo ''; + switch ($action) { + case 'add': + $this->admin_add_new(); + break; + case 'license': + $this->admin_license_menu(); + break; + case 'edit': + default: + $form_nav_selected_id = filter_input(INPUT_GET, 'form'); + if (empty($form_nav_selected_id) || $form_nav_selected_id == 0) { + $this->all_forms(); + } else { + include_once( SWPM_FORM_BUILDER_PATH . 'includes/admin-form-creator.php' ); + } + break; + } + echo ''; + } + + /** + * Handle confirmation when form is submitted + * + * @since 1.3 + */ + function confirmation() { + global $wpdb; + + $form_id = ( isset($_REQUEST['form_id']) ) ? (int) esc_html($_REQUEST['form_id']) : ''; + + if (!isset($_REQUEST['swpm-submit'])) + return; + if ($this->form->is_fatal() || !$this->form->is_valid()) { + return; + } + + // Get forms + $order = sanitize_sql_orderby('form_id DESC'); + $forms = $wpdb->get_results($wpdb->prepare("SELECT * FROM $this->form_table_name WHERE form_id = %d ORDER BY $order", $form_id)); + + foreach ($forms as $form) : + // If text, return output and format the HTML for display + if ('text' == $form->form_success_type) { + return stripslashes(html_entity_decode(wp_kses_stripslashes($form->form_success_message))); + }// If page, redirect to the permalink + elseif ('page' == $form->form_success_type) { + $page = get_permalink($form->form_success_message); + wp_redirect($page); + exit(); + } + // If redirect, redirect to the URL + elseif ('redirect' == $form->form_success_type) { + wp_redirect(esc_url($form->form_success_message)); + exit(); + } + endforeach; + } + + /** + * Handle emailing the content + * + * @since 1.0 + * @uses wp_mail() E-mails a message + */ + public function email() { + require( SWPM_FORM_BUILDER_PATH . 'includes/email.php' ); + } + + /** + * Make sure the User Agent string is not a SPAM bot + * + * @since 1.3 + */ + public function isBot() { + $bots = apply_filters('swpm_blocked_spam_bots', array( + '<', '>', '<', '%0A', '%0D', '%27', '%3C', '%3E', '%00', 'href', + 'binlar', 'casper', 'cmsworldmap', 'comodo', 'diavol', + 'dotbot', 'feedfinder', 'flicky', 'ia_archiver', 'jakarta', + 'kmccrew', 'nutch', 'planetwork', 'purebot', 'pycurl', + 'skygrid', 'sucker', 'turnit', 'vikspider', 'zmeu', + ) + ); + + $isBot = false; + + $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? wp_kses_data($_SERVER['HTTP_USER_AGENT']) : ''; + + do_action('swpm_isBot', $user_agent, $bots); + + foreach ($bots as $bot) { + if (stripos($user_agent, $bot) !== false) + $isBot = true; + } + + return $isBot; + } + + /** + * Check whether the content contains the specified shortcode + * + * @access public + * @param string $shortcode (default: '') + * @return void + */ + function has_shortcode($shortcode = '') { + + $post_to_check = get_post(get_the_ID()); + + // false because we have to search through the post content first + $found = false; + + // if no short code was provided, return false + if (!$shortcode) { + return $found; + } + // check the post content for the short code + if (stripos($post_to_check->post_content, '[' . $shortcode) !== false) { + // we have found the short code + $found = true; + } + + // return our final results + return $found; + } + +} + +// The VFB widget +require( SWPM_FORM_BUILDER_PATH . 'includes/class-widget.php' ); diff --git a/css/smoothness/images/animated-overlay.gif b/css/smoothness/images/animated-overlay.gif new file mode 100644 index 0000000..d441f75 Binary files /dev/null and b/css/smoothness/images/animated-overlay.gif differ diff --git a/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png b/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png new file mode 100644 index 0000000..81f996d Binary files /dev/null and b/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png b/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png new file mode 100644 index 0000000..7dc8742 Binary files /dev/null and b/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png differ diff --git a/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png b/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png new file mode 100644 index 0000000..448f5ff Binary files /dev/null and b/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png differ diff --git a/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png b/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png new file mode 100644 index 0000000..e8791d7 Binary files /dev/null and b/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png b/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png new file mode 100644 index 0000000..f03b130 Binary files /dev/null and b/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png differ diff --git a/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png b/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png new file mode 100644 index 0000000..7e9446d Binary files /dev/null and b/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png differ diff --git a/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png b/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png new file mode 100644 index 0000000..20eb6ca Binary files /dev/null and b/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png differ diff --git a/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png new file mode 100644 index 0000000..4e130bc Binary files /dev/null and b/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ diff --git a/css/smoothness/images/ui-icons_222222_256x240.png b/css/smoothness/images/ui-icons_222222_256x240.png new file mode 100644 index 0000000..c1cb117 Binary files /dev/null and b/css/smoothness/images/ui-icons_222222_256x240.png differ diff --git a/css/smoothness/images/ui-icons_2e83ff_256x240.png b/css/smoothness/images/ui-icons_2e83ff_256x240.png new file mode 100644 index 0000000..84b601b Binary files /dev/null and b/css/smoothness/images/ui-icons_2e83ff_256x240.png differ diff --git a/css/smoothness/images/ui-icons_454545_256x240.png b/css/smoothness/images/ui-icons_454545_256x240.png new file mode 100644 index 0000000..b6db1ac Binary files /dev/null and b/css/smoothness/images/ui-icons_454545_256x240.png differ diff --git a/css/smoothness/images/ui-icons_888888_256x240.png b/css/smoothness/images/ui-icons_888888_256x240.png new file mode 100644 index 0000000..feea0e2 Binary files /dev/null and b/css/smoothness/images/ui-icons_888888_256x240.png differ diff --git a/css/smoothness/images/ui-icons_cd0a0a_256x240.png b/css/smoothness/images/ui-icons_cd0a0a_256x240.png new file mode 100644 index 0000000..ed5b6b0 Binary files /dev/null and b/css/smoothness/images/ui-icons_cd0a0a_256x240.png differ diff --git a/css/smoothness/jquery-ui-1.10.3.css b/css/smoothness/jquery-ui-1.10.3.css new file mode 100644 index 0000000..4e04c99 --- /dev/null +++ b/css/smoothness/jquery-ui-1.10.3.css @@ -0,0 +1,1177 @@ +/*! jQuery UI - v1.10.3 - 2013-08-21 +* http://jqueryui.com +* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px +* Copyright 2013 jQuery Foundation and other contributors Licensed MIT */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { + display: none; +} +.ui-helper-hidden-accessible { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} +.ui-helper-reset { + margin: 0; + padding: 0; + border: 0; + outline: 0; + line-height: 1.3; + text-decoration: none; + font-size: 100%; + list-style: none; +} +.ui-helper-clearfix:before, +.ui-helper-clearfix:after { + content: ""; + display: table; + border-collapse: collapse; +} +.ui-helper-clearfix:after { + clear: both; +} +.ui-helper-clearfix { + min-height: 0; /* support: IE7 */ +} +.ui-helper-zfix { + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + opacity: 0; + filter:Alpha(Opacity=0); +} + +.ui-front { + z-index: 100; +} + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { + cursor: default !important; +} + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + display: block; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; +} + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +.ui-resizable { + position: relative; +} +.ui-resizable-handle { + position: absolute; + font-size: 0.1px; + display: block; +} +.ui-resizable-disabled .ui-resizable-handle, +.ui-resizable-autohide .ui-resizable-handle { + display: none; +} +.ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0; +} +.ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0; +} +.ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0; + height: 100%; +} +.ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0; + height: 100%; +} +.ui-resizable-se { + cursor: se-resize; + width: 12px; + height: 12px; + right: 1px; + bottom: 1px; +} +.ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: -5px; + bottom: -5px; +} +.ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: -5px; + top: -5px; +} +.ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; + top: -5px; +} +.ui-selectable-helper { + position: absolute; + z-index: 100; + border: 1px dotted black; +} +.ui-accordion .ui-accordion-header { + display: block; + cursor: pointer; + position: relative; + margin-top: 2px; + padding: .5em .5em .5em .7em; + min-height: 0; /* support: IE7 */ +} +.ui-accordion .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-noicons { + padding-left: .7em; +} +.ui-accordion .ui-accordion-icons .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-header .ui-accordion-header-icon { + position: absolute; + left: .5em; + top: 50%; + margin-top: -8px; +} +.ui-accordion .ui-accordion-content { + padding: 1em 2.2em; + border-top: 0; + overflow: auto; +} +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default; +} +.ui-button { + display: inline-block; + position: relative; + padding: 0; + line-height: normal; + margin-right: .1em; + cursor: pointer; + vertical-align: middle; + text-align: center; + overflow: visible; /* removes extra width in IE */ +} +.ui-button, +.ui-button:link, +.ui-button:visited, +.ui-button:hover, +.ui-button:active { + text-decoration: none; +} +/* to make room for the icon, a width needs to be set here */ +.ui-button-icon-only { + width: 2.2em; +} +/* button elements seem to need a little more width */ +button.ui-button-icon-only { + width: 2.4em; +} +.ui-button-icons-only { + width: 3.4em; +} +button.ui-button-icons-only { + width: 3.7em; +} + +/* button text element */ +.ui-button .ui-button-text { + display: block; + line-height: normal; +} +.ui-button-text-only .ui-button-text { + padding: .4em 1em; +} +.ui-button-icon-only .ui-button-text, +.ui-button-icons-only .ui-button-text { + padding: .4em; + text-indent: -9999999px; +} +.ui-button-text-icon-primary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 1em .4em 2.1em; +} +.ui-button-text-icon-secondary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 2.1em .4em 1em; +} +.ui-button-text-icons .ui-button-text { + padding-left: 2.1em; + padding-right: 2.1em; +} +/* no icon support for input elements, provide padding by default */ +input.ui-button { + padding: .4em 1em; +} + +/* button icon element(s) */ +.ui-button-icon-only .ui-icon, +.ui-button-text-icon-primary .ui-icon, +.ui-button-text-icon-secondary .ui-icon, +.ui-button-text-icons .ui-icon, +.ui-button-icons-only .ui-icon { + position: absolute; + top: 50%; + margin-top: -8px; +} +.ui-button-icon-only .ui-icon { + left: 50%; + margin-left: -8px; +} +.ui-button-text-icon-primary .ui-button-icon-primary, +.ui-button-text-icons .ui-button-icon-primary, +.ui-button-icons-only .ui-button-icon-primary { + left: .5em; +} +.ui-button-text-icon-secondary .ui-button-icon-secondary, +.ui-button-text-icons .ui-button-icon-secondary, +.ui-button-icons-only .ui-button-icon-secondary { + right: .5em; +} + +/* button sets */ +.ui-buttonset { + margin-right: 7px; +} +.ui-buttonset .ui-button { + margin-left: 0; + margin-right: -.3em; +} + +/* workarounds */ +/* reset extra padding in Firefox, see h5bp.com/l */ +input.ui-button::-moz-focus-inner, +button.ui-button::-moz-focus-inner { + border: 0; + padding: 0; +} +.ui-datepicker { + width: 17em; + padding: .2em .2em 0; + display: none; +} +.ui-datepicker .ui-datepicker-header { + position: relative; + padding: .2em 0; +} +.ui-datepicker .ui-datepicker-prev, +.ui-datepicker .ui-datepicker-next { + position: absolute; + top: 2px; + width: 1.8em; + height: 1.8em; +} +.ui-datepicker .ui-datepicker-prev-hover, +.ui-datepicker .ui-datepicker-next-hover { + top: 1px; +} +.ui-datepicker .ui-datepicker-prev { + left: 2px; +} +.ui-datepicker .ui-datepicker-next { + right: 2px; +} +.ui-datepicker .ui-datepicker-prev-hover { + left: 1px; +} +.ui-datepicker .ui-datepicker-next-hover { + right: 1px; +} +.ui-datepicker .ui-datepicker-prev span, +.ui-datepicker .ui-datepicker-next span { + display: block; + position: absolute; + left: 50%; + margin-left: -8px; + top: 50%; + margin-top: -8px; +} +.ui-datepicker .ui-datepicker-title { + margin: 0 2.3em; + line-height: 1.8em; + text-align: center; +} +.ui-datepicker .ui-datepicker-title select { + font-size: 1em; + margin: 1px 0; +} +.ui-datepicker select.ui-datepicker-month-year { + width: 100%; +} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { + width: 49%; +} +.ui-datepicker table { + width: 100%; + font-size: .9em; + border-collapse: collapse; + margin: 0 0 .4em; +} +.ui-datepicker th { + padding: .7em .3em; + text-align: center; + font-weight: bold; + border: 0; +} +.ui-datepicker td { + border: 0; + padding: 1px; +} +.ui-datepicker td span, +.ui-datepicker td a { + display: block; + padding: .2em; + text-align: right; + text-decoration: none; +} +.ui-datepicker .ui-datepicker-buttonpane { + background-image: none; + margin: .7em 0 0 0; + padding: 0 .2em; + border-left: 0; + border-right: 0; + border-bottom: 0; +} +.ui-datepicker .ui-datepicker-buttonpane button { + float: right; + margin: .5em .2em .4em; + cursor: pointer; + padding: .2em .6em .3em .6em; + width: auto; + overflow: visible; +} +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { + float: left; +} + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { + width: auto; +} +.ui-datepicker-multi .ui-datepicker-group { + float: left; +} +.ui-datepicker-multi .ui-datepicker-group table { + width: 95%; + margin: 0 auto .4em; +} +.ui-datepicker-multi-2 .ui-datepicker-group { + width: 50%; +} +.ui-datepicker-multi-3 .ui-datepicker-group { + width: 33.3%; +} +.ui-datepicker-multi-4 .ui-datepicker-group { + width: 25%; +} +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { + border-left-width: 0; +} +.ui-datepicker-multi .ui-datepicker-buttonpane { + clear: left; +} +.ui-datepicker-row-break { + clear: both; + width: 100%; + font-size: 0; +} + +/* RTL support */ +.ui-datepicker-rtl { + direction: rtl; +} +.ui-datepicker-rtl .ui-datepicker-prev { + right: 2px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next { + left: 2px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-prev:hover { + right: 1px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next:hover { + left: 1px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane { + clear: right; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button { + float: left; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, +.ui-datepicker-rtl .ui-datepicker-group { + float: right; +} +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { + border-right-width: 0; + border-left-width: 1px; +} +.ui-dialog { + position: absolute; + top: 0; + left: 0; + padding: .2em; + outline: 0; +} +.ui-dialog .ui-dialog-titlebar { + padding: .4em 1em; + position: relative; +} +.ui-dialog .ui-dialog-title { + float: left; + margin: .1em 0; + white-space: nowrap; + width: 90%; + overflow: hidden; + text-overflow: ellipsis; +} +.ui-dialog .ui-dialog-titlebar-close { + position: absolute; + right: .3em; + top: 50%; + width: 21px; + margin: -10px 0 0 0; + padding: 1px; + height: 20px; +} +.ui-dialog .ui-dialog-content { + position: relative; + border: 0; + padding: .5em 1em; + background: none; + overflow: auto; +} +.ui-dialog .ui-dialog-buttonpane { + text-align: left; + border-width: 1px 0 0 0; + background-image: none; + margin-top: .5em; + padding: .3em 1em .5em .4em; +} +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: right; +} +.ui-dialog .ui-dialog-buttonpane button { + margin: .5em .4em .5em 0; + cursor: pointer; +} +.ui-dialog .ui-resizable-se { + width: 12px; + height: 12px; + right: -5px; + bottom: -5px; + background-position: 16px 16px; +} +.ui-draggable .ui-dialog-titlebar { + cursor: move; +} +.ui-menu { + list-style: none; + padding: 2px; + margin: 0; + display: block; + outline: none; +} +.ui-menu .ui-menu { + margin-top: -3px; + position: absolute; +} +.ui-menu .ui-menu-item { + margin: 0; + padding: 0; + width: 100%; + /* support: IE10, see #8844 */ + list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); +} +.ui-menu .ui-menu-divider { + margin: 5px -2px 5px -2px; + height: 0; + font-size: 0; + line-height: 0; + border-width: 1px 0 0 0; +} +.ui-menu .ui-menu-item a { + text-decoration: none; + display: block; + padding: 2px .4em; + line-height: 1.5; + min-height: 0; /* support: IE7 */ + font-weight: normal; +} +.ui-menu .ui-menu-item a.ui-state-focus, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} + +.ui-menu .ui-state-disabled { + font-weight: normal; + margin: .4em 0 .2em; + line-height: 1.5; +} +.ui-menu .ui-state-disabled a { + cursor: default; +} + +/* icon support */ +.ui-menu-icons { + position: relative; +} +.ui-menu-icons .ui-menu-item a { + position: relative; + padding-left: 2em; +} + +/* left-aligned */ +.ui-menu .ui-icon { + position: absolute; + top: .2em; + left: .2em; +} + +/* right-aligned */ +.ui-menu .ui-menu-icon { + position: static; + float: right; +} +.ui-progressbar { + height: 2em; + text-align: left; + overflow: hidden; +} +.ui-progressbar .ui-progressbar-value { + margin: -1px; + height: 100%; +} +.ui-progressbar .ui-progressbar-overlay { + background: url("images/animated-overlay.gif"); + height: 100%; + filter: alpha(opacity=25); + opacity: 0.25; +} +.ui-progressbar-indeterminate .ui-progressbar-value { + background-image: none; +} +.ui-slider { + position: relative; + text-align: left; +} +.ui-slider .ui-slider-handle { + position: absolute; + z-index: 2; + width: 1.2em; + height: 1.2em; + cursor: default; +} +.ui-slider .ui-slider-range { + position: absolute; + z-index: 1; + font-size: .7em; + display: block; + border: 0; + background-position: 0 0; +} + +/* For IE8 - See #6727 */ +.ui-slider.ui-state-disabled .ui-slider-handle, +.ui-slider.ui-state-disabled .ui-slider-range { + filter: inherit; +} + +.ui-slider-horizontal { + height: .8em; +} +.ui-slider-horizontal .ui-slider-handle { + top: -.3em; + margin-left: -.6em; +} +.ui-slider-horizontal .ui-slider-range { + top: 0; + height: 100%; +} +.ui-slider-horizontal .ui-slider-range-min { + left: 0; +} +.ui-slider-horizontal .ui-slider-range-max { + right: 0; +} + +.ui-slider-vertical { + width: .8em; + height: 100px; +} +.ui-slider-vertical .ui-slider-handle { + left: -.3em; + margin-left: 0; + margin-bottom: -.6em; +} +.ui-slider-vertical .ui-slider-range { + left: 0; + width: 100%; +} +.ui-slider-vertical .ui-slider-range-min { + bottom: 0; +} +.ui-slider-vertical .ui-slider-range-max { + top: 0; +} +.ui-spinner { + position: relative; + display: inline-block; + overflow: hidden; + padding: 0; + vertical-align: middle; +} +.ui-spinner-input { + border: none; + background: none; + color: inherit; + padding: 0; + margin: .2em 0; + vertical-align: middle; + margin-left: .4em; + margin-right: 22px; +} +.ui-spinner-button { + width: 16px; + height: 50%; + font-size: .5em; + padding: 0; + margin: 0; + text-align: center; + position: absolute; + cursor: default; + display: block; + overflow: hidden; + right: 0; +} +/* more specificity required here to overide default borders */ +.ui-spinner a.ui-spinner-button { + border-top: none; + border-bottom: none; + border-right: none; +} +/* vertical centre icon */ +.ui-spinner .ui-icon { + position: absolute; + margin-top: -8px; + top: 50%; + left: 0; +} +.ui-spinner-up { + top: 0; +} +.ui-spinner-down { + bottom: 0; +} + +/* TR overrides */ +.ui-spinner .ui-icon-triangle-1-s { + /* need to fix icons sprite */ + background-position: -65px -16px; +} +.ui-tabs { + position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ + padding: .2em; +} +.ui-tabs .ui-tabs-nav { + margin: 0; + padding: .2em .2em 0; +} +.ui-tabs .ui-tabs-nav li { + list-style: none; + float: left; + position: relative; + top: 0; + margin: 1px .2em 0 0; + border-bottom-width: 0; + padding: 0; + white-space: nowrap; +} +.ui-tabs .ui-tabs-nav li a { + float: left; + padding: .5em 1em; + text-decoration: none; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active { + margin-bottom: -1px; + padding-bottom: 1px; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active a, +.ui-tabs .ui-tabs-nav li.ui-state-disabled a, +.ui-tabs .ui-tabs-nav li.ui-tabs-loading a { + cursor: text; +} +.ui-tabs .ui-tabs-nav li a, /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { + cursor: pointer; +} +.ui-tabs .ui-tabs-panel { + display: block; + border-width: 0; + padding: 1em 1.4em; + background: none; +} +.ui-tooltip { + padding: 8px; + position: absolute; + z-index: 9999; + max-width: 300px; + -webkit-box-shadow: 0 0 5px #aaa; + box-shadow: 0 0 5px #aaa; +} +body .ui-tooltip { + border-width: 2px; +} + +/* Component containers +----------------------------------*/ +.ui-widget { + font-family: Verdana,Arial,sans-serif; + font-size: 1.1em; +} +.ui-widget .ui-widget { + font-size: 1em; +} +.ui-widget input, +.ui-widget select, +.ui-widget textarea, +.ui-widget button { + font-family: Verdana,Arial,sans-serif; + font-size: 1em; +} +.ui-widget-content { + border: 1px solid #aaaaaa; + background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; + color: #222222; +} +.ui-widget-content a { + color: #222222; +} +.ui-widget-header { + border: 1px solid #aaaaaa; + background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; + color: #222222; + font-weight: bold; +} +.ui-widget-header a { + color: #222222; +} + +/* Interaction states +----------------------------------*/ +.ui-state-default, +.ui-widget-content .ui-state-default, +.ui-widget-header .ui-state-default { + border: 1px solid #d3d3d3; + background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; + font-weight: normal; + color: #555555; +} +.ui-state-default a, +.ui-state-default a:link, +.ui-state-default a:visited { + color: #555555; + text-decoration: none; +} +.ui-state-hover, +.ui-widget-content .ui-state-hover, +.ui-widget-header .ui-state-hover, +.ui-state-focus, +.ui-widget-content .ui-state-focus, +.ui-widget-header .ui-state-focus { + border: 1px solid #999999; + background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; + font-weight: normal; + color: #212121; +} +.ui-state-hover a, +.ui-state-hover a:hover, +.ui-state-hover a:link, +.ui-state-hover a:visited { + color: #212121; + text-decoration: none; +} +.ui-state-active, +.ui-widget-content .ui-state-active, +.ui-widget-header .ui-state-active { + border: 1px solid #aaaaaa; + background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; + font-weight: normal; + color: #212121; +} +.ui-state-active a, +.ui-state-active a:link, +.ui-state-active a:visited { + color: #212121; + text-decoration: none; +} + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, +.ui-widget-content .ui-state-highlight, +.ui-widget-header .ui-state-highlight { + border: 1px solid #fcefa1; + background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; + color: #363636; +} +.ui-state-highlight a, +.ui-widget-content .ui-state-highlight a, +.ui-widget-header .ui-state-highlight a { + color: #363636; +} +.ui-state-error, +.ui-widget-content .ui-state-error, +.ui-widget-header .ui-state-error { + border: 1px solid #cd0a0a; + background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; + color: #cd0a0a; +} +.ui-state-error a, +.ui-widget-content .ui-state-error a, +.ui-widget-header .ui-state-error a { + color: #cd0a0a; +} +.ui-state-error-text, +.ui-widget-content .ui-state-error-text, +.ui-widget-header .ui-state-error-text { + color: #cd0a0a; +} +.ui-priority-primary, +.ui-widget-content .ui-priority-primary, +.ui-widget-header .ui-priority-primary { + font-weight: bold; +} +.ui-priority-secondary, +.ui-widget-content .ui-priority-secondary, +.ui-widget-header .ui-priority-secondary { + opacity: .7; + filter:Alpha(Opacity=70); + font-weight: normal; +} +.ui-state-disabled, +.ui-widget-content .ui-state-disabled, +.ui-widget-header .ui-state-disabled { + opacity: .35; + filter:Alpha(Opacity=35); + background-image: none; +} +.ui-state-disabled .ui-icon { + filter:Alpha(Opacity=35); /* For IE8 - See #6059 */ +} + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + width: 16px; + height: 16px; +} +.ui-icon, +.ui-widget-content .ui-icon { + background-image: url(images/ui-icons_222222_256x240.png); +} +.ui-widget-header .ui-icon { + background-image: url(images/ui-icons_222222_256x240.png); +} +.ui-state-default .ui-icon { + background-image: url(images/ui-icons_888888_256x240.png); +} +.ui-state-hover .ui-icon, +.ui-state-focus .ui-icon { + background-image: url(images/ui-icons_454545_256x240.png); +} +.ui-state-active .ui-icon { + background-image: url(images/ui-icons_454545_256x240.png); +} +.ui-state-highlight .ui-icon { + background-image: url(images/ui-icons_2e83ff_256x240.png); +} +.ui-state-error .ui-icon, +.ui-state-error-text .ui-icon { + background-image: url(images/ui-icons_cd0a0a_256x240.png); +} + +/* positioning */ +.ui-icon-blank { background-position: 16px 16px; } +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-on { background-position: -96px -144px; } +.ui-icon-radio-off { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-all, +.ui-corner-top, +.ui-corner-left, +.ui-corner-tl { + border-top-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-top, +.ui-corner-right, +.ui-corner-tr { + border-top-right-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-left, +.ui-corner-bl { + border-bottom-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-br { + border-bottom-right-radius: 4px; +} + +/* Overlays */ +.ui-widget-overlay { + background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; + opacity: .3; + filter: Alpha(Opacity=30); +} +.ui-widget-shadow { + margin: -8px 0 0 -8px; + padding: 8px; + background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; + opacity: .3; + filter: Alpha(Opacity=30); + border-radius: 8px; +} diff --git a/css/smoothness/jquery-ui-1.10.3.min.css b/css/smoothness/jquery-ui-1.10.3.min.css new file mode 100644 index 0000000..f7efcac --- /dev/null +++ b/css/smoothness/jquery-ui-1.10.3.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-08-21 +* http://jqueryui.com +* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px +* Copyright 2013 jQuery Foundation and other contributors Licensed MIT */.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted #000}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin-top:2px;padding:.5em .5em .5em .7em;min-height:0}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:21px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:2px;margin:0;display:block;outline:0}.ui-menu .ui-menu{margin-top:-3px;position:absolute}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:400}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-weight:400;margin:-1px}.ui-menu .ui-state-disabled{font-weight:400;margin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url(images/animated-overlay.gif);height:100%;filter:alpha(opacity=25);opacity:.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:0;background:0;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:0;border-bottom:0;border-right:0}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav li a{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-tabs-loading a{cursor:text}.ui-tabs .ui-tabs-nav li a,.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:0}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px} \ No newline at end of file diff --git a/css/swpm-form-builder-admin.css b/css/swpm-form-builder-admin.css new file mode 100644 index 0000000..a3f9bcb --- /dev/null +++ b/css/swpm-form-builder-admin.css @@ -0,0 +1,1705 @@ +/* VFB Pro call to action */ +.swpm-pro-call-to-action { + padding: 5px 0; + text-align: center; +} + +.swpm-btn { + display: inline-block; + *display: inline; + /* IE7 inline-block hack */ + + *zoom: 1; + padding: 15px 10px; + margin-bottom: 0; + line-height: 20px; + text-align: center; + vertical-align: middle; + cursor: pointer; + color: #333333; + font-size: 21px; + font-weight: 500; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + background-color: #f5f5f5; + background-repeat: repeat-x; + border-color: #e6e6e6 #e6e6e6 #bfbfbf; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + *background-color: #e6e6e6; + /* Darken IE7 buttons by default so they stand out more given they won't have borders */ + + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + border: 1px solid #cccccc; + *border: 0; + border-bottom-color: #b3b3b3; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + *margin-left: .3em; + -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); + -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); + box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); + text-decoration: none; +} + +.swpm-btn:hover, +.swpm-btn:focus { + color: #333333; + text-decoration: none; + background-position: 0 -15px; + -webkit-transition: background-position 0.1s linear; + -moz-transition: background-position 0.1s linear; + -o-transition: background-position 0.1s linear; + transition: background-position 0.1s linear; +} + +.swpm-btn:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} + +.swpm-btn.active, +.swpm-btn:active { + background-image: none; + outline: 0; + -webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); + -moz-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); + box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); +} + + +.swpm-btn-primary.active { + color: rgba(255, 255, 255, 0.75); +} + +.swpm-btn-primary { + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + background-color: #006dcc; + background-image: -moz-linear-gradient(top, #0088cc, #0044cc); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); + background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); + background-image: -o-linear-gradient(top, #0088cc, #0044cc); + background-image: linear-gradient(to bottom, #0088cc, #0044cc); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0); + border-color: #0044cc #0044cc #002a80; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + *background-color: #0044cc; + /* Darken IE7 buttons by default so they stand out more given they won't have borders */ + + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); +} + +.swpm-btn-primary:hover, +.swpm-btn-primary:focus, +.swpm-btn-primary:active, +.swpm-btn-primary.active, +.swpm-btn-primary.disabled, +.swpm-btn-primary[disabled] { + color: #ffffff; + background-color: #0044cc; + *background-color: #003bb3; +} + +.swpm-btn-primary:active, +.swpm-btn-primary.active { + background-color: #003399 \9; +} + +.swpm-btn-inverse { + background-color: #363636; + background-repeat: repeat-x; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + color: #FFFFFF; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} + +.swpm-btn-inverse:hover, +.swpm-btn-inverse:focus, +.swpm-btn-inverse:active, +.swpm-btn-inverse.active, +.swpm-btn-inverse.disabled, +.swpm-btn-inverse[disabled] { + background-color: #222222; + color: #FFFFFF; +} + +.swpm-pro-call-to-action .cta-sign-up { + color: #fff; + display: block; + font-size: 24px; + font-weight: bold; + text-align: center; + text-decoration: none; + text-shadow: 1px 1px 1px #2b658c; + width: 100%; + line-height: 22px; +} + +.swpm-pro-call-to-action .cta-price { + color: #ace7ff; + display: block; + font-size: 12px; + font-weight: normal; + line-height: 20px; + text-align: center; + text-decoration: none; + width: 100%; + line-height: 20px; +} + +.swpm-pro-upgrade { + display: inline; + float: left; + padding: 10px; + margin-bottom: 20px; + background-color: #d3e7ee; + border: 1px solid #21759b; + border-radius: 5px; +} + +.rtl .swpm-pro-upgrade { + float: right; +} + +.swpm-pro-upgrade h2, +.wrap .swpm-pro-upgrade h2 { + font-size: 23px; + font-weight: 500; + padding: 5px 0; + text-align: center; +} + +.swpm-pro-upgrade h2 a { + text-decoration: none; +} + +.swpm-pro-upgrade ul { + list-style: outside; + margin-left: 10px; +} + +.rtl .swpm-pro-upgrade ul { + margin-left: 0; + margin-right: 10px; +} + +/* !Form View framework */ +#swpm-form-builder-frame{ + display:block; + margin: 0 -8px 0 290px; +} + +.rtl #swpm-form-builder-frame { + margin: 0 290px 0 -8px; +} + +#swpm-form-builder-frame:after, +#form-editor-header .swpm-major-publishing-actions:after, +#form-editor-footer .swpm-major-publishing-actions:after, +#swpm-form-builder-frame .menu-item-settings:after, +#swpm-form-list:after, +.option:after{ + display: block; + visibility: hidden; + clear:both; + height: 0; + content: "."; +} + +#swpm-form-builder-sidebar{ + clear:both; + width:281px; +} + +#swpm-form-builder-management{ + position: relative; + margin-right: 10px; +} + +.rtl #swpm-form-builder-management { + margin-right: 0; + margin-left: 10px; +} + +#swpm-form-builder-management .form-edit{ + margin-bottom: 20px; + border: 1px solid #dfdfdf; + border-radius: 3px; +} + +/* Blue Admin style */ +.admin-color-classic #swpm-form-builder-management .form-edit { + border-color: #D0DFE9; +} + +/* !Form Editor Header/Footer */ +#form-editor-header, +#form-editor-footer{ + padding: 0 10px; + background-color: #f1f1f1; +} + +#form-editor-footer{ + border-top:1px solid #dfdfdf; +} + +/* Blue Admin style */ +.admin-color-classic #form-editor-header, +.admin-color-classic #form-editor-footer { + background-color: #F5FAFD; +} + +.admin-color-class #form-editor-footer { + border-top-color: #D0DFE9; +} + +.swpm-major-publishing-actions{ + clear:both; + padding:3px 0 5px; +} + +.swpm-major-publishing-actions .publishing-action{ + float:right; + margin: 5px 0 1px; + text-align: right; + line-height: 23px; +} + +#form-editor-header .publishing-action{ + margin-top:12px; +} + +/* !Subnavigation links */ +.sub-navigation{ + float:none; + margin:8px 0 5px; + padding:0; + list-style: none; + white-space: nowrap; + font-size: 12px; +} + +.sub-navigation li{ + display: inline; + margin:0; + padding:0; +} + +.sub-navigation a{ + padding:0.2em; + text-decoration: none; + line-height: 2; +} + +.sub-navigation a.current{ + border:medium none; + background:none; + color: black; + font-weight: bold; +} + +.sub-navigation a:hover{ + color:rgb(213,78,33); +} + +/* Form Box view */ +#swpm-sidebar, +#swpm-main{ + float: left; + margin: 10px 0; + width: 280px; +} + +.rtl #swpm-sidebar, +.rtl #swpm-main { + float: right; +} + +#swpm-main{ + width:auto; +} +#swpm-main.swpm-order-type-list{ + width: 100%; +} + +#swpm-main p a, +#swpm-main h3 a{ + text-decoration: none; +} + +#swpm-main .submitdelete{ + color: #BC0B0B; + text-decoration: none; +} +#swpm-main .submitdelete:hover{ + color:red; +} + +#swpm-sidebar{ + margin-left: -300px; +} + +.rtl #swpm-sidebar { + margin-left: 0; + margin-right: -300px; +} + +#swpm-form-list{ + display: block; + /*margin-left: 300px;*/ +} + +.rtl #swpm-form-list { + margin-left: 0; + margin-right: 300px; +} + +/* !Form Boxes */ +.swpm-box{ + position:relative; + float:left; + padding:0 10px; + border: 1px solid #DFDFDF; + border-radius: 3px 3px 3px 3px; + background-color: #F5F5F5; + background: -moz-linear-gradient(top, #ffffff 0%, #f5f5f5 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#f5f5f5)); + background: -webkit-linear-gradient(top, #ffffff 0%,#f5f5f5 100%); + background: -o-linear-gradient(top, #ffffff 0%,#f5f5f5 100%); + background: -ms-linear-gradient(top, #ffffff 0%,#f5f5f5 100%); + background: linear-gradient(to bottom, #ffffff 0%,#f5f5f5 100%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f5f5f5',GradientType=0 ); + box-shadow: 0 1px 0 #FFFFFF inset; + line-height: 1.4em; +} + +.swpm-form-alpha-list{ + width: 70%; + float: left; + padding-right:20px; +} + +.rtl .swpm-form-alpha-list { + float: right; + padding-right: 0; + padding-left: 20px; +} + +.swpm-form-alpha-list hr{ + display:block; + margin:1em 0; + padding:0; + height:1px; + border:0; + border-top:1px solid #ccc; +} + +.swpm-form-alpha-group .letter, +.wrap h2.letter{ + float:left; + padding:0; + color:#666; + font-size:14px; + line-height: 17px; +} + +.swpm-form-alpha-form{ + display: block; + margin:10px 0; + padding-left:150px; + width:auto; +} +.swpm-form-alpha-form h3{ + float:left; + margin: 0; + width:50%; + word-wrap: break-word; + font-size:17px; +} + +.swpm-form-alpha-form .swpm-publishing-actions, +.swpm-form-alpha-form .swpm-form-meta{ + float:left; + width:20%; + text-align: center; +} + +.swpm-form-alpha-form .swpm-form-meta{ + width: 30%; +} + +.swpm-form-alpha-form .swpm-publishing-actions p, +.swpm-form-alpha-form .swpm-form-meta p{ + margin:0; +} + +.swpm-form-alpha-form .swpm-form-meta, +.swpm-form-alpha-form .paypal{ + float:left; + margin:0; + text-align: left; +} + +.rtl .swpm-form-alpha-form .swpm-form-meta, +.rtl .swpm-form-alpha-form .paypal { + float: right; + text-align: right; +} + +.swpm-sortable-placeholder{ + display:block; + height:35px; + width:400px; + margin:8px; + border:1px dashed #bbb; + background-color:#f5f5f5; +} + +#swpm-main .swpm-sortable-placeholder{ + float:left; + margin:8px; + height:200px; + width:210px; +} + +.rtl #swpm-main .swpm-sortable-placeholder { + float: right; +} + +#swpm-menu-to-edit .mjs-nestedSortable-error{ + border-color:red; + background-color:#fbe3e4; + color:#8a1f11; +} +.swpm-meta-entries-total span, +.swpm-meta-entries-total-today span{ + font-size: 11px; + font-weight: bold; + height: 1.4em; + line-height: 1.4em; + min-width: .7em; + padding: 0 6px; + display: inline-block; + border-radius: 5px; + background-color: #bbb; + color: white; + text-align: center; +} + +.swpm-meta-entries-total:hover span, +.swpm-meta-entries-total-today:hover span{ + background-color: #d54e21; +} +.fixed .column-entries, +.fixed .column-form_id { + width: 8em; +} + +strong .swpm-meta-entries-total span { + background-color: #21759B; +} + +.entries-count-wrapper { + font-family: sans-serif; + min-width: 22px; + padding-bottom: 1px; +} + +/* !New Form box */ +#new-form{ + margin:8px 0; + padding-top:10px; + width:75px; + height:105px; + text-align: center; +} +#new-form a{ + display:block; + width:auto; + text-decoration: none; +} + +#post-body{ + padding: 10px; + background: white; +} + +/* !Form Editor columns */ +.swpm-postbox-container{ + float:left; + margin:0 8px; + width:100%; +} + +.rtl .swpm-postbox-container { + float: right; +} + +#swpm-postbox-container-1 .postbox{ + min-width:281px; +} + +#swpm-postbox-container-2{ + min-width: 485px; +} + +#swpm-form-builder-frame.columns-1{ + margin-left:-8px; +} + +.rtl #swpm-form-builder-frame.columns-1 { + margin-left: 0; + margin-right: -8px; +} + +#swpm-form-builder-frame.columns-1 #swpm-postbox-container-1{ + float:none; +} + +#swpm-form-builder-frame.columns-1 #swpm-postbox-container-2{ + width:99%; +} + +#swpm-form-builder-frame.columns-2 #swpm-postbox-container-3{ + display:none; +} + +#swpm-form-builder-frame.columns-2 #swpm-postbox-container-1, +#swpm-form-builder-frame.columns-3 #swpm-postbox-container-1{ + margin-left:-290px; + width:281px; +} + +.rtl #swpm-form-builder-frame.columns-2 #swpm-postbox-container-1, +.rtl #swpm-form-builder-frame.columns-3 #swpm-postbox-container-1{ + margin-left: 0; + margin-right: -290px; +} + +#swpm-form-builder-frame.columns-3 #swpm-form-builder-management{ + margin-right: 0; +} + +#swpm-form-builder-frame.columns-3 #swpm-postbox-container-2{ + width:30%; +} + +#swpm-form-builder-frame.columns-3 #swpm-postbox-container-3{ + display:inline; + margin-right:0; + width:46.5%; +} + +.rtl #swpm-form-builder-frame.columns-3 #swpm-postbox-container-3{ + margin-right: 0; + margin-left: 0; +} + +#swpm-form-meta-preview iframe{ + width:100%; + height: 100%; +} + +#swpm_form_media_button_tip input { + width: 100%; + border: 0; + padding: 6px; + font-family: Consolas, Monaco, monospace; + font-size: 12px; +} + +/* !Form Editor Columns - One Column */ +@media only screen and (max-width: 799px) { + #swpm-form-builder-frame .swpm-postbox-container { + width: 100%; + } + .columns-prefs .columns-prefs-3{ + display: none; + } +} + +/* !Form Editor Columns - Two Columns */ +@media only screen and (min-width: 800px) and (max-width: 1200px) { + #swpm-form-builder-frame .swpm-postbox-container { + width: 49.5%; + } + + #swpm-form-builder-frame.columns-3 #swpm-postbox-container-2, + #swpm-form-builder-frame.columns-3 #swpm-postbox-container-3{ + width: 50.5%; + } + + #swpm-form-builder-frame.columns-1 .swpm-postbox-container { + width: 100%; + } +} +/* !Form Editor Columns - Three Columns */ +@media only screen and (min-width: 1600px) { + #swpm-form-builder-frame.columns-3 #swpm-postbox-container-3{ + width: 58%; + } +} + +/* !Field Item arrows */ +.item-edit { + position: absolute; + top: 3px; + right: -20px; + display: block; + overflow: hidden; + width:30px; + height: 40px; + background:url('../images/arrows.png?d=20130703') no-repeat scroll 8px 10px transparent; + text-indent:-999em; +} + +/* Blue Admin style */ +.admin-color-classic .item-edit { + background: url('../images/arrows-vs.png?d=20130703') no-repeat scroll 8px 10px transparent; +} + +.rtl .item-edit { + right: auto; + left: -20px; +} + +.item-edit:hover{ + background:url('../images/arrows-dark.png?d=20130703') no-repeat scroll 8px 10px transparent; +} + +/* Blue Admin style */ +.admin-color-classic .item-edit:hover { + background: url('../images/arrows-dark-vs.png?d=20130703') no-repeat scroll 8px 10px transparent; +} + +.item-edit.opened{ + background:url('../images/arrows.png?d=20130703') no-repeat scroll 8px -25px transparent; +} + +/* Blue Admin style */ +.admin-color-classic .item-edit.opened { + background: url('../images/arrows-vs.png?d=20130703') no-repeat scroll 8px -25px transparent; +} + +.item-edit.opened:hover{ + background:url('../images/arrows-dark.png?d=20130703') no-repeat scroll 8px -25px transparent; +} + +/* Blue Admin style */ +.admin-color-classic .item-edit.opened:hover { + background: url('../images/arrows-dark-vs.png?d=20130703') no-repeat scroll 8px -25px transparent; +} + +/* !Field Item attribute input styles */ +.option .widefat, +.options-other-show .widefat, +.options-other-hide .widefat { + margin: 0 6px 7px 0; + width: 320px; +} + +.rtl .option .widefat, +.rtl .options-other-show .widefat, +.rtl .options-other-hide .widefat { + margin: 0 0 7px 6px; +} + +#form-settings .description-thin{ + margin:12px 10px 12px 0; +} + +.rtl #form-settings .description-thin { + margin: 12px 0 12px 10px; +} + +.description-thin, +.description-wide { + float: left; + margin-right: 10px; +} + +.rtl .description-thin, +.rtl .description-wide { + float: right; + margin-right: 0; + margin-left: 10px; +} + +.description-thin { + width: 190px; + height: 40px; +} + +.description-wide { + width: 390px; +} + +/* Interface icons */ +.swpm-interface-icon { + position: absolute; + top: 4px; + right: 4px; + display: inline-block; + width: 16px; + height: 16px; + background-color: transparent; + background-image: url('../images/swpm-interface-icons.png?d=20130713'); + background-repeat: no-repeat; + text-indent: -9999px; +} + +.swpm-interface-settings { background-position: -32px 0;} +.swpm-interface-duplicate { background-position: 0 0;} +.swpm-interface-trash { background-position: -64px 0;} +.swpm-interface-conditional { background-position: -224px 0;} +.swpm-interface-sort { background-position: -128px 0;} +.swpm-interface-plus { background-position: -160px 0;} +.swpm-interface-minus { background-position: -192px 0;} +.swpm-interface-bulk-add { background-position: -96px 0;} + +.swpm-interface-plus, +.swpm-interface-minus { + top: 0; +} + +/* Form Settings add/delete emails */ +.addEmail, +.deleteEmail { + top: 28px; +} +.addEmail { + right: 55px; +} + +.rtl .addEmail { + right: auto; + left: 55px; +} + +.deleteEmail { + right: 30px; +} + +.rtl .deleteEmail { + right: auto; + left: 30px; +} + +/* Form item delete/sort options */ +.deleteOption, +.swpm-interface-sort, +.addCondition, +.deleteCondition { + top: 3px; +} + +.deleteOption, +.addCondition { + right: 25px; +} + +.rtl .deleteOption, +.rtl .addCondition { + right: auto; + left: 25px; +} + +.swpm-interface-sort, +.deleteCondition { + right: 0; +} + +.rtl .swpm-interface-sort, +.rtl .deleteCondition { + right: auto; + left: 0; +} + +.swpm-interface-sort:hover { + cursor: pointer; +} + +.option { + float: left; + width: 97%; + position: relative; +} + +.rtl .option { + float: right; +} + +#swpm-poststuff{ + display:block; + margin-right:300px; +} + +.rtl #swpm-poststuff { + margin-right: 0; + margin-left: 300px; +} + +#swpm-entries-body-content{ + float:left; + width:100%; +} + +.rtl #swpm-entries-body-content { + float: right; +} + +.metabox-holder #swpm-entries-body-content h3{ + font-weight: bold; + font-family: sans-serif; +} + +#entry-edit #side-info-column{ + margin-right:-300px; +} + +.rtl #entry-edit #side-info-column { + margin-right: 0; + margin-left: -300px; +} + +label.error{ + display:block; + color:red; +} + +#visual-form-builder-update input.error, +#visual-form-builder-update textarea.error, +#visual-form-builder-update select.error{ + border:1px solid red; +} + +#swpm-menu-to-edit .menu-item-settings { + width: 402px; +} + +.swpm-menu-item-handle { + background: white; + border: 1px solid #DFDFDF; + border-radius: 3px; + height: auto; + line-height: 35px; + overflow: hidden; + padding: 10px 15px; + position: relative; + text-shadow: 0 1px 0 #FFFFFF; + width: 382px; + word-wrap: break-word; + cursor: move; +} + +.swpm-menu-item-handle:hover { + border-color: #999; +} + +/* Blue Admin style */ +.admin-color-classic .swpm-menu-item-handle { + background: #F5FAFD; + box-shadow: 0 1px 0 #FFFFFF inset; + border-color: #D0DFE9; +} + +.rtl .swpm-menu-item-handle { + padding-left: 0; + padding-right: 10px; +} + +.swpm-menu-item-type-fieldset, +.swpm-menu-item-type-verification, +#form-element-fieldset { + background: #e3e3e3; + box-shadow:0 1px 0 #e3e3e3 inset; +} + +/* Blue Admin style */ +.admin-color-classic .swpm-menu-item-type-fieldset, +.admin-color-classic .swpm-menu-item-type-verification, +.admin-color-classic #form-element-fieldset { + background: #e2f3ff; + box-shadow: 0 1px 0 #FFFFFF inset; +} + +.swpm-menu-item-handle .item-title { + min-height: 20px; + display: block; + font-size: 12px; + font-weight: bold; + line-height: 20px; + margin-right: 13em; +} + +.rtl .swpm-menu-item-handle .item-title { + margin-right: 0; + margin-left: 13em; +} + +.swpm-menu-item-active .swpm-menu-item-handle { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; +} + +.sender-labels{ + width:80px; +} + +.is-field-required{ + color:#BC1212; +} + +#form-details-nav{ + padding-top:10px; + font-size:1.0em; +} +#form-details-nav a, +.charts-nav a{ + padding:5px 10px; + text-decoration:none; + font-weight:bold; +} + +#form-details-nav a.current, +.charts-nav a.current{ + height:40px; + border-color: #dfdfdf; + border-radius:5px; + background-color:#777; + background-image: -ms-linear-gradient(bottom, #6d6d6d, #808080); + background-image: -moz-linear-gradient(bottom, #6d6d6d, #808080); + background-image: -o-linear-gradient(bottom, #6d6d6d, #808080); + background-image: -webkit-gradient(linear, left bottom, left top, from(#6d6d6d), to(#808080)); + background-image: -webkit-linear-gradient(bottom, #6d6d6d, #808080); + background-image: linear-gradient(bottom, #6d6d6d, #808080); + color:white; + text-shadow:0 -1px 0 #333333; +} + +/* !Form Settings - Confirmation */ +.form-details, +#form-success-message-text, +#form-success-message-page, +#form-success-message-redirect{ + display:none; +} + +.form-details-current, .active{ + display:block; +} + +#confirmation-message textarea, +#notification textarea{ + width:100%; + height:10em; + font-family:Consolas,Monaco,monospace; +} + +#form-success-message-page, +#form-success-message-redirect{ + margin-top:10px; + width:100%; +} + +.post-body-plain ol li{ + list-style:decimal; +} + +#swpm-upgrade-column { + display: inline; + float: left; + width: auto; +} + +.rtl #swpm-upgrade-column { + float: right; +} + +ul#promote-swpm { + margin-left: 20px; + list-style: disc; +} + +.rtl ul#promote-swpm { + margin-left: auto; + margin-right: 20px; +} + +#promote-swpm li { + text-align: left; +} + +.rtl #promote-swpm li { + text-align: right; +} + +.menu .ui-nestedSortable-error { + background-color: #fbe3e4; + border-color: red; + color: #8a1f11; +} + +ul#swpm-menu-to-edit ul{ + margin: 0 0 0 25px; + padding: 0; + width:98%; + list-style-type: none; +} +#swpm-menu-to-edit{ + margin-top:0; + padding:1em 0; +} + +#swpm-fieldset-first-warning{ + display: none; +} + +.ui-state-disabled, +.ui-state-disabled dl, +.ui-state-disabled dt, +.form-item.ui-state-disabled { + opacity: 100; + filter: alpha(Opacity=100); + background-image: none; +} + +.ui-state-disabled .swpm-menu-item-handle, +.ui-state-disabled .menu-item-handle { + background: #dfdfdf; + box-shadow: none; + cursor: default; +} + +.swpm-details{ + margin-bottom:10px; + padding:0 10px; + border:1px solid #ccc; + border-radius:3px; +} + +.swpm-details.section{ + width:97.55%; + background-color:#efefef; +} + +.swpm-details .postbox{ + min-height:60px; +} + +#poststuff .swpm-details h2{ + margin-top:0; +} + +#poststuff h3.section-heading{ + padding-left:0; +} + +/* !Form Items */ +#form-items .tabs-panel{ + overflow: visible; + padding: 0.5em 0 0.5em 4px; + min-height: 325px; + height: auto; +} + +.rtl #form-items .tabs-panel { + padding: 0.5em 4px 0.5em 0; +} + +ul.swpm-fields-col-1, +ul.swpm-fields-col-2{ + float:left; + width:50%; + list-style: none; +} + +.rtl ul.swpm-fields-col-1, +.rtl ul.swpm-fields-col-2 { + float: right; +} + +#swpm-form-builder-frame.columns-1 #swpm-postbox-container-1 #form-items .tabs-panel{ + height:auto; +} + +.swpm-draggable-form-items{ + position: relative; + position: relative; + display: block; + margin-right: 8px; + padding:4px 0 4px 34px; + border:1px solid #bbb; + border-radius: 3px; + color:#464646; + text-align: left; + text-decoration: none; + font-size: 12px; +} + +.rtl .swpm-draggable-form-items { + margin-right: 0; + margin-left: 8px; + padding: 4px 34px 4px 10px; +} + +.swpm-draggable-form-items:hover{ + border-color:#aaaaaa; +} + +.swpm-draggable-form-items b{ + position: absolute; + left:8px; + display: inline-block; + width:16px; + height:16px; + background-color: transparent; + background-image: url('../images/swpm-form-items.png?d=20130712'); + background-repeat: no-repeat; + line-height: 16px; +} + +.rtl .swpm-draggable-form-items b { + left: auto; + right: 8px; +} + +#form-element-address b{ background-position: -128px 0;} +#form-element-autocomplete b{ background-position: -384px 0;} +#form-element-checkbox b{ background-position: -672px 0;} +#form-element-color b{ background-position: 0 0;} +#form-element-currency b{ background-position: -64px 0;} +#form-element-datepicker b{ background-position: -224px 0;} +#form-element-digits b{ background-position: -832px 0;} +#form-element-email b{ background-position: -160px 0;} +#form-element-file b{ background-position: -512px 0;} +#form-element-hidden b{ background-position: -544px 0;} +#form-element-html b{ background-position: -800px 0;} +#form-element-instructions b{ background-position: -256px 0;} +#form-element-ip b{ background-position: -448px 0;} +#form-element-max b{ background-position: -576px 0;} +#form-element-min b{ background-position: -608px 0;} +#form-element-name b{ background-position: -320px 0;} +#form-element-pagebreak b{ background-position: -768px 0;} +#form-element-password b{ background-position: -352px 0;} +#form-element-phone b{ background-position: -96px 0;} +#form-element-radio b{ background-position: -704px 0;} +#form-element-range b{ background-position: -640px 0;} +#form-element-select b{ background-position: -416px 0;} +#form-element-text b{ background-position: -736px 0;} +#form-element-textarea b{ background-position: -32px 0;} +#form-element-time b{ background-position: -192px 0;} +#form-element-username b{ background-position: -288px 0;} +#form-element-url b{ background-position: -480px 0;} + +.static-vars-inactive{ + display:none; +} + +.static-vars-active{ + display:block; +} + +/* !Form Settings buttons */ +.swpm-button { + position: relative; + display: inline-block; + overflow: visible; + margin: 0; + padding:0.5em 2.5em 0.5em 1em; + outline: none; + border: 1px solid #d4d4d4; + border-radius: 0.2em; + background-color: #f5f5f5; + color: #333; + text-decoration: none; + white-space: nowrap; + font:12px/normal sans-serif; + cursor: pointer; + zoom: 1; + -webkit-background-clip: padding; + -moz-background-clip: padding; + -o-background-clip: padding-box; + *display: inline; +} + +.swpm-button:hover, +.swpm-button:active, +.swpm-button.current { + border-color: #929292; + border-bottom-color: #929292; + background-color: #eeeeee; + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#eeeeee), to(#cccccc)); + background-image: -moz-linear-gradient(#eeeeee, #cccccc); + background-image: -o-linear-gradient(#eeeeee, #cccccc); + background-image: linear-gradient(#eeeeee, #cccccc); + color: #000; +} + +.swpm-button.current{ + font-weight:bold; +} + +.swpm-button::-moz-focus-inner { + padding: 0; + border: 0; +} + +.swpm-button.swpm-settings:hover, +.swpm-button.swpm-settings:focus, +.swpm-button.swpm-settings:active { + color: #3072b3; +} + +.swpm-button.swpm-delete:hover, +.swpm-button.swpm-delete:focus, +.swpm-button.swpm-delete:active { + color: #900; +} + +.swpm-button.swpm-duplicate:hover, +.swpm-button.swpm-duplicate:focus, +.swpm-button.swpm-duplicate:active { + color: #008e0d; +} + +.swpm-button.swpm-conditional-fields:hover, +.swpm-button.swpm-conditional-fields:focus, +.swpm-button.swpm-conditional-fields:active { + +} + +.swpm-button-group{ + display:inline-block; + margin: 10px 0; + list-style:none; +} + +.rtl .swpm-button-group { + margin-left: -2px; +} + +.swpm-button-group .swpm-button{ + float:left; + margin-right: 5px; +} + +.rtl .swpm-button-group .swpm-button { + float: right; + margin-right: 0; + margin-left: 5px; +} + +.swpm-button-group .button-primary { + margin-top: 2px; +} + +.swpm-item-actions{ + margin-right: 10px; + margin-bottom: 10px; + text-align: center; +} + +.rtl .swpm-item-actions { + margin-right: 0; + margin-left: 10px; +} + +.swpm-item-actions .swpm-delete{ + float:left; +} + +.rtl .swpm-item-actions .swpm-delete { + float: right; +} + +.swpm-item-actions .swpm-conditional-fields{ + float:right; +} + +.rtl .swpm-item-actions .swpm-conditional-fields { + float: left; +} + +.swpm-item-actions .swpm-delete, +.swpm-item-actions .swpm-duplicate, +.swpm-item-actions .swpm-conditional-fields{ + margin-top: 10px; +} + +#form-settings{ + display:none; + width: 100%; + max-width: 460px; + margin-bottom: 15px; + border-bottom: 1px solid #D6D6D6; +} + +#form-settings.current{ + display:block; +} + +.form-details{ + padding:20px; + background: rgb( 255, 255, 255 ); + background: rgba(255, 255, 255, 0.5); + border-left: 1px solid #D6D6D6; + border-right: 1px solid #D6D6D6; +} + +.form-details.on{ + display:block; +} + +.settings-links{ + position: relative; + z-index: 1; + display: block; + padding: 5px 15px; + height: 25px; + background: #f5f5f5; + border-top: 1px solid #cccccc; + border-left: 1px solid #cccccc; + border-right: 1px solid #cccccc; + color: #333333; + text-decoration:none; + text-transform:uppercase; + text-shadow: 0 1px 0 #FFFFFF; + font-weight: normal; + font-size: 15px; + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; + line-height: 25px; + cursor: pointer; +} + +.settings-links .swpm-large-arrow{ + position: absolute; + top: 16px; + right: 25px; + width: 5px; + height: 0; + z-index: 1; +} + +.settings-links .swpm-large-arrow:after { + content: ''; + width: 0; + height: 0; + border-color: #ccc transparent; + border-style: solid; + border-width: 6px 6px 0; + position: absolute; + z-index: 1; +} + +.rtl .settings-links .swpm-large-arrow { + right: auto; + left: 13px; +} + +.settings-links.on { + border-bottom: 1px solid #808080; +} + +.settings-links:hover, +.settings-links.on { + background: #808080; + color: #ffffff; + text-shadow: 0 -1px 0 #333333; +} + +.settings-links:first-child { + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} + +/* !Help tooltip popups */ +.swpm-tooltip{ + position: relative; + float: right; + margin-right: 2px; + width: 16px; + height: 16px; + cursor: pointer; +} + +.rtl .swpm-tooltip { + float: left; + margin-right: 0; + margin-left: 2px; +} + +.swpm-tooltip-popup { + position: absolute; + top: -40px; + z-index: 200; + display: none; + padding: 5px 20px; + width: 250px; + border: 2px solid #333; + border-radius: 5px; + background: #222; + box-shadow: 0 0 7px black; + color: white; + text-indent: 0; + font-style: normal; +} + +.swpm-tooltip-popup h3, +.swpm-tooltip .swpm-tooltip-popup h3{ + margin: 5px 0; + padding: 0 0 6px 0; + border-bottom: 1px solid white; + color: white; + font-weight: normal; + font-size: 13px; + font-family: sans-serif; +} + +.swpm-tooltip-popup p{ + margin-top:1 0px; + color: white; + font-size: 12px; +} + +/* !Bulk Add Options */ +.swpm-add-options-group { + display: inline-block; + margin: 10px 0; + list-style: none; + text-align: center; + width: 95%; +} + +.swpm-add-options-group .swpm-interface-plus { + top: 4px; +} + +/* !Import/Export */ +.swpm-export-label { + width: 10em; + float: left; +} + +.rtl .swpm-export-label { + float: right; +} + +#swpm-export-entries-fields { + height:275px; + width:300px; + overflow: auto; + display: block; + border:1px solid #e8e8e8; + border-radius: 3px; + margin-left: 10em; + padding: 5px; + background: white; +} + +#swpm-export-select-all, +#swpm-export-unselect-all { + width: 150px; + display: inline-block; + text-align: left; +} + +#swpm-export-unselect-all { + text-align: right; + margin-left: 5px; +} + + +@media print { + body * { + float: none; + } + + html, + .wrap, + #wpbody-content, + #swpm-poststuff { + background: none !important; + padding: 0; + margin: 0; + height: auto; + } + + #wpadminbar, + #adminmenuwrap, + #adminmenushadow, + #adminmenuback, + .screen-reader-shortcut, + #screen-meta, + #screen-meta-links, + #wpfooter, + #icon-options-general, + .wrap h2, + .view-entry, + #major-publishing-actions, + .clear { + display: none; + } + + #wpcontent, + body #wpcontent { + margin-left: 0; + width: auto; + height: auto; + } + + #entry-edit h3 span { + font-size: 23px; + font-weight: normal; + } + + #swpm-poststuff { + page-break-after: auto; + } + + #swpm-entries-body-content { + width: 100%; + height: auto; + margin: 0 0 50px 0; + padding: 0; + } + + #side-info-column{ + width: 100%; + height: auto; + float: none; + } + + #side-info-column .postbox .inside { + margin: 0; + padding: 0; + } + + #minor-publishing, + .misc-pub-section, + #submitdiv, + #submitdiv h3 { + background: none !important; + border: none; + margin: 0; + } + + #submitdiv h3 span { + font-family: sans-serif; + font-size: 16px; + } + + .inner-sidebar #side-sortables, + .columns-2 .inner-sidebar #side-sortables { + margin: 0; + padding: 0; + width: auto; + } + + table { + page-break-inside: auto; + } + + tr textarea { + overflow: visible; + } +} + +/* !HiDPI Displays */ +@media print, +(-o-min-device-pixel-ratio: 5/4), +(-webkit-min-device-pixel-ratio: 1.25), +(min-resolution: 120dpi) { + + /* Interface icons */ + .swpm-interface-icon { + top: 5px; + background-image: url( '../images/swpm-interface-icons-2x.png?d=20130712' ); + background-size: cover; + } + + /* Form items */ + .swpm-draggable-form-items b { + background-image: url( '../images/swpm-form-items-2x.png?d=20130712' ); + background-size: cover; + } + + .swpm-add-options-group .swpm-interface-plus { + top: 5px; + } + + .addEmail, + .deleteEmail { + top: 28px; + } + + /* Field Item arrows */ + .item-edit { + background-image: url('../images/arrows-2x.png?d=20130611'); + background-size: 15px 123px; + } + + /* Blue Admin style */ + .admin-color-classic .item-edit { + background-image: url('../images/arrows-vs-2x.png?d=20130611'); + background-size: 15px 123px; + } + + .item-edit:hover{ + background-image: url('../images/arrows-dark-2x.png?d=20130611'); + background-size: 15px 123px; + } + + /* Blue Admin style */ + .admin-color-classic .item-edit:hover { + background-image: url('../images/arrows-dark-vs-2x.png?d=20130611'); + background-size: 15px 123px; + } + + .item-edit.opened{ + background-image: url('../images/arrows-2x.png?d=20130611'); + background-size: 15px 123px; + } + + /* Blue Admin style */ + .admin-color-classic .item-edit.opened { + background-image: url('../images/arrows-vs-2x.png?d=20130611'); + background-size: 15px 123px; + } + + .item-edit.opened:hover{ + background-image: url('../images/arrows-dark-2x.png?d=20130611'); + background-size: 15px 123px; + } + + /* Blue Admin style */ + .admin-color-classic .item-edit.opened:hover { + background-image: url('../images/arrows-dark-vs-2x.png?d=20130611'); + background-size: 15px 123px; + } + + /* Form Settings arrow */ + .button-icon.swpm-small-arrow{ + background-image: url('../images/arrows-2x.png?d=20130611'); + background-size: 15px 123px; + } + + /* Blue Admin style */ + .admin-color-classic .button-icon.swpm-small-arrow { + background-image: url('../images/arrows-vs-2x.png?d=20130611'); + background-size: 15px 123px; + } + + .current .button-icon.swpm-small-arrow{ + background-image: url('../images/arrows-2x.png?d=20130611'); + background-size: 15px 123px; + } + + /* Blue Admin style */ + .admin-color-classic .current .button-icon.swpm-small-arrow { + background-image: url('../images/arrows-vs.png?d=20130611'); + background-size: 15px 123px; + } +} \ No newline at end of file diff --git a/css/swpm-form-builder-admin.min.css b/css/swpm-form-builder-admin.min.css new file mode 100644 index 0000000..3ef9b77 --- /dev/null +++ b/css/swpm-form-builder-admin.min.css @@ -0,0 +1 @@ +.swpm-pro-call-to-action{padding:5px 0;text-align:center}.swpm-btn{display:inline-block;*display:inline;*zoom:1;padding:15px 10px;margin-bottom:0;line-height:20px;text-align:center;vertical-align:middle;cursor:pointer;color:#333;font-size:21px;font-weight:500;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f5f5f5;background-repeat:repeat-x;border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#e6e6e6;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);border:1px solid #ccc;*border:0;border-bottom-color:#b3b3b3;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);text-decoration:none}.swpm-btn:hover,.swpm-btn:focus{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.swpm-btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.swpm-btn.active,.swpm-btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.swpm-btn-primary.active{color:rgba(255,255,255,0.75)}.swpm-btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);border-color:#04c #0044cc #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#04c;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.swpm-btn-primary:hover,.swpm-btn-primary:focus,.swpm-btn-primary:active,.swpm-btn-primary.active,.swpm-btn-primary.disabled,.swpm-btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.swpm-btn-primary:active,.swpm-btn-primary.active{background-color:#039 \9}.swpm-btn-inverse{background-color:#363636;background-repeat:repeat-x;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.swpm-btn-inverse:hover,.swpm-btn-inverse:focus,.swpm-btn-inverse:active,.swpm-btn-inverse.active,.swpm-btn-inverse.disabled,.swpm-btn-inverse[disabled]{background-color:#222;color:#fff}.swpm-pro-call-to-action .cta-sign-up{color:#fff;display:block;font-size:24px;font-weight:bold;text-align:center;text-decoration:none;text-shadow:1px 1px 1px #2b658c;width:100%;line-height:22px}.swpm-pro-call-to-action .cta-price{color:#ace7ff;display:block;font-size:12px;font-weight:normal;line-height:20px;text-align:center;text-decoration:none;width:100%;line-height:20px}.swpm-pro-upgrade{display:inline;float:left;padding:10px;margin-bottom:20px;background-color:#d3e7ee;border:1px solid #21759b;border-radius:5px}.rtl .swpm-pro-upgrade{float:right}.swpm-pro-upgrade h2,.wrap .swpm-pro-upgrade h2{font-size:23px;font-weight:500;padding:5px 0;text-align:center}.swpm-pro-upgrade h2 a{text-decoration:none}.swpm-pro-upgrade ul{list-style:outside;margin-left:10px}.rtl .swpm-pro-upgrade ul{margin-left:0;margin-right:10px}#swpm-form-builder-frame{display:block;margin:0 -8px 0 290px}.rtl #swpm-form-builder-frame{margin:0 290px 0 -8px}#swpm-form-builder-frame:after,#form-editor-header .swpm-major-publishing-actions:after,#form-editor-footer .swpm-major-publishing-actions:after,#swpm-form-builder-frame .menu-item-settings:after,#swpm-form-list:after,.option:after{display:block;visibility:hidden;clear:both;height:0;content:"."}#swpm-form-builder-sidebar{clear:both;width:281px}#swpm-form-builder-management{position:relative;margin-right:10px}.rtl #swpm-form-builder-management{margin-right:0;margin-left:10px}#swpm-form-builder-management .form-edit{margin-bottom:20px;border:1px solid #dfdfdf;border-radius:3px}.admin-color-classic #swpm-form-builder-management .form-edit{border-color:#d0dfe9}#form-editor-header,#form-editor-footer{padding:0 10px;background-color:#f1f1f1}#form-editor-footer{border-top:1px solid #dfdfdf}.admin-color-classic #form-editor-header,.admin-color-classic #form-editor-footer{background-color:#f5fafd}.admin-color-class #form-editor-footer{border-top-color:#d0dfe9}.swpm-major-publishing-actions{clear:both;padding:3px 0 5px}.swpm-major-publishing-actions .publishing-action{float:right;margin:5px 0 1px;text-align:right;line-height:23px}#form-editor-header .publishing-action{margin-top:12px}.sub-navigation{float:none;margin:8px 0 5px;padding:0;list-style:none;white-space:nowrap;font-size:12px}.sub-navigation li{display:inline;margin:0;padding:0}.sub-navigation a{padding:.2em;text-decoration:none;line-height:2}.sub-navigation a.current{border:medium none;background:0;color:black;font-weight:bold}.sub-navigation a:hover{color:#d54e21}#swpm-sidebar,#swpm-main{float:left;margin:10px 0;width:280px}.rtl #swpm-sidebar,.rtl #swpm-main{float:right}#swpm-main{width:auto}#swpm-main.swpm-order-type-list{width:100%}#swpm-main p a,#swpm-main h3 a{text-decoration:none}#swpm-main .submitdelete{color:#bc0b0b;text-decoration:none}#swpm-main .submitdelete:hover{color:red}#swpm-sidebar{margin-left:-300px}.rtl #swpm-sidebar{margin-left:0;margin-right:-300px}#swpm-form-list{display:block;margin-left:300px}.rtl #swpm-form-list{margin-left:0;margin-right:300px}.swpm-box{position:relative;float:left;padding:0 10px;border:1px solid #dfdfdf;border-radius:3px 3px 3px 3px;background-color:#f5f5f5;background:-moz-linear-gradient(top,#fff 0,#f5f5f5 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#fff),color-stop(100%,#f5f5f5));background:-webkit-linear-gradient(top,#fff 0,#f5f5f5 100%);background:-o-linear-gradient(top,#fff 0,#f5f5f5 100%);background:-ms-linear-gradient(top,#fff 0,#f5f5f5 100%);background:linear-gradient(to bottom,#fff 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#f5f5f5',GradientType=0);box-shadow:0 1px 0 #fff inset;line-height:1.4em}.swpm-form-alpha-list{width:70%;float:left;padding-right:20px}.rtl .swpm-form-alpha-list{float:right;padding-right:0;padding-left:20px}.swpm-form-alpha-list hr{display:block;margin:1em 0;padding:0;height:1px;border:0;border-top:1px solid #ccc}.swpm-form-alpha-group .letter,.wrap h2.letter{float:left;padding:0;color:#666;font-size:14px;line-height:17px}.swpm-form-alpha-form{display:block;margin:10px 0;padding-left:150px;width:auto}.swpm-form-alpha-form h3{float:left;margin:0;width:50%;word-wrap:break-word;font-size:17px}.swpm-form-alpha-form .swpm-publishing-actions,.swpm-form-alpha-form .swpm-form-meta{float:left;width:20%;text-align:center}.swpm-form-alpha-form .swpm-form-meta{width:30%}.swpm-form-alpha-form .swpm-publishing-actions p,.swpm-form-alpha-form .swpm-form-meta p{margin:0}.swpm-form-alpha-form .swpm-form-meta,.swpm-form-alpha-form .paypal{float:left;margin:0;text-align:left}.rtl .swpm-form-alpha-form .swpm-form-meta,.rtl .swpm-form-alpha-form .paypal{float:right;text-align:right}.swpm-sortable-placeholder{display:block;height:35px;width:400px;margin:8px;border:1px dashed #bbb;background-color:#f5f5f5}#swpm-main .swpm-sortable-placeholder{float:left;margin:8px;height:200px;width:210px}.rtl #swpm-main .swpm-sortable-placeholder{float:right}#swpm-menu-to-edit .mjs-nestedSortable-error{border-color:red;background-color:#fbe3e4;color:#8a1f11}.swpm-meta-entries-total span,.swpm-meta-entries-total-today span{font-size:11px;font-weight:bold;height:1.4em;line-height:1.4em;min-width:.7em;padding:0 6px;display:inline-block;border-radius:5px;background-color:#bbb;color:white;text-align:center}.swpm-meta-entries-total:hover span,.swpm-meta-entries-total-today:hover span{background-color:#d54e21}.fixed .column-entries,.fixed .column-form_id{width:8em}strong .swpm-meta-entries-total span{background-color:#21759b}.entries-count-wrapper{font-family:sans-serif;min-width:22px;padding-bottom:1px}#new-form{margin:8px 0;padding-top:10px;width:75px;height:105px;text-align:center}#new-form a{display:block;width:auto;text-decoration:none}#post-body{padding:10px;background:white}.swpm-postbox-container{float:left;margin:0 8px;width:100%}.rtl .swpm-postbox-container{float:right}#swpm-postbox-container-1 .postbox{min-width:281px}#swpm-postbox-container-2{min-width:485px}#swpm-form-builder-frame.columns-1{margin-left:-8px}.rtl #swpm-form-builder-frame.columns-1{margin-left:0;margin-right:-8px}#swpm-form-builder-frame.columns-1 #swpm-postbox-container-1{float:none}#swpm-form-builder-frame.columns-1 #swpm-postbox-container-2{width:99%}#swpm-form-builder-frame.columns-2 #swpm-postbox-container-3{display:none}#swpm-form-builder-frame.columns-2 #swpm-postbox-container-1,#swpm-form-builder-frame.columns-3 #swpm-postbox-container-1{margin-left:-290px;width:281px}.rtl #swpm-form-builder-frame.columns-2 #swpm-postbox-container-1,.rtl #swpm-form-builder-frame.columns-3 #swpm-postbox-container-1{margin-left:0;margin-right:-290px}#swpm-form-builder-frame.columns-3 #swpm-form-builder-management{margin-right:0}#swpm-form-builder-frame.columns-3 #swpm-postbox-container-2{width:30%}#swpm-form-builder-frame.columns-3 #swpm-postbox-container-3{display:inline;margin-right:0;width:46.5%}.rtl #swpm-form-builder-frame.columns-3 #swpm-postbox-container-3{margin-right:0;margin-left:0}#swpm-form-meta-preview iframe{width:100%;height:100%}#swpm_form_media_button_tip input{width:100%;border:0;padding:6px;font-family:Consolas,Monaco,monospace;font-size:12px}@media only screen and (max-width:799px){#swpm-form-builder-frame .swpm-postbox-container{width:100%}.columns-prefs .columns-prefs-3{display:none}}@media only screen and (min-width:800px) and (max-width:1200px){#swpm-form-builder-frame .swpm-postbox-container{width:49.5%}#swpm-form-builder-frame.columns-3 #swpm-postbox-container-2,#swpm-form-builder-frame.columns-3 #swpm-postbox-container-3{width:50.5%}#swpm-form-builder-frame.columns-1 .swpm-postbox-container{width:100%}}@media only screen and (min-width:1600px){#swpm-form-builder-frame.columns-3 #swpm-postbox-container-3{width:58%}}.item-edit{position:absolute;top:3px;right:-20px;display:block;overflow:hidden;width:30px;height:40px;background:url('../images/arrows.png?d=20130703') no-repeat scroll 8px 10px transparent;text-indent:-999em}.admin-color-classic .item-edit{background:url('../images/arrows-vs.png?d=20130703') no-repeat scroll 8px 10px transparent}.rtl .item-edit{right:auto;left:-20px}.item-edit:hover{background:url('../images/arrows-dark.png?d=20130703') no-repeat scroll 8px 10px transparent}.admin-color-classic .item-edit:hover{background:url('../images/arrows-dark-vs.png?d=20130703') no-repeat scroll 8px 10px transparent}.item-edit.opened{background:url('../images/arrows.png?d=20130703') no-repeat scroll 8px -25px transparent}.admin-color-classic .item-edit.opened{background:url('../images/arrows-vs.png?d=20130703') no-repeat scroll 8px -25px transparent}.item-edit.opened:hover{background:url('../images/arrows-dark.png?d=20130703') no-repeat scroll 8px -25px transparent}.admin-color-classic .item-edit.opened:hover{background:url('../images/arrows-dark-vs.png?d=20130703') no-repeat scroll 8px -25px transparent}.option .widefat,.options-other-show .widefat,.options-other-hide .widefat{margin:0 6px 7px 0;width:320px}.rtl .option .widefat,.rtl .options-other-show .widefat,.rtl .options-other-hide .widefat{margin:0 0 7px 6px}#form-settings .description-thin{margin:12px 10px 12px 0}.rtl #form-settings .description-thin{margin:12px 0 12px 10px}.description-thin,.description-wide{float:left;margin-right:10px}.rtl .description-thin,.rtl .description-wide{float:right;margin-right:0;margin-left:10px}.description-thin{width:190px;height:40px}.description-wide{width:390px}.swpm-interface-icon{position:absolute;top:4px;right:4px;display:inline-block;width:16px;height:16px;background-color:transparent;background-image:url('../images/swpm-interface-icons.png?d=20130713');background-repeat:no-repeat;text-indent:-9999px}.swpm-interface-settings{background-position:-32px 0}.swpm-interface-duplicate{background-position:0 0}.swpm-interface-trash{background-position:-64px 0}.swpm-interface-conditional{background-position:-224px 0}.swpm-interface-sort{background-position:-128px 0}.swpm-interface-plus{background-position:-160px 0}.swpm-interface-minus{background-position:-192px 0}.swpm-interface-bulk-add{background-position:-96px 0}.swpm-interface-plus,.swpm-interface-minus{top:0}.addEmail,.deleteEmail{top:28px}.addEmail{right:55px}.rtl .addEmail{right:auto;left:55px}.deleteEmail{right:30px}.rtl .deleteEmail{right:auto;left:30px}.deleteOption,.swpm-interface-sort,.addCondition,.deleteCondition{top:3px}.deleteOption,.addCondition{right:25px}.rtl .deleteOption,.rtl .addCondition{right:auto;left:25px}.swpm-interface-sort,.deleteCondition{right:0}.rtl .swpm-interface-sort,.rtl .deleteCondition{right:auto;left:0}.swpm-interface-sort:hover{cursor:pointer}.option{float:left;width:97%;position:relative}.rtl .option{float:right}#swpm-poststuff{display:block;margin-right:300px}.rtl #swpm-poststuff{margin-right:0;margin-left:300px}#swpm-entries-body-content{float:left;width:100%}.rtl #swpm-entries-body-content{float:right}.metabox-holder #swpm-entries-body-content h3{font-weight:bold;font-family:sans-serif}#entry-edit #side-info-column{margin-right:-300px}.rtl #entry-edit #side-info-column{margin-right:0;margin-left:-300px}label.error{display:block;color:red}#swpm-form-builder-update input.error,#swpm-form-builder-update textarea.error,#swpm-form-builder-update select.error{border:1px solid red}#swpm-menu-to-edit .menu-item-settings{width:402px}.swpm-menu-item-handle{background:white;border:1px solid #dfdfdf;border-radius:3px;height:auto;line-height:35px;overflow:hidden;padding:10px 15px;position:relative;text-shadow:0 1px 0 #fff;width:382px;word-wrap:break-word;cursor:move}.swpm-menu-item-handle:hover{border-color:#999}.admin-color-classic .swpm-menu-item-handle{background:#f5fafd;box-shadow:0 1px 0 #fff inset;border-color:#d0dfe9}.rtl .swpm-menu-item-handle{padding-left:0;padding-right:10px}.swpm-menu-item-type-fieldset,.swpm-menu-item-type-verification,#form-element-fieldset{background:#e3e3e3;box-shadow:0 1px 0 #e3e3e3 inset}.admin-color-classic .swpm-menu-item-type-fieldset,.admin-color-classic .swpm-menu-item-type-verification,.admin-color-classic #form-element-fieldset{background:#e2f3ff;box-shadow:0 1px 0 #fff inset}.swpm-menu-item-handle .item-title{min-height:20px;display:block;font-size:12px;font-weight:bold;line-height:20px;margin-right:13em}.rtl .swpm-menu-item-handle .item-title{margin-right:0;margin-left:13em}.swpm-menu-item-active .swpm-menu-item-handle{border-bottom-left-radius:0;border-bottom-right-radius:0}.sender-labels{width:80px}.is-field-required{color:#bc1212}#form-details-nav{padding-top:10px;font-size:1.0em}#form-details-nav a,.charts-nav a{padding:5px 10px;text-decoration:none;font-weight:bold}#form-details-nav a.current,.charts-nav a.current{height:40px;border-color:#dfdfdf;border-radius:5px;background-color:#777;background-image:-ms-linear-gradient(bottom,#6d6d6d,#808080);background-image:-moz-linear-gradient(bottom,#6d6d6d,#808080);background-image:-o-linear-gradient(bottom,#6d6d6d,#808080);background-image:-webkit-gradient(linear,left bottom,left top,from(#6d6d6d),to(#808080));background-image:-webkit-linear-gradient(bottom,#6d6d6d,#808080);background-image:linear-gradient(bottom,#6d6d6d,#808080);color:white;text-shadow:0 -1px 0 #333}.form-details,#form-success-message-text,#form-success-message-page,#form-success-message-redirect{display:none}.form-details-current,.active{display:block}#confirmation-message textarea,#notification textarea{width:100%;height:10em;font-family:Consolas,Monaco,monospace}#form-success-message-page,#form-success-message-redirect{margin-top:10px;width:100%}.post-body-plain ol li{list-style:decimal}#swpm-upgrade-column{display:inline;float:left;width:auto}.rtl #swpm-upgrade-column{float:right}ul#promote-swpm{margin-left:20px;list-style:disc}.rtl ul#promote-swpm{margin-left:auto;margin-right:20px}#promote-swpm li{text-align:left}.rtl #promote-swpm li{text-align:right}.menu .ui-nestedSortable-error{background-color:#fbe3e4;border-color:red;color:#8a1f11}ul#swpm-menu-to-edit ul{margin:0 0 0 25px;padding:0;width:98%;list-style-type:none}#swpm-menu-to-edit{margin-top:0;padding:1em 0}#swpm-fieldset-first-warning{display:none}.ui-state-disabled,.ui-state-disabled dl,.ui-state-disabled dt,.form-item.ui-state-disabled{opacity:100;filter:alpha(Opacity=100);background-image:none}.ui-state-disabled .swpm-menu-item-handle,.ui-state-disabled .menu-item-handle{background:#dfdfdf;box-shadow:none;cursor:default}.swpm-details{margin-bottom:10px;padding:0 10px;border:1px solid #ccc;border-radius:3px}.swpm-details.section{width:97.55%;background-color:#efefef}.swpm-details .postbox{min-height:60px}#poststuff .swpm-details h2{margin-top:0}#poststuff h3.section-heading{padding-left:0}#form-items .tabs-panel{overflow:visible;padding:.5em 0 .5em 4px;min-height:325px;height:auto}.rtl #form-items .tabs-panel{padding:.5em 4px .5em 0}ul.swpm-fields-col-1,ul.swpm-fields-col-2{float:left;width:50%;list-style:none}.rtl ul.swpm-fields-col-1,.rtl ul.swpm-fields-col-2{float:right}#swpm-form-builder-frame.columns-1 #swpm-postbox-container-1 #form-items .tabs-panel{height:auto}.swpm-draggable-form-items{position:relative;position:relative;display:block;margin-right:8px;padding:4px 0 4px 34px;border:1px solid #bbb;border-radius:3px;color:#464646;text-align:left;text-decoration:none;font-size:12px}.rtl .swpm-draggable-form-items{margin-right:0;margin-left:8px;padding:4px 34px 4px 10px}.swpm-draggable-form-items:hover{border-color:#aaa}.swpm-draggable-form-items b{position:absolute;left:8px;display:inline-block;width:16px;height:16px;background-color:transparent;background-image:url('../images/swpm-form-items.png?d=20130712');background-repeat:no-repeat;line-height:16px}.rtl .swpm-draggable-form-items b{left:auto;right:8px}#form-element-address b{background-position:-128px 0}#form-element-autocomplete b{background-position:-384px 0}#form-element-checkbox b{background-position:-672px 0}#form-element-color b{background-position:0 0}#form-element-currency b{background-position:-64px 0}#form-element-datepicker b{background-position:-224px 0}#form-element-digits b{background-position:-832px 0}#form-element-email b{background-position:-160px 0}#form-element-file b{background-position:-512px 0}#form-element-hidden b{background-position:-544px 0}#form-element-html b{background-position:-800px 0}#form-element-instructions b{background-position:-256px 0}#form-element-ip b{background-position:-448px 0}#form-element-max b{background-position:-576px 0}#form-element-min b{background-position:-608px 0}#form-element-name b{background-position:-320px 0}#form-element-pagebreak b{background-position:-768px 0}#form-element-password b{background-position:-352px 0}#form-element-phone b{background-position:-96px 0}#form-element-radio b{background-position:-704px 0}#form-element-range b{background-position:-640px 0}#form-element-select b{background-position:-416px 0}#form-element-text b{background-position:-736px 0}#form-element-textarea b{background-position:-32px 0}#form-element-time b{background-position:-192px 0}#form-element-username b{background-position:-288px 0}#form-element-url b{background-position:-480px 0}.static-vars-inactive{display:none}.static-vars-active{display:block}.swpm-button{position:relative;display:inline-block;overflow:visible;margin:0;padding:.5em 2.5em .5em 1em;outline:0;border:1px solid #d4d4d4;border-radius:.2em;background-color:#f5f5f5;color:#333;text-decoration:none;white-space:nowrap;font:12px/normal sans-serif;cursor:pointer;zoom:1;-webkit-background-clip:padding;-moz-background-clip:padding;-o-background-clip:padding-box;*display:inline}.swpm-button:hover,.swpm-button:active,.swpm-button.current{border-color:#929292;border-bottom-color:#929292;background-color:#eee;background-image:-webkit-gradient(linear,0 0,0 100%,from(#eee),to(#ccc));background-image:-moz-linear-gradient(#eee,#ccc);background-image:-o-linear-gradient(#eee,#ccc);background-image:linear-gradient(#eee,#ccc);color:#000}.swpm-button.current{font-weight:bold}.swpm-button::-moz-focus-inner{padding:0;border:0}.swpm-button.swpm-settings:hover,.swpm-button.swpm-settings:focus,.swpm-button.swpm-settings:active{color:#3072b3}.swpm-button.swpm-delete:hover,.swpm-button.swpm-delete:focus,.swpm-button.swpm-delete:active{color:#900}.swpm-button.swpm-duplicate:hover,.swpm-button.swpm-duplicate:focus,.swpm-button.swpm-duplicate:active{color:#008e0d}.swpm-button-group{display:inline-block;margin:10px 0;list-style:none}.rtl .swpm-button-group{margin-left:-2px}.swpm-button-group .swpm-button{float:left;margin-right:5px}.rtl .swpm-button-group .swpm-button{float:right;margin-right:0;margin-left:5px}.swpm-button-group .button-primary{margin-top:2px}.swpm-item-actions{margin-right:10px;margin-bottom:10px;text-align:center}.rtl .swpm-item-actions{margin-right:0;margin-left:10px}.swpm-item-actions .swpm-delete{float:left}.rtl .swpm-item-actions .swpm-delete{float:right}.swpm-item-actions .swpm-conditional-fields{float:right}.rtl .swpm-item-actions .swpm-conditional-fields{float:left}.swpm-item-actions .swpm-delete,.swpm-item-actions .swpm-duplicate,.swpm-item-actions .swpm-conditional-fields{margin-top:10px}#form-settings{display:none;width:100%;max-width:460px;margin-bottom:15px;border-bottom:1px solid #d6d6d6}#form-settings.current{display:block}.form-details{padding:20px;background:#fff;background:rgba(255,255,255,0.5);border-left:1px solid #d6d6d6;border-right:1px solid #d6d6d6}.form-details.on{display:block}.settings-links{position:relative;z-index:1;display:block;padding:5px 15px;height:25px;background:#f5f5f5;border-top:1px solid #ccc;border-left:1px solid #ccc;border-right:1px solid #ccc;color:#333;text-decoration:none;text-transform:uppercase;text-shadow:0 1px 0 #fff;font-weight:normal;font-size:15px;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:25px;cursor:pointer}.settings-links .swpm-large-arrow{position:absolute;top:16px;right:25px;width:5px;height:0;z-index:1}.settings-links .swpm-large-arrow:after{content:'';width:0;height:0;border-color:#ccc transparent;border-style:solid;border-width:6px 6px 0;position:absolute;z-index:1}.rtl .settings-links .swpm-large-arrow{right:auto;left:13px}.settings-links.on{border-bottom:1px solid #808080}.settings-links:hover,.settings-links.on{background:#808080;color:#fff;text-shadow:0 -1px 0 #333}.settings-links:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.swpm-tooltip{position:relative;float:right;margin-right:2px;width:16px;height:16px;cursor:pointer}.rtl .swpm-tooltip{float:left;margin-right:0;margin-left:2px}.swpm-tooltip-popup{position:absolute;top:-40px;z-index:200;display:none;padding:5px 20px;width:250px;border:2px solid #333;border-radius:5px;background:#222;box-shadow:0 0 7px black;color:white;text-indent:0;font-style:normal}.swpm-tooltip-popup h3,.swpm-tooltip .swpm-tooltip-popup h3{margin:5px 0;padding:0 0 6px 0;border-bottom:1px solid white;color:white;font-weight:normal;font-size:13px;font-family:sans-serif}.swpm-tooltip-popup p{margin-top:1 0;color:white;font-size:12px}.swpm-add-options-group{display:inline-block;margin:10px 0;list-style:none;text-align:center;width:95%}.swpm-add-options-group .swpm-interface-plus{top:4px}.swpm-export-label{width:10em;float:left}.rtl .swpm-export-label{float:right}#swpm-export-entries-fields{height:275px;width:300px;overflow:auto;display:block;border:1px solid #e8e8e8;border-radius:3px;margin-left:10em;padding:5px;background:white}#swpm-export-select-all,#swpm-export-unselect-all{width:150px;display:inline-block;text-align:left}#swpm-export-unselect-all{text-align:right;margin-left:5px}@media print{body *{float:none}html,.wrap,#wpbody-content,#swpm-poststuff{background:none!important;padding:0;margin:0;height:auto}#wpadminbar,#adminmenuwrap,#adminmenushadow,#adminmenuback,.screen-reader-shortcut,#screen-meta,#screen-meta-links,#wpfooter,#icon-options-general,.wrap h2,.view-entry,#major-publishing-actions,.clear{display:none}#wpcontent,body #wpcontent{margin-left:0;width:auto;height:auto}#entry-edit h3 span{font-size:23px;font-weight:normal}#swpm-poststuff{page-break-after:auto}#swpm-entries-body-content{width:100%;height:auto;margin:0 0 50px 0;padding:0}#side-info-column{width:100%;height:auto;float:none}#side-info-column .postbox .inside{margin:0;padding:0}#minor-publishing,.misc-pub-section,#submitdiv,#submitdiv h3{background:none!important;border:0;margin:0}#submitdiv h3 span{font-family:sans-serif;font-size:16px}.inner-sidebar #side-sortables,.columns-2 .inner-sidebar #side-sortables{margin:0;padding:0;width:auto}table{page-break-inside:auto}tr textarea{overflow:visible}}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.swpm-interface-icon{top:5px;background-image:url('../images/swpm-interface-icons-2x.png?d=20130712');background-size:cover}.swpm-draggable-form-items b{background-image:url('../images/swpm-form-items-2x.png?d=20130712');background-size:cover}.swpm-add-options-group .swpm-interface-plus{top:5px}.addEmail,.deleteEmail{top:28px}.item-edit{background-image:url('../images/arrows-2x.png?d=20130611');background-size:15px 123px}.admin-color-classic .item-edit{background-image:url('../images/arrows-vs-2x.png?d=20130611');background-size:15px 123px}.item-edit:hover{background-image:url('../images/arrows-dark-2x.png?d=20130611');background-size:15px 123px}.admin-color-classic .item-edit:hover{background-image:url('../images/arrows-dark-vs-2x.png?d=20130611');background-size:15px 123px}.item-edit.opened{background-image:url('../images/arrows-2x.png?d=20130611');background-size:15px 123px}.admin-color-classic .item-edit.opened{background-image:url('../images/arrows-vs-2x.png?d=20130611');background-size:15px 123px}.item-edit.opened:hover{background-image:url('../images/arrows-dark-2x.png?d=20130611');background-size:15px 123px}.admin-color-classic .item-edit.opened:hover{background-image:url('../images/arrows-dark-vs-2x.png?d=20130611');background-size:15px 123px}.button-icon.swpm-small-arrow{background-image:url('../images/arrows-2x.png?d=20130611');background-size:15px 123px}.admin-color-classic .button-icon.swpm-small-arrow{background-image:url('../images/arrows-vs-2x.png?d=20130611');background-size:15px 123px}.current .button-icon.swpm-small-arrow{background-image:url('../images/arrows-2x.png?d=20130611');background-size:15px 123px}.admin-color-classic .current .button-icon.swpm-small-arrow{background-image:url('../images/arrows-vs.png?d=20130611');background-size:15px 123px}} \ No newline at end of file diff --git a/css/swpm-form-builder.css b/css/swpm-form-builder.css new file mode 100644 index 0000000..ad42595 --- /dev/null +++ b/css/swpm-form-builder.css @@ -0,0 +1,530 @@ +form.swpm-form-builder{ + position: relative; + margin:20px 0; + background: none; + list-style:none; + list-style-type: none; + list-style-image: none; + text-shadow: none; + font-family:inherit; +} + +form.swpm-form-builder li{ + margin: 0 !important; + width: auto !important; + background: none !important; + list-style: none !important; + list-style-type: none !important; + list-style-image: none !important; + clear: both; +} + +form.swpm-form-builder li:before { + content: none; +} + +form.swpm-form-builder ul:after, +form.swpm-form-builder li:after, +form.swpm-form-builder li div:after { + clear: both; + content: '.'; + display: block; + height: 0; + visibility: hidden; +} + +/* Hide br tags for themes that auto add them */ +.swpm-form-builder br { + display: none; +} + +form.swpm-form-builder .swpm-item-instructions br { + display: inline; +} + +/* !Remove list item styles */ +.swpm-form-builder ul, +.entry-content .swpm-form-builder ul, +.comment-content .swpm-form-builder ul, +.mu_register .swpm-form-builder ul, +.swpm-form-builder ol, +.entry-content .swpm-form-builder ol, +.comment-content .swpm-form-builder ol, +.mu_register .swpm-form-builder ol { + margin: 0 14px !important; + padding: 0 !important; + background: none !important; + list-style: none !important; + list-style-type: none !important; + list-style-image: none !important; + font-size: 13px; + line-height: inherit; +} + +.swpm-form-builder ul li { + margin: 0 !important; + background: none !important; + list-style: none !important; + list-style-type: none !important; + list-style-image: none !important; +} + +.swpm-form-builder ul li:before { + content: none; +} + +.swpm-form-builder li, +.entry-content .swpm-form-builder li, +.comment-content .swpm-form-builder li, +.mu_register .swpm-form-builder li { + clear: both; + margin: 0 !important; + padding: 6px 1% 9px !important; + width: 64%; + background: none !important; + list-style: none !important; + list-style-type: none !important; + list-style-image: none !important; +} + +.swpm-form-builder li:before, +.entry-content .swpm-form-builder li:before, +.comment-content .swpm-form-builder li:before, +.mu_register .swpm-form-builder li:before { + content: none; +} + +.swpm-span, +.swpm-form-builder li div span.swpm-span, +.swpm-form-builder [class*="swpm-span"], +span.swpm-full input, +span.swpm-full input[type="text"].swpm-medium, +span.swpm-full select{ + display:block; + float:left; + margin: 0; + width:100%; +} + +.swpm-form-builder span.swpm-left{ + float:left; + width:48%; +} + +.swpm-form-builder span.swpm-right{ + float:right; + width:48%; +} + +.swpm-form-builder span.swpm-span ul li { + list-style: disc; +} + +.swpm-form-builder span.swpm-span ol li { + list-style: decimal; +} + +.swpm-form-builder span.swpm-right input, +.swpm-form-builder span.swpm-right input[type="text"], +.swpm-form-builder span.swpm-right select, +.swpm-form-builder span.swpm-left input, +.swpm-form-builder span.swpm-left input[type="text"], +.swpm-form-builder span.swpm-left select{ + width:100% !important; +} + +/* !Time Field */ +.swpm-form-builder span.swpm-time{ + float:left; + margin:0 0.3em 0 0; +} + +.rtl .swpm-form-builder span.swpm-time { + float: right; + margin: 0 0 0 0.3em; +} + +.swpm-form-builder li div label, +.swpm-form-builder li span label { + margin: 0; + font-size: 90%; +} + +/* !Fieldset */ +.swpm-form-builder fieldset{ + clear:both; + margin:15px 0; + padding: 0; + border:1px solid #D3D3D3; + border-radius:3px; + background-color:#eeeeee; +} + +/* !Legend */ +.swpm-form-builder .swpm-legend{ + margin:5px 14px; + padding:0 6px; + border-bottom:1px solid #CCCCCC; + color:#990000; + font-size:inherit; +} + +.swpm-form-builder .swpm-legend h3 { + margin: 0 !important; + padding: 0 !important; + font-size:20px; + line-height: 2.0em; +} + +/* !Description */ +.swpm-form-builder label, +label.swpm-desc{ + display:block; + margin:0; + padding: 0 0 3px 0; + color:#000; +} +label.swpm-desc{ + font-weight:bold; +} + +.swpm-form-builder.left-label .swpm-desc, +.swpm-form-builder.right-label .swpm-desc{ + float:left; + margin:0 15px 0 0; + width:20%; +} + +.swpm-form-builder.right-label .swpm-desc{ + padding-top:2px; + text-align:right; +} + +.swpm-form-builder li div { + margin: 0; + padding: 0; +} + +.swpm-form-builder.left-label li div, +.swpm-form-builder.right-label li div { + float: left; + width: 65%; +} + +.swpm-form-builder label.swpm-choice{ + margin:-16px 0 0 23px; + padding:0 0 5px; + width:88%; + font-size:100%; + line-height:150%; +} + +.rtl .swpm-form-builder label.swpm-choice { + margin: -16px 23px 0 0; +} + +.swpm-form-builder label .swpm-required-asterisk { + margin: 0; + padding: 0; + color: #BC1212; + vertical-align: baseline; + font-weight: bold; +} + +/* !Input, Textarea, and Select */ +input.swpm-text, +input[type="text"].swpm-text, +input[type="tel"].swpm-text, +input[type="email"].swpm-text, +input[type="url"].swpm-text, +textarea.swpm-textarea { + padding: 3px 0; + border: 1px solid #DDDDDD; + border-radius: 3px; + background: none repeat scroll 0 0 #FAFAFA; + + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border linear .2s, box-shadow linear .2s; + -moz-transition: border linear .2s, box-shadow linear .2s; + -o-transition: border linear .2s, box-shadow linear .2s; + transition: border linear .2s, box-shadow linear .2s; +} + +input.swpm-text:focus, +input[type="text"].swpm-text:focus, +input[type="tel"].swpm-text:focus, +input[type="email"].swpm-text:focus, +input[type="url"].swpm-text:focus, +textarea.swpm-textarea:focus { + outline: 0; + outline: thin dotted \9; + /* IE6-9 */ + border-color: rgba(82, 168, 236, 0.8); + + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); + -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); +} + +input.swpm-text.swpm-error:focus, +input[type="text"].swpm-text.swpm-error:focus, +input[type="tel"].swpm-text.swpm-error:focus, +input[type="email"].swpm-text.swpm-error:focus, +input[type="url"].swpm-text.swpm-error:focus, +textarea.swpm-textarea.swpm-error:focus { + border-color: rgba(238,83,83,0.8); + + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(238,83,83,.6); + -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(238,83,83,.6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(238,83,83,.6); +} + +input.swpm-text, +input[type="text"].swpm-text, +input[type="tel"].swpm-text, +input[type="email"].swpm-text, +input[type="url"].swpm-text, +textarea.swpm-textarea, +select.swpm-select { + margin: 0 0 5px 0; + height: auto; + color: #373737; + font-size:100%; + font-family:inherit; + line-height: normal; +} + +select.swpm-select{ + padding: 1px 0 0; +} + +input.swpm-small, +input[type="text"].swpm-small, +input[type="tel"].swpm-small, +input[type="email"].swpm-small, +input[type="url"].swpm-small, +select.swpm-small{ + width:25%; +} + +input.swpm-medium, +input[type="text"].swpm-medium, +input[type="tel"].swpm-medium, +input[type="email"].swpm-medium, +input[type="url"].swpm-medium, +select.swpm-medium{ + width:50%; +} + +input.swpm-large, +input[type="text"].swpm-large, +input[type="tel"].swpm-large, +input[type="email"].swpm-large, +input[type="url"].swpm-large, +select.swpm-large, +textarea.swpm-textarea{ + width:100%; +} + +input[type="file"].swpm-small, +input[type="file"].swpm-medium, +input[type="file"].swpm-large { + height: auto; + line-height: normal; +} + + +textarea.swpm-medium{ + height:5.5em; +} + +textarea.swpm-medium{ + height:10em; +} + +textarea.swpm-large{ + height:20em; +} + +/* !Submit Button */ +.swpm-submit, +input[type="submit"].swpm-submit { + font-size:1.1em; +} + +/* !Checkbox and Radio */ +input.swpm-checkbox, +input[type="checkbox"].swpm-checkbox, +input.swpm-radio, +input[type="radio"].swpm-radio { + display:block; + margin:4px 0 0; + width:13px; + height:13px; + font-size:1.1em; +} + +input.swpm-other, +input[type="text"].swpm-other { + margin: 0 0 8px 25px; +} + +/* !Field Layout */ +.swpm-form-builder li.swpm-two-column div span, +.swpm-form-builder li.swpm-three-column div span, +.swpm-form-builder li.swpm-auto-column div span{ + margin:0 5px 0 0; + width:48%; +} + +.swpm-form-builder li.swpm-three-column div span{ + width:30%; +} + +.swpm-form-builder li.swpm-auto-column div span{ + width:auto; +} + +.swpm-form-builder li.swpm-left-half, +.swpm-form-builder li.swpm-left-third, +.swpm-form-builder li.swpm-left-two-thirds{ + float:left; + clear:left; +} + +.swpm-form-builder li.swpm-right-half, +.swpm-form-builder li.swpm-right-third, +.swpm-form-builder li.swpm-right-two-thirds{ + float:right; + clear:none; +} + +.swpm-form-builder li.swpm-middle-third{ + float:left; + clear:none; + margin-left:2%; +} + +.swpm-form-builder li.swpm-left-half, +.swpm-form-builder li.swpm-right-half{ + width:47% !important; +} + +.swpm-form-builder li.swpm-left-third, +.swpm-form-builder li.swpm-middle-third, +.swpm-form-builder li.swpm-right-third{ + width:30% !important; +} + +.swpm-form-builder li.swpm-left-two-thirds, +.swpm-form-builder li.swpm-right-two-thirds{ + width:64% !important; +} + +li.swpm-left-half .swpm-small, +li.swpm-left-half .swpm-medium, +li.swpm-left-half .swpm-large, +li.swpm-right-half .swpm-small, +li.swpm-right-half .swpm-medium, +li.swpm-right-half .swpm-large, +li.swpm-left-third .swpm-small, +li.swpm-left-third .swpm-medium, +li.swpm-left-third .swpm-large, +li.swpm-middle-third .swpm-small, +li.swpm-middle-third .swpm-medium, +li.swpm-middle-third .swpm-large, +li.swpm-right-third .swpm-small, +li.swpm-right-third .swpm-medium, +li.swpm-right-third .swpm-large, +.swpm-form-builder li.swpm-left-two-thirds .swpm-small, +.swpm-form-builder li.swpm-left-two-thirds .swpm-medium, +.swpm-form-builder li.swpm-left-two-thirds .swpm-large, +.swpm-form-builder li.swpm-right-two-thirds .swpm-small, +.swpm-form-builder li.swpm-right-two-thirds .swpm-medium, +.swpm-form-builder li.swpm-right-two-thirds .swpm-large{ + width:100%; +} + +/* !Error */ +label.swpm-error{ + color:red; + font-weight:bold; + font-size:90%; +} + +input.swpm-error, +input.swpm-text.swpm-error, +input[type="text"].swpm-text.swpm-error, +input[type="tel"].swpm-text.swpm-error, +input[type="email"].swpm-text.swpm-error, +input[type="url"].swpm-text.swpm-error, +select.swpm-error, +textarea.swpm-error, +textarea.swpm-textarea.swpm-error,{ + border:1px solid red; +} + +/* !Success Mesage - Default */ +p#form_success, +.swpm-form-success { + color: green; + font-weight: bold; +} + +#ui-datepicker-div { + display: none; + font-size:12px; +} + +/* !Instructions */ +.swpm-item-instructions{ + border-radius:3px; + background-color:#e3e3e3; +} + +.swpm-item-instructions ul, +.swpm-item-instructions ul li { + padding-bottom: 0; + list-style: disc; +} + +.swpm-item-instructions ol, +.swpm-item-instructions ol li { + padding-bottom: 0; + list-style: decimal; +} + +/* !Sections */ +.swpm-section-div { + float:left; + margin:10px 0; + padding:10px; + width:97%; + border-radius:3px; + background-color:#D4D4D4; +} + +.swpm-form-builder .swpm-section-div h4 { + margin: 0 !important; + padding: 0 !important; + border-bottom:1px solid #BABABA; + font-size:16px; + line-height: inherit; +} + +/* !Clearing */ +.swpm-clear{ + display:block; + visibility:hidden; + clear:both; + overflow:hidden; + width:0; + height:0; +} + +/* !Conditional Field */ +.swpm-conditional-hide{ + display: none; +} diff --git a/css/swpm-form-builder.min.css b/css/swpm-form-builder.min.css new file mode 100644 index 0000000..5101276 --- /dev/null +++ b/css/swpm-form-builder.min.css @@ -0,0 +1 @@ +form.swpm-form-builder{position:relative;margin:20px 0;background:0;list-style:none;list-style-type:none;list-style-image:none;text-shadow:none;font-family:inherit}form.swpm-form-builder li{margin:0!important;width:auto!important;background:none!important;list-style:none!important;list-style-type:none!important;list-style-image:none!important;clear:both}form.swpm-form-builder li:before{content:none}form.swpm-form-builder ul:after,form.swpm-form-builder li:after,form.swpm-form-builder li div:after{clear:both;content:'.';display:block;height:0;visibility:hidden}.swpm-form-builder br{display:none}form.swpm-form-builder .swpm-item-instructions br{display:inline}.swpm-form-builder ul,.entry-content .swpm-form-builder ul,.comment-content .swpm-form-builder ul,.mu_register .swpm-form-builder ul,.swpm-form-builder ol,.entry-content .swpm-form-builder ol,.comment-content .swpm-form-builder ol,.mu_register .swpm-form-builder ol{margin:0 14px!important;padding:0!important;background:none!important;list-style:none!important;list-style-type:none!important;list-style-image:none!important;font-size:13px;line-height:inherit}.swpm-form-builder ul li{margin:0!important;background:none!important;list-style:none!important;list-style-type:none!important;list-style-image:none!important}.swpm-form-builder ul li:before{content:none}.swpm-form-builder li,.entry-content .swpm-form-builder li,.comment-content .swpm-form-builder li,.mu_register .swpm-form-builder li{clear:both;margin:0!important;padding:6px 1% 9px!important;width:64%;background:none!important;list-style:none!important;list-style-type:none!important;list-style-image:none!important}.swpm-form-builder li:before,.entry-content .swpm-form-builder li:before,.comment-content .swpm-form-builder li:before,.mu_register .swpm-form-builder li:before{content:none}.swpm-span,.swpm-form-builder li div span.swpm-span,.swpm-form-builder [class*="swpm-span"],span.swpm-full input,span.swpm-full input[type="text"].swpm-medium,span.swpm-full select{display:block;float:left;margin:0;width:100%}.swpm-form-builder span.swpm-left{float:left;width:48%}.swpm-form-builder span.swpm-right{float:right;width:48%}.swpm-form-builder span.swpm-span ul li{list-style:disc}.swpm-form-builder span.swpm-span ol li{list-style:decimal}.swpm-form-builder span.swpm-right input,.swpm-form-builder span.swpm-right input[type="text"],.swpm-form-builder span.swpm-right select,.swpm-form-builder span.swpm-left input,.swpm-form-builder span.swpm-left input[type="text"],.swpm-form-builder span.swpm-left select{width:100%!important}.swpm-form-builder span.swpm-time{float:left;margin:0 .3em 0 0}.rtl .swpm-form-builder span.swpm-time{float:right;margin:0 0 0 .3em}.swpm-form-builder li div label,.swpm-form-builder li span label{margin:0;font-size:90%}.swpm-form-builder fieldset{clear:both;margin:15px 0;padding:0;border:1px solid #d3d3d3;border-radius:3px;background-color:#eee}.swpm-form-builder .swpm-legend{margin:5px 14px;padding:0 6px;border-bottom:1px solid #ccc;color:#900;font-size:inherit}.swpm-form-builder .swpm-legend h3{margin:0!important;padding:0!important;font-size:20px;line-height:2.0em}.swpm-form-builder label,label.swpm-desc{display:block;margin:0;padding:0 0 3px 0;color:#000}label.swpm-desc{font-weight:bold}.swpm-form-builder.left-label .swpm-desc,.swpm-form-builder.right-label .swpm-desc{float:left;margin:0 15px 0 0;width:20%}.swpm-form-builder.right-label .swpm-desc{padding-top:2px;text-align:right}.swpm-form-builder li div{margin:0;padding:0}.swpm-form-builder.left-label li div,.swpm-form-builder.right-label li div{float:left;width:65%}.swpm-form-builder label.swpm-choice{margin:-16px 0 0 23px;padding:0 0 5px;width:88%;font-size:100%;line-height:150%}.rtl .swpm-form-builder label.swpm-choice{margin:-16px 23px 0 0}.swpm-form-builder label .swpm-required-asterisk{margin:0;padding:0;color:#bc1212;vertical-align:baseline;font-weight:bold}input.swpm-text,input[type="text"].swpm-text,input[type="tel"].swpm-text,input[type="email"].swpm-text,input[type="url"].swpm-text,textarea.swpm-textarea{padding:3px 0;border:1px solid #ddd;border-radius:3px;background:none repeat scroll 0 0 #fafafa;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border linear .2s,box-shadow linear .2s;-moz-transition:border linear .2s,box-shadow linear .2s;-o-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s}input.swpm-text:focus,input[type="text"].swpm-text:focus,input[type="tel"].swpm-text:focus,input[type="email"].swpm-text:focus,input[type="url"].swpm-text:focus,textarea.swpm-textarea:focus{outline:0;outline:thin dotted \9;border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.6)}input.swpm-text.swpm-error:focus,input[type="text"].swpm-text.swpm-error:focus,input[type="tel"].swpm-text.swpm-error:focus,input[type="email"].swpm-text.swpm-error:focus,input[type="url"].swpm-text.swpm-error:focus,textarea.swpm-textarea.swpm-error:focus{border-color:rgba(238,83,83,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(238,83,83,.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(238,83,83,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(238,83,83,.6)}input.swpm-text,input[type="text"].swpm-text,input[type="tel"].swpm-text,input[type="email"].swpm-text,input[type="url"].swpm-text,textarea.swpm-textarea,select.swpm-select{margin:0 0 5px 0;height:auto;color:#373737;font-size:100%;font-family:inherit;line-height:normal}select.swpm-select{padding:1px 0 0}input.swpm-small,input[type="text"].swpm-small,input[type="tel"].swpm-small,input[type="email"].swpm-small,input[type="url"].swpm-small,select.swpm-small{width:25%}input.swpm-medium,input[type="text"].swpm-medium,input[type="tel"].swpm-medium,input[type="email"].swpm-medium,input[type="url"].swpm-medium,select.swpm-medium{width:50%}input.swpm-large,input[type="text"].swpm-large,input[type="tel"].swpm-large,input[type="email"].swpm-large,input[type="url"].swpm-large,select.swpm-large,textarea.swpm-textarea{width:100%}input[type="file"].swpm-small,input[type="file"].swpm-medium,input[type="file"].swpm-large{height:auto;line-height:normal}textarea.swpm-medium{height:5.5em}textarea.swpm-medium{height:10em}textarea.swpm-large{height:20em}.swpm-submit,input[type="submit"].swpm-submit{font-size:1.1em}input.swpm-checkbox,input[type="checkbox"].swpm-checkbox,input.swpm-radio,input[type="radio"].swpm-radio{display:block;margin:4px 0 0;width:13px;height:13px;font-size:1.1em}input.swpm-other,input[type="text"].swpm-other{margin:0 0 8px 25px}.swpm-form-builder li.swpm-two-column div span,.swpm-form-builder li.swpm-three-column div span,.swpm-form-builder li.swpm-auto-column div span{margin:0 5px 0 0;width:48%}.swpm-form-builder li.swpm-three-column div span{width:30%}.swpm-form-builder li.swpm-auto-column div span{width:auto}.swpm-form-builder li.swpm-left-half,.swpm-form-builder li.swpm-left-third,.swpm-form-builder li.swpm-left-two-thirds{float:left;clear:left}.swpm-form-builder li.swpm-right-half,.swpm-form-builder li.swpm-right-third,.swpm-form-builder li.swpm-right-two-thirds{float:right;clear:none}.swpm-form-builder li.swpm-middle-third{float:left;clear:none;margin-left:2%}.swpm-form-builder li.swpm-left-half,.swpm-form-builder li.swpm-right-half{width:47%!important}.swpm-form-builder li.swpm-left-third,.swpm-form-builder li.swpm-middle-third,.swpm-form-builder li.swpm-right-third{width:30%!important}.swpm-form-builder li.swpm-left-two-thirds,.swpm-form-builder li.swpm-right-two-thirds{width:64%!important}li.swpm-left-half .swpm-small,li.swpm-left-half .swpm-medium,li.swpm-left-half .swpm-large,li.swpm-right-half .swpm-small,li.swpm-right-half .swpm-medium,li.swpm-right-half .swpm-large,li.swpm-left-third .swpm-small,li.swpm-left-third .swpm-medium,li.swpm-left-third .swpm-large,li.swpm-middle-third .swpm-small,li.swpm-middle-third .swpm-medium,li.swpm-middle-third .swpm-large,li.swpm-right-third .swpm-small,li.swpm-right-third .swpm-medium,li.swpm-right-third .swpm-large,.swpm-form-builder li.swpm-left-two-thirds .swpm-small,.swpm-form-builder li.swpm-left-two-thirds .swpm-medium,.swpm-form-builder li.swpm-left-two-thirds .swpm-large,.swpm-form-builder li.swpm-right-two-thirds .swpm-small,.swpm-form-builder li.swpm-right-two-thirds .swpm-medium,.swpm-form-builder li.swpm-right-two-thirds .swpm-large{width:100%}label.swpm-error{color:red;font-weight:bold;font-size:90%}input.swpm-error,input.swpm-text.swpm-error,input[type="text"].swpm-text.swpm-error,input[type="tel"].swpm-text.swpm-error,input[type="email"].swpm-text.swpm-error,input[type="url"].swpm-text.swpm-error,select.swpm-error,textarea.swpm-error,textarea.swpm-textarea.swpm-error,{border:1px solid red}p#form_success,.swpm-form-success{color:green;font-weight:bold}#ui-datepicker-div{display:none;font-size:12px}.swpm-item-instructions{border-radius:3px;background-color:#e3e3e3}.swpm-item-instructions ul,.swpm-item-instructions ul li{padding-bottom:0;list-style:disc}.swpm-item-instructions ol,.swpm-item-instructions ol li{padding-bottom:0;list-style:decimal}.swpm-section-div{float:left;margin:10px 0;padding:10px;width:97%;border-radius:3px;background-color:#d4d4d4}.swpm-form-builder .swpm-section-div h4{margin:0!important;padding:0!important;border-bottom:1px solid #bababa;font-size:16px;line-height:inherit}.swpm-clear{display:block;visibility:hidden;clear:both;overflow:hidden;width:0;height:0}.swpm-conditional-hide{display:none} \ No newline at end of file diff --git a/images/arrows-2x.png b/images/arrows-2x.png new file mode 100644 index 0000000..0b0c53d Binary files /dev/null and b/images/arrows-2x.png differ diff --git a/images/arrows-dark-2x.png b/images/arrows-dark-2x.png new file mode 100644 index 0000000..86be981 Binary files /dev/null and b/images/arrows-dark-2x.png differ diff --git a/images/arrows-dark-vs-2x.png b/images/arrows-dark-vs-2x.png new file mode 100644 index 0000000..c509a4e Binary files /dev/null and b/images/arrows-dark-vs-2x.png differ diff --git a/images/arrows-dark-vs.png b/images/arrows-dark-vs.png new file mode 100644 index 0000000..3c48995 Binary files /dev/null and b/images/arrows-dark-vs.png differ diff --git a/images/arrows-dark.png b/images/arrows-dark.png new file mode 100644 index 0000000..8ab7346 Binary files /dev/null and b/images/arrows-dark.png differ diff --git a/images/arrows-vs-2x.png b/images/arrows-vs-2x.png new file mode 100644 index 0000000..be55877 Binary files /dev/null and b/images/arrows-vs-2x.png differ diff --git a/images/arrows-vs.png b/images/arrows-vs.png new file mode 100644 index 0000000..4f1421d Binary files /dev/null and b/images/arrows-vs.png differ diff --git a/images/arrows.png b/images/arrows.png new file mode 100644 index 0000000..9e4a96c Binary files /dev/null and b/images/arrows.png differ diff --git a/images/swpm-form-items-2x.png b/images/swpm-form-items-2x.png new file mode 100644 index 0000000..9c17213 Binary files /dev/null and b/images/swpm-form-items-2x.png differ diff --git a/images/swpm-form-items.png b/images/swpm-form-items.png new file mode 100644 index 0000000..98662dd Binary files /dev/null and b/images/swpm-form-items.png differ diff --git a/images/swpm-interface-icons-2x.png b/images/swpm-interface-icons-2x.png new file mode 100644 index 0000000..9e4c100 Binary files /dev/null and b/images/swpm-interface-icons-2x.png differ diff --git a/images/swpm-interface-icons.png b/images/swpm-interface-icons.png new file mode 100644 index 0000000..3ac34ea Binary files /dev/null and b/images/swpm-interface-icons.png differ diff --git a/images/swpm_icon.png b/images/swpm_icon.png new file mode 100644 index 0000000..52dc8a0 Binary files /dev/null and b/images/swpm_icon.png differ diff --git a/includes/admin-field-options.php b/includes/admin-field-options.php new file mode 100644 index 0000000..94fd418 --- /dev/null +++ b/includes/admin-field-options.php @@ -0,0 +1,448 @@ +get_results( $wpdb->prepare( "SELECT * FROM $this->field_table_name WHERE form_id = %d $field_where ORDER BY field_sequence ASC", $form_nav_selected_id ) ); + +$depth = 1; +$parent = $last = 0; +ob_start(); + +// Loop through each field and display +foreach ( $fields as &$field ) : + // If we are at the root level + if ( !$field->field_parent && $depth > 1 ) { + // If we've been down a level, close out the list + while ( $depth > 1 ) { + echo ''; + $depth--; + } + + // Close out the root item + echo ''; + } + // first item of