public function __construct()
 {
     $fields = [form::create('field_select', 'source')->set_attr('default', '')->set_attr('options', ['OS6', 'OS8', 'OSGB36', 'WGS84']), form::create('field_string', 'OSGB36_lat')->set_attr('required', false), form::create('field_string', 'OSGB36_lng')->set_attr('required', false), form::create('field_string', 'WGS84_lat')->set_attr('required', false), form::create('field_string', 'WGS84_lng')->set_attr('required', false), form::create('field_string', 'OS6'), form::create('field_string', 'OS8')->set_attr('required', false)];
     parent::__construct($fields);
     $this->id = 'coordinate_conversion_form';
     $this->attributes['data-ajax-change'] = '\\module\\converter\\form\\coordinate_conversion_form:do_form_submit';
 }
Exemple #2
0
 public function __construct(array $sort_options, $calling_class)
 {
     $this->calling_class = $calling_class;
     $final_fields[] = form::create('field_select', 'sort')->set_attr('label', 'Sort By')->set_attr('options', $sort_options);
     $final_fields[] = form::create('field_string', 'identifier')->set_attr('hidden', true);
     parent::__construct($final_fields);
 }
Exemple #3
0
 public function __construct($calling_class)
 {
     $this->calling_class = $calling_class;
     $final_fields[] = form::create('field_string', 'keywords')->set_attr('label', 'Search');
     $final_fields[] = form::create('field_string', 'identifier')->set_attr('hidden', true);
     parent::__construct($final_fields);
 }
 public function __construct($mid = 0)
 {
     if (ajax && !$mid) {
         $mid = $_REQUEST['_mid'];
     }
     $class_name = table::get_class_from_mid($mid);
     /** @var \classes\table $class */
     $class = new $class_name();
     $super_fields = $class->get_fields();
     $fields = [form::create('field_boolean', 'deleted')->set_attr('label', 'Show deleted?')->set_attr('options', [25 => 25, 50 => 50, 75 => 75, 100 => 100, 0 => 'All'])->set_attr('required', false), form::create('field_select', 'npp')->set_attr('label', 'Number per page')->set_attr('options', [25 => 25, 50 => 50, 75 => 75, 100 => 100, 0 => 'All'])->set_attr('required', false), form::create('field_int', '_mid')->set_attr('hidden', true)];
     /** @var \form\field $field */
     foreach ($super_fields as $field) {
         if ($field->filter) {
             $field->required = false;
             $fields[] = $field;
         }
     }
     parent::__construct($fields);
     /** @var \form\field $field */
     foreach ($fields as $field) {
         if (session::is_set('cms', 'filter', $mid, $field->field_name)) {
             $this->{$field->field_name} = session::get('cms', 'filter', $mid, $field->field_name);
         }
     }
     $this->id = 'filter_form';
     $this->submit = 'Filter';
     $this->_mid = $mid;
 }
 public function __construct()
 {
     $fields = [form::create('field_string', 'username')->set_attr('label', 'Username'), form::create('field_password', 'password')->set_attr('label', 'Password')];
     parent::__construct($fields);
     $this->pre_fields_text = node::create('h2.form-signin-heading.text-center', [], node::create('small', [], 'Admin Login<br/>') . ini::get('site', 'title_tag'))->get();
     $this->submit = 'Login';
     $this->id = 'cms_login';
 }
Exemple #6
0
 public function __construct()
 {
     parent::__construct([form::create('field_link', 'pid')->set_attr('label', 'Pilot:')->set_attr('required', true)->set_attr('default', 'Choose A Pilot')->set_attr('post_text', node::create('a', ['data-ajax-click' => '\\form\\add_pilot_form:get_form'], 'Not in the list? Click here to add a new pilot'))->set_attr('link_module', '\\object\\pilot')->set_attr('link_field', 'name')->set_attr('options', ['order' => 'name']), form::create('field_link', 'gid')->set_attr('label', 'Glider:')->set_attr('required', true)->set_attr('post_text', node::create('a', ['data-ajax-click' => '\\form\\add_glider_form:get_form'], 'Not in the list? Click here to add a new glider'))->set_attr('link_module', '\\object\\glider')->set_attr('link_field', ['manufacturer.title', 'name'])->set_attr('options', ['join' => ['manufacturer' => 'manufacturer.mid = glider.mid'], 'order' => 'manufacturer.title, glider.name']), form::create('field_link', 'cid')->set_attr('label', 'Club:')->set_attr('required', true)->set_attr('link_module', '\\object\\club')->set_attr('link_field', 'title')->set_attr('options', ['order' => 'title']), form::create('field_string', 'coords')->set_attr('label', 'Flight coordinates')->set_attr('required_parent', 'defined')->set_attr('required', true)->set_attr('pre_text', node::create('p', [], 'Enter the coordinates below in \'XX000000;XX000000\' format, with no ending \';\''))->add_wrapper_class('cf')->set_attr('post_text', node::create('p.defined_info')), form::create('field_date', 'date')->set_attr('label', 'Date:')->set_attr('required', true), form::create('field_link', 'lid')->set_attr('label', 'Launch:')->set_attr('required', true)->set_attr('link_module', '\\object\\launch_type')->set_attr('link_field', 'title'), form::create('field_boolean', 'ridge')->set_attr('label', 'The flight was predominantly in ridge lift, so according to the rules will not qualify for multipliers')->add_wrapper_class('long_text'), form::create('field_textarea', 'info')->set_attr('label', 'Please write any extra information you wish to be made public here')->set_attr('required', false)->add_wrapper_class('long_text'), form::create('field_textarea', 'admin_info')->set_attr('label', 'Please write any extra information you wish to be seen by the admin team here')->set_attr('required', false)->add_wrapper_class('long_text'), form::create('field_boolean', 'delay')->set_attr('label', 'Publication of the flight should be delayed until it has been inspected by the admin team.'), form::create('field_boolean', 'personal')->set_attr('label', 'Show the flight in your personal log only / the flight was flown outside of the UK'), form::create('field_boolean', 'agree')->set_attr('label', 'The NXCL is free to publish the flight to the public and to be passed on to skywings for publication. The flight has not broken any airspace laws')->set_attr('required', true)]);
     $this->attributes['class'][] = 'form-compact';
     $this->h2 = 'Coordinate Flight';
     $this->id = 'coordinate_form';
     $this->name = 'coordinate';
     $this->title = 'Add Flight Form';
 }
Exemple #7
0
 public function __construct()
 {
     $fields = [form::create('field_file', 'kml')->set_attr('label', '')->set_attr('required', true)->set_attr('external', true), form::create('field_string', 'coords')->set_attr('label', 'Defined flight coordinates')->set_attr('required_parent', 'defined')->set_attr('wrapper_class', ['callout', 'callout-tertiary', 'cf'])->set_attr('required', false)->set_attr('pre_text', node::create('p', [], 'To submit a defined flight enter the coordinates below in \'XX000000;XX000000\' format, with no ending \';\'') . node::create('p i', [], "If you have declared your flight in your IGC file, they you don't need to do so again here."))->set_attr('post_text', node::create('p.defined_info'))];
     parent::__construct($fields);
     $this->submit = 'Calculate';
     $this->pre_text = node::create('p', [], 'Upload a flight here to calculate scores, whilst the flight is being processed please feel free to complete tbe rest of the form below');
     $this->post_text = node::create('div#kml_calc div#console a.calc', [], 'Calculate!') . node::create('div.callout.callout-secondary', [], [node::create('p', [], 'Please note that depending on the flight this may take anywhere between 10 seconds and 5 mins. You can still use the other functions of the league while this calculates'), node::create('p', [], 'On submit the flight will be read by the system to make sure it conforms for the rules. It will then be displayed on the map.')]);
     $this->has_submit = false;
     $this->id = 'igc_upload_form';
     $this->h2 = 'Upload Form';
     $this->submittable = false;
 }
Exemple #8
0
 public function __construct()
 {
     $fields = [form::create('field_select', 'layout')->set_attr('label', 'Table Type:')->set_attr('default', '')->set_attr('link', 'table_type')->set_attr('help', '')->set_attr('options', [0 => 'Standard', 1 => 'Club', 2 => 'Pilot', 3 => 'Top Tens', 4 => 'Plain List', 5 => 'Records']), form::create('field_link', 'pilot')->set_attr('label', 'Pilot:')->set_attr('link_module', '\\object\\pilot')->set_attr('link_field', 'name')->set_attr('options', ['order' => 'name ASC'])->set_attr('help', 'Select a pilot to display flight for|Only works if Pilot is selected in Table Type.')->add_class('pilot_select')->set_attr('disabled', true), form::create('field_string', 'year')->set_attr('label', 'Season:')->set_attr('help', "Choose a specific year 'xxxx' or a range 'xxxx-yyyy' or multiple|'xxxx,yyyy'. These can be combined so ie. a range plus some other|'xxxx-yyyy,zzzz' (note don't add the '').")->set_attr('value', '1991-' . date('Y')), form::create('field_select', 'gender')->set_attr('label', 'Gender:')->set_attr('options', [0 => 'Both', 'M' => 'Male', 'F' => 'Female'])->set_attr('help', 'Shows only flights of one gender.'), form::create('field_select', 'defined')->set_attr('label', 'Declared:')->set_attr('options', [-1 => 'Don\'t Filter', 1 => 'Yes', 0 => 'No'])->set_attr('help', 'Shows only declared or not.'), form::create('field_select', 'ridge')->set_attr('label', 'Ridge:')->set_attr('options', [-1 => 'Don\'t Filter', 1 => 'Yes', 0 => 'No'])->set_attr('help', 'Shows only flights which were under ridge lift or not |not all ridge lift flights have been marked as so...'), form::create('field_select', 'winter')->set_attr('label', 'Winter:')->set_attr('options', [-1 => 'Don\'t Filter', 1 => 'Winter Only', 0 => 'Summer Only'])->set_attr('help', 'Show only flights in the winter (start of november-end of February) | or the summer season'), form::create('field_select', 'dimensions')->set_attr('label', 'KML Submitted:')->set_attr('options', [0 => 'Don\'t Filter', 3 => 'Yes (3D)', 2 => 'Yes (2D)', 1 => 'Yes (Both)', 4 => 'No'])->set_attr('help', 'Choose what type of track confirmation you want.'), form::create('field_select', 'glider_class')->set_attr('label', 'Glider Class:')->set_attr('options', [0 => 'Don\'t Filter', 1 => 'Class 1', 5 => 'Class 5'])->set_attr('help', 'Show Class 1 (flexwing) or class 5 (rigid)'), form::create('field_select', 'Flights')->set_attr('label', '# of Flights')->set_attr('default', '')->set_attr('options', [6 => '6 Flights', 5 => '5 Flights', 4 => '4 Flights'])->set_attr('help', 'Maximum number fo flights which count. Before 2001 only 5 counted. now it is 6'), form::create('field_string', 'minimum_score')->set_attr('label', 'Minimum Distance')->set_attr('value', 10)->set_attr('help', 'Exclude flights under this distance (pre-multipliers)'), form::create('field_date', 'Date')->set_attr('label', 'Date')->set_attr('help', 'A date in which to show flights flown.')->set_attr('value', '')->set_attr('required', false), form::create('field_boolean', 'no_multipliers')->set_attr('label', 'No Multipliers')->set_attr('help', 'Do not add multipliers for qualifying flights, useful for looking up records.'), form::create('field_boolean', 'show_top_4')->set_attr('label', 'Top Flights')->set_attr('help', 'Show a sub table with the highest scoring flights in each category.'), form::create('field_boolean', 'official')->set_attr('label', 'Official View')->set_attr('help', 'for the maximum number of flights to count at least one defined and|at least one must be undefined. In club mode only the top 4 pilots|will count as well'), form::create('field_boolean', 'split_classes')->set_attr('label', 'Split Classes')->set_attr('help', 'Number class 5 and class 1 separately.'), form::create('field_string', 'flown_through')->set_attr('label', 'Flown through (eg. SU,TQ)')->set_attr('value', '')->set_attr('help', 'OS grids flights must fly through')->set_attr('required', false), form::create('field_boolean', 'handicap')->set_attr('label', 'Enable Handicapping')->set_attr('help', 'Handicap flights by the glider type, we need to build a better database of glider for this to be more useful,|as of now we only know what glider are KPL and Rigid |   Handicaps stack, so setting KPL to 0.5 and Rigid to 0.5 will actually score rigids as 0.25 as all rigids are KPL (I guess)'), form::create('field_string', 'handicap_kingpost')->set_attr('label', '-&gt; Kingpost')->set_attr('value', 1)->set_attr('help', 'Handicap to set KPL glider'), form::create('field_string', 'handicap_rigid')->set_attr('label', '-&gt; Class 5')->set_attr('value', 1)->set_attr('help', 'Handicap to set Rigid glider'), form::create('field_checkboxes', 'launches', [launch_type::WINCH => 'Winch', launch_type::FOOT => 'Foot', launch_type::AERO => 'Aerotow'])->set_attr('label', 'Launch Type')->set_attr('help', 'Include certain launch methods')->set_attr('default', '')->set_attr('value', ['w', 'f', 'a']), form::create('field_checkboxes', 'types', [flight_type::OD_ID => 'Open Distance', flight_type::GO_ID => 'Goal', flight_type::OR_ID => 'Out and Return', flight_type::TR_ID => 'Triangle', flight_type::FT_ID => 'Flat Triangle'])->set_attr('label', 'Flight Type')->set_attr('help', 'Include flight types')->set_attr('default', '')->set_attr('value', ['od', 'or', 'tr', 'go', 'ft'])];
     parent::__construct($fields);
     $this->name = 'advTables';
     $this->title = 'Pre Calculation Checks';
     $this->description = '';
     $this->wrapper_class[] = 'advanced_tables_wrapper';
     $this->id = 'advanced_tables';
     $this->submit = 'Generate';
     //$this->h2 = 'Advanced Options';
 }
Exemple #9
0
 public function __construct(field_collection $fields, collection $source_data)
 {
     $final_fields = [];
     $this->source_data = $source_data;
     $fields->iterate(function (filter $field) use(&$final_fields, $source_data) {
         $values = $source_data->filter_unique($field);
         $new_field = form::create('field_checkboxes', $field->inner_field()->field_name, $values);
         $new_field->original_field = $field->inner_field();
         $new_field->label = $field->title;
         $final_fields[] = $new_field;
     });
     $final_fields[] = form::create('field_string', 'identifier')->set_attr('hidden', true);
     parent::__construct($final_fields);
 }
 public function __construct()
 {
     $years = ['all_time' => 'All Time'];
     foreach (range(date('Y'), 1991) as $year) {
         $years[$year] = $year;
     }
     $fields = [form::create('field_select', 'type')->set_attr('options', [0 => 'Main', 14 => 'Class1', 13 => 'Class5', 1 => 'Foot', 2 => 'Aero', 3 => 'Winch', 5 => 'Defined', 4 => 'Winter', 6 => 'Female', 8 => 'Club', 7 => 'Club (Official)', 9 => 'Top Tens', 15 => 'Top Tens (1x)', 10 => 'Pilot', 12 => 'Hangies', 16 => 'Records', 17 => 'Dales'])->set_attr('label', 'League Type'), form::create('field_select', 'year')->set_attr('options', $years)->set_attr('label', 'Year')->set_attr('value', date('Y'))->set_attr('required', true), form::create('field_link', 'pilot')->set_attr('label', 'Pilot:')->set_attr('link_module', '\\object\\pilot')->set_attr('link_field', 'name')->set_attr('options', ['order' => 'name ASC'])->set_attr('help', 'Select a pilot to display flight for|Only works if Pilot is selected in Table Type.')->set_attr('required', true)->set_attr('disabled', true), form::create('field_boolean', 'no_min')->set_attr('label', 'No Minimum Distance'), form::create('field_boolean', 'split_classes')->set_attr('label', 'Split Class 1 & 5'), form::create('field_boolean', 'glider_mode')->set_attr('label', 'Score gliders not pilots')];
     /** @var \form\field $field */
     foreach ($fields as $field) {
         $field->set_attr('required', false);
     }
     parent::__construct($fields);
     $this->id = 'basic_tables';
     $this->wrapper_class[] = 'basic_tables_wrapper';
     $this->submit = 'Generate';
     $this->get_field_from_name('year')->value = date('Y');
     $this->shroud = '';
     //$this->h2 = 'Options';
 }
 public function __construct()
 {
     $fields = [form::create('field_string', 'site_name')->set_attr('label', 'Site Name')->set_attr('fieldset', 'Database Details'), form::create('field_string', 'username')->set_attr('label', 'Database'), form::create('field_password', 'password')->set_attr('label', 'Password'), form::create('field_checkboxes', 'modules', $this->get_modules())->set_attr('label', 'Modules')->set_attr('required', false)->set_attr('fieldset', 'Modules')];
     $i = 0;
     do {
         $fields['user_' . $i] = form::create('field_string', 'user_' . $i)->set_attr('label', 'User ' . ($i + 1))->set_attr('fieldset', 'User ' . ($i + 1) . ' Details')->set_attr('required', false);
         $fields['password_' . $i] = form::create('field_password', 'password_' . $i)->set_attr('label', 'Password ' . ($i + 1))->set_attr('required', false);
         $fields['user_level_' . $i] = form::create('field_select', 'user_level' . ($i + 1))->set_attr('options', [1 => 'User', 2 => 'Webmaster', 3 => 'Admin'])->set_attr('label', 'User Level ' . $i)->set_attr('required', false);
         $i++;
     } while (isset($_REQUEST['user' . $i]));
     parent::__construct($fields);
     foreach ($this->fields as $field) {
         $field->attributes['placeholder'] = $field->label;
     }
     $this->set_required_modules();
     $this->h2 = 'Site Creation';
     $this->submit = 'Create';
     $this->id = 'cms_builder';
 }
Exemple #12
0
 /**
  *
  */
 public function do_update_selector()
 {
     $field = form::create('field_link', 'gid')->set_attr('link_module', '\\object\\glider')->set_attr('link_field', ['manufacturer.title', 'name'])->set_attr('options', ['join' => ['manufacturer' => 'manufacturer.mid = glider.mid'], 'order' => 'manufacturer.title, glider.name']);
     $field->parent_form = $this;
     ajax::update($field->get_html());
 }
 public function __construct()
 {
     $fields = [form::create('field_int', 'mid')->set_attr('hidden', true), form::create('field_link', 'gid')->set_attr('label', 'Group')->set_attr('link_module', 19)->set_attr('link_field', 123)];
     parent::__construct($fields);
 }
 public function __construct()
 {
     parent::__construct([form::create('field_link', 'gid', ['link_module' => '\\module\\cms\\object\\_cms_group', 'link_field' => 'title', 'label' => 'Group']), form::create('field_string', 'primary_key', ['label' => 'Primary Key']), form::create('field_string', 'title', ['label' => 'Title']), form::create('field_string', 'title_label', ['label' => 'Title Label']), form::create('field_string', 'table_name', ['label' => 'Table Name']), form::create('field_string', 'namespace')->set_attr('label', 'Namespace <small>can be blank</small>')->set_attr('required', false), form::create('field_boolean', 'nestable', ['label' => 'Nestable'])]);
     $this->id = 'new_module';
 }
Exemple #15
0
 /**
  *
  */
 public function do_update_selector()
 {
     $field = form::create('field_link', 'pid')->set_attr('link_module', '\\object\\pilot')->set_attr('link_field', 'name')->set_attr('options', ['order' => 'name']);
     $field->parent_form = $this;
     ajax::update($field->get_html());
 }
 public function __construct()
 {
     parent::__construct([form::create('field_link', 'wgid')->set_attr('label', 'Waypoint Set')->set_attr('link_field', 'title')->set_attr('link_module', '\\module\\planner\\object\\waypoint_group')]);
     $this->submit = 'Load';
     $this->id = 'planner_load_waypoints';
 }
Exemple #17
0
 public function __construct()
 {
     parent::__construct([form::create('field_string', 'title'), form::create('field_string', 'field_name'), form::create('field_link', 'type')->set_attr('link_module', '\\module\\cms\\object\\field_type')->set_attr('link_field', 'title'), form::create('field_link', 'link_module')->set_attr('link_module', '\\module\\cms\\object\\_cms_module')->set_attr('link_field', 'title'), form::create('field_link', 'link_field')->set_attr('link_module', '\\module\\cms\\object\\_cms_field')->set_attr('link_field', 'title'), form::create('field_int', 'mid')->set_attr('hidden', true)]);
     $this->id = 'add_field_form';
 }
 public function __construct()
 {
     parent::__construct();
     $this->add_field(form::create('field_hidden', 'fid'));
 }
 public function __construct()
 {
     parent::__construct([form::create('field_link', 'gid', ['link_module' => '\\module\\cms\\object\\_cms_group', 'link_field' => 'title', 'label' => 'Group']), form::create('field_string', 'primary_key', ['label' => 'Primary Key']), form::create('field_string', 'title', ['label' => 'Title']), form::create('field_string', 'table_name', ['label' => 'Table Name']), form::create('field_string', 'namespace', ['label' => 'Namespace <small>can be blank</small>', 'required' => false]), form::create('field_boolean', 'nestable', ['label' => 'Nestable']), form::create('field_int', 'mid', ['hidden' => true])]);
     $this->id = 'module_edit';
 }