Spica
-
Posts
122 -
Joined
-
Last visited
Posts posted by Spica
-
-
I only get an empty TextformatterVideoEmbed Tag rendered on a https/vimeo.com/xxx link. Is there any fix for that already?
- 1
-
-
So, yes, this method unzips all nested files.
My use case, for anyone who may need:
<? // hook into tutorial upload and unzip file into destination wire()->addHookAfter("InputfieldFile::processInputFile", function(HookEvent $event) { $pagefile = $event->argumentsByName('pagefile'); // limit to a specific field {file_tutorial}, restricted to zip uploads if($pagefile->field->name != 'file_tutorial') return; // full disk path to your custom uploads directory $tutorialsBaseDirectory = $this->wire('config')->paths->assets . 'tutorials/'; // extend path with custom directory nam corresponding to page id $pageIdDirectory = $tutorialsBaseDirectory . $pagefile->page->id . "/"; // extend path with custom directory name from the filenme without extention $tutorialDirectory = $pageIdDirectory . $pagefile->basename($ext = false); // use ProcessWire's $files API // @see: http://processwire.com/api/ref/files/ $files = $this->wire('files'); // Remove directory and its files after ensuring $pathname is somewhere within /site/assets/ $files->rmdir($pageIdDirectory, true, [ 'limitPath' => $tutorialsBaseDirectory ]); // make tutorials id directory correspondig to ressources id if($files->mkdir($tutorialDirectory, true)) { // directory created: /site/assets/tutorials/id/filenameWithoutExtension } // get zipfile and destination and unzip $zip = $pagefile->filename; $dst = $tutorialDirectory; $items = $files->unzip($zip, $dst); });
Adopted from
The script takes an uploaded zip and unzips it into the destination folder. As it has an index.html I can point a link to it.
- 3
-
Is the unzip method constructiong a nested folder hirarchy that is given in the zip? Or does it zip all files flat into one folder?
-
I wonder how the module can be made GDPR conform.
As far as I can see only the unsubscription proccedure needs some tweaks in the private function validateUnsubscribeToken():$this->users->delete($user); $this->log->save('messages', "User has been successfully deleted with id `{$user->id}`.");
First line: Can anyone confirm, that the whole entry is fully deleted and cannot be restored? (At the moment I have no testsystem to check it)
Second line: Switching the log from email to id, as the id is no personal data. But the id could be used as unique identifyer for deleted users when syncing with / exporting to other systems . Maybe adding a timestamp also would be good.Another point to consider is neutralizing the optional email notifications to the admin.
Any other issue? -
1 hour ago, bernhard said:
And https://github.com/processwire/processwire-issues/issues/523
Yes. That explains...
- 1
-
37 minutes ago, bernhard said:
you'd need to find out the correct properties and values, but that should not be too hard.
// tracy console foreach($users as $user) { if($user->admin_theme == 'AdminThemeDefault' || $user->admin_theme == '') $user->setAndSave('admin_theme', 'AdminThemeUikit'); echo $user->name . ": " .$user->admin_theme . "<br>"; }
Well. This did it. It not exactly what I would have prefered but it works. Now every user has the uikit theme marked in his profile.
What was confusing: New Users have the default admin theme marked in the interface by default, but have no entry in the db ($user->admin_theme == ""). But explicitly saving the users profile will entry the AdminThemeDefault.
- 1
-
3 hours ago, monchu said:
You have to activate first the AdminThemeUIkit from your module page
Of course it is already activated. What I want is to switch the default theme to uikit for all existing users who have choosen the default theme. I cannot find eg any point to hook to.
-
Ah, ok. Missunderstood. Any way to change it by configuration in the way I would like it – to set the uikittheme as the default/standard theme for all users?
-
$config->defaultAdminTheme = 'AdminThemeUikit';
Set this iton the site/config.php. But has no effect. Well, I would expect to have all users with default theme selected to be switched to the uikittheme. Am I taking it wrong?
-
Great, kixe,
I did put it into a module. Works fine.
I have noticed, that loginerrors, eg caused by wrong pwd, are still logged, but with the user guest.
Can anyone give clearance about what this hook will cover and what not?
-
How can I prevent system logs ( eg. sessions) for specific user roles?
-
Ah, great, kongondo, that realy makes me happy.
-
Thanks, ottogal,
had a view on the thread. But not exactly what I want. It would be possible to reference different fields, but all manually. If the category taxonomy would increase the new relations would not be refected.
I now think about modifying the display of the input page reference. I think it is done in processPageList.js. But I dont see, how to modify only the one occurance of the page reference field. Maybe musst digg deeper into it.
But would be happy for any easier solution.
-
I use an inputfield Page Reference for managing categories, that are generated from a page tree like so:
-
cat 1
- subcat 1
- subcat 2
-
cat 2
- subcat 3
- subcat 4
- etc
I now would like to select the maincategory in a page first. And then based on the selection the subcategories should be offered. Cant find an easy and flexible way for that. Any suggestions?
-
cat 1
-
That looks good. Thanks, fbg13
-
I have an array with events from a calendar modul and its not a pagearray. I would like to generate a paginated list using pw's pagination routines. Any chances on that?
-
new version generates error:
Class 'ProcessWire\WireData' not found
on line 22 in SimpleContactForm.module
-
On 28.8.2016 at 9:33 PM, Mats said:
I don't think it's possible. Check out this SO answer: http://stackoverflow.com/questions/31861822/google-maps-how-to-show-city-or-an-area-outline/31865958#31865958
Well, I tried to avoid this. Also found only similar solutions. But for those who are interested, here a link for plz files. Maybe I 'll give it a try.
-
I wonder how to display plz (zip) areas in the map in additon to the markers.
What do I mean: If you search in google maps for e.g. "schöneberg, berlin, deutschland" you get an overlay for that city destrict. I wonder, if you can adress this by the api. Dont want to make own overlays.
-
I am looking for an calendar module like this. Has anyone had this in a productive installation and would share some experiences?
I am also keen on an recurrenceinput UI mentioned before. Did anyone implement one of these?
And I wonder if I could use different templates next to calendar-event.
-
I found an fork of FieldtypeMapMarker I already worked with that already does the sorting in the sql query. Think that could fit my needs.
-
Good Point, LostKobrakai, actually I need a pagination. So sort() seems not to be the right way. Will check your link, at first glance it seems more compicated than expected.
-
Ah, thanks, kongondo,
that was the missing link / information for me.
I now just wonder about the best sort strategie. I have different sort options beside the distance to sort the pagearray. All given by a users selection. So all other sort options are executed within the selector in $pages->find. Distance cannot be sorted within find. Should I mix find(sort=) with $res->sort() routines or do a routine just with $res->sort() for all sort options. Are there any reasons to prefere a sorting within find() over sort()?
Hanna Code
in Modules/Plugins
Posted
I am using an custom attribute. But it gets rendered with a tag. When I
bd($vid)
the output is
The value 508075620 is correct. I had to strip the tags manually. But would like to know whats going on.