Jump to content

Abe Cube

Members
  • Posts

    10
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Abe Cube's Achievements

Jr. Member

Jr. Member (3/6)

0

Reputation

  1. Hello All, I want to know, if it is possible to save credentials in processwire in order to call/use it. (This is asked for FTP process to access the xml file). THANK YOU again
  2. Thank you BitPoet for your reply. Yes I uploaded the correct file. TabExtension and TabButton are two different modules but for both of them I got the same error message. I accidently posted the wrong pic for my code, but the error messages are similar.
  3. <?php namespace ProcessWire; class TabExtension extends WireData implements Module { public static function getModuleInfo() { return [ 'title' => 'Foo test module', 'summary' => 'An example of creating a module', 'version' => 1, 'summary' => 'Display message when pages are saved', 'autoload' => true, ]; } public function ready() { $this->addHookAfter('ProcessPageEdit::buildForm', $this, 'addButtons'); } public function addButtons($event) { $page = $event->object->getPage(); if ($page->template == "bewerbung") { $form = $event->return; $inputfields = new InputfieldWrapper(); $tab = new InputfieldWrapper(); $tab->attr('title', 'Settings'); $tab->attr('class', 'WireTab'); $markup = $this->modules->get('InputfieldMarkup'); $markup->label = 'Settings'; $markup->value = '<p>Just a placeholder for some inputfields.</p>'; $tab->add($markup); $inputfields->add($tab); $form->add($inputfields); } } }
  4. I also tried to implement the code that you shared. There I got the error that I shared.
  5. <?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); } }
  6. <?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); } } ?>
  7. THANKS Zeka, but there is a problem. I got some errors when I try to intall or upload the/a plugin(module). On line 41 I have ($fom->append($OriginId)). By the way, thank you so much for the reply
  8. How to add a tab button in edit page(Admin) with some inputfield. These inputfields data then later will be transfered to another database via api. I have searched almost all possibilities but could not find any similar project. I would hightly appreciated any suggestion and code guidance. THANK YOU
  9. How to add a button in the same row and opens a page with some inputfield?
×
×
  • Create New...