src/chxj_hdml.c
/**
 * It is a handler who processes the SELECT tag.
 *
 * @param pdoc   [i/o] The pointer to the HDML structure at the output
 *                     destination is specified.
 * @param node   [i]   The SELECT tag node is specified.
 * @return The conversion result is returned.
 */
It is a handler who processes the SELECT tag.
@param pdoc   [i/o] The pointer to the HDML structure at the output
destination is specified.
@param node   [i]   The SELECT tag node is specified.
@return The conversion result is returned.
It is a handler who processes the SELECT tag . @param pdoc [ i / o ] The pointer to the HDML structure at the output destination is specified . @param node [ i ] The SELECT tag node is specified . @return The conversion result is returned .
static char *
s_hdml_start_select_tag(void *pdoc, Node *node)  
{
  Doc         *doc;
  request_rec *r;
  Attr        *attr;
  hdml_t      *hdml;
  hdml = GET_HDML(pdoc);
  doc  = hdml->doc;
  r    = doc->r;
  s_hdml_tag_output_upper_half(hdml, node);
  hdml->card_cnt++;
  s_output_to_hdml_out(hdml, apr_psprintf(r->pool, 
                                   "<A TASK=GOSUB LABEL=\x91\x49\x91\xf0 "
                                   "VARS=\"V=$%s%02d\" DEST=#D%d "
                                   "RECEIVE=\"%s%02d;%s%02d\">"
                                   "$%s%02d</A>\r\n",
                                   s_get_form_no(r, hdml),
                                   hdml->var_cnt[hdml->pure_form_cnt]+0, 
                                   hdml->card_cnt,
                                   s_get_form_no(r, hdml),
                                   hdml->var_cnt[hdml->pure_form_cnt]+0, 
                                   s_get_form_no(r, hdml),
                                   hdml->var_cnt[hdml->pure_form_cnt]+1, 
                                   s_get_form_no(r, hdml),
                                   hdml->var_cnt[hdml->pure_form_cnt]+1));
  s_output_to_hdml_card(hdml, 
                  apr_psprintf(r->pool, 
                          "<CHOICE KEY=V NAME=D%d ", hdml->card_cnt));
  s_output_to_hdml_card(hdml, 
                  apr_psprintf(r->pool, 
                          "DEFAULT=$V METHOD=ALPHA MARKABLE=FALSE>\r\n"));
  for (attr = qs_get_attr(doc,node); 
       attr; 
       attr=qs_get_next_attr(doc,attr)) {
    char *name      = qs_get_attr_name(doc,attr);
    char *value     = qs_get_attr_value(doc,attr);
    char *selval    = NULL;
    char *selvaltxt = NULL;
    if (STRCASEEQ('n','N',"name",name)) {
      s_output_to_postdata(hdml, 
                      apr_psprintf(r->pool, "%s=$%s%02d", 
                              value,
                              s_get_form_no(r, hdml),
                              hdml->var_cnt[hdml->pure_form_cnt]));
      selval = qs_get_selected_value(doc, node, r->pool);
      if (! selval) {
        DBG(r, "selected value not found");
        selval = qs_alloc_zero_byte_string(r->pool);
      }
      else {
        DBG(r, "selected value found[%s]" , selval);
      }
      selvaltxt = qs_get_selected_value_text(doc, node, r->pool);
      if (!selvaltxt)
        selvaltxt = qs_alloc_zero_byte_string(r->pool);
      DBG(r, "selvaltxt:[%s]" ,selvaltxt);
      s_output_to_init_vars(hdml, 
                      apr_psprintf(r->pool, 
                              "%s%02d=%s&%s%02d=%s",
                              s_get_form_no(r, hdml),
                              hdml->var_cnt[hdml->pure_form_cnt] + 0,
                              selval, 
                              s_get_form_no(r, hdml),
                              hdml->var_cnt[hdml->pure_form_cnt] + 1,
                              selvaltxt));
      hdml->var_cnt[hdml->pure_form_cnt] += 2;
      break;
    }
  }
  hdml->hdml_br_flag = 0;
  return hdml->out;
}
static char * s_hdml_start_select_tag ( void * pdoc , Node * node ) { Doc * doc ; request_rec * r ; Attr * attr ; hdml_t * hdml ; hdml = GET_HDML ( pdoc ) ; doc = hdml -> doc ; r = doc -> r ; s_hdml_tag_output_upper_half ( hdml , node ) ; hdml -> card_cnt ++ ; s_output_to_hdml_out ( hdml , apr_psprintf ( r -> pool , " \x91 \x49 \x91 \xf0 " " \" \" " " \" \" " " \r \n " , s_get_form_no ( r , hdml ) , hdml -> var_cnt [ hdml -> pure_form_cnt ] + 0 , hdml -> card_cnt , s_get_form_no ( r , hdml ) , hdml -> var_cnt [ hdml -> pure_form_cnt ] + 0 , s_get_form_no ( r , hdml ) , hdml -> var_cnt [ hdml -> pure_form_cnt ] + 1 , s_get_form_no ( r , hdml ) , hdml -> var_cnt [ hdml -> pure_form_cnt ] + 1 ) ) ; s_output_to_hdml_card ( hdml , apr_psprintf ( r -> pool , " " , hdml -> card_cnt ) ) ; s_output_to_hdml_card ( hdml , apr_psprintf ( r -> pool , " \r \n " ) ) ; for ( attr = qs_get_attr ( doc , node ) ; attr ; attr = qs_get_next_attr ( doc , attr ) ) { char * name = qs_get_attr_name ( doc , attr ) ; char * value = qs_get_attr_value ( doc , attr ) ; char * selval = NULL ; char * selvaltxt = NULL ; if ( STRCASEEQ ( ' ' , ' ' , " " , name ) ) { s_output_to_postdata ( hdml , apr_psprintf ( r -> pool , " " , value , s_get_form_no ( r , hdml ) , hdml -> var_cnt [ hdml -> pure_form_cnt ] ) ) ; selval = qs_get_selected_value ( doc , node , r -> pool ) ; if ( ! selval ) { DBG ( r , " " ) ; selval = qs_alloc_zero_byte_string ( r -> pool ) ; } else { DBG ( r , " " , selval ) ; } selvaltxt = qs_get_selected_value_text ( doc , node , r -> pool ) ; if ( ! selvaltxt ) selvaltxt = qs_alloc_zero_byte_string ( r -> pool ) ; DBG ( r , " " , selvaltxt ) ; s_output_to_init_vars ( hdml , apr_psprintf ( r -> pool , " " , s_get_form_no ( r , hdml ) , hdml -> var_cnt [ hdml -> pure_form_cnt ] + 0 , selval , s_get_form_no ( r , hdml ) , hdml -> var_cnt [ hdml -> pure_form_cnt ] + 1 , selvaltxt ) ) ; hdml -> var_cnt [ hdml -> pure_form_cnt ] += 2 ; break ; } } hdml -> hdml_br_flag = 0 ; return hdml -> out ; }
It is a handler who processes the SELECT tag.
It is a handler who processes the SELECT tag .
/*--------------------------------------------------------------------------*/ /* Get Attributes                                                           */ /*--------------------------------------------------------------------------*/