当前位置: 首页>>代码示例>>PHP>>正文


PHP data_entry_helper::hidden_text方法代码示例

本文整理汇总了PHP中data_entry_helper::hidden_text方法的典型用法代码示例。如果您正苦于以下问题:PHP data_entry_helper::hidden_text方法的具体用法?PHP data_entry_helper::hidden_text怎么用?PHP data_entry_helper::hidden_text使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在data_entry_helper的用法示例。


在下文中一共展示了data_entry_helper::hidden_text方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: link_to_parent

 public static function link_to_parent($auth, $args, $tabalias, $options, $path)
 {
     if (empty($_GET['table']) || $_GET['table'] !== 'sample' || empty($_GET['id'])) {
         throw new exception('paths_editor.link_to_parent control needs to be called from a form that saves a sample');
     }
     // construct a query to pull back the parent sample and any existing child samples in one go
     $samples = data_entry_helper::get_population_data(array('table' => 'sample', 'extraParams' => $auth['read'] + array('query' => json_encode(array('where' => array('id', $_GET['id']), 'orwhere' => array('parent_id', $_GET['id']))), 'view' => 'detail'), 'caching' => false));
     $childGeoms = array();
     $r = '';
     foreach ($samples as $sample) {
         if ($sample['id'] === $_GET['id']) {
             // found the parent sample. Send to JS so it can be shown on the map
             data_entry_helper::$javascript .= "indiciaData.showParentSampleGeom = '{$sample['geom']}';\n";
             $r = data_entry_helper::hidden_text(array('fieldname' => 'sample:date', 'default' => $sample['date_start']));
         } else {
             // found an already input child sample
             $childGeoms[] = "'{$sample['geom']}'";
         }
     }
     // Output some instructions to the user which will depend on whether we are on the first
     // child sample or not.
     if (!empty($options['outputInstructionsTo'])) {
         $instruct = empty($childGeoms) ? $options['firstInstructions'] : $options['otherInstructions'];
         data_entry_helper::$javascript .= "\$('#{$options['outputInstructionsTo']}').html('{$instruct}');\n";
     }
     $childGeoms = implode(',', $childGeoms);
     data_entry_helper::$javascript .= "indiciaData.showChildSampleGeoms = [{$childGeoms}];\n";
     $r .= data_entry_helper::hidden_text(array('fieldname' => 'sample:parent_id', 'default' => $_GET['id']));
     return $r;
 }
开发者ID:BirenRathod,项目名称:indicia-code,代码行数:30,代码来源:paths_editor.php

示例2: get_control_species

 protected static function get_control_species($auth, $args, $tabAlias, $options)
 {
     data_entry_helper::$onload_javascript .= "indiciaFns.bindTabsActivate(\$(\$('#{$tabAlias}').parent()), function(event, ui) {\r\n      panel = typeof ui.newPanel==='undefined' ? ui.panel : ui.newPanel[0];\r\n      if (panel.id==='{$tabAlias}') { setSectionDropDown(); }\r\n    });\n";
     // we need a place to store the subsites, to save loading from the db on submission
     $r = '<input type="hidden" name="subsites" id="subsites" value="" />';
     // plus hiddens to store the main sample's sref info
     $r .= data_entry_helper::hidden_text(array('fieldname' => 'sample:entered_sref', 'id' => 'imp-sref'));
     $r .= data_entry_helper::hidden_text(array('fieldname' => 'sample:entered_sref_system', 'id' => 'imp-sref-system'));
     $r .= data_entry_helper::hidden_text(array('fieldname' => 'sample:geom', 'id' => 'imp-geom'));
     // plus the sample method ids
     $sampleMethods = helper_base::get_termlist_terms($auth, 'indicia:sample_methods', array('Transect', 'Transect Section'));
     $r .= '<input type="hidden" name="sample:sample_method_id" value="' . $sampleMethods[0]['id'] . '" />';
     $r .= '<input type="hidden" name="subsample:sample_method_id" value="' . $sampleMethods[1]['id'] . '" />';
     // This option forces the grid to load all child sample occurrences, though we will ignore the hidden SampleIDX column and instead
     // use the section column to bind to samples
     $options['speciesControlToUseSubSamples'] = true;
     $r .= parent::get_control_species($auth, $args, $tabAlias, $options);
     // build an array of existing sub sample IDs, keyed by subsite location Id.
     $subSampleIds = array();
     if (isset(data_entry_helper::$entity_to_load)) {
         foreach (data_entry_helper::$entity_to_load as $key => $value) {
             if (preg_match('/^sc:(\\d+):(\\d+):sample:id$/', $key, $matches)) {
                 $subSampleIds[data_entry_helper::$entity_to_load["sc:{$matches['1']}:{$matches['2']}:sample:location_id"]] = $value;
             }
         }
     }
     $r .= '<input type="hidden" name="subSampleIds" value="' . htmlspecialchars(json_encode($subSampleIds)) . '" />';
     return $r;
 }
开发者ID:joewoodhouse,项目名称:client_helpers,代码行数:29,代码来源:dynamic_transect_sections_sample_occurrence.php

示例3: get_form

 /**
  * Return the generated form output.
  * @param array $args List of parameter values passed through to the form depending on how the form has been configured.
  * This array always contains a value for language.
  * @param object $node The Drupal node object.
  * @param array $response When this form is reloading after saving a submission, contains the response from the service call.
  * Note this does not apply when redirecting (in this case the details of the saved object are in the $_GET data).
  * @return Form HTML.
  */
 public static function get_form($args, $node, $response = null)
 {
     $reloadPath = self::get_reload_path();
     $auth = data_entry_helper::get_read_write_auth($args['website_id'], $args['password']);
     $r = "<form method=\"post\" id=\"entry_form\" action=\"{$reloadPath}\">\n";
     $r .= $auth['write'];
     data_entry_helper::$entity_to_load = array();
     if (!empty($_GET['termlists_term_id'])) {
         data_entry_helper::load_existing_record($auth['read'], 'termlists_term', $_GET['termlists_term_id']);
         // map fields to their appropriate supermodels
         data_entry_helper::$entity_to_load['term:term'] = data_entry_helper::$entity_to_load['termlists_term:term'];
         data_entry_helper::$entity_to_load['term:id'] = data_entry_helper::$entity_to_load['termlists_term:term_id'];
         data_entry_helper::$entity_to_load['meaning:id'] = data_entry_helper::$entity_to_load['termlists_term:meaning_id'];
         if (function_exists('hostsite_set_page_title')) {
             hostsite_set_page_title(lang::get('Edit {1}', data_entry_helper::$entity_to_load['term:term']));
         }
     }
     $r .= data_entry_helper::hidden_text(array('fieldname' => 'website_id', 'default' => $args['website_id']));
     $r .= data_entry_helper::hidden_text(array('fieldname' => 'termlists_term:id'));
     $r .= data_entry_helper::hidden_text(array('fieldname' => 'termlists_term:termlist_id', 'default' => $args['termlist_id']));
     $r .= data_entry_helper::hidden_text(array('fieldname' => 'termlists_term:preferred', 'default' => 't'));
     $r .= data_entry_helper::hidden_text(array('fieldname' => 'term:id'));
     $r .= data_entry_helper::hidden_text(array('fieldname' => 'term:language_id', 'default' => $args['language_id']));
     $r .= data_entry_helper::hidden_text(array('fieldname' => 'meaning:id'));
     // request automatic JS validation
     data_entry_helper::enable_validation('entry_form');
     $r .= data_entry_helper::text_input(array('label' => lang::get('Term'), 'fieldname' => 'term:term', 'helpText' => lang::get('Please provide the term'), 'validation' => array('required'), 'class' => 'control-width-5'));
     $r .= "<input type=\"submit\" name=\"form-submit\" id=\"delete\" value=\"Delete\" />\n";
     $r .= "<input type=\"submit\" name=\"form-submit\" value=\"Save\" />\n";
     $r .= '<form>';
     self::set_breadcrumb($args);
     return $r;
 }
开发者ID:BirenRathod,项目名称:drupal-6,代码行数:42,代码来源:term.php

示例4: get_form

 /**
  * Return the generated form output.
  * @param array $args List of parameter values passed through to the form depending on how the form has been configured.
  * This array always contains a value for language.
  * @param object $node The Drupal node object.
  * @param array $response When this form is reloading after saving a submission, contains the response from the service call.
  * Note this does not apply when redirecting (in this case the details of the saved object are in the $_GET data).
  * @return Form HTML.
  */
 public static function get_form($args, $node, $response = null)
 {
     global $indicia_templates;
     iform_load_helpers(array('map_helper', 'report_helper'));
     // apply defaults
     $args = array_merge(array(), $args);
     $reloadPath = self::getReloadPath();
     data_entry_helper::$website_id = $args['website_id'];
     $auth = data_entry_helper::get_read_write_auth($args['website_id'], $args['password']);
     if (!empty($_GET['user_trust_id'])) {
         self::loadExistingUserTrust($_GET['user_trust_id'], $auth, $args);
     }
     $r = "<form method=\"post\" id=\"entry_form\" action=\"{$reloadPath}\">\n";
     $r .= $auth['write'] . "<input type=\"hidden\" id=\"website_id\" name=\"website_id\" value=\"" . $args['website_id'] . "\" />\n";
     $r .= data_entry_helper::hidden_text(array('fieldname' => 'user_trust:id'));
     $r .= data_entry_helper::autocomplete(array('label' => lang::get('Recorder to trust'), 'fieldname' => 'user_trust:user_id', 'table' => 'user', 'valueField' => 'id', 'captionField' => 'person_name', 'extraParams' => $auth['read'] + array('view' => 'detail'), 'class' => 'control-width-4'));
     $col1 = '<p>Define the combination of survey, taxon group and/or location that this recorder is trusted for below.</p>';
     $col1 .= '<fieldset><legend>' . lang::get('Trust settings') . '</legend>';
     $col1 .= data_entry_helper::autocomplete(array('label' => lang::get('Trust records in this survey'), 'fieldname' => 'user_trust:survey_id', 'table' => 'survey', 'valueField' => 'id', 'captionField' => 'title', 'blankText' => '<' . lang::get('any') . '>', 'extraParams' => $auth['read'] + array('sharing' => 'verification'), 'class' => 'control-width-4'));
     $col1 .= data_entry_helper::autocomplete(array('label' => lang::get('Trust records in this taxon group'), 'fieldname' => 'user_trust:taxon_group_id', 'table' => 'taxon_group', 'valueField' => 'id', 'captionField' => 'title', 'blankText' => '<' . lang::get('any') . '>', 'extraParams' => $auth['read'], 'class' => 'control-width-4'));
     $col1 .= data_entry_helper::autocomplete(array('label' => lang::get('Trust records in this location'), 'fieldname' => 'user_trust:location_id', 'table' => 'location', 'valueField' => 'id', 'captionField' => 'name', 'blankText' => '<' . lang::get('any') . '>', 'extraParams' => $auth['read'] + array('location_type_id' => variable_get('indicia_profile_location_type_id', '')), 'class' => 'control-width-4'));
     $col2 = '<p>' . lang::get('Review this recorder\'s experience in the tabs below') . '</p>';
     $col2 .= '<div id="summary-tabs">';
     $col2 .= data_entry_helper::tab_header(array('tabs' => array('#tab-surveys' => lang::get('Surveys'), '#tab-taxon-groups' => lang::get('Taxon groups'), '#tab-locations' => lang::get('Locations'))));
     data_entry_helper::enable_tabs(array('divId' => 'summary-tabs'));
     $col2 .= '<div id="tab-surveys">';
     $col2 .= report_helper::report_grid(array('id' => 'surveys-summary', 'readAuth' => $auth['read'], 'dataSource' => 'library/surveys/filterable_surveys_verification_breakdown', 'ajax' => TRUE, 'autoloadAjax' => FALSE, 'extraParams' => array('my_records' => 1)));
     $col2 .= '</div>';
     $col2 .= '<div id="tab-taxon-groups">';
     $col2 .= report_helper::report_grid(array('id' => 'taxon-groups-summary', 'readAuth' => $auth['read'], 'dataSource' => 'library/taxon_groups/filterable_taxon_groups_verification_breakdown', 'ajax' => TRUE, 'autoloadAjax' => FALSE, 'extraParams' => array('my_records' => 1)));
     $col2 .= '</div>';
     $col2 .= '<div id="tab-locations">';
     $col2 .= report_helper::report_grid(array('id' => 'locations-summary', 'readAuth' => $auth['read'], 'dataSource' => 'library/locations/filterable_locations_verification_breakdown', 'ajax' => TRUE, 'autoloadAjax' => FALSE, 'extraParams' => array('my_records' => 1, 'location_type_id' => variable_get('indicia_profile_location_type_id', ''))));
     $col2 .= '</div>';
     $col2 .= '</div>';
     $r .= str_replace(array('{col-1}', '{col-2}'), array($col1, $col2), $indicia_templates['two-col-50']);
     $r .= '</fieldset>';
     $r .= '<input type="submit" class="indicia-button" id="save-button" value="' . (empty(data_entry_helper::$entity_to_load['user_trust_id:id']) ? lang::get('Grant trust') : lang::get('Update trust settings')) . "\" />\n";
     if (!empty($_GET['user_trust_id'])) {
         $r .= '<input type="submit" class="indicia-button" id="delete-button" name="delete-button" value="' . lang::get('Revoke this trust') . "\" />\n";
         data_entry_helper::$javascript .= "\$('#delete-button').click(function(e) {\n        if (!confirm(\"Are you sure you want to revoke this trust?\")) {\n          e.preventDefault();\n          return false;\n        }\n      });\n";
     }
     $r .= '</form>';
     data_entry_helper::enable_validation('entry_form');
     return $r;
 }
开发者ID:BirenRathod,项目名称:indicia-code,代码行数:55,代码来源:user_trust_edit.php

示例5:

<?php 
echo $metadata;
?>
<fieldset>
<?php 
echo data_entry_helper::hidden_text(array('fieldname' => 'location_medium:id', 'default' => $id));
echo data_entry_helper::hidden_text(array('fieldname' => 'location_medium:location_id', 'default' => html::initial_value($values, 'location_medium:location_id')));
?>
<legend>Media file details</legend>
<?php 
$mediaTypeId = html::initial_value($values, 'location_medium:media_type_id');
$mediaType = $mediaTypeId ? $other_data['media_type_terms'][$mediaTypeId] : 'Image:Local';
if ($mediaType === 'Image:Local') {
    echo '<label>Image:</label>';
    echo html::sized_image(html::initial_value($values, 'occurrence_medium:path')) . '</br>';
    echo data_entry_helper::hidden_text(array('fieldname' => 'location_medium:path', 'default' => html::initial_value($values, 'location_medium:path')));
    echo data_entry_helper::image_upload(array('label' => 'Upload image file', 'fieldname' => 'image_upload', 'default' => html::initial_value($values, 'location_medium:path')));
} else {
    echo data_entry_helper::text_input(array('label' => 'Path or URL', 'fieldname' => 'location_medium:path', 'default' => html::initial_value($values, 'location_medium:path'), 'class' => 'control-width-5'));
}
echo data_entry_helper::text_input(array('label' => 'Caption', 'fieldname' => 'location_medium:caption', 'default' => html::initial_value($values, 'location_medium:caption'), 'class' => 'control-width-5'));
if ($mediaTypeId && $mediaType !== 'Image:Local') {
    echo data_entry_helper::select(array('label' => 'Media type', 'fieldname' => 'location_medium:media_type_id', 'default' => $mediaTypeId, 'lookupValues' => $other_data['media_type_terms'], 'blankText' => '<Please select>', 'class' => 'control-width-5'));
}
?>

</fieldset>
<?php 
echo html::form_buttons($id != null, false, false);
data_entry_helper::$dumped_resources[] = 'jquery';
data_entry_helper::$dumped_resources[] = 'jquery_ui';
开发者ID:BirenRathod,项目名称:indicia-code,代码行数:31,代码来源:location_medium_edit.php

示例6: get_form

 /**
  * Return the generated form output.
  * @param array $args List of parameter values passed through to the form depending on how the form has been configured.
  * This array always contains a value for language.
  * @param object $node The Drupal node object.
  * @param array $response When this form is reloading after saving a submission, contains the response from the service call.
  * Note this does not apply when redirecting (in this case the details of the saved object are in the $_GET data).
  * @return Form HTML.
  */
 public static function get_form($args, $node, $response = null)
 {
     $form = '<form action="#" method="POST" id="entry_form">';
     if ($_POST) {
         $auth = data_entry_helper::get_read_write_auth($args['website_id'], $args['password']);
         self::subscribe($args, $auth);
     } else {
         // don't bother with write auth for initial form load, as read auth is cached and faster
         $auth = array('read' => data_entry_helper::get_read_auth($args['website_id'], $args['password']));
     }
     if (!empty($_GET['id'])) {
         data_entry_helper::load_existing_record($auth['read'], 'species_alert', $_GET['id']);
         // enforce permissions
         if (data_entry_helper::$entity_to_load['species_alert:user_id'] != hostsite_get_user_field('indicia_user_id')) {
             return lang::get('You cannot modify a species alert subscription created by someone else');
         }
         $form .= data_entry_helper::hidden_text(array('fieldname' => 'species_alert:id', 'default' => $_GET['id']));
     }
     // if not logged in, then ask for details to register against
     global $user;
     if (!hostsite_get_user_field('id') || !isset($user) || empty($user->mail) || !hostsite_get_user_field('last_name')) {
         $form .= "<fieldset><legend>" . lang::get('Your details') . ":</legend>\n";
         $default = empty($_POST['first_name']) ? hostsite_get_user_field('first_name', '') : $_POST['first_name'];
         $form .= data_entry_helper::text_input(array('label' => lang::get('First name'), 'fieldname' => 'first_name', 'validation' => array('required'), 'default' => $default, 'class' => 'control-width-4'));
         $default = empty($_POST['surname']) ? hostsite_get_user_field('last_name', '') : $_POST['surname'];
         $form .= data_entry_helper::text_input(array('label' => lang::get('Last name'), 'fieldname' => 'surname', 'validation' => array('required'), 'default' => $default, 'class' => 'control-width-4'));
         $default = empty($_POST['email']) ? empty($user->mail) ? '' : $user->mail : $_POST['email'];
         $form .= data_entry_helper::text_input(array('label' => lang::get('Email'), 'fieldname' => 'email', 'validation' => array('required', 'email'), 'default' => $default, 'class' => 'control-width-4'));
         $form .= "</fieldset>\n";
     } else {
         $form .= data_entry_helper::hidden_text(array('fieldname' => 'first_name', 'default' => hostsite_get_user_field('first_name')));
         $form .= data_entry_helper::hidden_text(array('fieldname' => 'surname', 'default' => hostsite_get_user_field('last_name')));
         $form .= data_entry_helper::hidden_text(array('fieldname' => 'email', 'default' => $user->mail));
         $form .= data_entry_helper::hidden_text(array('fieldname' => 'user_id', 'default' => hostsite_get_user_field('indicia_user_id')));
     }
     $form .= "<fieldset><legend>" . lang::get('Alert criteria') . ":</legend>\n";
     // Output the species selection control
     // Default after saving with a validation failure can be pulled direct from the post, but
     // when reloading we don't need a default taxa taxon list ID since we already know the meaning
     // ID or external key.
     $default = empty($_POST['taxa_taxon_list_id']) ? '' : $_POST['taxa_taxon_list_id'];
     if (empty($_POST['taxa_taxon_list_id:taxon'])) {
         $defaultCaption = empty(data_entry_helper::$entity_to_load['species_alert:preferred_taxon']) ? '' : data_entry_helper::$entity_to_load['species_alert:preferred_taxon'];
     } else {
         $defaultCaption = $_POST['taxa_taxon_list_id:taxon'];
     }
     $form .= data_entry_helper::species_autocomplete(array('label' => lang::get('Alert species'), 'helpText' => lang::get('Select the species you are interested in receiving alerts in ' . 'relation to if you want to receive alerts on a single species.'), 'fieldname' => 'taxa_taxon_list_id', 'cacheLookup' => true, 'extraParams' => $auth['read'] + array('taxon_list_id' => $args['list_id']), 'class' => 'control-width-4', 'default' => $default, 'defaultCaption' => $defaultCaption));
     if (empty($default)) {
         // Unless we've searched for the species name then posted (and failed), then the
         // default will be empty. We might therefore be reloading existing data which has
         // a meaning ID or external key.
         if (!empty(data_entry_helper::$entity_to_load['species_alert:external_key'])) {
             $form .= data_entry_helper::hidden_text(array('fieldname' => 'species_alert:external_key', 'default' => data_entry_helper::$entity_to_load['species_alert:external_key']));
         } elseif (!empty(data_entry_helper::$entity_to_load['species_alert:taxon_meaning_id'])) {
             $form .= data_entry_helper::hidden_text(array('fieldname' => 'species_alert:taxon_meaning_id', 'default' => data_entry_helper::$entity_to_load['species_alert:taxon_meaning_id']));
         }
     }
     if (!empty($args['full_lists'])) {
         $form .= data_entry_helper::select(array('label' => lang::get('Select full species lists'), 'helpText' => lang::get('If you want to restrict the alerts to records of any ' . 'species within a species list, then select the list here.'), 'fieldname' => 'species_alert:taxon_list_id', 'blankText' => lang::get('<Select a species list>'), 'table' => 'taxon_list', 'valueField' => 'id', 'captionField' => 'title', 'extraParams' => $auth['read'] + array('id' => $args['full_lists'], 'orderby' => 'title'), 'class' => 'control-width-4'));
     }
     $form .= data_entry_helper::location_select(array('label' => lang::get('Select location'), 'helpText' => lang::get('If you want to restrict the alerts to records within a certain boundary, select it here.'), 'fieldname' => 'species_alert:location_id', 'id' => 'imp-location', 'blankText' => lang::get('<Select boundary>'), 'extraParams' => $auth['read'] + array('location_type_id' => $args['location_type_id'], 'orderby' => 'name'), 'class' => 'control-width-4'));
     $form .= data_entry_helper::checkbox(array('label' => lang::get('Alert on initial entry'), 'helpText' => lang::get('Tick this box if you want to receive a notification when the record is first input into the system.'), 'fieldname' => 'species_alert:alert_on_entry'));
     $form .= data_entry_helper::checkbox(array('label' => lang::get('Alert on verification as correct'), 'helpText' => lang::get('Tick this box if you want to receive a notification when the record has been verified as correct.'), 'fieldname' => 'species_alert:alert_on_verify'));
     $form .= "</fieldset>\n";
     $form .= '<input type="Submit" value="Subscribe" />';
     $form .= '</form>';
     data_entry_helper::enable_validation('entry_form');
     iform_load_helpers(array('map_helper'));
     $mapOptions = iform_map_get_map_options($args, $auth['read']);
     $map = map_helper::map_panel($mapOptions);
     global $indicia_templates;
     return str_replace(array('{col-1}', '{col-2}'), array($form, $map), $indicia_templates['two-col-50']);
 }
开发者ID:BirenRathod,项目名称:indicia-code,代码行数:82,代码来源:subscribe_species_alert.php

示例7: get_control_locationurlparam

 /**
  * Implements the [location url param] control, for accepting the site to record against using a location_id URL parameter.
  *
  * Outputs hidden inputs into the form to specify the location_id for the sample. Uses the location's centroid and spatial ref system to 
  * fill in the sample's geometry data. If loading an existing sample, then the location_id in the URL is ignored.
  */
 protected static function get_control_locationurlparam($auth, $args, $tabAlias, $options)
 {
     $location_id = isset(data_entry_helper::$entity_to_load['sample:location_id']) ? data_entry_helper::$entity_to_load['sample:location_id'] : (empty($_GET['location_id']) ? '' : $_GET['location_id']);
     if (empty($location_id)) {
         return 'This form requires a URL parameter called location_id to specify which site to record against.';
     }
     if (!preg_match('/^[0-9]+$/', $location_id)) {
         return 'The location_id parameter must be an integer.';
     }
     if (isset(data_entry_helper::$entity_to_load['sample:location_id'])) {
         // no need for values as the entity to load will override any defaults.
         $location = array('id' => '', 'centroid_sref' => '', 'centroid_sref_system' => '');
     } else {
         $response = data_entry_helper::get_population_data(array('table' => 'location', 'extraParams' => $auth['read'] + array('id' => $_GET['location_id'], 'view' => 'detail')));
         $location = $response[0];
     }
     $r = data_entry_helper::hidden_text(array('fieldname' => 'sample:location_id', 'default' => $location['id']));
     $r .= data_entry_helper::hidden_text(array('fieldname' => 'sample:entered_sref', 'default' => $location['centroid_sref']));
     $r .= data_entry_helper::hidden_text(array('fieldname' => 'sample:entered_sref_system', 'default' => $location['centroid_sref_system']));
     return $r;
 }
开发者ID:BirenRathod,项目名称:drupal-6,代码行数:27,代码来源:dynamic_sample_occurrence.php

示例8: reportFilterBlock

 /**
  * Returns controls allowing a records filter to be defined and associated with the group. 
  * @param array $args Form configuration arguments
  * @return string HTML to output
  */
 private static function reportFilterBlock($args, $auth, &$hiddenPopupDivs)
 {
     $r = '';
     $hiddenPopupDivs = '';
     if ($args['include_report_filter']) {
         $r .= '<fieldset><legend>' . lang::get('Records that are of interest to the {1}', lang::get(self::$groupType)) . '</legend>';
         $r .= '<p>' . lang::get('LANG_Filter_Instruct', lang::get(self::$groupType), lang::get("group's")) . '</p>';
         $indexedLocationTypeIds = explode(',', $args['indexed_location_type_ids']);
         $otherLocationTypeIds = explode(',', $args['other_location_type_ids']);
         $r .= report_filter_panel($auth['read'], array('allowLoad' => false, 'allowSave' => false, 'filterTypes' => $args['filter_types'], 'embedInExistingForm' => true, 'indexedLocationTypeIds' => $indexedLocationTypeIds, 'otherLocationTypeIds' => $otherLocationTypeIds), $args['website_id'], $hiddenPopupDivs);
         // fields to auto-create a filter record for this group's defined set of records
         $r .= data_entry_helper::hidden_text(array('fieldname' => 'filter:id'));
         $r .= '<input type="hidden" name="filter:title" id="filter-title-val"/>';
         $r .= '<input type="hidden" name="filter:definition" id="filter-def-val"/>';
         $r .= '<input type="hidden" name="filter:sharing" value="R"/>';
         $r .= '</fieldset>';
     }
     return $r;
 }
开发者ID:joewoodhouse,项目名称:client_helpers,代码行数:24,代码来源:group_edit.php

示例9:

<?php

require_once DOCROOT . 'client_helpers/data_entry_helper.php';
echo data_entry_helper::textarea(array('label' => 'Exported survey structure', 'fieldname' => 'export survey structure', 'class' => 'control-width-6', 'helpText' => 'Copy this text to the clipboard. You can then paste it into another survey to clone the attributes.', 'default' => $export));
?>
<form class="iform" action="<?php 
echo url::site();
?>
survey_structure_export/save" method="post" id="entry-form"">
<fieldset>
<?php 
echo data_entry_helper::textarea(array('label' => 'Import survey structure', 'fieldname' => 'import survey structure', 'class' => 'control-width-6', 'helpText' => 'Paste in the export of another survey to import its attributes'));
echo data_entry_helper::hidden_text(array('fieldname' => 'survey_id', 'default' => $surveyId));
echo '<input type="submit" name="submit" value="Import" class="ui-corner-all ui-state-default button ui-priority-primary" />' . "\n";
data_entry_helper::link_default_stylesheet();
echo data_entry_helper::dump_javascript();
?>
</fieldset>
</form>
开发者ID:BirenRathod,项目名称:indicia-code,代码行数:19,代码来源:index.php

示例10: report_filter_panel


//.........这里部分代码省略.........
        $options['context_id'] = $_GET['context_id'];
    }
    if (!empty($_GET['filter_id'])) {
        $options['filter_id'] = $_GET['filter_id'];
    }
    if (!empty($_GET['filters_user_id'])) {
        $options['filters_user_id'] = $_GET['filters_user_id'];
    }
    foreach ($filterData as $filter) {
        if ($filter['defines_permissions'] === 't') {
            $selected = !empty($options['context_id']) && $options['context_id'] == $filter['id'] ? 'selected="selected" ' : '';
            $contexts .= "<option value=\"{$filter['id']}\" {$selected}>{$filter['title']}</option>";
            $contextDefs[$filter['id']] = json_decode($filter['definition']);
        } else {
            $selected = !empty($options['filter_id']) && $options['filter_id'] == $filter['id'] ? 'selected="selected" ' : '';
            $existing .= "<option value=\"{$filter['id']}\" {$selected}>{$filter['title']}</option>";
        }
    }
    $r = '<div id="standard-params" class="ui-widget">';
    if ($options['allowSave'] && $options['admin']) {
        if (empty($_GET['filters_user_id'])) {
            // new filter to create, so sharing type can be edited
            $reload = data_entry_helper::get_reload_link_parts();
            $reloadPath = $reload['path'];
            if (count($reload['params'])) {
                $reloadPath .= '?' . data_entry_helper::array_to_query_string($reload['params']);
            }
            $r .= "<form action=\"{$reloadPath}\" method=\"post\" >";
            $r .= data_entry_helper::select(array('label' => lang::get('Select filter type'), 'fieldname' => 'filter:sharing', 'lookupValues' => $options['adminCanSetSharingTo'], 'afterControl' => '<input type="submit" value="Go"/>', 'default' => $options['sharingCode']));
            $r .= '</form>';
        } else {
            // existing filter to edit, type is therefore fixed. JS will fill these values in.
            $r .= '<p>' . lang::get('This filter is for <span id="sharing-type-label"></span>.') . '</p>';
            $r .= data_entry_helper::hidden_text(array('fieldname' => 'filter:sharing'));
        }
    }
    if ($options['allowLoad']) {
        $r .= '<div class="header ui-toolbar ui-widget-header ui-helper-clearfix"><div><span id="active-filter-label">' . lang::get('New report') . '</span></div><span class="changed" style="display:none" title="This filter has been changed">*</span>';
        $r .= '<div>';
        if ($contexts) {
            data_entry_helper::$javascript .= "indiciaData.filterContextDefs = " . json_encode($contextDefs) . ";\n";
            if (count($contextDefs) > 1) {
                $r .= '<label for="context-filter">' . lang::get('Context:') . "</label><select id=\"context-filter\">{$contexts}</select>";
            } else {
                $keys = array_keys($contextDefs);
                $r .= '<input type="hidden" id="context-filter" value="' . $keys[0] . '" />';
            }
        }
        $r .= '<label for="select-filter">' . lang::get('Filter:') . '</label><select id="select-filter"><option value="" selected="selected">' . lang::get('Select filter') . "...</option>{$existing}</select>";
        $r .= '<button type="button" id="filter-apply">' . lang::get('Apply') . '</button>';
        $r .= '<button type="button" id="filter-reset" class="disabled">' . lang::get('Reset') . '</button>';
        $r .= '<button type="button" id="filter-build">' . lang::get('Create a filter') . '</button></div>';
        $r .= '</div>';
        $r .= '<div id="filter-details" style="display: none">';
        $r .= '<img src="' . data_entry_helper::$images_path . 'nuvola/close-22px.png" width="22" height="22" alt="Close filter builder" title="Close filter builder" class="button" id="filter-done"/>' . "\n";
    } else {
        $r .= '<div id="filter-details">';
        if (!empty($options['filter_id'])) {
            $r .= "<input type=\"hidden\" id=\"select-filter\" value=\"{$options['filter_id']}\"/>";
        } elseif (!empty($options['filters_user_id'])) {
            $r .= "<input type=\"hidden\" id=\"select-filters-user\" value=\"{$options['filters_user_id']}\"/>";
        }
    }
    $r .= '<div id="filter-panes">';
    if ($options['entity'] === 'occurrence') {
        $filters = array('filter_what' => new filter_what(), 'filter_where' => new filter_where(), 'filter_when' => new filter_when(), 'filter_who' => new filter_who(), 'filter_occurrence_id' => new filter_occurrence_id(), 'filter_quality' => new filter_quality(), 'filter_source' => new filter_source());
开发者ID:BirenRathod,项目名称:indicia-code,代码行数:67,代码来源:report_filters.php

示例11: json_encode

//title duplciate detection.
//So to fix this, collect the existing filters from the database so we can compare the titles with the one we create and then
//do the validation manually.
$readAuth = data_entry_helper::get_read_auth(0 - $_SESSION['auth_user']->id, kohana::config('indicia.private_key'));
$existingFilterData = data_entry_helper::get_population_data(array('table' => 'filter', 'extraParams' => $readAuth, 'nocache' => true));
//When we save a milestone when we need to automatically set the filter title as there isn't a separate field
//to fill this in.
//Also hide the "who" filter as we don't need this for milestones as they can apply to all users
//Also manually do the unique milestone/filter title validation (see note above)
data_entry_helper::$javascript .= "\nvar existingFilterData=" . json_encode($existingFilterData) . ";  \n\$('#pane-filter_who').hide();\n\$('#milestones-form').submit(function() {\n  \$('#filter-title-val').val('" . 'Filter for milestone' . " ' + \$('#milestone\\\\:title').val());\n  for (var i = 0; i<existingFilterData.length;i++) {\n    //Note we must allow a duplicate title in the situaton where the duplicate title is for the already existing item\n    if (existingFilterData[i]['title']==\$('#filter-title-val').val() && existingFilterData[i]['id']!=\$('#filter\\\\:id').val()) {\n      alert('The filter title is generated from the milestone title you have entered and would cause a duplicate filter title, please choose a different title');\n      return false;\n    }\n  }\n  \$('#filter-def-val').val(JSON.stringify(indiciaData.filter.def));\n});\n";
$readAuth = data_entry_helper::get_read_auth(0 - $_SESSION['auth_user']->id, kohana::config('indicia.private_key'));
$filterPanelHTML = '<h3>Specify the filter used to define which records count</h3>';
$hiddenPopupDivs = '';
$filterPanelHTML .= report_filter_panel($readAuth, array('allowLoad' => false, 'allowSave' => false, 'embedInExistingForm' => true, 'runningOnWarehouse' => true, 'taxon_list_id' => kohana::config('cache_builder_variables.master_list_id'), 'website_id' => html::initial_value($values, 'milestone:website_id') ? html::initial_value($values, 'milestone:website_id') : $values['website_id']), $this->uri->argument(1), $hiddenStuff);
// fields to auto-create a filter record for this group's defined set of records
$filterPanelHTML .= data_entry_helper::hidden_text(array('fieldname' => 'filter:id', 'default' => html::initial_value($values, 'filter:id')));
$filterPanelHTML .= '<input type="hidden" name="filter:title" id="filter-title-val"/>';
$filterPanelHTML .= '<input type="hidden" name="filter:definition" id="filter-def-val"/>';
$filterPanelHTML .= '<input type="hidden" name="filter:sharing" value="R"/>';
echo $filterPanelHTML;
echo html::form_buttons(html::initial_value($values, 'milestone:id') != null, false, false);
data_entry_helper::$dumped_resources[] = 'jquery';
data_entry_helper::$dumped_resources[] = 'jquery_ui';
data_entry_helper::$dumped_resources[] = 'fancybox';
data_entry_helper::enable_validation('milestones-form');
data_entry_helper::link_default_stylesheet();
echo data_entry_helper::dump_javascript();
?>
</fieldset>
</form>
<?php 
开发者ID:BirenRathod,项目名称:indicia-code,代码行数:31,代码来源:milestone_edit.php

示例12: array

echo data_entry_helper::text_input(array('label' => 'Period Start', 'fieldname' => 'summariser_definition:period_start', 'default' => html::initial_value($values, 'summariser_definition:period_start'), 'helpText' => 'Define the first day of each period. There are 2 options.<br/>' . "&nbsp;&nbsp;<strong>weekday=&lt;n&gt;</strong> where <strong>&lt;n&gt;</strong> is a number between 1 (for Monday) and 7 (for Sunday).<br/>" . "&nbsp;&nbsp;<strong>date=MMM/DD</strong> where <strong>MMM/DD</strong> is a month/day combination: e.g. choosing Apr-1 will start each week on the day of the week on which the 1st of April occurs.<br/>", 'validation' => 'required'));
echo data_entry_helper::text_input(array('label' => 'Period One Contains', 'fieldname' => 'summariser_definition:period_one_contains', 'default' => html::initial_value($values, 'summariser_definition:period_one_contains'), 'helpText' => 'Calculate week one as the week containing this date: value should be in the format <strong>MMM/DD</strong>, which is a month/day combination: e.g. choosing Apr-1 will mean week one contains the date of the 1st of April. Default is the Jan-01', 'validation' => 'required'));
echo data_entry_helper::select(array('label' => 'Attribute to Sum', 'fieldname' => 'summariser_definition:occurrence_attribute_id', 'lookupValues' => $other_data['occAttrs'], 'default' => html::initial_value($values, 'summariser_definition:occurrence_attribute_id'), 'helpText' => 'The occurrence attribute which is used as the count associated with the occurrence. If not provided then each occurrence has a count of one.'));
echo data_entry_helper::checkbox(array('label' => 'Calculate Estimates', 'fieldname' => 'summariser_definition:calculate_estimates', 'default' => html::initial_value($values, 'summariser_definition:calculate_estimates')));
?>
<fieldset><legend>Data Handling</legend>
<?php 
echo data_entry_helper::select(array('label' => 'Summary Data Combination method', 'fieldname' => 'summariser_definition:data_combination_method', 'lookupValues' => array('A' => 'Add all occurrences together', 'M' => 'Choose the value from the sample with the greatest count', 'L' => 'Average over all samples for that location during that period'), 'default' => html::initial_value($values, 'summariser_definition:data_combination_method'), 'helpText' => 'When data is aggregated for a location/period combination, this determines how.'));
echo data_entry_helper::select(array('label' => 'Data Rounding', 'fieldname' => 'summariser_definition:data_rounding_method', 'lookupValues' => array('N' => 'To the nearest integer, .5 rounds up', 'U' => 'Up: To the integer greater than or equal to the value', 'D' => 'Down: To the integer less than or equal to the value', 'X' => 'None (may result in non-integer values)'), 'default' => html::initial_value($values, 'summariser_definition:data_rounding_method'), 'helpText' => 'When data is averaged, this determines what rounding is carried out. Note that anything between 0 and 1 will be rounded up to 1.'));
?>
</fieldset><fieldset><legend>Estimate Generation</legend>
<p>Only one interpolation option (linear) available at the moment.</p>
<?php 
// Only one interpolation option at the moment. This may change in future. Keep hidden control until that point.
// 'L' = 'Linear interpolation'
echo data_entry_helper::hidden_text(array('fieldname' => 'summariser_definition:interpolation', 'default' => 'L'));
echo data_entry_helper::text_input(array('label' => 'Season Limits', 'fieldname' => 'summariser_definition:season_limits', 'default' => html::initial_value($values, 'summariser_definition:season_limits'), 'helpText' => 'This is a comma separated pair of the week numbers for the start and end of the season. When provided, and data is not entered for these weeks, the value is taken as zero, irrespective of the First/Last value processing. First/Last value processing is not carried out outwith these weeks.'));
echo data_entry_helper::select(array('label' => 'First Value Processing', 'fieldname' => 'summariser_definition:first_value', 'lookupValues' => array('X' => 'No special processing', 'H' => 'The entry for the previous week is half the entered value'), 'default' => html::initial_value($values, 'summariser_definition:first_value'), 'helpText' => 'When encountering the first entered value, this determines what happens.'));
echo data_entry_helper::select(array('label' => 'Last Value Processing', 'fieldname' => 'summariser_definition:last_value', 'lookupValues' => array('X' => 'No special processing', 'H' => 'The entry for the next week is half the entered value'), 'default' => html::initial_value($values, 'summariser_definition:last_value'), 'helpText' => 'When encountering the last entered value, this determines what happens.'));
?>
</fieldset>
<?php 
echo $metadata;
echo html::form_buttons($existing, false, false);
data_entry_helper::$dumped_resources[] = 'jquery';
data_entry_helper::$dumped_resources[] = 'jquery_ui';
data_entry_helper::$dumped_resources[] = 'fancybox';
echo data_entry_helper::dump_javascript();
?>
</fieldset>
</form>
开发者ID:BirenRathod,项目名称:indicia-code,代码行数:31,代码来源:summariser_definition_edit.php

示例13: reportFilterBlock

 /**
  * Returns controls allowing a records filter to be defined and associated with the group. 
  * @param array $args Form configuration arguments
  * @return string HTML to output
  */
 private static function reportFilterBlock($args, $auth, &$hiddenPopupDivs)
 {
     $r = '';
     $hiddenPopupDivs = '';
     if ($args['include_report_filter']) {
         $r .= '<p>' . lang::get('LANG_Filter_Instruct') . '</p>';
         $r .= '<label>' . lang::get(ucfirst(self::$groupType) . ' parameters') . ':</label>';
         $r .= report_filter_panel($auth['read'], array('allowLoad' => false, 'allowSave' => false, 'filterTypes' => $args['filter_types'], 'embedInExistingForm' => true), $args['website_id'], $hiddenPopupDivs);
         // fields to auto-create a filter record for this group's defined set of records
         $r .= data_entry_helper::hidden_text(array('fieldname' => 'filter:id'));
         $r .= '<input type="hidden" name="filter:title" id="filter-title-val"/>';
         $r .= '<input type="hidden" name="filter:definition" id="filter-def-val"/>';
         $r .= '<input type="hidden" name="filter:sharing" value="R"/>';
     }
     return $r;
 }
开发者ID:BirenRathod,项目名称:drupal-6,代码行数:21,代码来源:group_edit.php

示例14:

<p>This tab allows you to generate a piece of text which describes the terms in a termlist. The text generated can
  be used to recreate the same termlist on another warehouse. It is therefore ideal for migrating development
  or test versions of your surveys to the live warehouse server.</p>
<?php 
require_once DOCROOT . 'client_helpers/data_entry_helper.php';
echo data_entry_helper::textarea(array('label' => 'Exported termlist contents', 'fieldname' => 'export_termlist_contents', 'cols' => 100, 'rows' => 8, 'helpText' => 'Copy this text to the clipboard. You can then paste it into another termlist on another warehouse to clone the content.', 'default' => $export));
?>
<form class="iform" action="<?php 
echo url::site();
?>
termlist_export/save" method="post" id="entry-form"">
<fieldset>
<?php 
echo data_entry_helper::textarea(array('label' => 'Import termlist contents', 'fieldname' => 'import_termlist_contents', 'cols' => 100, 'rows' => 8, 'helpText' => 'Paste in the export of another termlist to import its terms.'));
echo data_entry_helper::hidden_text(array('fieldname' => 'termlist_id', 'default' => $termlistId));
echo '<input type="submit" name="submit" value="Import" class="ui-corner-all ui-state-default button ui-priority-primary" />' . "\n";
data_entry_helper::link_default_stylesheet();
echo data_entry_helper::dump_javascript();
?>
</fieldset>
</form>
开发者ID:BirenRathod,项目名称:indicia-code,代码行数:21,代码来源:index.php

示例15: foreach

 */
require_once DOCROOT . 'client_helpers/data_entry_helper.php';
$readAuth = data_entry_helper::get_read_auth(0 - $_SESSION['auth_user']->id, kohana::config('indicia.private_key'));
?>
<p>This page allows you to specify the details of a survey in which samples and records can be organised.</p>
<form class="cmxform" action="<?php 
echo url::site() . 'survey/save';
?>
" method="post" id="survey-edit">
<?php 
echo $metadata;
?>
<fieldset>
<legend>Survey dataset details</legend>
<?php 
echo data_entry_helper::hidden_text(array('fieldname' => 'survey:id', 'default' => html::initial_value($values, 'survey:id')));
echo data_entry_helper::text_input(array('label' => 'Title', 'fieldname' => 'survey:title', 'default' => html::initial_value($values, 'survey:title'), 'validation' => 'required', 'helpText' => 'Provide a title for your survey dataset'));
echo data_entry_helper::textarea(array('label' => 'Description', 'fieldname' => 'survey:description', 'default' => html::initial_value($values, 'survey:description'), 'validation' => 'required', 'helpText' => 'Provide an optional description of your survey to help when browsing survey datasets on the warehouse'));
echo data_entry_helper::autocomplete(array('label' => 'Parent survey', 'fieldname' => 'survey:parent_id', 'table' => 'survey', 'captionField' => 'title', 'valueField' => 'id', 'extraParams' => $readAuth, 'default' => html::initial_value($values, 'survey:parent_id'), 'defaultCaption' => html::initial_value($values, 'parent:title'), 'helpText' => 'Set a parent for your survey to allow grouping of survey datasets in reports'));
echo data_entry_helper::select(array('label' => 'Website', 'fieldname' => 'survey:website_id', 'default' => html::initial_value($values, 'survey:website_id'), 'lookupValues' => $other_data['websites'], 'helpText' => 'The survey must belong to a website registration'));
?>
</fieldset>
<?php 
if (array_key_exists('attributes', $values) && count($values['attributes']) > 0) {
    ?>
 <fieldset>
 <legend>Custom attributes</legend>
 <ol>
 <?php 
    foreach ($values['attributes'] as $attr) {
        $name = 'srvAttr:' . $attr['survey_attribute_id'];
开发者ID:BirenRathod,项目名称:indicia-code,代码行数:31,代码来源:survey_edit.php


注:本文中的data_entry_helper::hidden_text方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。