'BLAST', 'page callback' => 'drupal_get_form', 'page arguments' => array('blast_nucleotide_form'), 'access arguments' => array('access content'), 'type' => MENU_NORMAL_ITEM, 'expanded' => TRUE, ); $items['blast/report/%'] = array( 'title' => 'Nucleotide BLAST result:', 'page callback' => 'show_blast_output', 'page arguments' => array(2), 'access arguments' => array('access content'), 'type' => MENU_CALLBACK, ); $items['blast/blastn'] = array( 'title' => 'Nucleotide BLAST', 'page callback' => 'drupal_get_form', 'page arguments' => array('blast_nucleotide_form'), 'access arguments' => array('access content'), 'type' => MENU_NORMAL_ITEM ); // $items['blast/blastp'] = array( // 'title' => 'Protein BLAST', // 'page callback' => 'drupal_get_form', // 'page arguments' => array('blast_protein_form'), // 'access arguments' => array('access content'), // 'type' => MENU_NORMAL_ITEM // ); return $items; } /** * Facilitate presenting the result of the blast search * * @param $args * A string containing name of the blast output file. * * @return $result * Return a string containing the blast search output. A link is also provided to let users download the output file. * */ function show_blast_output($args = 'all') { if (preg_match('/^[^\/]*/',$args)) { $full_path_filename = '/var/www/kp-amir/sites/default/files/' . $args; if (file_exists($full_path_filename)) { $result = t('Download your BLAST result', array('@url' => url('sites/default/files/' . $args))); $result .= check_markup(file_get_contents($full_path_filename), 'full_html'); $result = str_replace('','',$result); } else { tripal_report_error( 'blast_ui', TRIPAL_ERROR, 'Unable to open blast results file (%file)', array('%file' => $full_path_filename) ); $result = '

An error was encountered while trying to process your blast results

'; } } else { $result = '

An error was encountered while trying to process your blast results

'; } return $result; }