當前位置: 首頁>>代碼示例>>PHP>>正文


PHP data_entry_helper::get_population_data方法代碼示例

本文整理匯總了PHP中data_entry_helper::get_population_data方法的典型用法代碼示例。如果您正苦於以下問題:PHP data_entry_helper::get_population_data方法的具體用法?PHP data_entry_helper::get_population_data怎麽用?PHP data_entry_helper::get_population_data使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在data_entry_helper的用法示例。


在下文中一共展示了data_entry_helper::get_population_data方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: group_authorise_form

/**
 * List of methods that assist with handling recording groups.
 * @package Client
 * @subpackage PrebuiltForms.
 */
function group_authorise_form($args, $readAuth)
{
    if (!empty($args['limit_to_group_id']) && $args['limit_to_group_id'] !== (empty($_GET['group_id']) ? '' : $_GET['group_id'])) {
        // page owned by a different group, so throw them out
        hostsite_show_message(lang::get('This page is a private recording group page which you cannot access.'), 'alert');
        hostsite_goto_page('<front>');
    }
    if (!empty($_GET['group_id'])) {
        // loading data into a recording group. Are they a member or is the page public?
        // @todo: consider performance - 2 web services hits required to check permissions.
        if (hostsite_get_user_field('indicia_user_id')) {
            $gu = data_entry_helper::get_population_data(array('table' => 'groups_user', 'extraParams' => $readAuth + array('group_id' => $_GET['group_id'], 'user_id' => hostsite_get_user_field('indicia_user_id')), 'nocache' => true));
        } else {
            $gu = array();
        }
        $gp = data_entry_helper::get_population_data(array('table' => 'group_page', 'extraParams' => $readAuth + array('group_id' => $_GET['group_id'], 'path' => drupal_get_path_alias($_GET['q']))));
        if (count($gp) === 0) {
            hostsite_show_message(lang::get('You are trying to access a page which is not available for this group.'), 'alert');
            hostsite_goto_page('<front>');
        } elseif (count($gu) === 0 && $gp[0]['administrator'] !== NULL) {
            // not a group member, so throw them out
            hostsite_show_message(lang::get('You are trying to access a page for a group you do not belong to.'), 'alert');
            hostsite_goto_page('<front>');
        }
    }
}
開發者ID:BirenRathod,項目名稱:indicia-code,代碼行數:31,代碼來源:groups.php

示例2: get_form_html

 protected static function get_form_html($args, $auth, $attributes)
 {
     global $user;
     data_entry_helper::$javascript .= "\n      var sampleCreatedOn;\n      var lockingDate;\n    ";
     //Test if the sample date is less than the locking date, if it is then lock the form.
     if (!empty($_GET['sample_id']) && !empty($args['locking_date']) && !in_array('administrator', $user->roles)) {
         $sampleData = data_entry_helper::get_population_data(array('table' => 'sample', 'extraParams' => $auth['read'] + array('id' => $_GET['sample_id'], 'view' => 'detail')));
         //The date also has a time element. However this breaks javascript new date, so just get first part of the date (remove time).
         //(the line below just gets the part of the string before the space).
         $sampleCreatedOn = strtok($sampleData[0]['created_on'], ' ');
         if (!empty($sampleCreatedOn)) {
             data_entry_helper::$javascript .= "\n          sampleCreatedOn = new Date('" . $sampleCreatedOn . "');\n          lockingDate = new Date('" . $args['locking_date'] . "');\n        ";
         }
     }
     //If the date the sample was created is less than the threshold date set by the user, then
     //lock the form (put simply, old data cannot be edited by the user).
     data_entry_helper::$javascript .= "\n      if (sampleCreatedOn&&lockingDate&&sampleCreatedOn<lockingDate) {  \n        \$('[id*=_lock]').remove();\n \$('.remove-row').remove();\n\n        \$('.scImageLink,.scClonableRow').hide();\n        \$('.edit-taxon-name,.remove-row').hide();\n        \$('#disableDiv').find('input, textarea, text, button, select').attr('disabled','disabled');\n      }";
     //remove default validation mode of 'message' as species grid goes spazzy
     data_entry_helper::$validation_mode = array('colour');
     //Div that can be used to disable page when required
     $r = '<div id = "disableDiv">';
     $r .= parent::get_form_html($args, $auth, $attributes);
     $r .= '</div>';
     return $r;
 }
開發者ID:BirenRathod,項目名稱:indicia-code,代碼行數:25,代碼來源:npms_sample_occurrence.php

示例3: 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

示例4: site_description

 public static function site_description($auth, $args, $tabalias, $options, $path)
 {
     if (!empty($_GET[$options['urlParameter']])) {
         $locationCommentData = data_entry_helper::get_population_data(array('table' => 'location', 'extraParams' => $auth['read'] + array('id' => $_GET[$options['urlParameter']], 'view' => 'detail')));
         $r = '<div><h2>' . $locationCommentData[0]['name'] . '</h2><p>' . $locationCommentData[0]['comment'] . '</p></div>';
         return $r;
     }
 }
開發者ID:BirenRathod,項目名稱:indicia-code,代碼行數:8,代碼來源:shorewatch_extensions.php

示例5: 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.
  * @todo: Implement this method 
  */
 public static function get_form($args, $node, $response = null)
 {
     require_once drupal_get_path('module', 'iform') . '/client_helpers/map_helper.php';
     $auth = data_entry_helper::get_read_write_auth($args['website_id'], $args['password']);
     $settings = array('locationTypes' => helper_base::get_termlist_terms($auth, 'indicia:location_types', array('Transect Section')), 'locationId' => isset($_GET['section_id']) ? $_GET['section_id'] : null, 'parentId' => isset($_GET['transect_id']) ? $_GET['transect_id'] : null);
     if ($settings['parentId']) {
         $parent = data_entry_helper::get_population_data(array('table' => 'location', 'extraParams' => $auth['read'] + array('view' => 'detail', 'id' => $settings['parentId'], 'deleted' => 'f'), 'nocache' => true));
         $settings['parent'] = $parent[0];
     } else {
         return 'This form must be called with a parent transect_id parameter.';
     }
     $settings['sections'] = data_entry_helper::get_population_data(array('table' => 'location', 'extraParams' => $auth['read'] + array('view' => 'detail', 'parent_id' => $settings['parentId'], 'deleted' => 'f'), 'nocache' => true));
     if ($settings['locationId']) {
         data_entry_helper::load_existing_record($auth['read'], 'location', $settings['locationId']);
     } else {
         data_entry_helper::$entity_to_load['location:code'] = 'S' . (count($settings['sections']) + 1);
     }
     $settings['attributes'] = data_entry_helper::getAttributes(array('id' => $settings['locationId'], 'valuetable' => 'location_attribute_value', 'attrtable' => 'location_attribute', 'key' => 'location_id', 'fieldprefix' => 'locAttr', 'extraParams' => $auth['read'], 'survey_id' => $args['survey_id'], 'location_type_id' => $settings['locationTypes'][0]['id']));
     if (data_entry_helper::$entity_to_load['location:code']) {
         $r = '<form method="post" id="input-form">';
     }
     $r .= $auth['write'];
     $r .= '<div id="controls">';
     $customAttributeTabs = array_merge(array('Section' => array('[*]')), get_attribute_tabs($settings['attributes']));
     if (count($customAttributeTabs) > 1) {
         $headerOptions = array('tabs' => array());
         foreach ($customAttributeTabs as $tab => $content) {
             $alias = preg_replace('/[^a-zA-Z0-9]/', '', strtolower($tab));
             $headerOptions['tabs']['#' . $alias] = lang::get($tab);
         }
         $r .= data_entry_helper::tab_header($headerOptions);
         data_entry_helper::enable_tabs(array('divId' => 'controls', 'style' => $args['interface'], 'progressBar' => isset($args['tabProgress']) && $args['tabProgress'] == true));
     }
     foreach ($customAttributeTabs as $tab => $content) {
         if ($tab == 'Section') {
             $r .= self::get_section_tab($auth, $args, $settings);
         } else {
             $alias = preg_replace('/[^a-zA-Z0-9]/', '', strtolower($tab));
             $r .= "\n<div id=\"{$alias}\">\n";
             $r .= get_attribute_html($settings['attributes'], $args, array('extraParams' => $auth['read']), $tab);
             $r .= "</div>\n";
         }
     }
     $r .= '</div>';
     // controls
     $r .= '</form>';
     data_entry_helper::link_default_stylesheet();
     if (function_exists('drupal_set_breadcrumb')) {
         $breadcrumb = array();
         $breadcrumb[] = l('Home', '<front>');
         $breadcrumb[] = l('Sites', $args['sites_list_path']);
         $breadcrumb[] = l($settings['parent']['name'], $args['transect_edit_path'], array('query' => array('id' => $settings['parentId'])));
         $breadcrumb[] = $settings['locationId'] ? data_entry_helper::$entity_to_load['location:name'] : lang::get('new section');
         drupal_set_breadcrumb($breadcrumb);
     }
     return $r;
 }
開發者ID:BirenRathod,項目名稱:drupal-6,代碼行數:67,代碼來源:sectioned_transects_edit_section.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)
 {
     if (!($user_id = hostsite_get_user_field('indicia_user_id'))) {
         return self::abort('Please ensure that you\'ve filled in your surname on your user profile before joining a group.', $args);
     }
     if (empty($_GET['group_id'])) {
         return self::abort('This form must be called with a group_id in the URL parameters.', $args);
     }
     $r = '';
     $auth = data_entry_helper::get_read_write_auth($args['website_id'], $args['password']);
     $group = data_entry_helper::get_population_data(array('table' => 'group', 'extraParams' => $auth['read'] + array('id' => $_GET['group_id']), 'nocache' => true));
     if (count($group) !== 1) {
         return self::abort('The group you\'ve requested membership of does not exist.', $args);
     }
     iform_load_helpers(array('submission_builder'));
     $group = $group[0];
     // Check for an existing group user record
     $existing = data_entry_helper::get_population_data(array('table' => 'groups_user', 'extraParams' => $auth['read'] + array('group_id' => $_GET['group_id'], 'user_id' => $user_id), 'nocache' => true));
     if (count($existing)) {
         if ($existing[0]['pending'] === 'true') {
             // if a previous request was made and unapproved when the group was request only, but the group is now public, we can approve their existing
             // groups_user record.
             if ($group['joining_method'] === 'P') {
                 $data = array('groups_user:id' => $existing[0]['id'], 'groups_user:pending' => 'f');
                 $wrap = submission_builder::wrap($data, 'groups_user');
                 $r = data_entry_helper::forward_post_to('groups_user', $wrap, $auth['write_tokens']);
                 return self::success($auth, $group, $args);
             } else {
                 return self::abort("You've already got a membership request for {$group['title']} pending approval.", $args);
             }
         } else {
             return self::abort("You're already a member of {$group['title']}.", $args);
         }
     } else {
         $data = array('groups_user:group_id' => $group['id'], 'groups_user:user_id' => $user_id);
         // request only, so make the groups_user record pending approval
         if ($group['joining_method'] === 'R') {
             $data['groups_user:pending'] = 't';
         }
         $wrap = submission_builder::wrap($data, 'groups_user');
         $r = data_entry_helper::forward_post_to('groups_user', $wrap, $auth['write_tokens']);
         if (!isset($r['success'])) {
             return self::abort('An error occurred whilst trying to update your group membership.', $args);
         } elseif ($group['joining_method'] === 'R') {
             return self::abort("Your request to join {$group['title']} is now awaiting approval.", $args);
         } else {
             return self::success($auth, $group, $args);
         }
     }
     return $r;
 }
開發者ID:BirenRathod,項目名稱:indicia-code,代碼行數:60,代碼來源:group_join.php

示例7: 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)
 {
     if (empty($_GET['group_id'])) {
         return 'This page needs a group_id URL parameter.';
     }
     global $base_url;
     global $user;
     iform_load_helpers(array('data_entry_helper'));
     data_entry_helper::$javascript .= "indiciaData.nodeId=" . $node->nid . ";\n";
     data_entry_helper::$javascript .= "indiciaData.baseUrl='" . $base_url . "';\n";
     data_entry_helper::$javascript .= "indiciaData.currentUsername='" . $user->name . "';\n";
     //Translations for the comment that goes into occurrence_comments when a record is verified or rejected.
     data_entry_helper::$javascript .= 'indiciaData.verifiedTranslation = "' . lang::get('Verified') . "\";\n";
     data_entry_helper::$javascript .= 'indiciaData.rejectedTranslation = "' . lang::get('Rejected') . "\";\n";
     self::$auth = data_entry_helper::get_read_write_auth($args['website_id'], $args['password']);
     group_authorise_form($args, self::$auth['read']);
     $group = data_entry_helper::get_population_data(array('table' => 'group', 'extraParams' => self::$auth['read'] + array('id' => $_GET['group_id'], 'view' => 'detail')));
     $group = $group[0];
     hostsite_set_page_title("{$group['title']}: {$node->title}");
     $def = json_decode($group['filter_definition'], true);
     $defstring = '';
     // reconstruct this as a string to feed into dynamic report explorer
     foreach ($def as $key => $value) {
         if ($key) {
             $value = is_array($value) ? json_encode($value) : $value;
             $defstring .= "{$key}={$value}\n";
             if ($key === 'indexed_location_id' || $key === 'indexed_location_list' || $key === 'location_id' || $key === 'location_list') {
                 $args['location_boundary_id'] = $value;
             } elseif (($key === 'taxon_group_id' || $key === 'taxon_group_list') && strpos($value, ',') === FALSE) {
                 // if the report is locked to a single taxon group, then we don't need taxonomy columns.
                 $args['skipped_report_columns'] = array('taxon_group', 'taxonomy');
             }
         }
     }
     if (empty($_GET['implicit'])) {
         // no need for a group user filter
         $args['param_presets'] = implode("\n", array($args['param_presets'], $defstring));
     } else {
         // filter to group users - either implicitly, or only if they explicitly submitted to the group
         $prefix = $_GET['implicit'] === 'true' || $_GET['implicit'] === 't' ? 'implicit_' : '';
         // add the group parameters to the preset parameters passed to all reports on this page
         $args['param_presets'] = implode("\n", array($args['param_presets'], $defstring, "{$prefix}group_id=" . $_GET['group_id']));
     }
     $args['param_presets'] .= "\n";
     if (!empty($args['hide_standard_param_filter'])) {
         data_entry_helper::$javascript .= "\$('#standard-params').hide();\n";
     }
     return parent::get_form($args, $node);
 }
開發者ID:BirenRathod,項目名稱:indicia-code,代碼行數:58,代碼來源:group_home.php

示例8: 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)
 {
     if (!($user_id = hostsite_get_user_field('indicia_user_id'))) {
         return self::abort('Please ensure that you\'ve filled in your surname on your user profile before leaving a group.', $args);
     }
     if (empty($_GET['group_id'])) {
         return self::abort('This form must be called with a group_id in the URL parameters.', $args);
     }
     $r = '';
     $auth = data_entry_helper::get_read_write_auth($args['website_id'], $args['password']);
     $group = data_entry_helper::get_population_data(array('table' => 'group', 'extraParams' => $auth['read'] + array('id' => $_GET['group_id']), 'nocache' => true));
     if (count($group) !== 1) {
         return self::abort('The group you\'ve requested membership of does not exist.', $args);
     }
     iform_load_helpers(array('submission_builder'));
     $group = $group[0];
     // Check for an existing group user record
     $existing = data_entry_helper::get_population_data(array('table' => 'groups_user', 'extraParams' => $auth['read'] + array('group_id' => $_GET['group_id'], 'user_id' => $user_id), 'nocache' => true));
     if (count($existing) !== 1) {
         return self::abort('You are not a member of this group.', $args);
     }
     if (!empty($_POST['response']) && $_POST['response'] === lang::get('Cancel')) {
         drupal_goto($args['groups_page_path']);
     } elseif (!empty($_POST['response']) && $_POST['response'] === lang::get('Confirm')) {
         $data = array('groups_user:id' => $existing[0]['id'], 'groups_user:group_id' => $group['id'], 'groups_user:user_id' => $user_id, 'deleted' => 't');
         $wrap = submission_builder::wrap($data, 'groups_user');
         $response = data_entry_helper::forward_post_to('groups_user', $wrap, $auth['write_tokens']);
         if (isset($response['success'])) {
             hostsite_show_message("You are no longer participating in {$group['title']}!");
             drupal_goto($args['groups_page_path']);
         } else {
             return self::abort('An error occurred whilst trying to update your group membership.');
         }
     } else {
         // First access of the form. Let's get confirmation
         $reload = data_entry_helper::get_reload_link_parts();
         $reloadpath = $reload['path'] . '?' . data_entry_helper::array_to_query_string($reload['params']);
         $r = '<form action="' . $reloadpath . '" method="POST"><fieldset>';
         $r .= '<legend>' . lang::get('Confirmation') . '</legend>';
         $r .= '<input type="hidden" name="leave" value="1" />';
         $r .= '<p>' . lang::get('Are you sure you want to stop participating in {1}?', $group['title']) . '</p>';
         $r .= '<input type="submit" value="' . lang::get('Confirm') . '" name="response" />';
         $r .= '<input type="submit" value="' . lang::get('Cancel') . '" name="response" />';
         $r .= '</fieldset></form>';
     }
     return $r;
 }
開發者ID:joewoodhouse,項目名稱:client_helpers,代碼行數:56,代碼來源:group_leave.php

示例9: get_form

 /**
  * Return the Indicia form code
  * @param array $args Input parameters.
  * @param array $node Drupal node object
  * @param array $response Response from Indicia services after posting a verification.
  * @return HTML string
  */
 public static function get_form($args, $node, $response)
 {
     iform_load_helpers(array('import_helper'));
     $auth = import_helper::get_read_write_auth($args['website_id'], $args['password']);
     group_authorise_form($args, $auth['read']);
     if ($args['model'] == 'url') {
         if (!isset($_GET['type'])) {
             return "This form is configured so that it must be called with a type parameter in the URL";
         }
         $model = $_GET['type'];
     } else {
         $model = $args['model'];
     }
     if (isset($args['presetSettings'])) {
         $presets = get_options_array_with_user_data($args['presetSettings']);
         $presets = array_merge(array('website_id' => $args['website_id'], 'password' => $args['password']), $presets);
     } else {
         $presets = array('website_id' => $args['website_id'], 'password' => $args['password']);
     }
     if (!empty($_GET['group_id'])) {
         // loading data into a recording group.
         $group = data_entry_helper::get_population_data(array('table' => 'group', 'extraParams' => $auth['read'] + array('id' => $_GET['group_id'], 'view' => 'detail')));
         $group = $group[0];
         $presets['sample:group_id'] = $_GET['group_id'];
         hostsite_set_page_title(lang::get('Import data into the {1} group', $group['title']));
         // if a single survey specified for this group, then force the data into the correct survey
         $filterdef = json_decode($group['filter_definition'], true);
         if (!empty($filterdef['survey_list_op']) && $filterdef['survey_list_op'] === 'in' && !empty($filterdef['survey_list'])) {
             $surveys = explode(',', $filterdef['survey_list']);
             if (count($surveys) === 1) {
                 $presets['survey_id'] = $surveys[0];
             }
         }
     }
     try {
         $r = import_helper::importer(array('model' => $model, 'auth' => $auth, 'presetSettings' => $presets));
     } catch (Exception $e) {
         hostsite_show_message($e->getMessage(), 'warning');
         $reload = import_helper::get_reload_link_parts();
         unset($reload['params']['total']);
         unset($reload['params']['uploaded_csv']);
         $reloadpath = $reload['path'] . '?' . import_helper::array_to_query_string($reload['params']);
         $r = "<p>" . lang::get('Would you like to ') . "<a href=\"{$reloadpath}\">" . lang::get('import another file?') . "</a></p>";
     }
     return $r;
 }
開發者ID:joewoodhouse,項目名稱:client_helpers,代碼行數:53,代碼來源:importer.php

示例10: breadcrumb

 public function breadcrumb($auth, $args, $tabalias, $options)
 {
     global $base_url;
     $breadCrumbLocationNamesArray = array();
     //The location ids to display in the breadcrumb are held in the URL if the user
     //is returning from another page.
     $breadCrumbLocationIdsArray = explode(',', $_GET['breadcrumb']);
     $locationRecords = data_entry_helper::get_population_data(array('table' => 'location', 'extraParams' => $auth['read'], 'nocache' => true));
     //Get the names associated with the ids
     foreach ($breadCrumbLocationIdsArray as $breadCrumbLocationId) {
         foreach ($locationRecords as $locationRecord) {
             if ($locationRecord['id'] === $breadCrumbLocationId) {
                 $breadCrumbLocationNamesArray[] = $locationRecord['name'];
             }
         }
     }
     $r = '';
     //Only display links to homepage if we have links to show
     if (!empty($breadCrumbLocationNamesArray)) {
         $r .= '<label><h4>Links to homepage</h4></label></br>';
         $r .= '<div>';
         $r .= '<ul id="homepage-breadcrumb">';
         //Loop through the links to show
         foreach ($breadCrumbLocationNamesArray as $num => $breadCrumbLocationName) {
             //For each link back to the homepage, we need to give the homepage some locations IDs to rebuild
             //its breadcrumb with. So we need to include ids of any locations that are "above" the location we are linking back with.
             //e.g. If the link is for Guildford, then we would need to supply the ids for Guildford, Surrey and South England
             //as well to the homepage can make a full breadcrumb trail to guildford.
             if (empty($breadCrumbParamToSendBack)) {
                 $breadCrumbParamToSendBack = 'breadcrumb=' . $breadCrumbLocationIdsArray[$num];
             } else {
                 $breadCrumbParamToSendBack .= ',' . $breadCrumbLocationIdsArray[$num];
             }
             $r .= '<li id="breadcrumb-part-"' . $num . '>';
             //The breadcrumb link is a name, with a url back to the homepage containing ids for the homepage
             //to show in its breadcrumb
             $r .= '<a href="' . $base_url . (variable_get('clean_url', 0) ? '' : '?q=') . $options['homepage_path'] . (variable_get('clean_url', 0) ? '?' : '&') . $breadCrumbParamToSendBack . '">' . $breadCrumbLocationName . '<a>';
             $r .= '</li>';
         }
         $r .= '</ul></div>';
     }
     return $r;
 }
開發者ID:BirenRathod,項目名稱:drupal-6,代碼行數:43,代碼來源:cudi_breadcrumb.php

示例11: 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.
  * @todo: Implement this method 
  */
 public static function get_form($args, $node, $response = null)
 {
     if (empty($_GET['group_id'])) {
         return 'This page needs a group_id URL parameter.';
     }
     require_once 'includes/map.php';
     require_once 'includes/groups.php';
     global $indicia_templates;
     iform_load_helpers(array('report_helper', 'map_helper'));
     $conn = iform_get_connection_details($node);
     $readAuth = report_helper::get_read_auth($conn['website_id'], $conn['password']);
     report_helper::$javascript .= "indiciaData.website_id={$conn['website_id']};\n";
     report_helper::$javascript .= "indiciaData.nodeId={$node->nid};\n";
     group_authorise_form($args, $readAuth);
     $group = data_entry_helper::get_population_data(array('table' => 'group', 'extraParams' => $readAuth + array('id' => $_GET['group_id'], 'view' => 'detail')));
     $group = $group[0];
     hostsite_set_page_title("{$group['title']}: {$node->title}");
     $actions = array();
     if (!empty($args['edit_location_path'])) {
         $actions[] = array('caption' => 'edit', 'url' => '{rootFolder}' . $args['edit_location_path'], 'urlParams' => array('group_id' => $_GET['group_id'], 'location_id' => '{location_id}'));
     }
     $actions[] = array('caption' => 'remove', 'javascript' => "remove_location_from_group({groups_location_id});");
     $leftcol = report_helper::report_grid(array('readAuth' => $readAuth, 'dataSource' => 'library/locations/locations_for_groups', 'sendOutputToMap' => true, 'extraParams' => array('group_id' => $_GET['group_id']), 'rowId' => 'location_id', 'columns' => array(array('display' => 'Actions', 'actions' => $actions, 'caption' => 'edit', 'url' => '{rootFolder}'))));
     $leftcol .= '<fieldset><legend>' . lang::Get('Add sites to the group') . '</legend>';
     $leftcol .= '<p>' . lang::get('LANG_Add_Sites_Instruct') . '</p>';
     if (!empty($args['edit_location_path'])) {
         $leftcol .= lang::get('Either') . ' <a class="button" href="' . hostsite_get_url($args['edit_location_path'], array('group_id' => $_GET['group_id'])) . '">' . lang::get('enter details of a new site') . '</a><br/>';
     }
     $leftcol .= data_entry_helper::select(array('label' => lang::get('Or, add an existing site'), 'fieldname' => 'add_existing_location_id', 'report' => 'library/locations/locations_available_for_group', 'caching' => false, 'blankText' => lang::get('<please select>'), 'valueField' => 'location_id', 'captionField' => 'name', 'extraParams' => $readAuth + array('group_id' => $_GET['group_id'], 'user_id' => hostsite_get_user_field('indicia_user_id', 0)), 'afterControl' => '<button id="add-existing">Add</button>'));
     $leftcol .= '</fieldset>';
     // @todo Link existing My Site to group. Need a new report to list sites I created, with sites already in the group
     // removed. Show in a drop down with an add button. Adding must create the groups_locations record, plus refresh
     // the grid and refresh the drop down.
     // @todo set destination after saving added site
     $map = map_helper::map_panel(iform_map_get_map_options($args, $readAuth), iform_map_get_ol_options($args));
     $r = str_replace(array('{col-1}', '{col-2}'), array($leftcol, $map), $indicia_templates['two-col-50']);
     data_entry_helper::$javascript .= "indiciaData.group_id={$_GET['group_id']};\n";
     return $r;
 }
開發者ID:BirenRathod,項目名稱:indicia-code,代碼行數:49,代碼來源:group_locations.php

示例12: get_form

 /**
  * Return the generated form output.
  * @return Form HTML.
  * @todo: Implement this method
  */
 public static function get_form($args)
 {
     $readAuth = data_entry_helper::get_read_auth($args['website_id'], $args['password']);
     // setup the map options
     $options = iform_map_get_map_options($args, $readAuth);
     $olOptions = iform_map_get_ol_options($args);
     if (array_key_exists('table', $_GET) && $_GET['table'] == 'sample') {
         // Use a cUrl request to get the data from Indicia which contains the value we need to filter against
         // Read the record that was just posted.
         $fetchOpts = array('table' => 'occurrence', 'extraParams' => $readAuth + array('sample_id' => $_GET['id'], 'view' => 'detail'));
         // @todo Error handling on the response
         $occurrence = data_entry_helper::get_population_data($fetchOpts);
     }
     // Add the 3 distribution layers if present. Reverse the order so 1st layer is topmost
     $layerName = self::build_distribution_layer(3, $args, $occurrence);
     if ($layerName) {
         $options['layers'][] = $layerName;
     }
     $layerName = self::build_distribution_layer(2, $args, $occurrence);
     if ($layerName) {
         $options['layers'][] = $layerName;
     }
     $layerName = self::build_distribution_layer(1, $args, $occurrence);
     if ($layerName) {
         $options['layers'][] = $layerName;
     }
     // Now output a grid of the occurrences that were just saved.
     if (isset($occurrence)) {
         $r .= "<table class=\"submission\"><thead><tr><th>Species</th><th>Date</th><th>Spatial Reference</th></tr></thead>\n";
         $r .= "<tbody>\n";
         foreach ($occurrence as $record) {
             $r .= "<tr><td>" . $record['taxon'] . "</td><td>" . $record['date_start'] . "</td><td>" . $record['entered_sref'] . "</td></tr>\n";
         }
         $r .= "</tbody></table>\n";
     }
     $r .= data_entry_helper::map_panel($options, $olOptions);
     return $r;
 }
開發者ID:BirenRathod,項目名稱:drupal-6,代碼行數:43,代碼來源:my_dot_map.php

示例13: 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.
  * @todo: Implement this method 
  */
 public static function get_form($args, $node, $response = null)
 {
     if (empty($_GET['group_id'])) {
         return 'This page needs a group_id URL parameter.';
     }
     self::$auth = data_entry_helper::get_read_write_auth($args['website_id'], $args['password']);
     $group = data_entry_helper::get_population_data(array('table' => 'group', 'extraParams' => self::$auth['read'] + array('id' => $_GET['group_id'])));
     $group = $group[0];
     hostsite_set_page_title($group['title']);
     $filter = data_entry_helper::get_population_data(array('table' => 'filter', 'extraParams' => self::$auth['read'] + array('id' => $group['filter_id'])));
     $filter = $filter[0];
     $def = json_decode($filter['definition'], true);
     $defstring = '';
     // reconstruct this as a string to feed into dynamic report explorer
     foreach ($def as $key => $value) {
         if ($key) {
             $defstring .= "{$key}={$value}\n";
         }
     }
     // add the group parameters to the preset parameters passed to all reports on this page
     $args['param_presets'] = implode("\n", array($args['param_presets'], $defstring, "group_id=" . $_GET['group_id']));
     return parent::get_form($args, $node);
 }
開發者ID:BirenRathod,項目名稱:drupal-6,代碼行數:33,代碼來源:group_home.php

示例14: clear_moderation_task_notifications

 /**
  * Clears moderation notifications for a moderator automatically on visiting the page, so then they
  * will get notified about new incoming records.
  */
 public static function clear_moderation_task_notifications($auth, $args, $tabalias, $options, $path)
 {
     //Using 'submission_list' and 'entries' allows us to specify several top-level submissions to the system
     //i.e. we need to be able to submit several notifications.
     $submission['submission_list']['entries'] = array();
     $submission['id'] = 'notification';
     $notifications = data_entry_helper::get_population_data(array('table' => 'notification', 'extraParams' => $auth['read'] + array('acknowledged' => 'f', 'user_id' => hostsite_get_user_field('indicia_user_id'), 'source_type' => 'PT'), 'nocache' => true));
     if (count($notifications) > 0) {
         $auth = data_entry_helper::get_read_write_auth(variable_get('indicia_website_id', 0), variable_get('indicia_password', ''));
         //Setup the structure we need to submit.
         foreach ($notifications as $notification) {
             $data['id'] = 'notification';
             $data['fields']['id']['value'] = $notification['id'];
             $data['fields']['acknowledged']['value'] = 't';
             $submission['submission_list']['entries'][] = $data;
         }
         //Submit the stucture for processing
         $response = data_entry_helper::forward_post_to('save', $submission, $auth['write_tokens']);
         if (!is_array($response) || !array_key_exists('success', $response)) {
             drupal_set_message(print_r($response, true));
         }
     }
     return '';
 }
開發者ID:BirenRathod,項目名稱:indicia-code,代碼行數:28,代碼來源:moderation.php

示例15: informationSheetSurveysReport

 public function informationSheetSurveysReport($auth, $args, $tabalias, $options, $path)
 {
     //The Surveys associated with the Count Unit are held as location_attribute_values so collect these
     $surveysAttributeData = data_entry_helper::get_population_data(array('table' => 'location_attribute_value', 'extraParams' => $auth['read'] + array('location_id' => $_GET['id'], 'location_attribute_id' => $options['surveys_attribute_id']), 'nocache' => true, 'sharing' => $sharing));
     //Create a table to put the data in
     $r = '<div><h3>Surveys</h3><table><tr><th>Name</th><th>Date</th></tr>';
     //Cycle around each Survey associated with the Count Unit and add rows to the grid.
     foreach ($surveysAttributeData as $surveysAttributeDataItem) {
         //The Survey Id and Date are json_encoded in the location_atribute_value so decode.
         $decoded = json_decode($surveysAttributeDataItem['value']);
         //The stored data does not include the Survey name, so we need to collect it.
         $surveysData = data_entry_helper::get_population_data(array('table' => 'survey', 'extraParams' => $auth['read'] + array('id' => $decoded[0]), 'nocache' => true, 'sharing' => $sharing));
         $r .= '<tr><td>';
         $r .= $surveysData[0]['title'];
         $r .= '</td>';
         $r .= '<td>';
         //The second item in the $decoded array holds the date associated with the Survey entry.
         $r .= $decoded[1];
         $r .= '</td>';
         $r .= '</tr>';
     }
     $r .= '</table></div>';
     return $r;
 }
開發者ID:BirenRathod,項目名稱:indicia-code,代碼行數:24,代碼來源:cudi_information_sheet.php


注:本文中的data_entry_helper::get_population_data方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。