protected function _fieldset() { $fieldset = ViewForm\Fieldset::forge(); $fieldset->add_text('full_name', 'Name')->add_rule('required')->add_rule('max_length', 255); $fieldset->add_text('location', 'Location')->add_rule('max_length', 255); $fieldset->add_textarea('description', 'description')->add_rule('max_length', 9999); $fieldset->add_text('website', 'Website')->add_rule('valid_url'); $fieldset->add_text('camera', 'Camera')->add_rule('max_length', 255); return $fieldset; }
protected function _fieldset() { $zentohan = function ($fieldset) { return mb_convert_kana($fieldset, 'a'); }; $fieldset = ViewForm\Fieldset::forge(); $fieldset->add_text('serial_dive_no', __('serial_dive_no'), array('value' => Model_Post::get_last_serial_dive_no($this->current_user->id)))->add_rule($zentohan)->add_rule('valid_string', 'numeric')->add_rule('max_length', 255); $fieldset->add_text('date', __('date'))->add_rule('required')->add_rule($zentohan)->add_rule('max_length', 10); $fieldset->add_text('location', __('location'))->add_rule($zentohan)->add_rule('max_length', 255); $fieldset->add_text('point', __('point'))->add_rule($zentohan)->add_rule('max_length', 255); $fieldset->add_select('point_type', __('point_type'), Model_Lookup::items('post_point_type'))->add_rule('max_length', 8); $fieldset->add_text('diving_shop', __('diving_shop'))->add_rule($zentohan)->add_rule('max_length', 255); $fieldset->add_text('entry', __('entry'))->add_rule($zentohan)->add_rule('match_pattern', '/^(0[0-9]{1}|1{1}[0-9]{1}|2{1}[0-3]{1}):(0[0-9]{1}|[1-5]{1}[0-9]{1})$/')->add_rule('max_length', 5); $fieldset->add_text('pressure_start', __('entry'))->add_rule($zentohan)->add_rule('valid_string', 'numeric')->add_rule('max_length', 8); $fieldset->add_text('exit', __('exit'))->add_rule($zentohan)->add_rule('match_pattern', '/^(0[0-9]{1}|1{1}[0-9]{1}|2{1}[0-3]{1}):(0[0-9]{1}|[1-5]{1}[0-9]{1})$/')->add_rule('max_length', 5); $fieldset->add_text('pressure_end', __('exit'))->add_rule($zentohan)->add_rule('valid_string', 'numeric')->add_rule('max_length', 8); $fieldset->add_text('depth_of_water_ave', __('depth_of_water_ave'))->add_rule($zentohan)->add_rule('valid_string', 'float')->add_rule('max_length', 8); $fieldset->add_text('depth_of_water_max', __('depth_of_water_max'))->add_rule($zentohan)->add_rule('valid_string', 'float')->add_rule('max_length', 8); $fieldset->add_text('water_temp_bottom', __('water_temp_bottom'))->add_rule($zentohan)->add_rule('valid_string', 'float')->add_rule('max_length', 8); $fieldset->add_text('air_temp', __('air_temp'))->add_rule($zentohan)->add_rule('valid_string', 'float')->add_rule('max_length', 8); $fieldset->add_select('weather', __('weather'), Model_Lookup::items('post_weather'))->add_rule('max_length', 8); $fieldset->add_select('suit', __('suit'), Model_Lookup::items('post_suit'))->add_rule('max_length', 8); $fieldset->add_text('suit_thickness', __('suit'))->add_rule($zentohan)->add_rule('valid_string', 'numeric')->add_rule('max_length', 8); $fieldset->add_text('weight', __('weight'))->add_rule($zentohan)->add_rule('valid_string', 'float')->add_rule('max_length', 8); $fieldset->add_select('tank', __('tank'), Model_Lookup::items('post_tank'))->add_rule('max_length', 8); $fieldset->add_text('tank_cap', __('tank_cap'))->add_rule($zentohan)->add_rule('valid_string', 'numeric')->add_rule('max_length', 8); $fieldset->add_text('visibility', __('visibility'))->add_rule($zentohan)->add_rule('max_length', 255); /* $fieldset->add_text('buddy', 'Buddy') ->add_rule('max_length', 255); $fieldset->add_text('instructor_and_guide', 'Instructor And Guide') ->add_rule('max_length', 255); */ $fieldset->add_textarea('report', __('report'))->add_rule($zentohan)->add_rule('max_length', 9999); $fieldset->add_textarea('comment', __('comment'))->add_rule($zentohan)->add_rule('strip_tags')->add_rule('max_length', 9999); $fieldset->add_select('status', __('status'), Model_Lookup::items('post_status', false))->add_rule('max_length', 8); return $fieldset; }