Jump to content

bernhard

Members
  • Posts

    6,670
  • Joined

  • Last visited

  • Days Won

    366

Everything posted by bernhard

  1. ok last time it was not critical but now it was, so i implemented this little hook to check unsaved changes via javascript when clicking on the button defined at line var buttons = '#button_example_id'; when the user clicks the button the confirm-dialog appears code: /** * show warning message on button click if there are unsaved changes in the form **/ public function confirmUnsavedChanges($event) { $page = $event->object; // only add this to admin pages if($page->template != 'admin') return; ob_start(); ?> <script type="text/javascript"> $( document ).ready(function() { // buttons to observe var buttons = '#sendLoginLinkButton, #newInvoice'; $('body').on('click', buttons, function(e) { var msg = InputfieldFormBeforeUnloadEvent(true); if(typeof msg != "undefined" && msg.length) { if(!confirm(msg)) { e.preventDefault(); return false; } } }); }); </script> <?php $script = ob_get_clean(); $event->return = str_replace("</body>", $script."</body>", $event->return); }
  2. i just installed tracy and had some problems: im on 2.7.2 and installation went without problems. but i can't see the debug bar. neither on frontend nor on backend. i tried with a different browser because i have some problems with visibility sometimes on my laptop and got the following error on the pw-login screen: debug->true Fatal error: Cannot use object of type TracyDebugger as array in /var/www/.../site/modules/TracyDebugger/TracyDebugger.module on line 476 Error: Cannot use object of type TracyDebugger as array (line 476 of /var/www/.../site/modules/TracyDebugger/TracyDebugger.module) This error message was shown because site is in debug mode ($config->debug = true; in /site/config.php). Error has been logged. debug->false Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Error has been logged. besides those errors: do i have to do some additional things to see the tracy bar? thanks for your help
  3. Hi can, Thank you for the module. It would be great to have a description of what the module does or a screenshot
  4. hi mrjasongorman, thanks for sharing! could you please also share some details on how you deciphered the code? thank you
  5. thank you reno, saved my life today after hours of messing around with regex when trying on my own... should have searched earlier
  6. update: v 2.0.0 - added support for ajax loaded fields including repeaters - added sanitization for the jquery selector
  7. does <?php echo $page->google_map->lat; ?> output anything?
  8. hi horst, thank you for your module. could be that i need it one day, though i have to say it was all new to me and your explanation in the other thread was helpful for me: https://processwire.com/talk/topic/11927-wirequeue-needs-testing/?p=111287 thank you also for the screencasts that helped me a lot understanding what it is all about. i think you mean "does not have to be done" as "must not be done" = "darf nicht innerhalb pw gemacht werden", right? could you please explain why you used TXT/SQLite for data storage? why not use a mysql table from within pw? thank you
  9. bernhard

    5 of a kind

    didn't have time to integrate a module... one of those sentences i love processwire for
  10. awesome! the search could maybe be a great help if it worked would also prefer a light theme i think...
  11. awesome! but i'm still excited how (and when) PW 3 will handle client side image resizing https://processwire.com/blog/posts/happy-new-year-heres-a-roadmap-for-processwire-in-2016/#what-else-is-coming-for-processwire-3.x-in-2016
  12. bernhard

    5 of a kind

    really great work
  13. hi marco, sounds like https://processwire.com/api/modules/multi-site-support/ option #2 would be worth a try. but it depends a lot on the setup of your sites. are they exactly the same or should they be different? i think pw 3.0 should also be able to grab data from other installations but i have no experience with it so far
  14. had an issue today when using a name like "example.com transfer profile" it showed up in the select box but after clicking on "continue" it said "no site profile found"
  15. thank you adrian - i know i wasn't dreaming! that's really strange because recently i discovered that i don't see some site elements that should be there. thats not related to processwire. don't know where this comes from, its only on my new laptop with touchscreen. i also do not see pagelistactions on hover... it only works on firefox, not on chrome and IE but thats offtopic here and i will investigate when i have more time...
  16. hmmm... i thought there was an option for this in the core recently but can't find where. or have i been dreaming?!
  17. Good idea. Would be good for images but in my case I have to do some php work on button click so it would have to be some complicated ajax...
  18. @lostkobrakai can you confirm that when clicking this button the page is NOT saved. so if you edit other fields the changes will get lost. any way to change this behaviour? the reason is i created a button "create invoice" for a client and if he changes some fields (address for example) and clicks the button "create invoice" without saving the page before this changes will get lost
  19. You would have to use OR instead of AND Glad it helped
  20. Thank you Adrian. Seems that the blog post came 3 months too early for me. I read it but didn't remember. Now it makes sense
  21. if you want to get access to eg $pages in modules you have to do something like $pages = wire('pages'); sometimes i see people using $this->wire('pages') like here for example: https://processwire.com/talk/topic/11939-make-dashboard-plugin-page-the-default-admin-page/?p=111017 is there any difference in those two methods? i also saw $this->user->name and i was not sure if that would work inside a module because i thought it should be wire('user')->name thank you in advance
  22. hi christophe, maybe this helps: put this in your /site/ready.php $wire->addHookAfter("ProcessPageEdit::buildForm", function(HookEvent $event){ $process = $event->object; $page = $process->getPage(); $user = wire('user'); // example: limit code to one template if($page->template != 'basic-page') return; // example: limit it to user role if(!$user->hasRole("membres")) return; $config = wire('config'); $config->scripts->append($config->urls->templates . 'scripts/yourscript.js'); $config->styles->append($config->urls->templates . 'styles/yourstyle.css'); }); of course you will have to put your script or style-files in the appropriate folders (in the example above it would be the folder /site/templates/scripts or /site/templates/styles
  23. Or something like While ($pages->count("title=".$title.", parent...) $title.="-1"; Sorry on mobile
  24. I was really surprised why you are asking this when you are developing awesome modules with ajax field reloading at the same time
  25. hi kixe, sorry - i was unclear. "think it would be good to handle this one as well" was meant as "would be good to handle this as a wrong input" and maybe give an appropriate error message that helps the user find a correct string. "val" was just a placeholder for any value. as i said i don't need this because i switched to standard name for children + creating title field on page save per custom module. i agree that there is room for improvement in the core at this special step of naming children automatically
×
×
  • Create New...