<?php
namespace Modules\Admin\QcRules;

class View_Options extends \App\Mvc\View_Window_PaginatedListing_OptionsAbstract
{
	/**
	 * (non-PHPdoc)
	 * @see \App\Mvc\View_Window_PaginatedListing_OptionsAbstract::populateDefinedOptions()
	 */
	public function populateDefinedOptions(\App\Mvc\View\Utils\RowOptions\Container\Simple $options)
	{
		$options
			->append(\App\Mvc\View\Utils\RowOptions\Option\Popup\Insert::create("insert")
				->setDescription($this->lang['index']['options']['buttons']['insert'])
				->setDimensions(700, 650)
			)

			->append(\App\Mvc\View\Utils\RowOptions\Container\OptionEmulator::create()
				->append(\App\Mvc\View\Utils\RowOptions\Option\Option::create("activate")
					->setDescription($this->lang['index']['options']['buttons']['activate'])
					->setIcon("unlock")
					->setJsCallback("MVC.listing.installedHandlers.listing.activateItemsWithConfirmation(this);")
				)
				->append(\App\Mvc\View\Utils\RowOptions\Option\Option::create("deactivate")
					->setDescription($this->lang['index']['options']['buttons']['deactivate'])
					->setIcon("lock")
					->setJsCallback("MVC.listing.installedHandlers.listing.deactivateItemsWithConfirmation(this);")
				)
			)

			->append(\App\Mvc\View\Utils\RowOptions\Option\Popup::create("clone")
				->setDescription($this->lang['index']['options']['buttons']['duplicate'])
				->setIcon("clone")
				->setAction("insert")
				->setDimensions(700, 650)
				->setKeyForCurrentRow('cloneFromQcRule')
			)

			->append(\App\Mvc\View\Utils\RowOptions\Option\Popup\Update::create("update")
				->setDescription($this->lang['index']['options']['buttons']['update'])
				->setDimensions(700, 650)
			)

			->append(\App\Mvc\View\Utils\RowOptions\Option\Delete::create("delete")
				->setDescription($this->lang['index']['options']['buttons']['delete'])
			)

			->append(\App\Mvc\View\Utils\RowOptions\Container\OptionEmulator::create()
				->setSection('bulk')
				->append(\App\Mvc\View\Utils\RowOptions\Option\Option::create("deactivate")
					->setIcon('lock')
					->setDescription($this->lang['index']['options']['buttons']['deactivate'])
					->setJsCallback("MVC.listing.installedHandlers.listing.deactivateSelectedWithConfirmation(this);")
					)
				->append(\App\Mvc\View\Utils\RowOptions\Option\Option::create("activate")
					->setIcon('unlock')
					->setDescription($this->lang['index']['options']['buttons']['activate'])
					->setJsCallback("MVC.listing.installedHandlers.listing.activateSelectedWithConfirmation(this);")
					)
				)
			->append(\App\Mvc\View\Utils\RowOptions\Option\DeleteSelected::create("delete")
				->setDescription($this->lang['index']['options']['buttons']['delete'])
			)

		;
	}
}
