Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/26/2018 in all areas

  1. Hello I am still working hard ? and I'm trying to turn the prototype into something reliable and usable. Many changes behind the scenes and some additional features. I will show a screencast soon. Thank you.
    5 points
  2. This sounds awesome! I can offer my humble testing skills even though I'm not having too much free time these days but this project is more important than ever (thinking of GDPR compliant backups, ie. encryption for backups). Last time Flydev could not reach out to too many active testers, so now I encourage anyone reading these lines to join in and offer testing – maybe even development – help to Flydev in advance if you can really do it when he needs it. Also, please do not just hit the like button but reply with suggestions too ? BTW, my first suggestions is: besides being GUI friendly, the new module could also be cli friendly: meaning wireshell integration.
    2 points
  3. I think they are referring to a Drupal setting that maps to CKEditor's config.fullPage, for editing a full HTML document? That's not something we use. Though it's possible I'm missing something. I noticed CKEditor 4 is now up to version 4.9.2 (we are on 4.8.0). Maybe they have fixed the issue in CKE. I'm going to update to 4.9.2 in PW core 3.0.107 this week, hopefully that'll help.
    2 points
  4. I've run into this problem on a client site before. I was never able to duplicate it myself, but noticed there were style attributes ending up in the CKE field of my client's site somehow, and the client said they pasted from Word. I don't have Word, and I'm not observing the issue occurring with pasting from anything else, so there must be some Microsoft trickery going on, who knows. I don't understand why CKE's ACF allows it. It does seem like a CKE bug. I'm sure it's possible to configure HTML Purifier to remove that stuff, but haven't looked too closely into it. While there is a way to force CKE to paste as plain text (see thread that flydev linked), I don't really like losing links and normal CKE formatting when I paste, because I'm often pasting from one CKE field to another, and having to redo all the formatting is a pain. Usually if I want to paste as plain text, I just use SHIFT-CMD-V on Mac (SHIFT-CTRL-V on PC), as this is a pretty universal way to paste as plain text, anywhere. But the reality is, clients aren't likely to remember it, and many are doing Edit > Paste, rather than using the keyboard. I'd rather not have the client have to think about whether they need to use plain text pasting or not. A simple way to remove style attributes from CKE fields is to hook after the process input, look for them, and then remove them. This hook at the top of your /site/templates/admin.php file should do the trick: $wire->addHookAfter('InputfieldCKEditor::processInput', function($event) { $inputfield = $event->object; $value = $inputfield->attr('value'); if(strpos($value, 'style=') === false) return; $qty = 0; $value = preg_replace('/\bstyle=(["\'])([^\1]+?)\1/i', '', $value, -1, $qty); if(!$qty) return; $inputfield->attr('value', $value); $inputfield->trackChange('value'); $inputfield->warning("Stripped $qty style attribute(s) from field $inputfield->name"); }); Word may be adding some other weirdness too, but I don't have a good example to look at to know what else there might be (MSO-specific class names?). In any case, we could probably remove it in a similar manner.
    2 points
  5. A small news about Duplicator and why its not updated recently: On the current state of the module, it is usable for small website, I mean small database (I am aware of the issue which include the parent directory in the compressed package which make the package non deployable by the installer). As stated by Ryan itself, If you are working with really large files, it may be better to perform that task directly in PhpMyAdmin or the native MySQL client. And as I am working now with giga-sized databases, its the time to rewrite this module. So what is planned ? Duplicator will be made on top of PHPBU in the hope to provide to the community a professional focused backup service for your websites. More information : Future requirement: PHP 7.x.x The official repo : https://github.com/sebastianfeldmann/phpbu Any suggestion welcome. Have a nice day ! ✌️
    2 points
  6. What form do you mean? A Page Edit form? You could look at these as a starting point: http://modules.processwire.com/modules/form-template-processor/ https://gist.github.com/somatonic/5011926
    2 points
  7. ConnectPageFields Allows the connecting of two related Page fields so that changing one updates the other. Purpose of module An example: suppose your website is about movies. You have a template "movie" with Page field "actors". For each movie you add the actors that appear in the movie. All good, but what if you want to find results like... the 10 actors who have appeared in the most movies actors who haven't appeared in any movies since 1990 You cannot retrieve these pages with a single efficient $pages->find() query, and must load a large PageArray into memory in order to iterate or filter it. For the sake of making these types of queries more efficient you could structure your templates/fields so that movies are added to actors instead, but this may be a less comfortable workflow and can run into equivalent problems (e.g. "find the 10 movies with the largest cast"). The solution is to have a two-way relationship so that movie pages have an "actors" Page field and actor pages have a "movies" Page field. This module will keep these two Page fields in sync so that adding "Ryan Gosling" to "Drive" automatically adds "Drive" to "Ryan Gosling". Also, you can select the same Page field in both Page field A and Page field B. For example, create a "Related" Page field for related pages. Choose "Related" for both fields in a pair in the module config. Now when you add "Orange buffoon" to Related for "Donald Trump", "Donald Trump" is automatically added to Related for "Orange buffoon". Usage Install the ConnectPageFields module. If you haven't already done so, create the two Page fields you want to connect and add them to templates. In the module config select the two Page fields in a "Connected field pair" row as Page field A and Page field B. You can add rows as needed using the "Add another row" button. Troubleshooting Make sure you have set the "Selectable Pages" settings for each Page field correctly: The settings for Page field A should allow pages using the template(s) that Page field B has been added to. The settings for Page field B should allow pages using the template(s) that Page field A has been added to. http://modules.processwire.com/modules/connect-page-fields/ https://github.com/Toutouwai/ConnectPageFields Module config: Demo showing how changing one Page field updates the other:
    1 point
  8. LogMaintenance A simple ProcessWire module to give some maintenance control over log files. I found myself often having lots of log files for different things that can grow more or less quickly to a size where they can be difficult to maintain. The built in Logger of PW does a good job of giving you the possibility to delete or prune logs. But it has to be done manually and sometimes a log grows into millions of lines, which makes it often impossible to even prune it as it's too large. LogMaintenance uses LazyCron to run the maintenance task and there's several settings you can setup on a global or per log basis. Archive: will create zip files for each log file in logs/archive/ folder and add the log each time the maintenance is run to a subfolder containing the datetime. Lines: keeps logs to a certain number of lines Days: keeps the log to a certain number of days Bytes: keeps the log to a certain amount of bytes Each setting is checked from top down, the first setting to contain something is used. So if you check the "Archive" option, all other settings are ignored and logs are archived everytime the LazyCron is executed. If you want to keep your logs to a certain amount of bytes just leave all other settings to 0 or blank. Per Log Settings There's a textarea that you can use to setup a config for a specific log file one per line. All the logs you define here ignore the global settings above. The syntax for the settings is: logname:[archive]:[lines]:[days]:[bytes] errors:1:0:0:0 // would archive the errors log messages:0:10000:0:0 // will prune the errors log to 10000 lines The module can be found on github for you to check out. It's still fresh and I'm currently testing. https://github.com/somatonic/LogMaintenance
    1 point
  9. Yes, the handling of form errors is great now, thanks.
    1 point
  10. @jmartsch: Thank you. Not sure. It's a matter of taste. I like it this way because I can quickly change sizes and I don't have to use the keyboard.
    1 point
  11. Just a quick thought: I think it is better and more flexible if you use an options field with autocomplete and "chosen select multiple (extra module)" for the column widths, offsets etc. Right now it looks very cumbersome. Take a look at my screencast at https://screencast-o-matic.com/watch/cF1OY3FYE2
    1 point
  12. Well if you are logged in and add a query param ?id=1001 to your url and in the template file you add $content .= $modules->ProcessPageEdit->execute(); You'll get the full form markup rendered in your front-end. It even works saving the page out of the box. There's just (quite alot) the css and JS parts missing and maybe some other things that might not work down the road. ? After all it depends what you want to achieve with it and if it's secure etc. I would prefer a Iframe modal solution and just call $page->editUrl(). OR use something like FormBuilder, Fredi (modal solution) or Frontend Edit Core Feature.
    1 point
  13. I think the Cloudinary image conversion service (they have a generous free tier) could take care of the conversion. They support TIFF. You can use their Fetch method to remotely transform your TIFFs.
    1 point
  14. Thanks again for the hook code @ryan - it works perfectly, with just one minor change - we added a question mark to stop the regular expression being greedy. It was replacing everything between the opening of the first style on the page and the closing of the last style of the page. $value = preg_replace('/\bstyle=(["\'])([^\1]+?)\1/i', '', $value, -1, $qty); It's a great workaround until they fix the bug in CKEditor. I'll keep an eye out for the next core update. ?
    1 point
  15. Will all those nice functions ever appear in the Api Reference or just when the dev reaches master? I am more or less afraid of forgetting all the nice features mentioned in the blog.
    1 point
  16. https://www.baumrock.com/portfolio/hrdiamonds-360-feedback-tool/ This tool was developed for the vienna based HR company hrdiamonds.com. They can create projects for their clients, setup the feedback architecture, choose from a library of competences and create their very own surveys and provide highly customized services for their clients. Highlights: Everything multilingual (EN/DE) PDF reports with custom designs, table of contents, page numbers, importable custom pdfs (annex, written in MS Word, so they have perfect freedom and ease of use) and of course: pretty charts (done by chart.js): Scalable and nice UI by RockGrid+batcher in several custom process modules: Automatic multilingual e-mails with several variables: Another example of RockGrid: Customizable groupings of feedback-roles (there have to be at least 3 feedbacks per role so they need to have the possibility of aggregating different feedbacks-roles). This project was online for some time already but I ported it from RockDatatables to RockGrid which I plan to release in the next days. If anybody is interested in using/reselling this tool feel free to contact me via PM ?
    1 point
  17. I use this hook to inject edit icons into the breadcrumb. Unfortunately the options exposed by $this->wire('breadcrumbs') are not great, no page id's etc… so it's kind of a hack… public function init() { wire()->addHookAfter('AdminThemeUikit::renderBreadcrumbs', $this, 'renderBreadcrumbs'); } /** * Render a list of breadcrumbs (list items), excluding the containing <ul>. * * @return string */ public function renderBreadcrumbs(HookEvent $event) { if (!$event->return) { return; } $process = $this->wire('page')->process; if ($process == 'ProcessPageList') { return ''; } $breadcrumbs = $this->wire('breadcrumbs'); $out = ''; // don't show breadcrumbs if only one of them (subjective) if (count($breadcrumbs) < 2 && $process != 'ProcessPageEdit') { return ''; } if (strpos($this->layout, 'sidenav') === false) { $out = '<li>'.$event->object->renderQuickTreeLink().'</li>'; } foreach ($breadcrumbs as $breadcrumb) { $title = $breadcrumb->get('titleMarkup'); if (!$title) { $title = $this->wire('sanitizer')->entities1($this->_($breadcrumb->title)); } $edit = ''; $icon = $event->object->renderIcon('pencil'); if (strpos($breadcrumb->url, 'open=') > 0) { $pageid = explode('open=', $breadcrumb->url); $pageid = end($pageid); if (wire('pages')->get($pageid)->editable()) { $edit = "&nbsp;&nbsp;<a href='../edit/?id=$pageid'>$icon</a>"; } } elseif (strpos($breadcrumb->url, '../') !== false && wire('process')) { $pageid = wire('process')->getPage()->parent->id; if (wire('pages')->get($pageid)->editable()) { $edit = "&nbsp;&nbsp;<a href='../edit/?id=$pageid'>$icon</a>"; } // modify open $breadcrumb->url = "../?open=$pageid"; } $out .= "<li><a href='$breadcrumb->url'>$title</a>$edit</li>"; } if ($out) { $out = "<ul class='uk-breadcrumb'>$out</ul>"; } $event->return = $out; } @ryan maybe this would be a useful addition to AdminThemeUikit?
    1 point
  18. Then with a hook, you can remove them, look : On a module : $this->addHookAfter('LoginRegister::buildProfileForm', $this, 'renderProfileForm'); protected function renderProfileForm($event) { $form = $event->return; foreach ($form->children as $field) { if ($field instanceof InputfieldEmail || $field instanceof InputfieldPassword) { $form->remove($field); } } } or in ready.php : wire()->addHookAfter('LoginRegister::buildProfileForm', function($event) { $form = $event->return; foreach ($form->children as $field) { if ($field instanceof InputfieldEmail || $field instanceof InputfieldPassword) { $form->remove($field); } } });
    1 point
×
×
  • Create New...