Leaderboard
Popular Content
Showing content with the highest reputation on 02/12/2017 in all areas
-
Hey @bcartier and everyone who is following. I implemented a basic language support. Nothing really changed, except now with LanguageSupport enabled in your ProcessWire app, the GraphQL api will return the content in whatever language the user is assigned. In addition, when Language Support module is activated, there is a language field in your GraphQL api. So you can request the exact language you want. It looks like this. { language(name: "de") basic_page{ list{ title summary } } } You need to put the language field on the top. Well, not exactly on top but just before fields that return translatable content, like title, headline, body etc. It's because GraphQL processes requested fields from top to bottom and it will not know what language you want till it gets to language field. Did you also know that in GraphQL you can query same field multiple times with aliases? Here, take a look at this { basic_page_default: basic_page{ list{ title summary } } language(name: "de") basic_page_de: basic_page{ list{ title summary } } } Curious what will be the response? Try this with site-languages profile and find out.5 points
-
AdminOnSteroids is nice and it's features should be evaluated for the new admin theme, but I'm not sure there's even remotely the need to implement them in the core like you're describing things. The core should not strive for feature completeness, but rather in the direction of the simplest possible subset of features needed by most of our users. Everything else is a matter for optional (core or 3rd party) modules. Talking about your example I'd imagine that hiding description/notes is rather a anti-pattern for most use-cases as they're usually filled with information the editors/moderators of a site tend to forget but are important none the less.5 points
-
You just need to add curly braces around the thumbnail url variable: $dt = "<a href='$item->url'><img src='{$item->thumbnail->url}'></a>"."<a href='$item->url'>$dt</a>"; Using curly braces around variables tells PHP exactly where the start and the end of the variable name is, so it doesn't get confused with other neighbouring text that isn't part of the variable name. You can use curly braces around any variable and it wont hurt, but usually isn't necessary until you use more than one -> in your variable or have some other complex variable expression. That's why you get the problem with $item->thumbnail->url but not $item->url.3 points
-
No there isn't at the moment. There will be support for it of course. The way it will work is if the user has a view access to the image field she will be able to fetch all the available image information, including the thumbnail variations. For user to be able to create thumbnails herself, she will need an edit access for that field.3 points
-
Yes. And the setup is : Ubuntu 16.04 Apache 2.4.18 MySQL 10.0.29-MariaDB PHP-7 ProcessWire 3.0.52 add this directive to your VirtualHost in /etc/apache2/sites-available/000-default.conf : <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>2 points
-
There was a blog post that the new admin theme will have some kind of sidebar if I remember right. Is this idea rejected?2 points
-
It might be obvious but I would like to point out that this would be the right time to implement most (if not all ) of the features of AdminOnSteroids which means at least a built in admin theme settings page to customize things to our liking, similar to AOS. However, there are features in AOS which can even be made better when implemented as integrated parts of the admin theme, such as "hiding"/revealing the Descriptions and Notes of fields. Having Descriptions and Notes around is extremely useful, but only in "development mode". When things are set up, they just take up space, distracting navigation and focusing, so I generally "hide" them by AOS (turning them into tooltips), but oftentimes I disable AOS, just to be able to skim through them quickly. Enabling/disabling AOS is not the best solution, because I loose all other functionalities of the module, but a native admin theme feature like this would only switch the relevant option of the admin, not all the others all at once. This can even be taken to the next level by being able to specify it on a field-by-field basis. The above mentioned example is just one, AdminOnSteroids is full of handy-dandy goodies that could boost the new admin theme a lot if implemented in an integrated manner.2 points
-
Ditto this. I have been following this module development with huge interest. I too develop SPA with VueJS and this module will be very useful. Hopefully not a stupid question, but is it possible, for example, to get cropped images? Or more of a general question, can you manipulate the data before you fetch it? Here is an example of the JSON I generate ATM: { "banners": [ { "origin": { "description": "", "httpUrl": "http://www.mysite.localdev/site/assets/files/1/img.jpg", "width": 2500, "height": 1666 }, "thumb": { "httpUrl": "http://www.mysite.localdev/site/assets/files/1/img.400x400.jpg", "width": 400, "height": 400, "orientation": "" }, "bp": { "400": { "httpUrl": "http://www.mysite.localdev/site/assets/files/1/img.400x300.jpg" }, "800": { "httpUrl": "http://www.mysite.localdev/site/assets/files/1/img.800x600.jpg" }, "1200": { "httpUrl": "http://www.mysite.localdev/site/assets/files/1/img.1200x900.jpg" } }, "srcset": "http://www.mysite.localdev/site/assets/files/1/img.400x300.jpg 400w,http://www.mysite.localdev/site/assets/files/1/img.800x600.jpg 800w,http://www.mysite.localdev/site/assets/files/1/img.1200x900.jpg 1200w" } ] }2 points
-
@Nurguly Ashyrov I really like what you do here! So much fun to see this. Unfortunately I have no time ATM to start playing / using it. (buhuhh, - schnüff)2 points
-
@Oliver, @bcartier Thanks guys. Glad you like it. No, Language fields are not supported yet. There will be support for them too. Maybe I will implement them this weekend. In any case I will let you know when they are available. For those who are following this module, I make releases almost everyday. Sometimes I introduce new bugs but patch them as soon as I find them. There are bunch of features added since the first introduction. You can follow up the changes/additions in the changelog. Lots of parts are not documented yet but I will provide full documentation and possibly introduction video targeted to ProcessWire users, on what the module is about, how you can use it, along with some todo app tutorial. But for now, feel free to play with it and provide some feedback either here or in issue tracker. It is always easier to make changes in the beginning.2 points
-
Last update: June 2024 Current stable version: 1.5.4 Dev version: github dev-branch You can find the module on Github and in the modules directory : https://modules.processwire.com/modules/duplicator/ https://github.com/flydev-fr/Duplicator/archive/master.zip Screenshots / Features Dir and files exclusion CRON job Advanced settings Local and Cloud storage duplicator.mp41 point
-
NOTE: This thread originally started in the Pub section of the forum. Since we moved it into the Plugin/Modules section I edited this post to meet the guidelines but also left the original content so that the replies can make sense. ProcessGraphQL ProcessGraphQL seamlessly integrates to your ProcessWire web app and allows you to serve the GraphQL api of your existing content. You don't need to apply changes to your content or it's structure. Just choose what you want to serve via GraphQL and your API is ready. Warning: The module supports PHP version >= 5.5 and ProcessWire version >= 3. Links: Zip Download Github Repo ScreenCast PW modules Page Please refer to the Readme to learn more about how to use the module. Original post starts here... Hi Everyone! I became very interested in this GraphQL thing lately and decided to learn a bit about it. And what is the better way of learning a new thing than making a ProcessWire module out of it! For those who are wondering what GraphQL is, in short, it is an alternative to REST. I couldn't find the thread but I remember that Ryan was not very happy with the REST and did not see much value in it. He offered his own AJAX API instead, but it doesn't seem to be supported much by him, and was never published to official modules directory. While ProcessWire's API is already amazing and allows you to quickly serve your content in any format with less than ten lines of code, I think it might be convenient to install a module and have JSON access to all of your content instantly. Especially this could be useful for developers that use ProcessWire as a framework instead of CMS. GraphQL is much more flexible than REST. In fact you can build queries in GraphQL with the same patterns you do with ProcessWire API. Ok, Ok. Enough talk. Here is what the module does after just installing it into skyscrapers profile. It supports filtering via ProcessWire selectors and complex fields like FieldtypeImage or FieldtypePage. See more demo here The module is ready to be used, but there are lots of things could be added to it. Like supporting any type of fields via third party modules, authentication, permissions on field level, optimization and so on. I would love to continue to develop it further if I would only know that there is an interest in it. It would be great to hear some feedback from you. I did not open a thread in modules section of the forum because I wanted to be sure there is interest in it first. You can install and learn about it more from it's repository. It should work with PHP >=5.5 and ProcessWire 3.x.x. The support for 2.x.x version is not planned yet. Please open an issue if you find bugs or you want some features added in issue tracker. Or you can share your experience with the module here in this thread.1 point
-
Soundmanager2 Audio for Processwire Github: https://github.com/outflux3/TextformatterSoundmanager Modules Directory: http://modules.processwire.com/modules/textformatter-soundmanager/ This module provides most of the free audio player interfaces for Soundmanager2 by Scott Schiller: Bar UI 360 UI 360+ spectrum UI mp3 buttons mp3 links Page Player, muxtape-style UI Cassette Player The module is a Textformatter that works by allowing you to insert shortcodes which are parsed into audio players. The players may be placed anywhere in the content (ck editor or other text field) using the shortcode, for example: [smplayer tag=audio1] The output will be a default single player (as specificed in the module settings), or if multiple audio files have the same tag, and you don't specify a type (UI), it will default to the Bar UI for the playlist. You may also specify page-player for the type as it also supports playlists. Here is a more complex tag: [smplayer tag=audio1 type=bar-ui color=2288CC] the tags available on shortcodes are: tag - *required to find the audio file on the page type (the type of player) limit (limit the number of files to load when using a playlist) Player specific tags for Bar UI: bar-ui (options for the bar-ui player) skin (applies to a bar-ui skin to load) extra (when set to true, it will display the extra controls) color (hex value for color - applies to bar-ui and mp3 buttons) compact (makes the player very narrow) playlist-open (make the playlist drawer open instead of needing to click the playlist button to open it.) dark-text (instead of white) flat (remove the faux 3d effect) When using the shortcode, you can chain the tags using underscore, for exmaple: [smplayer type=bar-ui bar-ui=flat_playlist-open_dark_text] Player specific tags for Cassette: cassette (options for the cassette player) In case you are not familiar with SM2, it powers a lot of major audio on the web, like Soundcloud, LastFM, AllMusic etc). The players are all rock solid and work on a wide range of browsers and devices. Features Multiple Audio Formats SM2 supports many formats, and those can be enabled/disabled in the module config if you want to prevent any from being loaded. So far this module was tested with MP3 and AAC (.m4a). GetID3 Support When enabled, ID3 tags from every audio file that pass through the Textformatter are read and cached as arrays using WireCache. Therefore the first load of a page with new audio files may be slow while the tags are read and stored. The tags are indexed by the filename of the audio, so as long as you don't upload multiple files with the same filename, or change the tags, the system will store the metadata permanently. To remove any metadata, you would need to use Soma's Cache Admin module, or clear it from the database. Schema Support When enabled, some schema tags relating to audio files will be added to the markup. CK editor Plugin Very basic dropdown that inserts some pre-configured player codes into the editor. Copy the plugin into your CK editor plugins folder, enable and add a button for 'soundmanager'. Instructions Before you install: 1) You will need a files field that accepts audio files, so set the extensions you want to use, such as mp3, m4a, mp4, wav etc. 2) Also make sure that you enable tags on the files field because the module references the tags for any audio file in the shortcode. 3) Add the files field to your template. Installation and Setup 1) Install the module and adjust your settings from the module configuration screen. 2) Add the TextformatterSoundmanager textformatter to the field where you want to insert audio (e.g. 'body'). 3) Optionally install the CK editor plugin to enable quick access to preconfigured shortcodes. 4) Add a shortcode into the textarea field that has the textformatter applied to. 5) You must reference the tag you entered in the audio file's tag field in the shortcode, and that will create a player for that audio file. 5a) To create a playlist, put the same tag in multiple audio files. Output 1) In order for the module to output the necessary styles and scripts, you need to echo the $config->styles and $config->scripts arrays into your site's header/footer. Here is an example: // In Header foreach($config->styles as $style) echo "<link rel='stylesheet' type='text/css' href='{$style}' />\n"; // In Footer foreach($config->scripts as $script) echo "<script type='text/javascript' src='{$script}'></script>\n"; API Usage To access the module's player method directly, you would first init the module in your _init.php file: $sm2 = $modules->get('TextformatterSoundmanager'); then anywhere in your templates, you can output any audio file with any player, in an configuration like this: $options = [ 'type' => 'bar-ui', 'skin' => 'gradient-fat', //'tag' => 'audio1', // tag is not needed when using the API //'bar-ui' => 'playlist-open' //all of the classes to apply to the bar ui. ]; foreach($page->audio as $track) { $content .= $sm2->player($track, $options); } Advanced Features Using other pages for storing music as playlists. You can create a field to hold a tag for a **page* and then refer to that tag in your shortcode. The shortcode word would be smplaylist instead of smplayer. The module will search the site for pages with that tag in that field. Then it will output all of the audio files in that page's audio field using the player and settings you specify. See the module configuration to select the tag field and adjust your shortcode words. Caveats Some player will not work well on the same page as other players. Bar UI and Page Player 360 Player and 360 Visual (large) players Also note that the cassette player can only occur once on a page. You can have multiple cassettes output, but they will all play the same audio file. The file that the cassette player uses is set in the script tag. In the future the setup may be modified to allow for cassette players to have their own audio files. About Soundmanager2 http://www.schillmania.com/projects/soundmanager2/ Speak and be heard More sound, in more places Despite being one of the senses, sound has largely been missing from the web due to inconsistent technology support. SoundManager 2 bridges this gap, making it easier to use audio across a growing variety of devices and platforms, both desktop and mobile. HTML5 + flash hybrid Complexity, reduced Supporting HTML5 audio can be tedious in modern browsers, let alone legacy ones. With real-world visitors using browsers ranging from mobile Safari to IE 6 across a wide range of devices, there can be many support cases to consider. SoundManager 2 gives you a single, powerful API that supports both new and old, using HTML5 audio where supported and optional Flash-based fallback where needed. Ideally when using SoundManager 2, audio "just works." The ginsu knife: 12 KB Big features, small footprint Performance is an important metric, too. SoundManager 2 packs a comprehensive, feature-rich API into as little as 12 KB over the wire when optimized; that's less than 8% of the original, uncompressed file size. SM2 is self-contained, having no external dependencies, and is compatible with popular JavaScript frameworks. The source code is BSD-licensed and is provided in fully-commented, non-debug and compiler-optimized "minified" versions appropriate for development and production use.1 point
-
Try to empty the database and remove the content of /var/www/html then upload a new copy of ProcessWire. After that give permission to apache: chown -R www-data:www-data /var/www/html Now try to reinstall ProcessWire. If it doesn't work then reinstall the whole thing Sorry for the short answer i am on mobile.1 point
-
http://leafletjs.com/examples/choropleth/ Another awesome option for chloropleth maps is: http://datamaps.github.io/1 point
-
The message just says the user or password is invalid, and that the client did provide a password. Invalid user may also mean that the configured user account is only valid for '%', which means any remote client, not localhost. You did create the fubar@localhost user, didn't you?1 point
-
I'm not sure cause every other link on ProcessWire works great except the link injection in this module. On the AdminCustomFiles.module I replaced the 249 line: 'relative' => substr($base, strpos($base, '/site/templates/')), to this and it worked: 'relative' => substr($base, strpos($base, '/mysite.com/site/templates/')), It seems that the module can't recognize that ProccessWire installed on localhost/mysite.com.1 point
-
1 point
-
hi roych, you should be as clear as possible in your questions. you don't explain what the problem is. you could add screenshots how it is and how it should be. styling is usually done via CSS. answers depend a lot on your setup...1 point
-
A file config-body.js is included by default to demonstrate how you can create config files that target individual fields. If you want the global config.js to affect the body field you must delete (or rename) config-body.js1 point
-
I'm not sure how the custom grid feature will be implemented, we have to wait to see it in action. The sidebar is something I would really miss.1 point
-
Yeah, but please also consider the subset of users not even using AOS.1 point
-
Ryan says in his new blog post: "For instance, if you like a 2-column layout (like Reno) rather than 1-column layout (like Default) then that's a simple matter with the built in grid system. Nothing is set in stone, and our focus is on establishing the system to provide the path and flexibility for it all." also: "So what I've been doing here is coming up with a basic admin theme profile that the skilled designers in our community can then run with. My hope is this will be a collaboration where we'll come up with the best admin themes anyone has ever seen for any CMS. As a community, we'll want to select one or two that we can also bundle with the core in ProcessWire 3.1 as well." Well, +1 for a sidebar, but even better to have a setting that moves the menu from the top navbar to the sidebar and vice versa1 point
-
Adding a field manually should work, thanks. As I wrote, memory selectors would make pagination to fail, but with the extra field it will be OK. I only need to add it to the protected parent and use has_parent. I'll check the child issue without latte too. I need the redirect because if one tries to access a child page by knowing its url, I would like redirect him to the protected parent. This page has different template with the login form.1 point
-
1 point
-
Thanks @Robin S. Ya, I also noticed you can do: $page->url(true); which respects the template's slashUrls setting as well.1 point
-
Sorry, I wasn't proposing that as a module feature - just a suggestion for @tpr to consider. I think it's something that most users don't need so I agree it shouldn't be implemented by the module. Rather than do that I was thinking a person would use has_parent in their $pages->find() selector. $page_protects_children = implode('|', $pages->findIDs("protect_children=1")); $results = $pages->find("has_parent!=$page_protects_children"); // actual selector would have more conditions1 point
-
Hey, @VirtuallyCreative! The first thing that occurs to me is that you're echoing the $item li before you check to see if it has children, after which you're also echoing the $item li, and that's what is causing the top-level duplication. You could handle this a few different ways, but whatever approach you take, you basically want to determine if $item has children, and, based on that, decide what href to use and whether or not to include the arrow. I haven't tested this to see if it works, but something like this might give you a place to start: // top navigation consists of homepage and its visible children foreach($homepage->and($homepage->children) as $item) { echo "<li class=''><a href='". ($item->hasChildren() ? "javascript:;" : $item->url) ."'><span class='title'>$item->title</span>"; if($item->hasChildren()) { echo "<span class='arrow'></span></a><span class='icon-thumbnail'><i class='pg-form'></i></span>"; //loop through the top navigation child's children pages and output them as nested menu item foreach($child->children as $childitem) { echo "<ul class='sub-menu'>"; echo "<li class=''><a href='$childitem->url'>$childitem->title</a>"; echo "</a><span class='icon-thumbnail'>"; echo substr($childitem->title, 0, 2); echo "</span></li></ul>"; } } ... Hope that helps! If it doesn't work as expected, or if you have any questions about it, let me know. That first echo statement uses PHP's ternary operator for a shorthand if. If you aren't familiar with this, here's a pretty good article that covers the basics. Good luck to you!1 point
-
@tpr - just had a quick play with a protected property and selectors. Runtime properties only work with in memory page arrays, so you would have to do: $allResults = $pages->find("template=basic-page"); $notProtectedResults = $allResults->find("protected=0"); I think you already figured this out Anyway, that example works with the attached version. What are your thoughts on the best approach here? PageProtector.zip1 point
-
Hey @tpr - thanks for the report. I'll take a look at the issue with protected() and trying to make the property available in find() selectors - not sure if this is possible or not. Regarding the child issue - it is working here if use the default login form and also if I choose a login template - that is both options seem to be working fine. Perhaps it's a Latte issue when using wireRenderFile like I am around line 304 ? I don't really understand this - users should see the same login form no matter what page they try to visit (because it renders the template you have chosen) - I don't see any reason to redirect - again, maybe a latte issue? Any chance you could try the module without latte just to see if everything works as expected? Maybe I am still not understanding though?1 point
-
Thanks! Search results I can easily exclude the protected pages now but I guess there's no way I could exclude them in the initial $pages->find() query, where search results are populated. This leads to improper number of results if I exclude pages when outputting the results list, or if I filter them in memory beforehands then pagination will broke. This is no surprise because $page->protected is not a page field so I cannot use "protected=''" in the selector. I've tried using addHookProperty but $pages->find() doesn't respect that ($page->protected worked fine though). Anyway, I can live with it - but please correct me if I'm missing something. Child pages In case of child page protection I found that if I set no template in the module settings, then the protected child page loads with the loginForm, which is the expected behaviour. This unfortunately doesn't fit my current needs because I would prefer only one login page for members, so that's why I do a redirect: if ($page->id !== $memberLoginPage->id && $page->protected() && !($user->isSuperUser() || $user->hasRole('member'))) { $session->redirect($memberLoginPage->url); $this->halt(); } Would it be possible to have an option under "Protect child pages" like "Redirect to protected parent on direct access"?1 point
-
It does sound like a bug that needs fixing, but just wanted to add that you can get an equivalent of httpUrl in a way that respects the slash settings with: $page->url(['http' => true]);1 point
-
thanks again - i learned a lot from studying the migrator as well as your other modules... I'm surprised this hasn't come up before, as i would think it quite common for clients to paste in HTML to the editor with external image references; My one client was totally confused because they would paste in these reviews with all of the images, not realizing the images were being pulled from external sites, and then they couldn't click the images in the editor;1 point
-
1 point
-
cool - yes, thanks almost have this working using your examples!, will post final code once it's tested... Edit: this is the new improved version for specific usage; could be improved a lot (basically copy the migrator code), with the try/catch in case the external image can't be retrieved, and also allow for some additional checks for image field, RTE field; for most applications i can just add this to my SiteUtilities module and enable it for some specific templates and fields... public function importExternalImages($event) { $page = $event->arguments[0]; $html = $page->body; if (strpos($html,'<img') === false) return; //return early if no images are embedded in html $dom = new \DOMDocument(); $dom->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8')); $images = $dom->getElementsByTagName('img'); if(!$images->length) return; // not needed? $assetsPath = $this->pages->get($page->id)->filesManager()->url(); $extCount = 0; foreach ($images as $image) { $img_url = $image->getAttribute('src'); if(!filter_var($img_url, FILTER_VALIDATE_URL)) continue; $page->images->add($img_url); if($image->getAttribute('title') != ''){ $page->images->last()->description = $image->getAttribute('title'); } elseif($image->getAttribute('alt') != ''){ $page->images->last()->description = $image->getAttribute('alt'); } //resize image to make version to match the size originally in the RTE //check to make sure size is different to downloaded version before resizing if($image->getAttribute('width') && $image->getAttribute('width') != $page->images->last()->width) { $imgForRte = $page->images->last()->size($image->getAttribute('width'), 0); } else { $imgForRte = $page->images->last(); } $image->setAttribute('src', $imgForRte->url); $extCount++; } if(!$extCount) return; $page->of(false); //$page->body = $dom->saveHTML(); $page->body = preg_replace('/^<!DOCTYPE.+?>/', '', str_replace( array('<html>', '</html>', '<body>', '</body>'), array('', '', '', ''), $dom->saveHTML())); $page->save('body'); $this->message("image links updated to local images."); $page->save('images'); $this->message("external images imported to page"); } thanks again for your help and advice!1 point
-
If you can reach your server at it's certainly not what I'm talking about. Also there are only a few rules in .htaccess, which you should consider when debugging issues with pages not reachable. Everything else in there is either not to be touched or only for specific features like for example https redirects or www. redirects. The 95% trouble maker in the .htaccess is the RewriteBase, because it's different depending on the actual apache setup on the server and if you're using subdirectories or not. Could you be more specific? Those 3 issues would be caused by different issues in your setup.1 point
-
Apache and Nginx are both individual webservers, but only apache is supported officially by processwire. EC2 is from a plain server pov not different to other virtual server providers, but aws does have a lot of privacy / access rulings around all it's services, which is (or at least can be) super complicated for simple setups. That's why I think one should only use aws if one does need aws. I'm not sure how much knowledge you have about setting up your own servers, but if you're not quite comfortable with it I'd suggest you not doing it for any production work. If a simple shared hosting would be enough I'd charge the client a good amount extra for the hoops of setting up a virtual server in the first place. It's not only the time spent, but also the responsibility coming with setting up anything on your own. If you still want to roll with it I'd suggest you the tutorials over at digital ocean (initial setup / lamp setup) and using ubuntu. Ubuntu is the most used system out there and the digital ocean tutorials are quite well written and not really dedicated to their service per se. And just a suggestion about your "cloud loving" client. You might take a look a PaaS like heroku, which is as cloudy (in terms of scalablity/on-demand hosting) as aws, but a lot simpler to setup.1 point
-
Exactly what I was going to write, but you were quicker. I think we should put an emphasis on accessibility when creating this new admin theme. Not just only color contrast but also regarding keyboard-only usage and usage with assistive technologies like screen readers. Creators of WordPress and Drupal already aim for ATAG (Authoring Tool Accessibility Guidelines) compliance, e.g. here and here and ProcessWire should do so as well Although I'm no professional in this topic I'd love to help with audits and Pull Requests.1 point
-
@Nurguly Ashyrov, this is really awesome. My front-end work is mostly JS/SPA work these days and I learnt to love the “headless”/“api first“ approach of commercial CMSes like Contentful. So I often thought about what a perfect and easy to manage back-end ProcessWire would be with a solid HTTP-based api built right in to allow uncoupling actual front-end/ui parts like admin and user interfaces (as actual self-contained apps) from the CMS itself. A module like yours makes a huge leap in this direction and will make ProcessWire much more interesting for a lot of front-end devs and e.g. as a flexible and fast to set up back-end for app prototyping/mvp development. A pity this didn’t exist 9 month ago!1 point
-
This might be a bit off topic, but this problem has come up a few times. Maybe the modules directory could proxy downloads of modules and add the vendor folder on demand (to the module itself) if a composer.json is present. So users can choose if they do a composer install some/module or install it via the backend – without the benefits of a global dependency management tool in the latter case.1 point
-
1 point
-
Currently the module is functional, I use it on every site and it work quite well, no error since November. At this moment only ProcessWire >3.0.0 is supported but I was planning to release it being compatible with 2.7. What you can do with the module (working features) : You can modify package's settings : name of final filename, ignore some folders, set a maximum number of packages, remove older packages and trigger the backup function with LazyCron or PwCron. Save the package in a local folder Upload package to Dropbox Upload package to GoogleDrive Remove packages from those cloud services (depending on the configuration set) *A package is a ZIP file bundled with a database dump and a full website directory dump (site, wire, etc) I think I will finish the first public version and we'll see what happens as I tested the @arjen's fork of @rot's module and didn't managed to get it working as expected. I also find my module more "simple" to use; I mean you set options, check some checkbox, set a cronjob, click submit and let it run. Also I saw some good features like emailing the logs on failure that could be added easily. I'll look at the module a little closer this afternoon. Thanks for your input guys.1 point
-
I spent way too much of my spare time with trying to produce an overly complex site backup module. Anyway - it is here in a pre-release state. I somehow have to get rid of the monster. Features: Use Storage Providers There are two base classes for Storage modules and three reference implementations: Remote Storage Driver This is a baseclass for construcing plug-in modules that allow to send data to a remote storage. You need to extend all abstract functions: connect, disconnect, upload and getConfigFieldset Implemented Examples Storage Mail Sends a backup as mail attachment. If the file size exceeds a set limit it will get split. It uses PHPMailer library as WireMail does not support attachments. @todo: For now this mails all in a single smtp session - maybe thats not so safe? Remote Directory Driver This is a baseclass for construcing plug-in modules that allow to send data to a remote storage and list and delete old files. You need to extend all abstract functions: connect, disconnect, upload, find, size, mdate, delete and getConfigFieldset. Implemented Examples Storage FTP Allows to connect to an ftp server and upload, list and delete files. Uses standard php ftp functions. Storage Google Drive Allows to connect to google drive server and upload, list and delete files. Uses the php google api. You have to create a Service account with the google developers console and add the key file to the plugin directory (or another directory if you specify a relative or absolute path to that file). s. https://developers.google.com/identity/protocols/OAuth2ServiceAccount#creatinganaccount I don't use the OAuth token process because it is not more secure. Once there is a renew token (which is necessary to avoid user interaction) it is as powerful and insecure as a keyfile. It is just more complex as it needs a callback url for registering. @todo? In case you can prove otherwise I will implement the callback registration. Run from the web or the command line It's allways better to have a regular cron job running. But sometimes you might need webcron Command Line You just need to call backup.php with the id of a backup job and it will be run Web Cron There is a token that starts the backup job from the web if passed as a url parameter. You can specify whether you want logging the http stream or not. You can also specify whether you want a job to be repeated within a certain timespan. This is for using unreliable webcron services by hitting the backup multiple times. @todo Consider integration of cron.pw @todo I use the init function of an automatically loaded module as a hook. This seems a bit strange. Is there better ways to do that? Log to mail, file and admin You can recieve logs by mail (on success or failure), log to a file and see log in a an admin page: Configure I built a admin interface that - besides the log viewer - features a list of jobs: and an editor for the job (which is too extensive to be described in detail): Dicussion I am not too sure on how to solve the issues indicated with @todo. My main concern are the hooking (init of an autoload module for the moment) and locking (none, no singleton for the moment). As for hooking I only know of the alternative of using a page where one would have (afaik) to use a special template as the admin template is secured or hook into the security functions (which would probably call for a singleton module). Concerning the locking issue I think it might be good if the Admin Class would lock if it is updateing something. For the moment this is the same class that runs the backups thus it would also lock the admin if there is a backup running. And it would lock the whole site if it is on autoload (as I use the init hook). Lastly I should reconsider the logging and maybe try to better integrate it with processwire logging. I would appreciate comments and suggestionsn on these issues. I appreciate your test results. Don't be took frutsrated if something goes wrong, this is at an early stage but afaik it should be running. Please find the modulle on: https://github.com/romanseidl/remote-backup1 point
-
@Juergen, obviously I missed your post half a year New Edition But finally I found it and redesigned the template file I provided in post 88 of another thread It is working now properly according to the google guidelines. It comes with 301 redirect to the path version that lacks the language segment which works in PW 3.0 up but not in 2.7. In this case you need to uncomment the code line which forces the redirect. Template detects if the translation is checked 'active'. Furthermore you can easily adjust selectors for the page array where the pathes are taken from. Feel free to try and use it. multilang-sitemap-xml.php.zip1 point
-
InputfieldEmail does this validation for you. PHP's built-in mail() function makes this pretty simple: $body = "This is the message body"; $subject = "Web Contact"; $emailFrom = $form->get('email')->value; $emailTo = 'you@domain.com'; mail($emailTo, $subject, $body, "From: $emailFrom");1 point