* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ if (!defined('_PS_VERSION_')) { exit; } require_once dirname(__FILE__) . '/AdminStEasyVideoListController.php'; class AdminStEasyVideoManufacturerController extends AdminStEasyVideoListController { protected $contr = 'manufacturer'; public function addWhere($where = '') { return $where.' AND id_product=\'\' AND id_category=0 AND id_manufacturer!=0 '; } public function filterFormFields(&$fileds, $obj) { array_splice($fileds['input'], 1, 0, array( array( 'type' => 'select', 'label' => $this->l('Select a manufacture:'), 'required' => true, 'name' => 'id_manufacturer', 'class' => 'fixed-width-xxl', 'options' => array( 'query' => $this->getApplyManufacture(), 'id' => 'id', 'name' => 'name', 'default' => array( 'value' => '', 'label' => $this->l('Please select') ) ), ), )); } public function getApplyManufacture() { $manufacturer_arr = array(); $manufacturers = Manufacturer::getManufacturers(false, $this->context->language->id); foreach ($manufacturers as $manufacturer) { $manufacturer_arr[] = array('id' => $manufacturer['id_manufacturer'],'name' => $manufacturer['name']); } return $manufacturer_arr; } }