Hi! I've adquired a drupal module and would like to use it in drupalgap but we don't know how to use the functions and variables that are created on it. Any idea about how to handle it?

Thanks in advance!!

Comments

Sorek created an issue. See original summary.

tyler.frankenstein’s picture

Status: Active » Closed (won't fix)

This is way too broad of a question, and I am unable to answer it.

Start here: http://docs.drupalgap.org/7

Or please clarify with much more detail what you're trying to do.

tyler.frankenstein’s picture

Status: Closed (won't fix) » Postponed (maintainer needs more info)
sorek’s picture

Yeah it's true, I haven't specified...

We have for example this code in our drupal module:

/**
 * sorteos_suscription.
 */
function sorteos_subscription_form($form, &$form_state, $instance) {

  global $user;

  $form['#instances_id'] = $instance;

  if ( $user->uid ) {

    // Check if user is participating.
    if ( _sorteos_is_contestant_instance($instance, $user->uid) ) {
      $form['contest'] = array(
        '#markup' => t('You are participating in the contest.'),
        '#weight' => 20,
        '#prefix' => '<p class="user-participating">',
        '#suffix' => '</p>',
      );
    }
    else {
      $form['submit'] = array(
        '#type' => 'submit',
        '#value' => t('I want to participate'),
        '#weight' => 20,
        '#prefix' => '<p class="participate">',
        '#suffix' => '</p>',
      );
    }

    return $form;

  } else {

    $form['contest'] = array(
      '#markup' => t('To participate you need to be registered.'),
    );
    $form['linklogin'] = array(
      '#markup' => '<p>' .
        l(t('Login'), 'user/login') .
        ' ' .
        t('or') .
        ' ' .
        l(t('Register'), 'user/register') .
        '</p>' ,
    );

    // drupal_set_message(t('You need to be registered ....'));

	 $form['#submit'][] = 'test';
    
	return $form;
  }

}

This is a function to check if our registered user is already participating in the draw, and if not, creates a form to subscribe him/her on it... it works fine on our drupal site, but the problem is when we try to do the same in our drupalgap application. Is there any way to use/call this function or it's variables and forms in our drupalgap custom module?

For example, something like the "add to cart" form in the commerce module.

tyler.frankenstein’s picture

Build a custom DrupalGap form: http://docs.drupalgap.org/7/Forms

Use the Services module to get any variables you need.