Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/20/2025 in all areas

  1. This week on the dev branch there are some issue fixes and new features. ProcessWire’s modal JS alert functions have been upgraded to use Uikit modals. Previously they were using Vex modals, but it appears that Vex is no longer maintained, so when we ran into an issue with them it just made sense to switch to Uikit for this, at least when AdminThemeUikit is the current admin theme. The JS functions affected are ProcessWire.alert(), ProcessWire.confirm() and ProcessWire.prompt(). All of which can be found in ProcessWire’s main.js file used by admin themes. ProcessWire’s Markup Regions output method was updated this week to support class removal by wildcard or regular expression. When you specify a class attribute with a class name that starts with “-“ that means that you want to remove that class from the element you are overriding/appending/prepending. Previously you had to specify the full class name you wanted to remove. Now you can specify a wildcard like this: <div id="content" class="-uk-width-*" pw-append></div> That would make it remove all classes from #content that start with "uk-width-". You may place the wildcard anywhere in the expression that you want to, enabling you to remove by prefix or suffix. But if that’s not enough, you can also specify a regular expression like this, which would do the same thing as the above: <div id="content" class="-/^uk-width-.*$/" pw-append></div> That's probably overkill for most, but between the “/“ delimiters, you may use any PCRE regular expression. Usually when we add a class to a markup region, we just specify it like a regular HTML class attribute. But if you want to add a class that would match what you are removing, you’ll want to prefix your class name with a plus sign. That tells the Markup Regions processor not to remove it even if it matches your rule. For example, the following would remove all uk-width classes and then add a uk-width-1-4 class: <div id="content" class="-uk-width-* +uk-width-1-4" pw-append></div> Regarding the new ProcessWire website: it’s nearly done except for the homepage. I’m saving the best part for last. I’m not saying the site will launch tomorrow, as there’s still a lot of detail work to take care of too. But I did want to say that a lot of progress has been made and hopefully it won’t be too much longer before we launch it. Thanks for reading and have a great weekend!
    2 points
  2. I just built an application using Livewire and it was a blast to work with, mentioning given NativePHP's support for Laravel. I recommend it if there's a project that has requirements to justify it while avoiding JS hell in full stack. I essentially wrote 130 lines of JS for an app with AJAX, dynamic forms + validation, file uploads, notifications dispatched from the server, SPA navigation, polling, etc. That aside, it would be pretty amazing to see a PW to desktop bridge. For all the power full stack frameworks offer- they're too open ended for a lot of projects and ProcessWire would be really rad alternative to see in this context. Hope to see something with your project @flydev! First app I would build would be an app to track all the work I'm not doing while I'm building a ProcessWire desktop app (billion $ idea, get in on the ground floor, investors welcome).
    2 points
  3. https://nativephp.com/docs/1/getting-started/introduction "NativePHP is not a GUI framework. We don't want to tell you how to build your app. You can choose whatever UI toolset makes you and your team feel most productive." "#What's in the box? NativePHP comes with a bunch of useful features out of the box, including: Window management Menu management File management Database support (SQLite) Native notifications" What can I build with NativePHP? Honestly, anything you want. The only limit is your imagination. Now for building Windows apps too: https://github.com/orgs/NativePHP/discussions/278
    1 point
  4. Version 1 is here! https://github.com/orgs/NativePHP/discussions/547 Mobile apps capability in the works: Not surprised; given that Caleb Porzio also wrote Alpine.JS 😊.
    1 point
  5. Ever needed a color picker on some kind of settings page? Didn't want to install and setup a full-blown colorpicker module? Here's a quick and dirty hook to change a regular text field into an <input type="color"> type of input: Before: After: <?php public function init(): void { wire()->addHookBefore('Inputfield::render', $this, 'changeFieldType'); } public function changeFieldType(HookEvent $event): void { $f = $event->object; $colorFields = [ Site::field_col_primary, Site::field_col_secondary, Site::field_contrast_primary, Site::field_contrast_secondary, ]; if (!in_array($f->name, $colorFields)) return; $f->attr('type', 'color'); } So right before the text input is rendered we change its "type" property to "color" and the browser will render a default color picker 😎 It once more shows how versatile ProcessWire is. And maybe it helps someone... 🙂 PS: Be advised that with that hack you only modify the optics of the field. The field will under the hood still be a regular text field, which means you'll not get any sanitisation or such from it and you might have to take care of that on your own. In my case it's a superuser-only settings page. So it is no issue at all.
    1 point
  6. LyriChord is a Fieldtype, Inputfield and Markup module that lets you input a song's lyrics and optionally chords. You can input these manually or by importing from your clipboard. Inspired by the challenge posed by @oscarale in this thread: The markup module is optional. You can output your song the way you wish. For the HTML I prefer to use tables as they make it easier for things to be aligned properly without having to play around much with the CSS. Planned Features IMPORT XML HTML JSON CSV OCR PDF Other? NOTATION Staff? Guitar Tabs Solfa BOOKS Song books Pagination? EXPORT OTHER Support for syllables Transpose ??? Project + Download TBD soon. I need to cleanup a few things Quick(-ish) Demo
    1 point
  7. Correct. My code is wrong. I was searching for this answer today and didn't even remember I'd written this. I have revised my answer just now: // Add these lines to your config.php file. // Tell PHP to use this timezone as the default when a timezone API call doesn't specify a zone. // Change to your local time zone name: https://www.php.net/manual/en/timezones.php date_default_timezone_set('America/New_York'); // Initialize database connection with session time zone based on PHP's time zone. $config->dbInitCommand = (function() { $charset = 'utf8'; // What is the timezone offset (in minutes) from UTC for the current time in the current timezone? $minutes = (new \DateTime())->getOffset() / 60; $sign = ($minutes >= 0) ? '+' : '-'; $h = str_pad(intdiv(abs($minutes), 60), 2, '0', STR_PAD_LEFT); $m = str_pad(abs($minutes) % 60, 2, '0', STR_PAD_LEFT); $dbTimeZone = "{$sign}{$h}:{$m}"; return "SET NAMES '{$charset}', time_zone = '{$dbTimeZone}'"; })(); // Tell ProcessWire to use this timezone. // (You'll find this in your config file already under the comment "Installer: Time zone setting".) $config->timezone = 'America/New_York';
    1 point
×
×
  • Create New...