|
@@ -31,7 +31,7 @@ function tripal_core_init(){
|
|
|
// variable is always set. In the case where a view needs to query the
|
|
|
// chado schema when it is local to the Drupal database. Otherwise the
|
|
|
// search_path isn't set. When tripal_db_set_active is called it
|
|
|
- // automatically sets the serach path if chado is local to the
|
|
|
+ // automatically sets the serach path if chado is local to the
|
|
|
// Drupal database
|
|
|
$previous = tripal_db_set_active('chado');
|
|
|
tripal_db_set_active($previous);
|
|
@@ -43,11 +43,11 @@ function tripal_core_init(){
|
|
|
if(!db_fetch_object(db_query("SELECT * FROM {cv} WHERE name = 'tripal'"))){
|
|
|
$results = db_query("INSERT INTO {cv} (name,definition) ".
|
|
|
"VALUES ('tripal','Terms used by Tripal for modules to manage data such as that stored in property tables like featureprop, analysisprop, etc')");
|
|
|
- }
|
|
|
+ }
|
|
|
if(!db_fetch_object(db_query("SELECT * FROM {db} WHERE name = 'tripal'"))){
|
|
|
- $results = db_query("INSERT INTO {db} (name,description) ".
|
|
|
+ $results = db_query("INSERT INTO {db} (name,description) ".
|
|
|
"VALUES ('tripal','Used as a database placeholder for tripal defined objects such as tripal cvterms')");
|
|
|
- }
|
|
|
+ }
|
|
|
tripal_db_set_active($previous_db); // now use drupal database
|
|
|
}
|
|
|
|
|
@@ -56,8 +56,8 @@ function tripal_core_init(){
|
|
|
$theme_dir = drupal_get_path('theme', 'tripal');
|
|
|
$clean_urls = variable_get('clean_url', 0);
|
|
|
drupal_add_js("
|
|
|
- var baseurl = '$base_url';
|
|
|
- var themedir = '$theme_dir';
|
|
|
+ var baseurl = '$base_url';
|
|
|
+ var themedir = '$theme_dir';
|
|
|
var isClean = $clean_urls;",'inline');
|
|
|
|
|
|
// make sure the date time settings are the way Tripal will insert them
|
|
@@ -123,7 +123,7 @@ function tripal_core_menu() {
|
|
|
'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
|
|
|
+ 'type' => MENU_CALLBACK | MENU_LINKS_TO_PARENT
|
|
|
);
|
|
|
$items['admin/tripal/chado_1_11_install'] = array(
|
|
|
'title' => 'Install Chado v1.11',
|
|
@@ -179,47 +179,39 @@ function tripal_core_menu() {
|
|
|
'access arguments' => array('access administration pages'),
|
|
|
'type' => MENU_CALLBACK,
|
|
|
);
|
|
|
- $items['admin/tripal/views/integration'] = array(
|
|
|
- 'title' => t('Drupal Views Integration'),
|
|
|
- 'description' => t('Allows you to select existing materialized views and provide details for integration with Drupal Views.'),
|
|
|
- 'page callback' => 'drupal_get_form',
|
|
|
- 'page arguments' => array('tripal_core_views_integration_admin_form'),
|
|
|
- 'access arguments' => array('manage tripal_views_integration'),
|
|
|
- 'type' => MENU_NORMAL_ITEM,
|
|
|
- );
|
|
|
- $items['admin/tripal/views/integration/mviews'] = array(
|
|
|
- 'title' => t('Integrated MViews'),
|
|
|
- 'description' => t('Allows you to select existing materialized views and provide details for integration with Drupal Views.'),
|
|
|
- 'page callback' => 'drupal_get_form',
|
|
|
- 'page arguments' => array('tripal_core_views_integration_admin_form'),
|
|
|
- 'access arguments' => array('manage tripal_views_integration'),
|
|
|
- 'type' => MENU_NORMAL_ITEM,
|
|
|
- );
|
|
|
-
|
|
|
-// $items['admin/tripal/views/integration/edit_form'] = array(
|
|
|
-// 'title' => 'My redirected path',
|
|
|
-// 'page callback' => 'drupal_goto',
|
|
|
-// 'page arguments' => array('tripal_core_views_integration_new_setup_form'),
|
|
|
-// 'access arguments' => array('access administration pages'),
|
|
|
-// 'type' => MENU_CALLBACK,
|
|
|
+// $items['admin/tripal/views/integration'] = array(
|
|
|
+// 'title' => t('Drupal Views Integration'),
|
|
|
+// 'description' => t('Allows you to select existing materialized views and provide details for integration with Drupal Views.'),
|
|
|
+// 'page callback' => 'drupal_get_form',
|
|
|
+// 'page arguments' => array('tripal_core_views_integration_admin_form'),
|
|
|
+// 'access arguments' => array('manage tripal_views_integration'),
|
|
|
+// 'type' => MENU_NORMAL_ITEM,
|
|
|
// );
|
|
|
|
|
|
- //page to actually create setup->mview->chado table relationships
|
|
|
- $items['admin/tripal/views/integration/mviews/new'] = array(
|
|
|
- 'title' => 'Add an MView',
|
|
|
- 'page callback' => 'drupal_get_form',
|
|
|
- 'page arguments' => array('tripal_core_views_integration_new_setup_form'),
|
|
|
- 'access arguments' => array('manage tripal_views_integration'), //TODO: figure out the proper permissions arguments
|
|
|
- 'type' => MENU_NORMAL_ITEM,
|
|
|
- );
|
|
|
+// $items['admin/tripal/views/integration/mviews'] = array(
|
|
|
+// 'title' => t('Integrated MViews'),
|
|
|
+// 'description' => t('Allows you to select existing materialized views and provide details for integration with Drupal Views.'),
|
|
|
+// 'page callback' => 'drupal_get_form',
|
|
|
+// 'page arguments' => array('tripal_core_views_integration_admin_form'),
|
|
|
+// 'access arguments' => array('manage tripal_views_integration'),
|
|
|
+// 'type' => MENU_NORMAL_ITEM,
|
|
|
+// );
|
|
|
|
|
|
- $items['admin/tripal/views/integration/mviews/edit/%'] = array(
|
|
|
- 'title' => 'Add an MView',
|
|
|
- 'page callback' => 'drupal_get_form',
|
|
|
- 'page arguments' => array('tripal_core_views_integration_new_setup_form', 6),
|
|
|
- 'access arguments' => array('manage tripal_views_integration'), //TODO: figure out the proper permissions arguments
|
|
|
- 'type' => MENU_NORMAL_ITEM,
|
|
|
- );
|
|
|
+// $items['admin/tripal/views/integration/mviews/new'] = array(
|
|
|
+// 'title' => 'Add an MView',
|
|
|
+// 'page callback' => 'drupal_get_form',
|
|
|
+// 'page arguments' => array('tripal_core_views_integration_new_setup_form'),
|
|
|
+// 'access arguments' => array('manage tripal_views_integration'), //TODO: figure out the proper permissions arguments
|
|
|
+// 'type' => MENU_NORMAL_ITEM,
|
|
|
+// );
|
|
|
+
|
|
|
+// $items['admin/tripal/views/integration/mviews/edit/%'] = array(
|
|
|
+// 'title' => 'Edit MView Integration',
|
|
|
+// 'page callback' => 'drupal_get_form',
|
|
|
+// 'page arguments' => array('tripal_core_views_integration_new_setup_form', 6),
|
|
|
+// 'access arguments' => array('manage tripal_views_integration'), //TODO: figure out the proper permissions arguments
|
|
|
+// 'type' => MENU_NORMAL_ITEM,
|
|
|
+// );
|
|
|
|
|
|
$items['admin/tripal/views/integration/chado'] = array(
|
|
|
'title' => t('Integrated Chado Table'),
|
|
@@ -233,9 +225,18 @@ function tripal_core_menu() {
|
|
|
'title' => 'Add a Chado table',
|
|
|
'page callback' => 'drupal_get_form',
|
|
|
'page arguments' => array('tripal_core_views_integration_new_setup_form'),
|
|
|
- 'access arguments' => array('manage tripal_views_integration'), //TODO: figure out the proper permissions arguments
|
|
|
+ 'access arguments' => array('manage tripal_views_integration'), //TODO: What is this item supposed to be?
|
|
|
'type' => MENU_NORMAL_ITEM,
|
|
|
);
|
|
|
+
|
|
|
+ $items['admin/tripal/views/integration/chado/edit/%'] = array(
|
|
|
+ 'title' => 'Edit MView Integration',
|
|
|
+ 'page callback' => 'drupal_get_form',
|
|
|
+ 'page arguments' => array('tripal_core_views_integration_new_setup_form', 6),
|
|
|
+ 'access arguments' => array('manage tripal_views_integration'), //TODO: figure out the proper permissions arguments
|
|
|
+ 'type' => MENU_NORMAL_ITEM,
|
|
|
+ );
|
|
|
+
|
|
|
return $items;
|
|
|
}
|
|
|
|
|
@@ -259,7 +260,7 @@ function tripal_core_perm(){
|
|
|
* The name of the database to switch to as indicated in settings.php
|
|
|
* Should be either default or chado
|
|
|
*
|
|
|
- * @return
|
|
|
+ * @return
|
|
|
* The name of the previously set database
|
|
|
*
|
|
|
* @ingroup tripal_chado_api
|
|
@@ -267,12 +268,12 @@ function tripal_core_perm(){
|
|
|
function tripal_core_is_chado_installed(){
|
|
|
global $db_url, $db_type;
|
|
|
|
|
|
- // first check if chado is in the db_url of the
|
|
|
+ // first check if chado is in the db_url of the
|
|
|
// settings.php file
|
|
|
- if(is_array($db_url)){
|
|
|
+ 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'";
|
|
@@ -290,7 +291,7 @@ function tripal_core_is_chado_installed(){
|
|
|
* views integration code is
|
|
|
*
|
|
|
* @ingroup tripal_core
|
|
|
- */
|
|
|
+ */
|
|
|
function tripal_core_views_api() {
|
|
|
return array(
|
|
|
'api' => 2.0,
|
|
@@ -303,7 +304,7 @@ function tripal_core_views_api() {
|
|
|
* @ingroup tripal_core
|
|
|
*/
|
|
|
function tripal_core_theme () {
|
|
|
- return array(
|
|
|
+ return array(
|
|
|
'tripal_core_job_view' => array (
|
|
|
'arguments' => array('job_id'=> null),
|
|
|
'template' => 'tripal_core_job_view',
|
|
@@ -323,18 +324,18 @@ function tripal_core_job_describe_args($callback,$args){
|
|
|
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]));
|
|
|
+ $mview = db_fetch_object(db_query($sql,$args[0]));
|
|
|
$new_args['View Name'] = $mview->name;
|
|
|
}
|
|
|
return $new_args;
|
|
|
}
|
|
|
|
|
|
// this is just a wrapper for backwards compatibility with a naming mistake.
|
|
|
-// it can go away in the future as it only is useful for jobs created by v0.3b
|
|
|
-function tripal_core_load_gff3($gff_file, $organism_id,$analysis_id,$add_only =0,
|
|
|
+// it can go away in the future as it only is useful for jobs created by v0.3b
|
|
|
+function tripal_core_load_gff3($gff_file, $organism_id,$analysis_id,$add_only =0,
|
|
|
$update = 0, $refresh = 0, $remove = 0, $job = NULL)
|
|
|
{
|
|
|
- tripal_feature_load_gff3($gff_file, $organism_id,$analysis_id,$add_only,
|
|
|
+ tripal_feature_load_gff3($gff_file, $organism_id,$analysis_id,$add_only,
|
|
|
$update, $refresh, $remove, $job);
|
|
|
}
|
|
|
|