Jump to content

tpr

Members
  • Posts

    2,321
  • Joined

  • Last visited

  • Days Won

    44

Everything posted by tpr

  1. What do you think about appending the field type to the Fields asmSelect list options? I often don't remember the type by the name so it would come handy. However, since it's a plain select HTML element it cannot be styled and in the rendered asmSelect the type appears twice (also at the end of the bars).
  2. It would possible of course but I'm not sure that would be too beneficial. It would further increase the DOM weight and make more clutter, even when it could be disabled. Furthermore, many features couldn't have such indicators (eg. hotkeys) and it would be hard to create a "trademark" that would fit for most feature. But PR's are welcomed, as always ?
  3. It should be AOS, if the same file is added for translation in other languages you can navigate easily between the them.
  4. I'm not sure but perhaps it's a cross-domain issue, perhaps caused by a Firefox addon, I got the idea from here:
  5. I think it's OK. PHP shouldn't assume that the instance you are checking is in the current namespace, so you should clearly state which one to check against.
  6. Same here, but without "\ProcessWire\" the output is 0: $className = '\FieldtypeEmail'; // or $className = 'FieldtypeEmail';
  7. Just had a look at what PhpStorm offered as abbreviation, and it worked: private const CLASS_NAME = FieldtypeEmail::class; // or $className = FieldtypeEmail::class; (it would add a "use" statement if necessary but in this case it didn't as the namespace was already ProcessWire)
  8. Apparently not, my snippet fails when I exclude ProcessWire from it. Are you referring to the #5 example here? To my understanding it's the "variable being tested", and not the class name (after the "instanceof"): http://php.net/manual/en/language.operators.type.php Edit: I see, when using the constant with the instanceof directly it generates an error. He is already doing that ? @Gadgetto Could you post the whole file? Probably we could find what's happening.
  9. The self::FIELDTYPE_GROUPMAILER_MESSAGE_META is suspicious, where do you have this code, what class is it in and in what namespace? I put this in ready.php with and it works fine - note that I used \ProcessWire\FieldtypeEmail: <?php namespace ProcessWire; class G { private const CLASS_NAME = '\ProcessWire\FieldtypeEmail'; public function __construct(){ $templates = \ProcessWire\wire('templates'); $messageTeplates = array(); // both of these two below work fine $className = '\ProcessWire\FieldtypeEmail'; // $className = self::CLASS_NAME; foreach ($templates as $t) { foreach ($t->fields as $f) { if ($f->type instanceof $className) { $messageTeplates[] = $t->name; break; } } } echo count($messageTeplates); } } new G(); exit; Btw you have a typo in $messageTeplates".
  10. No problems here with Tracy 4.10.23 / 4.17.23 + PHP 7.0.33 / 7.2.6.
  11. Sorry I haven't had the chance but just had a look. I solved it without regex in v0.6.1 and the exact template name is checked. I have only tested it thoroughly so be aware ?
  12. Can't you just hide them there with CSS?
  13. @gmclelland With AOS PageListTweaks you can add "{title} [em.my-template-class]{template.name}[/em]" to a template's "List of fields to display in the admin Page list" and they are shown only in the page tree and not in the breadcrumb dropdown. Note that this requires editing every template so it may not be the one you need. @Robin S I have some pages without title and they show up in the breadcrumb menu like this: I know it's not a common thing but apparently PW saves the page even if you don't fill the title, so the page name could be added as a fallback ($page->get('title|name')). Perhaps such pages could be surrounded with eg. square brackets to indicate that it's the name and not the title.
  14. There is no regex: https://github.com/rolandtoth/TemplateLatteReplace/blob/38bce741c1b300165572aa07c8cf4e2197537cbf/TemplateLatteReplace.module#L183 I will need to check why it fails.
  15. I use something like this in AdminOnSteroids for log actin select (select to radios). But I agree that it should work for similar type fields.
  16. tpr

    SeoMaestro

    So it is multilanguage-first.
  17. Damn, I hoped it's a new feature related to water, sugar and coffee beans ?
  18. Or with AdminOnSteroids' FieldOverrides feature: https://github.com/rolandtoth/AdminOnSteroids/wiki/FieldOverrides
  19. I remember seeing this bug earlier but couldn't fix it. I'll give it another try some day, thanks for bringing this up.
  20. All done. @bernhard I had to modify return false to true to to keep processing other tables in the loop (if any).
  21. Thanks @adrian and @bernhard, I'll take care of these in the following days.
  22. tpr

    TDD in PW

    Troll Driven Developer
  23. Perhaps you need to check $item->template->hasField('id') instead.
×
×
  • Create New...