What is the proper way to call for the Content language field type. My below code works but I don't use the content language field type. I am building a drop down from all available languages.
$languages = JLanguageHelper::getLanguages();
if ($row->contentlanguage == null)
{
$lang = JFactory::getLanguage();
$selectedlanguage = $lang->getTag();
}
else
{
$selectedlanguage = $row->contentlanguage;
}
$DropdownCode = mosHTML::selectList( $languages, 'contentlanguage', 'class="text_area" size="1"', 'lang_code', 'title', $selectedlanguage );
Joomla Field Type link: https://docs.joomla.org/ContentLanguage_form_field_type
Some Context
I have a form in a component where I want the user to select one of the Joomla installed content languages. The component base code that I am changing was not written with the XML field definitions style. And all the examples on the internet is for the XML field definitions style. Joomla has lots of field types for forms, but its always a problem getting the code not the xml for getting the Joomla field type.
The below example will generate the HTML for the date time field type of Joomla. With this question I want the same type of code for the Content Language Field type.
$attribs['todayBtn'] = 1;
$attribs['weekNumbers'] = 0;
$attribs['showTime'] = 1;
$attribs['class'] = 'inputdatetimesize';
return JHTML::_('calendar',$this->value, $this->name, $this->name, $this->format, $attribs);