예제 #1
0
    ItemForm::region_select(osc_get_regions(), osc_user());
} else {
    ItemForm::region_text(osc_user());
}
?>
              </div>
            </div>
            <div class="form-group">
              <label class="control-label" for="city">
                <?php 
_e('City', OSCLASSWIZARDS_THEME_FOLDER);
?>
              </label>
              <div class="controls">
                <?php 
if (osclasswizards_locations_input_as() == 'select') {
    ItemForm::city_select(osc_get_cities(), osc_user());
} else {
    ItemForm::city_text(osc_user());
}
?>
              </div>
            </div>
            <div class="form-group">
              <label class="control-label" for="cityArea">
                <?php 
_e('City Area', OSCLASSWIZARDS_THEME_FOLDER);
?>
              </label>
              <div class="controls">
                <?php 
예제 #2
0
function osclasswizards_item_post_form_validate()
{
    ?>
<script type="text/javascript">
	$(document).ready(function(){
		$('#regionId, #cityId').removeAttr('disabled');
	});

	//form validate
	$('form[name=item]').validate({
		rules: {
			catId: {
				required: true,
				digits: true
			},
			'title[<?php 
    echo osc_current_user_locale();
    ?>
]': {
				required:true,
				minlength:<?php 
    echo osclasswizards_title_minimum_length();
    ?>
			},
			'description[<?php 
    echo osc_current_user_locale();
    ?>
]': {
				minlength:<?php 
    echo osclasswizards_description_minimum_length();
    ?>
			},
			price: {
				maxlength: 50
			},
			currency: "required",
			"photos[]": {
				accept: "png,gif,jpg,jpeg"
			},
			contactName: {
				required: true,
				minlength: 3,
				maxlength: 35
			},
			contactEmail: {
				required: true,
				email: true
			},
			countryId:{
				required: <?php 
    echo osclasswizards_locations_required();
    ?>
			},
			region: {
				required: <?php 
    echo osclasswizards_locations_required();
    ?>
,
				minlength: 3,
				maxlength: 100
			},
			city: {
				required: <?php 
    echo osclasswizards_locations_required();
    ?>
,
				minlength: 3,
				maxlength: 1000
			}
			<?php 
    if (osclasswizards_locations_input_as() == 'select') {
        ?>
			,
			regionId: {
				required: <?php 
        echo osclasswizards_locations_required();
        ?>
			},
			cityId: {
				required: <?php 
        echo osclasswizards_locations_required();
        ?>
			}
			<?php 
    }
    ?>
			
		},
		messages: {
			catId: {
			required: "<?php 
    echo osc_esc_js(__("Choose one category", OSCLASSWIZARDS_THEME_FOLDER));
    ?>
."
			},
			'title[<?php 
    echo osc_current_user_locale();
    ?>
]': {
				required: "<?php 
    echo osc_esc_js(__("Title: this field is required", OSCLASSWIZARDS_THEME_FOLDER));
    ?>
.",
				minlength: "<?php 
    echo osc_esc_js(__("Title too short", OSCLASSWIZARDS_THEME_FOLDER));
    ?>
."
			},
			'description[<?php 
    echo osc_current_user_locale();
    ?>
]': {
				minlength: "<?php 
    echo osc_esc_js(__("Description too short", OSCLASSWIZARDS_THEME_FOLDER));
    ?>
."
			},
			price: {
				maxlength: "<?php 
    echo osc_esc_js(__("Price: no more than 50 characters", OSCLASSWIZARDS_THEME_FOLDER));
    ?>
."
			},
			currency: "<?php 
    echo osc_esc_js(__("Currency: make your selection", OSCLASSWIZARDS_THEME_FOLDER));
    ?>
.",
			"photos[]": {
				accept: "<?php 
    echo osc_esc_js(__("Photo: must be png,gif,jpg,jpeg", OSCLASSWIZARDS_THEME_FOLDER));
    ?>
."
			},
			contactName: {
				required: "<?php 
    echo osc_esc_js(__("Name: this field is required", OSCLASSWIZARDS_THEME_FOLDER));
    ?>
.",
				minlength: "<?php 
    echo osc_esc_js(__("Name: enter at least 3 characters", OSCLASSWIZARDS_THEME_FOLDER));
    ?>
.",
				maxlength: "<?php 
    echo osc_esc_js(__("Name: no more than 35 characters", OSCLASSWIZARDS_THEME_FOLDER));
    ?>
."
			},
			contactEmail: {
				required: "<?php 
    echo osc_esc_js(__("Email: this field is required", OSCLASSWIZARDS_THEME_FOLDER));
    ?>
.",
				email: "<?php 
    echo osc_esc_js(__("Invalid email address", OSCLASSWIZARDS_THEME_FOLDER));
    ?>
."
			},
			countryId: {
				required: "<?php 
    echo osc_esc_js(__("Please select a stream", OSCLASSWIZARDS_THEME_FOLDER));
    ?>
."
			},
			region: {
				required: "<?php 
    echo osc_esc_js(__("Region: this field is required", OSCLASSWIZARDS_THEME_FOLDER));
    ?>
.",
				minlength: "<?php 
    echo osc_esc_js(__("Region: enter at least 3 characters", OSCLASSWIZARDS_THEME_FOLDER));
    ?>
.",
				maxlength: "<?php 
    echo osc_esc_js(__("Region: no more than 100 characters", OSCLASSWIZARDS_THEME_FOLDER));
    ?>
."
			},
			city: {
				required: "<?php 
    echo osc_esc_js(__("City: this field is required", OSCLASSWIZARDS_THEME_FOLDER));
    ?>
.",
				minlength: "<?php 
    echo osc_esc_js(__("City: enter at least 3 characters", OSCLASSWIZARDS_THEME_FOLDER));
    ?>
.",
				maxlength: "<?php 
    echo osc_esc_js(__("City: no more than 100 characters", OSCLASSWIZARDS_THEME_FOLDER));
    ?>
."
			}
			<?php 
    if (osclasswizards_locations_input_as() == 'select') {
        ?>
			,
			regionId: {
				required: "<?php 
        echo osc_esc_js(__("Region: this field is required", OSCLASSWIZARDS_THEME_FOLDER));
        ?>
."
			},
			cityId: {
				required: "<?php 
        echo osc_esc_js(__("City: this field is required", OSCLASSWIZARDS_THEME_FOLDER));
        ?>
."
			}
			<?php 
    }
    ?>
		},
		errorLabelContainer: "#error_list",
		wrapper: "li",
		invalidHandler: function(form, validator) {
			$('html,body').animate({ scrollTop: $('h1').offset().top }, { duration: 250, easing: 'swing'});
		},
		submitHandler: function(form){
			$('button[type=submit], input[type=submit]').attr('disabled', 'disabled');
			setTimeout("$('button[type=submit], input[type=submit]').removeAttr('disabled')", 5000);
			form.submit();
		}
	});
</script>
<?php 
}
예제 #3
0
?>
;
    osclasswizards.fancybox_prev = '<?php 
echo osc_esc_js(__('Previous image', OSCLASSWIZARDS_THEME_FOLDER));
?>
';
    osclasswizards.fancybox_next = '<?php 
echo osc_esc_js(__('Next image', OSCLASSWIZARDS_THEME_FOLDER));
?>
';
    osclasswizards.fancybox_closeBtn = '<?php 
echo osc_esc_js(__('Close', OSCLASSWIZARDS_THEME_FOLDER));
?>
';
    osclasswizards.locations_input_as = '<?php 
echo osc_esc_js(osclasswizards_locations_input_as());
?>
';
</script>
<!--Ie Js-->
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if lt IE 9]>
	<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

<link href="<?php 
echo osc_current_web_theme_url('css/bootstrap.min.css');
?>
" rel="stylesheet" type="text/css" />