Release of v3.2.2-alpha6
Add new subform classes. Fix registry class methods return type. Update all list and custom fields to use the new layouts.
This commit is contained in:
@ -143,29 +143,30 @@ class JFormFieldSnippets extends JFormFieldList
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('a.id','a.name','b.name','c.name'),array('id','snippet_name','type','library')));
|
||||
$query->from($db->quoteName('#__componentbuilder_snippet', 'a'));
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('a.id','a.name','b.name','c.name'),array('id','snippet_name','type','library')));
|
||||
$query->from($db->quoteName('#__componentbuilder_snippet', 'a'));
|
||||
// From the componentbuilder_snippet_type table.
|
||||
$query->join('LEFT', $db->quoteName('#__componentbuilder_snippet_type', 'b') . ' ON (' . $db->quoteName('a.type') . ' = ' . $db->quoteName('b.id') . ')');
|
||||
// From the componentbuilder_library table.
|
||||
$query->join('LEFT', $db->quoteName('#__componentbuilder_library', 'c') . ' ON (' . $db->quoteName('a.library') . ' = ' . $db->quoteName('c.id') . ')');
|
||||
$query->where($db->quoteName('a.published') . ' >= 1');
|
||||
$query->join('LEFT', $db->quoteName('#__componentbuilder_library', 'c') . ' ON (' . $db->quoteName('a.library') . ' = ' . $db->quoteName('c.id') . ')');
|
||||
$query->where($db->quoteName('a.published') . ' >= 1');
|
||||
$query->order('c.ordering ASC');
|
||||
$query->order('b.name ASC');
|
||||
$db->setQuery((string)$query);
|
||||
$items = $db->loadObjectList();
|
||||
$options = array();
|
||||
if ($items)
|
||||
{
|
||||
foreach($items as $item)
|
||||
{
|
||||
$query->order('b.name ASC');
|
||||
$db->setQuery((string)$query);
|
||||
$items = $db->loadObjectList();
|
||||
$options = array();
|
||||
if ($items)
|
||||
{
|
||||
foreach($items as $item)
|
||||
{
|
||||
$lib = (isset($item->library) && ComponentbuilderHelper::checkString($item->library)) ? ' (' . $item->library . ')' :'';
|
||||
$type = (isset($item->type) && ComponentbuilderHelper::checkString($item->type)) ? $item->type :JText::_('COM_COMPONENTBUILDER_NO_TYPE');
|
||||
$options[] = JHtml::_('select.option', $item->id, $type . ' - ' . $item->snippet_name . $lib );
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
$type = (isset($item->type) && ComponentbuilderHelper::checkString($item->type)) ? $item->type :JText::_('COM_COMPONENTBUILDER_NO_TYPE');
|
||||
$options[] = JHtml::_('select.option', $item->id, $type . ' - ' . $item->snippet_name . $lib );
|
||||
}
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user