Jump to content

adrian

PW-Moderators
  • Posts

    10,912
  • Joined

  • Last visited

  • Days Won

    349

Everything posted by adrian

  1. This module is very old and I am not sure if it is still maintained - maybe it's just fine, but you might also find what you need in this PW core function: wireRelativeTimeStr() https://github.com/processwire/processwire/blob/d935e9b6995124d76e6fda17fd47ab46dc4d3a3c/wire/core/Functions.php#L283
  2. Glad to hear it's working with 2.8. Sorry about the issue with 2.7 - I think perhaps the "noLang" template setting must have been introduced in 2.8/3.x I'll update the modules directory to reflect this. Thanks for the help debugging!
  3. Ok, the problem is that you are running PW 2.5.3. Please try updating to 2.8 or 3.x. I don't think there is any way to make this module work with 2.5.3.
  4. Thanks - unfortunately it looks fine! I don't suppose there is any chance I can get access to this site to test a little? If not, we need to figure out why the module is not processing this page. I need to know that the multilanguageStatusCheck() methods is being called. If you have Tracy installed, could you replace that method with this: public function multilanguageStatusCheck(HookEvent $event) { $p = $event->object->getPage(); bd('pid:'.$p->id); // if actual noLang setting for this page's template is set to disabled (1) then exit now so we don't potentially enable if($p->template->noLang === 1) return; bd('OK1'); $parentsToMatch = array(); foreach($this->data['multilanguageStatus'] as $pid => $settings) { if($settings['onlyThisPage'] != 1 || $p->id === $pid) $parentsToMatch[] = $pid; } $pageMatchSelector = "id=".implode("|", $parentsToMatch); bd($pageMatchSelector); // parent() doesn't include current page $this->closestSpecifiedParent = $p->parent($pageMatchSelector); // closest() includes current page $this->closestMatch = $p->closest($pageMatchSelector); // if there's a match, set the noLang value for the page's template appropriately if(isset($this->data['multilanguageStatus'][$this->closestMatch->id])) { bd('match'); $p->template->noLang = ($this->data['multilanguageStatus'][$this->closestMatch->id]['status'] == 'disabled') ? '1' : '0'; } // if no match, then use default from config settings else { bd('no match'); $p->template->noLang = $this->data['multilanguageDefaultStatus'] == 'disabled' ? '1' : '0'; } } and then post a screenshot of the dumps panel for me.
  5. No, I am looking for this - do you have access to PHPMyAdmin or similar to browse the PW "modules" table?
  6. Sorry about this. Can you please post the contents of the data field on the RestrictMultiLanguageBranch row of the PW modules db table?
  7. @adrianmak - thanks for that. Sorry about the problem. Can you please try the new version I just committed. I have updated the modules directory, so it should be available from the update check.
  8. @adrianmak - can you please post a screenshot of the settings for this module that are at the bottom of this page's Settings tab?
  9. There are several options: 1) The easiest option would be in the Console Panel in TracyDebugger 2) Converted to an action for the Admin Actions module - this would be a great option because I expect there will be lots of users wanting to convert from Thumbnails to Croppable image over the next few months - hint hint @netcarver, @horst, or @jacmaes 3) In a test hanna code 4) In a template file 5) In a bootstrapped script in the root of your site
  10. Quick update to the CreateUsersBatcher action. It now allows two options: 1) Define Username and email address (requires EmailNewUser to generate password). 2) Define additional user template fields (whichever ones you want). If you use this option and include the password, then you don't need the EmailNewUser module. You could even given all staff at a client's office the same temp password and let me know by phone (this way there is no security risk with emailing even a temporary password that will be changed) - it's your choice. Hopefully this screenshot will help to explain it better - note that the "New Users" textarea lists the fields from the user template and the order they need to be entered. In this example I have additional "first_name" and "last_name" fields, as well as the field added by the PasswordForceChange module which you can set to 1 to enforce this if you want.
  11. Hi everyone, To celebrate @teppo featuring this module in PW Weekly, I have added a new action: Create Users Batcher It lets you quickly create many users by entering: "username, email address" on separate lines in a textarea. This action requires the EmailNewUser module and it must be configured to automatically generate a user password. The action checks for this module and that setting before it will let you proceed. I also recommend that you install the PasswordForceChange module to reduce the risks of having emailed a password to a user. You can set multiple roles to be added to each new user. Be aware that at least one of these roles must have the "profile-edit" permission so that the user has the ability to change their password when they first login. Note that EmailNewUser will report each successful user creation and email sent success. I hope that the next time you need to create several users for a new client that you'll give this a try. And of course, don't forget to send me your own actions for inclusion with the module
  12. Nice sleuthing - sorry, I should have thought to mention that since I posted this issues ages ago: https://github.com/ryancramerdesign/ProcessWireUpgrade/issues/10
  13. Definitely working here. Have you done a Modules > Refresh? Maybe it is caching the source?
  14. FYI - this module has been updated and now points to the new repos: https://github.com/ryancramerdesign/ProcessWireUpgrade/commit/5333322703f0f47a6d6454e8fdb3107db330eec4
  15. @mel47 and @Klenkes - not ignoring you guys - I will try to take a look at your issues/requests in a next few days.
  16. I haven't tested your new module yet - I am sure it will work great But back to the thoughts from my last post, I was thinking of hooking into: Inputfield::getConfigInputfields and adding the selector and custom php options there. Anyway, when I have a minute I'll try your module and also take a look at that hook and see if I can implement it that way as well.
  17. Hey @Robin S - obviously I don't know what approach you have taken so far, but I just had another idea for how this could be implemented. Perhaps under the field's Input > Visibility > ShowIf settings, there could be new options: 1) a selector text field, 2) a custom PHP code textarea. This would be a little like the Input > Selectable Pages options for Page fields. Anyway, I think this could be really powerful - if the currently edited page doesn't match the selector, or the custom php doesn't return true, the field would be hidden completely from the page editor for that page. What do you think ?
  18. Hey @kongondo - when adding via the API, eg: $matrix = new Matrix(); $matrix->row = 1060; $matrix->column = 1073; $matrix->value = "This is my value"; $p->results->add($matrix); $p->save('results'); is there a recommended way to overwrite existing rows? At the moment doing this when the cells are already populated results in duplicated entries in the "field_matrixfield" db table. Obviously only one set is shown when editing the field on a page in the backend, but I am worried about consistency of what will be returned (backend and frontend) and of course just wasted db space and data integrity. I am thinking that the easiest option might be to just remove the entries manually with a raw SQL statement before adding the matrix row. Any thoughts? Thanks!
  19. Whether it is actually meaningful or not, it might help convince your clients - ProcessWire won the best small business CMS for 2016: https://www.cmscritic.com/awards/
  20. $event->object->getPage(); should get you the page being edited.
  21. Check out the top two PR's: https://github.com/ryancramerdesign/FieldtypeMapMarker/pulls Hopefully the second one down will take care of it. I have used that for when this field is in a fieldsettab and it works.
  22. Now that's what I call service, or maybe it's just "Great minds think alike" Can't wait to see what you have put together!
  23. Hi everyone! Just curious if anyone has developed a solution for this. I feel like it has been mentioned somewhere before, but I am not finding anything. I have a site with a complex, but repetitive tree (hence my various branch restriction modules), and I am finding myself wanting the ability to add a field but only have it available on a specific branch. I obviously don't want a separate template for this one field so I am thinking of creating something to make this possible, but just want to make sure I am not reinventing the wheel. It might be best to just go with a simple hook that is specific to this scenario, but maybe this is also an opportunity to build something that makes it easier to manage these situations through the field's settings. At first thought I am thinking of a new "Branch Restrictions" tab (between Access and Advanced) on the field settings page that lets you limit what pages it will appear on. Any thoughts?
  24. Based on @Macrura's example - maybe just a personal preference more than anything, but I prefer the look of this. I do think it really helps to indent the code though function renderUkGrid($page) { return " <div class='uk-grid uk-grid-large'> <div class='uk-width-medium-1-3'> <div class='uk-panel uk-panel-box prodotto__panel-mod'> <div class='uk-panel-teaser'> <div class='uk-cover-background' style='background-image: url({$page->product_image->url});'> <img class='uk-invisible' src='{$page->product_image->url}' width='600' height='400' alt='Placeholder'> </div> </div> </div> <a class='prodotto__panel-links prodotto__panel-links-blue' href='{$page->url}'><span>Discover more</span></a> </div> <div class='uk-width-medium-2-3'> <div class='prodotto__descr'><span>{$page>product_options->title}</span> <h3 class='shadow-blue'>{$page->title}</h3> <p>".truncateText($page->product_description)."</p> <p><a href='{$page->url}'><i class='uk-icon-chevron-circle-right uk-margin-small-right'></i>Link</a></p> </div> </div> </div> "; }
×
×
  • Create New...