'Tripal Management', 'description' => "Manage the behavior or Tripal and its various modules.", 'position' => 'right', 'weight' => -5, 'page callback' => 'system_admin_menu_block_page', 'access arguments' => array('administer site configuration'), 'file' => 'system.admin.inc', 'file path' => drupal_get_path('module', 'system'), ); $items['admin/tripal/tripal_jobs'] = array( 'title' => 'Jobs', 'description' => 'Jobs managed by Tripal', 'page callback' => 'tripal_jobs_report', 'access arguments' => array('access administration pages'), 'type' => MENU_NORMAL_ITEM, ); $items['admin/tripal/tripal_jobs/cancel/%'] = array( 'title' => 'Jobs', 'description' => 'Cancel a pending job', 'page callback' => 'tripal_jobs_cancel', 'page arguments' => array(4), 'access arguments' => array('access administration pages'), 'type' => MENU_CALLBACK, ); $items['admin/tripal/tripal_jobs/rerun/%'] = array( 'title' => 'Jobs', 'description' => 'Re-run an existing job.', 'page callback' => 'tripal_jobs_rerun', 'page arguments' => array(4), 'access arguments' => array('access administration pages'), 'type' => MENU_CALLBACK, ); $items['admin/tripal/tripal_jobs/view/%'] = array( 'title' => 'Jobs Details', 'description' => 'View job details.', 'page callback' => 'tripal_jobs_view', 'page arguments' => array(4), 'access arguments' => array('access administration pages'), 'type' => MENU_CALLBACK, ); $items['admin/tripal/tripal_mview/%'] = array( 'title' => 'Materialized View', 'description' => 'Materialized views are used to improve speed of large or complex queries.', 'page callback' => 'tripal_mview_report', 'page arguments' => array(3), 'access arguments' => array('access administration pages'), 'type' => MENU_NORMAL_ITEM, ); $items['admin/tripal/tripal_mviews'] = array( 'title' => 'Materialized Views', 'description' => 'Materialized views are used to improve speed of large or complex queries.', 'page callback' => 'tripal_mviews_report', 'access arguments' => array('access administration pages'), 'type' => MENU_NORMAL_ITEM, ); $items['admin/tripal/tripal_mviews/new'] = array( 'title' => 'Create View', 'description' => 'Materialized views are used to improve speed of large or complex queries.', 'page callback' => 'drupal_get_form', 'page arguments' => array('tripal_mviews_form'), 'access arguments' => array('access administration pages'), 'type' => MENU_NORMAL_ITEM, ); $items['admin/tripal/tripal_mviews/edit/%'] = array( 'title' => 'Edit View', 'page callback' => 'drupal_get_form', 'page arguments' => array('tripal_mviews_form',4), 'access arguments' => array('access administration pages'), 'type' => MENU_NORMAL_ITEM, ); $items['admin/tripal/tripal_mviews/action/%/%'] = array( 'title' => 'Create View', 'description' => 'Materialized views are used to improve speed of large or complex queries.', 'page callback' => 'tripal_mviews_action', 'page arguments' => array(4,5), 'access arguments' => array('access administration pages'), 'type' => MENU_CALLBACK, ); $items['tripal_toggle_box_menu/%/%/%'] = array( 'title' => t('Libraries'), 'page callback' => 'tripal_toggle_box_menu', 'page arguments' => array(1,2,3), 'access arguments' => array('access administration pages'), 'type' => MENU_CALLBACK | MENU_LINKS_TO_PARENT ); $items['admin/tripal/chado_1_11_install'] = array( 'title' => 'Install Chado v1.11', 'description' => 'Installs Chado version 1.11 inside the current Drupal database', 'page callback' => 'drupal_get_form', 'page arguments' => array('tripal_core_chado_v1_11_load_form'), 'access arguments' => array('access administration pages'), 'type' => MENU_NORMAL_ITEM, ); $items['admin/tripal/bulk_load/create'] = array( 'title' => 'Create Bulk Loader', 'description' => 'Create a bulk loader template for loading data into Chado', 'page callback' => 'tripal_core_bulk_loader_create', 'access arguments' => array('access administration pages'), 'type' => MENU_NORMAL_ITEM, ); $items['admin/tripal/bulk_load/step2_get_type/%'] = array( 'title' => 'Create Bulk Loader', 'description' => 'Create a bulk loader template for loading data into Chado', 'page callback' => 'tripal_core_bulk_loader_ahah_step2_feature_type', 'page arguments' => array(4), 'access arguments' => array('access administration pages'), 'type' => MENU_CALLBACK, ); $items['test2'] = array( 'title' => 'test', 'description' => 'test', 'page callback' => 'tripal_core_chado_insert_test', 'access arguments' => array('access administration pages'), 'type' => MENU_CALLBACK, ); return $items; } /** * * * @param $dbname * The name of the database to switch to as indicated in settings.php * Should be either default or chado * * @return * The name of the previously set database * * @ingroup tripal_chado_api */ function tripal_core_is_chado_installed(){ global $db_url, $db_type; // first check if chado is in the db_url of the // settings.php file if(is_array($db_url)){ if(isset($db_url['chado'])){ return true; } } // check to make sure the chado schema exists $sql = "select nspname from pg_catalog.pg_namespace where nspname = 'chado'"; if(db_fetch_object(db_query($sql))){ return true; } return false; } /** * Implements hook_views_api() * * Purpose: Essentially this hook tells drupal that there is views support for * for this module which then includes tripal_core.views.inc where all the * views integration code is * * @ingroup tripal_core */ function tripal_core_views_api() { return array( 'api' => 2.0, ); } /** * * @ingroup tripal_core */ function tripal_core_theme () { return array( 'tripal_core_job_view' => array ( 'arguments' => array('job_id'=> null), 'template' => 'tripal_core_job_view', ), ); } /** * * @ingroup tripal_core */ function tripal_core_job_describe_args($callback,$args){ $new_args = array(); if($callback == 'tripal_update_mview'){ // get this mview details $sql = "SELECT * FROM {tripal_mviews} WHERE mview_id = %d "; $mview = db_fetch_object(db_query($sql,$args[0])); $new_args['View Name'] = $mview->name; } return $new_args; }