Esempio n. 1
0
 function prepareData($zData = '', $sView = 'list')
 {
     // Prepares the data by "enriching" the variable received with links, pictures, etc.
     if (!in_array($sView, array('list', 'entry'))) {
         $sView = 'list';
     }
     // Makes sure it's an array and htmlspecialchars() all the values.
     $zData = parent::prepareData($zData, $sView);
     if ($sView == 'list') {
         $zData['row_id'] = $zData['id'];
         $zData['row_link'] = 'columns/' . $zData['id'];
         // Note: I chose not to use rawurlencode() here!
         $zData['colid_'] = '<A href="' . $zData['row_link'] . '" class="hide">' . $zData['colid'] . '</A>';
         $zData['form_type_'] = lovd_describeFormType($zData);
     } else {
         // Remove unnecessary columns.
         if ($zData['edited_by'] == NULL) {
             // Never been edited.
             unset($this->aColumnsViewEntry['edited_by_'], $this->aColumnsViewEntry['edited_date']);
         }
         // Remove columns based on form type?
         $aFormType = explode('|', $zData['form_type']);
         if ($aFormType[2] != 'select') {
             unset($this->aColumnsViewEntry['select_options']);
         } else {
             unset($this->aColumnsViewEntry['preg_pattern']);
         }
         $zData['mandatory_'] = '<IMG src="gfx/mark_' . $zData['mandatory'] . '.png" alt="" width="11" height="11">';
         $zData['description_legend_short'] = html_entity_decode(str_replace(array("\r", "\n"), ' ', $zData['description_legend_short']));
         $zData['description_legend_full'] = html_entity_decode(str_replace(array("\r", "\n"), ' ', $zData['description_legend_full']));
         $zData['form_type_'] = lovd_describeFormType($zData) . '<BR>' . $zData['form_type'];
         $zData['public_add_'] = '<IMG src="gfx/mark_' . $zData['public_add'] . '.png" alt="" width="11" height="11">';
         $zData['allow_count_all_'] = '<IMG src="gfx/mark_' . $zData['allow_count_all'] . '.png" alt="" width="11" height="11">';
         if ($zData['category'] == 'VariantOnTranscript') {
             // Show genes for which this column is activated.
             $this->aColumnsViewEntry['parent_objects'] = 'Column activated for genes';
             $zData['parent_objects'] = $this->lovd_getObjectLinksHTML($zData['genes'], 'genes/%s');
         } elseif ($zData['category'] == 'Phenotype') {
             // Show diseases for which this column is activated.
             $this->aColumnsViewEntry['parent_objects'] = "Column activated for diseases";
             $zData['parent_objects'] = $this->lovd_getObjectLinksHTML($zData['diseases'], 'diseases/%s');
         } else {
             unset($this->aColumnsViewEntry['parent_objects']);
         }
     }
     // FIXME; for titles use tooltips?
     $zData['active_'] = '<IMG src="gfx/mark_' . (int) $zData['active'] . '.png" alt="" width="11" height="11">';
     $zData['hgvs_'] = '<IMG src="gfx/mark_' . $zData['hgvs'] . '.png" alt="" title="This column is ' . ($zData['hgvs'] ? '' : 'not ') . 'required by the HGVS standards for sequence variant databases" width="11" height="11">';
     $zData['standard_'] = '<IMG src="gfx/mark_' . $zData['standard'] . '.png" alt="" title="This column is ' . ($zData['standard'] ? '' : 'not ') . 'enabled by default" width="11" height="11">';
     $zData['public_view_'] = '<IMG src="gfx/mark_' . $zData['public_view'] . '.png" alt="" width="11" height="11">';
     return $zData;
 }
Esempio n. 2
0
 function prepareData($zData = '', $sView = 'list')
 {
     // Prepares the data by "enriching" the variable received with links, pictures, etc.
     if (!in_array($sView, array('list', 'entry'))) {
         $sView = 'list';
     }
     // Makes sure it's an array and htmlspecialchars() all the values.
     $zData = parent::prepareData($zData, $sView);
     if ($sView == 'list') {
         $zData['row_id'] = $zData['id'];
         if ($this->sObjectID) {
             // Can't use CURRENT_PATH here, because that might resolve to the ajax/viewlist.php file.
             $zData['row_link'] = (ctype_digit($this->sObjectID) ? 'diseases' : 'genes') . '/' . $this->sObjectID . '/columns/' . $zData['colid'];
             // Note: I chose not to use rawurlencode() here!
             $zData['colid_'] = '<A href="' . $zData['row_link'] . '" class="hide">' . $zData['colid'] . '</A>';
         }
         $zData['form_type_'] = lovd_describeFormType($zData);
     } else {
         // Remove unnecessary columns.
         if ($zData['edited_by'] == NULL) {
             // Never been edited.
             unset($this->aColumnsViewEntry['edited_by_'], $this->aColumnsViewEntry['edited_date']);
         }
         // Remove columns based on form type?
         $aFormType = explode('|', $zData['form_type']);
         if ($aFormType[2] != 'select') {
             unset($this->aColumnsViewEntry['select_options']);
         }
         $zData['description_legend_short'] = html_entity_decode(str_replace(array("\r", "\n"), ' ', $zData['description_legend_short']));
         $zData['description_legend_full'] = html_entity_decode(str_replace(array("\r", "\n"), ' ', $zData['description_legend_full']));
         $zData['public_add_'] = '<IMG src="gfx/mark_' . $zData['public_add'] . '.png" alt="" width="11" height="11">';
     }
     // FIXME; for titles use tooltips?
     $zData['mandatory_'] = '<IMG src="gfx/mark_' . $zData['mandatory'] . '.png" alt="" width="11" height="11">';
     $zData['public_view_'] = '<IMG src="gfx/mark_' . $zData['public_view'] . '.png" alt="" width="11" height="11">';
     return $zData;
 }