<?php
/**
 * @package    VP Advanced User
 * @author     Abhishek Das <info@virtueplanet.com>
 * @copyright  Copyright (C) 2012-2019 VirtuePlanet Services LLP. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 * @link       https://www.virtueplanet.com
 */

defined('_JEXEC') or die;

JFormHelper::loadFieldClass('list');

class JFormFieldEmailpurposes extends JFormFieldList
{
	public $type = 'Emailpurposes';
	
	public function getOptions()
	{
		JModelLegacy::addIncludePath(JPATH_COMPONENT . '/models', 'VPAdvancedUserModel');
		
		$model    = JModelLegacy::getInstance('emailtemplates', 'VPAdvancedUserModel', array('ignore_request' => true));
		$purposes = $model->getPurposes();
		
		return array_merge(parent::getOptions(), $purposes);
	}
}
