0

I have two questions about twitter module.

I want to hide global twitter account from twitter_account_list_form, because authenticate user can delete global account, and i want to stop him.

I try with this in form_alter

    $pom_array = array_keys($form['accounts']);
        foreach ($pom_array as $key => $val) {
            if (is_int($val)) {
                if ($form['accounts'][$val]['#account']->is_global == 1 )
                    $form['accounts'][$key]['#prefix'] = '<div style="display:none;">';
                    $form['accounts'][$key]['#suffix'] = '</div>';
             }
        }

but without success.

And if node has option post to twitter.com, I want to hide that option also because authenticate can change message. I want in that case to post message for global and user's twitter account, if user already connected account with twitter.

Many thanks

  • I think you got $val and $key mixed up a bit especially in the if() statement. – Beebee May 22 '12 at 12:21
  • Hi @Baysaa Yes i made suggested changes but again there is no success 'code' $pom_array = array_keys($form['accounts']); foreach ($pom_array as $val) { if (is_int($val)) { if ($form['accounts'][$val]['#account']->is_global == 1 ){ $form['accounts'][$val]['#prefix'] = '<div style="display:none;">'; $form['accounts'][$val]['#suffix'] = '</div>'; } } } 'code' – miske May 22 '12 at 12:59
  • Shouldn't it be $form['accounts'][$key] and NOT $form['accounts'][$val]? – Beebee May 22 '12 at 13:01
  • here is what is in '$pom_array' 'array(13) { [0]=> int(0) [1]=> int(1) [2]=> int(2) [3]=> string(5) "#tree" [4]=> string(8) "#parents" [5]=> string(14) "#array_parents" [6]=> string(7) "#weight" [7]=> string(10) "#processed" [8]=> string(9) "#required" [9]=> string(11) "#attributes" [10]=> string(14) "#title_display" [11]=> string(3) "#id" [12]=> string(7) "#sorted" } ' – miske May 22 '12 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.