/** * @param $renderApi * @param \Render\Unit $unit * @param \Render\ModuleInfo $moduleInfo */ public function renderContent($renderApi, $unit, $moduleInfo) { $child = new ChildModuleDependency(); if ($child->isInsideModule($renderApi, $unit, 'rz_form')) { $this->renderFormFieldContent($renderApi, $unit); } else { $i18n = new Translator($renderApi, $moduleInfo); $msg = $i18n->translate('error.moduleOnlyWorkingInForm'); $errorTag = new HtmlTagBuilder('div', array('class' => 'RUKZUKmissingInputHint'), array(new HtmlTagBuilder('button', array('style' => 'cursor: default;'), array($msg)))); echo $errorTag->toString(); } }
public function testIsInsideUnit() { $result = $this->object->isInsideModule($this->getRenderApiMock("rz_form"), $this->getUnitMock('test_2_test'), "rz_form"); $this->assertTrue($result); }