Jelajahi Sumber

tripal_views_setup ahah work

alexgl 13 tahun lalu
induk
melakukan
9b1963d5c7

+ 16 - 21
base/tripal_views_setup/includes/tripal_views_setup.admin.inc

@@ -65,7 +65,7 @@ function tripal_views_setup_admin_form_submit($form, &$form_state){
  *
  * @ingroup tripal_view_setup
  */
-function tripal_views_setup_new_search_form(&$form_state){
+function tripal_views_setup_new_setup_form(&$form_state){
 	$form = array();
 
 	$form['#cache'] = TRUE;
@@ -127,11 +127,9 @@ function tripal_views_setup_new_search_form(&$form_state){
   	'#suffix' => '</div>',
 	);
 
-	if($form_state['values']['mview_id'] || $form['mview_id']['#value']){
-		if (isset($form_state['values']['mview_id']))
-			$mview_id = $form_state['values']['mview_id'];
-		else
-			$mview_id = $form['mview_id']['#value'];
+	if($form_state['values']['mview_id']){
+
+		$mview_id = $form_state['values']['mview_id'];
 
 		$form['view_setup_table'] = array(
 			'#type' => 'fieldset',
@@ -187,7 +185,7 @@ function tripal_views_setup_new_search_form(&$form_state){
          '#required' => FALSE,
          '#ahah' => array(
            'path' => 'admin/tripal/tripal_views_setup/ajax/field_col_join',
-           'wrapper' => "fields-column-join-column-$i",
+           'wrapper' => "table-rows-div",
            'effect' => 'fade',
            'event' => 'change',
            'method' => 'replace',
@@ -197,7 +195,6 @@ function tripal_views_setup_new_search_form(&$form_state){
 			if($form_state['values']["fields_column_join_$i"]){
 				$column_join = array('hello', 'world');
 			}
-			dpm($form_state,'formstate attopfieldcolumns');
 			$form['view_setup_table']["fields_column_join_column_$i"] = array(
          '#type' => 'select',
          '#prefix' => "<div id=\"fields-column-join-column-$i\" class=\"fields-column-join-column\">",
@@ -223,15 +220,16 @@ function tripal_views_setup_new_search_form(&$form_state){
 		'#type' => 'hidden',
 		'#value' => $i,
 		);
-	}
 
+
+
+	}
+	
 	$form['submit'] = array(
-      '#type' => 'submit',
-      '#value' => 'Create',
+	      '#type' => 'submit',
+	      '#value' => 'Create',
 	);
 
-	dpm($form, 'form final');
-
 	return $form;
 }
 /**
@@ -285,9 +283,6 @@ function tripal_views_setup_ajax_getform(&$form_state, &$args, &$_POST){
  * @ingroup tripal_view_setup
  */
 function tripal_view_setup_ajax_field_col_join(){
-	dpm($_POST,'post tripal_view_setup_ajax_field_col_join');
-
-	dpm($form_state,'formstate tripal_view_setup_ajax_field_col_join');
 
 	$form = tripal_views_setup_ajax_getform($form_state, $args, $_POST);
 
@@ -397,8 +392,8 @@ function tripal_view_setup_ajax_field_col_join(){
 // }
 
 // function tripal_views_setup_fields_form_submit($form, &$form_state){
-// 	dpm($form,'formfield');
-// 	dpm($form_state, 'formstatefield');
+// 	----($form,'formfield');
+// 	----($form_state, 'formstatefield');
 
 // }
 
@@ -408,7 +403,7 @@ function tripal_view_setup_ajax_field_col_join(){
  *
  * @ingroup tripal_view_setup
  */
-function tripal_views_setup_new_search_form_submit($form, &$form_state){
-	dpm($form,'form on submit');
-	dpm($form_state, 'formstate on submit');
+function tripal_views_setup_new_setup_form_submit($form, &$form_state){
+	dpm($form, 'form on submit');
+	dpm($form_state, 'forms_state on submit');
 }

+ 4 - 3
base/tripal_views_setup/tripal_views_setup.module

@@ -15,11 +15,11 @@ function tripal_views_setup_menu(){
     'type' => MENU_NORMAL_ITEM,
   );
 
-  //page to actually create search->mview->chado table relationships
+  //page to actually create setup->mview->chado table relationships
    $items['admin/tripal/tripal_views_setup_new'] = array(
      'title' => 'Create New Views Setup',
      'page callback' => 'drupal_get_form',
-     'page arguments' => array('tripal_views_setup_new_search_form'),
+     'page arguments' => array('tripal_views_setup_new_setup_form'),
      'access arguments' => array('access administration pages'), //TODO: figure out the proper permissions arguments
      'type' => MENU_NORMAL_ITEM,
    );
@@ -58,7 +58,8 @@ function tripal_views_setup_menu(){
 function tripal_views_setup_theme(){
   $theme = array();
 
-  $theme['tripal_views_setup_fields_form'] = array(
+//   $theme['tripal_views_setup_fields_form'] = array(
+  $theme['tripal_views_setup_new_setup_form'] = array(
     'arguments' => array('form' => NULL),
       'template'  => 'tripal_views_setup_fields_form',
    );

+ 11 - 11
base/tripal_views_setup/tripal_views_setup_fields_form.tpl.php

@@ -1,43 +1,43 @@
 <style type="text/css">
 
-#tripal-views-setup-fields-form  .fields-new-row, .field-headers {
+#tripal-views-setup-new-setup-form  .fields-new-row, .field-headers {
    dislay: block;
    margin: 0px;
    border-bottom-style: solid;
    border-bottom-width: 1px;
 }
-#tripal-views-setup-fields-form .form-item {
+#tripal-views-setup-new-setup-form .form-item {
    margin: 0px 0px 5px 0px;
 }
-#tripal-views-setup-fields-form .column-id,.fields-column-join,.fields-column-join-column, .fields-column-handler {
+#tripal-views-setup-new-setup-form .column-id,.fields-column-join,.fields-column-join-column, .fields-column-handler {
    display: inline-block;
    margin: 0px;
    vertical-align: top;
 }
-#tripal-views-setup-fields-form  .field-headers {
+#tripal-views-setup-new-setup-form  .field-headers {
    font-weight: bold;  
 }
-#tripal-views-setup-fields-form  .field-headers div {
+#tripal-views-setup-new-setup-form  .field-headers div {
    display: inline-block;
    margin: 0px;
    vertical-align: top;
 }
-#tripal-views-setup-fields-form .column-name {
+#tripal-views-setup-new-setup-form .column-name {
 
 }
-#tripal-views-setup-fields-form .column-type {
+#tripal-views-setup-new-setup-form .column-type {
    font-style: italic;  
 }
-#tripal-views-setup-fields-form .column-id {
+#tripal-views-setup-new-setup-form .column-id {
    width: 25%;
 }
-#tripal-views-setup-fields-form .fields-column-join {
+#tripal-views-setup-new-setup-form .fields-column-join {
    width: 25%;
 }
-#tripal-views-setup-fields-form .fields-column-join-column {
+#tripal-views-setup-new-setup-form .fields-column-join-column {
    width: 25%;
 }
-#tripal-views-setup-fields-form .fields-column-handler {
+#tripal-views-setup-new-setup-form .fields-column-handler {
    width: 25%;
 }