<?php

namespace Modules\Orders\ServiceItinerary;

class View_Index extends \App\Mvc\View_Popup_FormAbstract
{

	protected $renderingTemplate = "index.tpl";

	protected $formClassName='View_Utils_FormAdmin';


	public function renderSegmentRow($matrix, $index, $counter, $values=[])
	{

		// the smarty manipulation is an ugly fix to make sure the module $lang is assigned to $smarty, instead of makinmg the input load its own lang file
		\Theme::getInstance()->stdModuleSmartyAssign($this);
		$this->render_prepare(\Engine\Smarty\SmartyMultiton::getInstance());

		$responseRow = '';
		for ($i = $index; $i < ($index+$counter); $i++) {
			$responseRow.= $matrix->getRow('Engine\Form\Input\Matrix\Row')
			->setIndex($i)
			->setValue($values['segments'][0])
			->setStyle('class_body', 'clone')
			->render();
		}

		return $responseRow;
	}

}
