ContentLanguage form field type

From Joomla! Documentation

Revision as of 07:08, 16 September 2013 by Sovainfo (talk | contribs) (type text instead of moduleorder)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Provides a list of content languages..

  • name (mandatory) is the unique name of the parameter.
  • type (mandatory) must be text.
  • label (mandatory) is the descriptive title of the field.
  • description (optional) tooltip for the form field.

Example XML Definition from plugins/system/languagecode/languagecode.php

if ($languages = JLanguage::getKnownLanguages(JPATH_SITE))
{
	// Inject fields into the form
	foreach ($languages as $tag => $language)
	{
		$form->load('
			<form>
				<fields name="params">
					<fieldset
						name="languagecode"
						label="PLG_SYSTEM_LANGUAGECODE_FIELDSET_LABEL"
						description="PLG_SYSTEM_LANGUAGECODE_FIELDSET_DESC"
					>
						<field
							name="'.strtolower($tag).'"
							type="text"
							description="' . htmlspecialchars(JText::sprintf('PLG_SYSTEM_LANGUAGECODE_FIELD_DESC', $language['name']), ENT_COMPAT, 'UTF-8') . '"
							translate_description="false"
							label="' . $tag . '"
							translate_label="false"
							size="7"
							filter="cmd"
						/>
					</fieldset>
				</fields>
			</form>
		');
	}
}