oathUser = $oathUser;
$this->oathRepo = $oathRepo;
$this->module = $module;
$this->logger = $this->getLogger();
parent::__construct( $this->getDescriptors(), null, "oathauth" );
}
/**
* @inheritDoc
*/
public function show( $layout = null ) {
$this->layoutContainer = $layout;
return parent::show();
}
/**
* @inheritDoc
*/
public function displayForm( $submitResult ) {
if ( !$this->layoutContainer instanceof Layout ) {
return parent::displayForm( $submitResult );
}
$this->layoutContainer->appendContent( new HtmlSnippet(
$this->getHTML( $submitResult )
) );
}
/**
* @return array
*/
protected function getDescriptors() {
return [];
}
/**
* @return LoggerInterface
*/
private function getLogger() {
return LoggerFactory::getInstance( 'authentication' );
}
/**
* @inheritDoc
*/
protected function wrapFieldSetSection( $legend, $section, $attributes, $isRoot ) {
// to get a user visible effect, wrap the fieldset into a framed panel layout
$layout = new PanelLayout( array_merge( [
'expanded' => false,
'padded' => true,
'framed' => false,
'infusable' => false,
], [
'padded' => $this->panelPadded,
'framed' => $this->panelFramed
] ) );
$layout->appendContent(
new FieldsetLayout( [
'label' => $legend,
'infusable' => false,
'items' => [
new Widget( [
'content' => new HtmlSnippet( $section )
] ),
],
] + $attributes )
);
return $layout;
}
/**
* @param array $formData
* @return array|bool
*/
abstract public function onSubmit( array $formData );
abstract public function onSuccess();
}