User login

Disabling locale choices in Organic Group node form

Wanted to hide the choice of Language: "Selecting a different locale will change the interface language of the group. Users who have chosen a preferred language always see their chosen language."

Also we will disable the choice of whether to subscribe to the node you create for an action (set to yes), "Receive notification of replies or comments to this node."

And disable or hide upload files? I guess not, you could attach fliers...

Or should fliers be a separate content type?

[locale] => Array
(
[og_language] => Array
(
[#type] => radios
[#title] => Language
[#default_value] =>
[#options] => Array
(
[eng] => English
[zh-hans] => Chinese, Simplified
[nl] => Dutch
[fr] => French
[de] => German
[it] => Italian
[ja] => Japanese
[fa] => Persian
[pt-br] => Portuguese, Brazil
[th] => Thai
)

[#description] => Selecting a different locale will change the interface language of the group. Users who have chosen a preferred language always see their chosen language.
)

)

so unset($form['locale']);

Should take care of that. But since this language does show up for anonymous users coming to the group, we'll want to set it automatically based on the language chosen above:

[i18n] => Array
(
[#type] => fieldset
[#title] => Multilingual settings
[#collapsible] => 1
[#collapsed] =>
[#weight] => -4
[language] => Array
(
[#type] => select
[#title] => Language
[#default_value] => eng
[#options] => Array
(
[] =>
[zh-hans] => Chinese, Simplified
[nl] => Dutch
[eng] => English
[fr] => French
[de] => German
[it] => Italian
[ja] => Japanese
[fa] => Persian
[pt-br] => Portuguese, Brazil
[th] => Thai
)

Since there is no tree set, this should be accessed simply with $form['language'].

When dealing with subforms (the Agaric way)...

Each subform can be modified in its own case of the form_alter statement (that is, say in a switch statement inside form_alter, when the form_id equals the form your dealing with). OK, that wasn't clear at all. Here's the deal: you cannot try to add the subform and mess with things there, in that plain form_alter. (Subform element does provide a special #subform_after_build to do this though.)

Resolution

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.