<?php
defined('_JEXEC') or die('Restricted access');

class JElementARTIOFusionChart extends JElement
{
    var $_name = 'ARTIOFusionChart';

    function fetchElement($name, $value, &$node, $control_name)
    {
        $db = &JFactory::getDBO();
        $query = "SELECT `id`, `title` FROM `#__artiofusioncharts` ORDER BY `title` ASC";
        $db->setQuery($query);
        $options = $db->loadObjectList();
        array_unshift($options, JHTML::_('select.option', '0', '- ' . JText::_('Select Chart') . ' -', 'id', 'title'));
        return JHTML::_('select.genericlist', $options, '' . $control_name . '[' . $name . ']', 'class="inputbox"', 'id', 'title', $value, $control_name . $name);
    }
}
