Jump to content

flydev

Members
  • Posts

    1,327
  • Joined

  • Last visited

  • Days Won

    47

Everything posted by flydev

  1. Your parent page is not assigned in a correct way. $form->parent = $page('template=contact-form'); // optional, saves form as page should be $form->parent = $pages->get('template=contact-form')->id; // optional, saves form as page
  2. Did you checked the browser's console to see if there an error ? Did you call the $modules->get("MarkupGoogleRecaptcha")->getScript() somewhere ? its required.
  3. hi @strandoo thanks you. I never used the module you are talking about but I read the module code on Github and it look like you can insert the ReCaptcha before the submit button by hooking into the function ___buildForm(). Please try the following (not tested) and let me know. In ready.php put : wire()->addHookAfter('FormTemplateProcessor::buildForm', function ($event) { /* @var $form InputfieldForm */ $form = $event->return; $f = new InputfieldMarkup(); $f->markupText = wire('modules')->get("MarkupGoogleRecaptcha")->render(); foreach ($form->children as $field) { if ($field instanceof InputfieldSubmit) { // find the submit button $form->insertBefore($f, $field); // insert reCAPTCHA before the submit button } } $event->return = $form; });
  4. What bernhard said - also please tell us which output strategy you use, and which profile did you installed to play with the tutorial (if there is one..) ?
  5. No problem dude, feel free to ask, it will be benefit for other people too. And you was close ? Try this : wire()->addHookBefore('LoginRegister::createdUser', function($event) { $u = $event->arguments[0]; // get user object $mail = WireMail(); // no keyword 'new' $mail->subject('Welcome to our website'); $mail->to($u->email); $body = "<p>" . "Welcome to our website " . $u->name . "</p>"; $mail->body(strip_tags($body)); $mail->bodyHTML($body . "<p><a href='$this->page->url?profile=1'>" . $this->_('Your Account') . "</a></p>"); $mail->send(); });
  6. Yes it was planned to be done in first instance trough FTP protocol. Horst had give me some code to work with but since 2 months I am so busy with my works that I didn't found the time to try it. But this feature is definitely on the top of the todo list.
  7. Hi @Ivan Gretsky Sound good to me, look like I have some work to be done! Tables are simply dropped if they exist.
  8. Yes, do not hesitate to share your result, try to make your best and we will try to send a Pull Request on Github ✨ PS: I forgot to send my post. I modified the module to bypass confirmation, if you wanna try and report back, rename your LoginRegister folder to .LoginRegister, then extract the zip in place of the original one in site/modules, refresh modules and check the box in the module's admin. File : LoginRegister.zip
  9. Nope, it's not possible in the current state of the module.
  10. Anyone already tried the module with admin page/Process modules ? I can get it working, but only by hacking the module. Not surprised here, did you tried with another var name ? ($page is a reserved word in ProcessWire) @Wanze With PHP-7.0.10 I get those warning : Edit: fixed by replacing mpdf with the version 6.1
  11. @MarcoPLY You have to call the module by using an ajax request in order to avoid the redirection when the user click. In the following example, I am using jQuery (I'm lazy) and the modal script from w3c and a new template LoginRegister.php for the example : Code of the template : JavaScript code :
  12. Sorry I can't understand all the post ?, can you please post some code or explain "better" what you are trying to achieve ? You can use LiceCap to show us a screencast of what happen on your page.
  13. Yes everything, PHP functions and also the ProcessWire API. Do not hesitate to install TracyDebugger to debug your app and speed up development
  14. More precisely, it create a new InputfieldMarkup and add it to the LoginRegister form. You can put any markup you want inside this field. Compare and try with this code : wire()->addHookAfter('LoginRegister::renderMessage', function ($event){ $message = $event->return; // get the original message // bd($message); // use TracyDebugger to get whats inside the variable - now we know how to modify the markup $message = str_replace("</p>", " (<a href='". wire('pages')->url ."?logout=1'>" . __('Logout') . "</a>)", $message); // replace markup $event->return = $message; // set the modified value back to the return value }); https://processwire.com/blog/posts/introducing-tracy-debugger/ https://www.google.com/search?q=processwire+get+started+with+hooks
  15. It just return a multidimensional array where I can check a value (key: 'closing' or 'transactions') and assign a different label.
  16. Hey @kixe thanks for this idea, I tried to implement it but I ran into an issue. I can't manage to set a different label depending on a condition. I think I must be missing something. The hook : $this->wire->addHookAfter('ProcessPageListRender::getPageLabel', $this, 'getPageLabel'); public function getPageLabel($event) { $listedPage = $event->arguments[0]; if($listedPage->template->name == 'tpl1' || $listedPage->template->name == 'tpl2') { $this->status = $this->getUpdateStatus(); foreach ($this->status as $key => $value) { $event->return = ($this->status[$key]['closing'] == -1 || $this->status[$key]['transactions'] == -1) ? '<span class="uk-label label-update-status-error">ERR</span> ' : '<span class="uk-label label-update-status-ok">OK</span> '; } } } Each page on the page-tree have the same label label-update-status-ok : Could you share a portion of code ? ? @theo sorry for hijacking your thread ? Edit: fixed, it was just bad logic in the foreach loop inside the hook. Thanks again @kixe it rocks !
  17. Sure ! ? To get you started, I hope I am not spoiling things, you can add a link quite easily. In the file ready.php put : wire()->addHookAfter('LoginRegister::buildLoginForm', function ($event) { $obj = $event->object; $form = $event->return; $f = new InputfieldMarkup(); $f->markupText = "<a href='". wire('pages')->get('/purchased-products/')->url ."'><h3>Purchased Products</h3></a>"; foreach ($form->children as $field) { if ($field instanceof InputfieldSubmit) { // find the submit button $form->insertAfter($f, $field); // insert the InputfieldMarkup after the button } } $event->return = $form; });
  18. You can only modify the markup/styles with hooks, CSS and JS - you can find some examples in the post I linked earlier - and I advice you to not modify the module himself in case update happen ? More info there : https://github.com/ryancramerdesign/LoginRegister#customization
  19. Hello Marco, Not really a direct answer, but you can find some information in this thread To add custom fields, you have to add your custom fields to the user system template. After that, Go to the LoginRegister module settings and add the fields to the profile options. Your users will be able to edit their profile with the new customs fields :
  20. Hi @elabx I did not know this property, I will make an option available for that. I plan to add new features and test the module in the next 10 days, sorry I miss time ?
  21. Hi, it look like you are looking for that: https://processwire.com/blog/posts/processwire-2.5.2/#new-wirerenderfile-and-wireincludefile-functions
  22. @szabesz Yes and because the sanitizer used on filename: https://processwire.com/api/ref/sanitizer/filename/ @adrian I will test GoogleDrive, but if you choose to keep 10 backups, it should keep deleting the oldest backup and adding the new one without the need to use the "Remove Backup Packages Older Than" option. I remember and Its possible that I changed one settings last time I pushed an update. I will check. @antpre Thanks for the feedback! ?
  23. Ok @matjazp , with your fix it works! I modified the module.
  24. Thanks for the idea, I tested with and without UAC, same thing happen. And I can confirm that permission are OK as the files are copied by the script only if the dir already exist. Directories and files in regular site/assets are created/written successfully. This drive me crazzy and I can't live with a modified core file ?
  25. Same thing here with Firefox or Chrome. Not so much annoying but it happen ?
×
×
  • Create New...