Example #1
0
    // To save ourselves a lot of code, we'll build the DIV containers as templates.
    $aGraphs = array('Variant type (DNA level, all ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'variants)' => array('variantsTypeDNA_all' => 'All ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'variants', 'variantsTypeDNA_unique' => 'Unique ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'variants'), 'Variant type (DNA level, all ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'pathogenic variants)' => array('variantsTypeDNA_all_pathogenic' => 'All ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'pathogenic variants', 'variantsTypeDNA_unique_pathogenic' => 'Unique ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'pathogenic variants'), 'Variant type (Protein level, all ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'variants) (note: numbers are sums for all transcripts of this gene)' => array('variantsTypeProtein_all' => 'All ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'variants', 'variantsTypeProtein_unique' => 'Unique ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'variants'), 'Variant type (Protein level, all ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'pathogenic variants) (note: numbers are sums for all transcripts of this gene)' => array('variantsTypeProtein_all_pathogenic' => 'All ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'pathogenic variants', 'variantsTypeProtein_unique_pathogenic' => 'Unique ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'pathogenic variants'), 'Variant location (DNA level, all ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'variants) (note: numbers are sums for all transcripts of this gene)' => array('variantsLocations_all' => 'All ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'variants', 'variantsLocations_unique' => 'Unique ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'variants'), 'Variant type (DNA level, all ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'pathogenic variants) (note: numbers are sums for all transcripts of this gene)' => array('variantsLocations_all_pathogenic' => 'All ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'pathogenic variants', 'variantsLocations_unique_pathogenic' => 'Unique ' . ($_AUTH['level'] >= LEVEL_COLLABORATOR ? '' : 'public ') . 'pathogenic variants'));
    foreach ($aGraphs as $sCategory => $aCategory) {
        print '      <H5>' . $sCategory . '</H5>' . "\n" . '      <TABLE border="0" cellpadding="2" cellspacing="0" width="900" style="height : 320px;">' . "\n" . '        <TR valign="top">';
        foreach ($aCategory as $sGraphID => $sTitle) {
            print "\n" . '          <TD width="50%">' . "\n" . '            <B>' . $sTitle . '</B><BR>' . "\n" . '            <DIV id="' . $sGraphID . '" style="width : 325px; height : 250px;"><IMG src="gfx/lovd_loading.gif" alt="Loading..."></DIV><BR><DIV id="' . $sGraphID . '_hover">&nbsp;</DIV></TD>';
        }
        print '</TR></TABLE>' . "\n\n";
    }
    flush();
    $_T->printFooter(false);
    $_G->variantsTypeDNA('variantsTypeDNA_all', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, false);
    $_G->variantsTypeDNA('variantsTypeDNA_unique', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, true);
    $_G->variantsTypeDNA('variantsTypeDNA_all_pathogenic', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, false, true);
    $_G->variantsTypeDNA('variantsTypeDNA_unique_pathogenic', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, true, true);
    $_G->variantsTypeProtein('variantsTypeProtein_all', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, false, false);
    $_G->variantsTypeProtein('variantsTypeProtein_unique', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, true, false);
    $_G->variantsTypeProtein('variantsTypeProtein_all_pathogenic', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, false, true);
    $_G->variantsTypeProtein('variantsTypeProtein_unique_pathogenic', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, true, true);
    $_G->variantsLocations('variantsLocations_all', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, false);
    $_G->variantsLocations('variantsLocations_unique', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, true);
    $_G->variantsLocations('variantsLocations_all_pathogenic', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, false, true);
    $_G->variantsLocations('variantsLocations_unique_pathogenic', $sID, $_AUTH['level'] >= LEVEL_COLLABORATOR, true, true);
    print '</BODY>' . "\n" . '</HTML>' . "\n";
    exit;
}
if (PATH_COUNT == 2 && preg_match('/^[a-z][a-z0-9#@-]*$/i', rawurldecode($_PE[1])) && in_array(ACTION, array('authorize', 'sortCurators'))) {
    // URL: /genes/DMD?authorize
    // URL: /genes/DMD?sortCurators
    // Authorize users to be curators or collaborators for this gene, and/or define the order in which they're shown.
    $sID = rawurldecode($_PE[1]);