Campo de Formulario, Tipo content languaje

From Joomla! Documentation

This page is a translated version of the page ContentLanguage form field type and the translation is 100% complete.
Other languages:
English • ‎Nederlands • ‎español • ‎français

Proporciona una lista de los idiomas para contenidos.

  • name (obligatorio) es el nombre único del parámetro.
  • type (obligatorio) debe ser contentlanguage.
  • label (obligatorio) (traducible) es el título descriptivo del campo.
  • description (opcional) (traducible) es el texto que será mostrado como un texto de ayuda cuando el usuario mueve el ratón sobre el cuadro de texto.

Ejemplo de Definición XML de 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>
		');
	}
}