User login

Do not show group-adding subform when adding an action to an existing group

And finally, restricting adding that extra form, the group subform in the action node posting form, to only when the action is called without a group specified:

In restricting that subset of form_alter...

Could check $form here:

[#action] => /eng/node/add/action?gids[]=156

But it seems more precise to check $form over in this mess:

[og_nodeapi] => Array
(
[visible] => Array
(
[og_groups_visible] => Array
(
[#type] => item
[#title] => Audience
[#value] => The group the action will be associated with
)

)

[invisible] => Array
(
[og_groups_hidden] => Array
(
[#type] => hidden
[#value] => a:1:{i:156;s:3:"156";}
)

[og_groups] => Array
(
[#type] => value
[#value] => Array
(
[156] => 156
)

)

)

)

That comes down to:

$form['og_nodeapi']['invisible']['og_groups']['#value']

Which I will stick in an if statement wrapping the modified subform code, which you can find hidden somewhere deep in the over-documented odyssey on merging two forms.

Resolution

Searched words: 
Organic Groups form_alter subform element

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.