Abe Cube Posted December 14, 2021 Share Posted December 14, 2021 <?php namespace ProcessWire; class EventClass extends WireData implements Module{ public static function getModuleInfo(){ return array( 'title' => 'Veranschtaltung', 'version' => '01', 'summary' => 'Add inputfield for Events', 'singular' => true, 'autoload' => true, ); } public function ready(){ if(wire('page')->process != 'ProcessPageEdit') return; $this->addHookAfter('ProcessPageEdit::buildForm', $this, 'addTab'); } public function addTab(HookEvent $event){ $form = $event->return; // Create Tab $EventTab = new InputfieldWrapper(); $EventTab = attr('id+name', $this->ClassName() . 'event'); $EventTab = attr('title', $this->_('Veranschtaltung')); // Add Inputfields (GrundInformation einer Veranstaltung) $OwnerId = $modules->get('InputfieldInteger'); $OwnerId-> label = 'OwnerId'; $OriginId->attr('Id', 'OwnerId') $form->append($OwnerId); $OriginId = $modules->get('InputfieldInteger'); $OriginId-> label = 'OriginId'; $OriginId-> attr('Id', 'OriginId'); $form->append($OriginId); $OriginLastUpdatedAt = $modules->get('InputfieldDatetime'); $OriginLastUpdatedAt-> label = 'OriginLastUpdatedAt'; $OriginLastUpdatedAt-> attr('Date', 'OriginLastUpdatedAt'); $form->append($OriginLastUpdatedAt); $Deleted = $modules->get(InputfieldInteger); $Deleted-> label = 'Deleted'; $Deleted-> attr('delete', 'Deleted'); $form->append($Deleted); // DetailInformation einer Veranstaltung $Title = $modules->get('InputfieldText'); $Title-> label = 'Title'; $Title-> attr('title', 'Title'); $form->append($Title); $LocationName = $modules->get('InputfieldText'); $LocationName-> label = 'LocationName'; $LocationName-> attr('locationname', 'LocationName'); $form->append($LocationName); // ActivityDates $StartDate = $modules->get('InputfieldDatetime'); $StartDate-> label = 'StartDate'; $StartDate-> attr('startdate', 'StartDate'); $form->append($StartDate); } } ?> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now