Jump to content

bernhard

Members
  • Posts

    6,629
  • Joined

  • Last visited

  • Days Won

    358

Everything posted by bernhard

  1. Thank you gmclelland! Found this while looking through your links. Looks promising! http://www.raymondhill.net/finediff/viewdiff-ex.php
  2. 1 minor "issue" some modules are double listed. i guess that comes from the "new modules" tab, that shows recently installed modules. maybe you can exclude them in the list? feature suggestion (thank you for the docs-links btw): i think it should be possible to have an index on top of your github readme linking to each submodule via #mysubmodule. i suggest placing only ONE link to the docs beside the main headline (as shown in my screenshot in my previous post) and then the user could click on the relevant item and images would already be loaded and the github issue should not be an issue any more. the current help-icon could be replaced by a link icon, linking to the section of the module config, where we can define the detailed options for this submodule. do you get me? i find myself a lot enabling/disabling submodules and then having a "hard time" to find the options for that submodule. thank you for this great module
  3. glad you like it. i think ryan likes it too, as the new demo page is also powered by uikit and the roadmap for 2016 (how fast did this year pass?!??) states, that the admin may get powered by uikit as well. really looking forward to that. https://processwire.com/blog/posts/happy-new-year-heres-a-roadmap-for-processwire-in-2016/
  4. i guess you could also to this: // if submitted $form->addClass('my-form-submitted'); and css like .my-form-submitted input { /* input fields styling for submitted forms */ }
  5. good idea with the snippet button! my suggestion would be: case1: code that does NOT get stored anywhere echo 'no comment at first line, no save'; case2: code that goes to history, but NOT to snippets. that would be for some kind of code you need multiple times for a limited period of time (eg developing a module). you could change your code as often as you want, it would only show up ONCE in the history, saying "update module XY 1 -> 2". the list could be limited to around 5 - 10 items. // update module XY 1 -> 2 $m = $modules... $m->upgrade(1,2); case3: when you click on an icon or the like in the list of historical codes, you could make a snippet out of this code. eg "update module XY 1 -> 2 (icon: create permanent snippet)" // my awesome snippet // do stuff for all pages under parent XY foreach($pages->find('parent=XY, ... i think the snippets and codes should always show up only once in the list and hold the last executed code. if you want to apply slight modifications you could just update the comment in the first line (like creating a new branch on github) // my awesome snippet - TEMP CHANGE XYZ // do stuff for all pages under parent XYZ foreach($pages->find('parent=XYZ, ... after the change you could rename the comment and overwrite your old snippet
  6. i think that woulb be totally enough and if that is simpler, i would be totally happy with that you brought up a new idea: what if the code restore feature that you implemented remembered the window/tab somehow? do you think that would be possible? i guess a simple solution would be to store it based on the url path in a cookie. another idea, and a short explanation why i think that this would be useful: in the last weeks i found myself often do something like this: $m = $modules->get('mymodule'); $m->upgrade(1,2); // test upgrade from version 1 to 2 $m->upgrade(2,1); // test downgrad from version 2 to 1 i then have to (un)comment one of those lines repeatedly... i think a history would be quite nice! simpler and maybe easier and more efficient than a snippet library (or similar in many cases): just put a comment in the first line and it would save it to the history. what do you think?
  7. just for reference, i'm using a different approach on another project now:
  8. this is another solution i used lately: javascript for handling the clicks: // mobile menu click handler $('#tm-mobile-nav').on('click', 'a,i', function() { // if the link icon was clicked go to url if($(this).is('i')) { location.href = $(this).data('mobile-link'); $(this).removeClass('uk-icon-arrow-right').addClass('uk-icon-spinner uk-icon-spin'); } }); css for handling the visibility: /* mobile menu */ #tm-mobile-nav li .uk-icon-arrow-right { display: none; } #tm-mobile-nav li.uk-parent.uk-open .uk-icon-arrow-right, #tm-mobile-nav li.uk-parent .uk-icon-spinner { display: inline-block; margin-left: 10px; } and php (using custom UIKIT markup): $out .= "<li class=\"{$cls}\"><a href=\"" . ($item->numDropdownItems ? '#' : $item->url) . "\">{$item->title} <i data-mobile-link=\"{$item->url}\" class=\"uk-icon-arrow-right\"></i></a>"; uikit will handle all links with # as collapsible menu items: https://getuikit.com/docs/offcanvas.html live example: https://www.mistelbach-mustangs.at/
  9. just because i needed this again today: if you are dealing with any sort of tags (HTML data) in your fields, than the easiest solution is to base64_encode($var) your data in the export and then base64_decode($var) it in your import. i had to import some pages with inline images today and if you know how to do it, that is also quite easy and straigtforward. the problem is, that you have some html like img src="/site/assets/files/12345/your-image.jpg" in your field and the ID will change after the import! sample export xml - note the tag <pid> holding the old id echo "<?xml version='1.0' ?>"; echo '<pages>'; // find pages $results = $pages->find('parent=/your-parent/'); $results->add($pages->find('parent=/something-else/')); foreach($results as $p): $p->of(false); ?> <page> <title><?= $p->get('headline|title') ?></title> <date><?= $p->created ?></date> <featured>1</featured> <pid><?= $p->id ?></pid> <pic><?= $p->coverpic->first()->httpUrl ?: '' ?></pic> <body><?= base64_encode($p->body) ?></body> <images><?php foreach($p->images as $image) { echo '<image>' . $image->httpUrl . '</image>'; } ?></images> <files><?php foreach($p->attachments as $file) { echo '<file>' . $file->httpUrl . '</file>'; } ?></files> <gallery><?php foreach($p->gallery as $image) { echo '<image>' . $image->httpUrl . '</image>'; } ?></gallery> </page> <?php endforeach; echo '</pages>'; die(); and then the import: $items = simplexml_load_file('your-url-of-export-data'); foreach($items as $page) { $p = new Page(); $p->template = 'blogitem'; $p->parent = '/news'; $p->title = $page->title; $p->name = $sanitizer->pageName($page->title, true); while($pages->find('parent='.$p->parent.',name='.$p->name)->count() > 0) $p->name .= '-'; $p->date = $page->date; $p->featured = $page->featured; // get body html and remove root node $p->body = base64_decode($page->body); $p->save(); // change images in body field $re = '/src="\/site\/assets\/files\/' . $page->pid . '\//'; $p->body = preg_replace($re, 'src="/site/assets/files/' . $p->id . '/', $p->body); $p->save(); // add images if(strlen($page->pic)) $p->pic->add((string)$page->pic); foreach($page->images->image as $image) $p->images->add((string)$image); foreach($page->files->file as $file) $p->files->add((string)$file); foreach($page->gallery->image as $image) $p->gallery->add((string)$image); $p->save(); echo 'new page <a href="' . $p->editUrl . '" target="_blank">' . $p->path . '</a><br>'; } die(); just set your ckeditor field settings porperly before your import and all images will be recreated on your new site! remark: this will only replace images from the same page and not any images that are linked from a different page with different page-id. that would need some extra mapping of old-id --> new-id
  10. thank you tpr, i was not familiar with that pages. now i am @adrian what do you think of hiding the tracy bar on mobile? at least a checkbox for that? in my case it would totally be enough to hide it based on screen width. if you don't think that's a good idea let me know and i'll add it via css on my own. i would prefer this to be built in though because it annoys me on almost any project.
  11. hi tpr, wow - the filterbox is really cool! just one minor problem is when using the finder it only finds pages from the currently open pagination. it's obvious to me that this is because of ajax pagination and the data not being in the dom, but i'm sure it's not obvious for clients with no knowledge about all that. i think there should be at least a visual tip. don't know how to solve that in a better way - this will also be a problem in my current project so i'm curious what you think about that i would also suggest adding a link to the docs. i didn't even notice that the module is documented so great and wanted to ask you to add some more descriptive descriptions i'm always installing the module just by typing in AdminOnSteroids so i never went to github for that. and i guess i'm not the only one doing so...
  12. hi guys, i'm developing a module to pull data from a live site so that i have a copy of this site on my local dev environment with one click. i plan to do it like this: both sites will be setup manually for the first time. than i will install my module on both sites and they get one superuser with the same name + password then, on DEV click button, send POST request to the remote site with this data: name = $user->name (dev admin user) password = $user->pass on LIVE fetch username + password compare $user->pass (live admin user) and password of post data if they match, force login (without password, as the password is the encrypted password and not the password itself return requested data on DEV get the data and do stuff would this procedure be safe? could anybody sniff my admin password when i'm only sending and getting data via HTTPS? the reason why i do not send the actual password is because the user is already logged in and i only get the encrypted version from the db. and i don't want to force the user to input the password on every request... thank you for your help!
  13. i don't think it's too verbose as you should always be aware of the context where the change happened. maybe some collapse feature would be nice, though. but looking at the markup i have no idea how to implement that shortly. the problem is that it sometimes creates not so good readable results. i'll paste one when i have a good example. maybe thats already fixed by using the module's initialization feature that i added later.
  14. hi @Ivan Gretsky thank you for your suggestions. seems we share the same wishes (as many others also do, i suppose), but such things are very tricky and i don't think one (especially i) can build a solid solution for that. you have ids and integers all around and you have to know the order of editing/removing/adding stuff. for example you cant create a template when the corresponding fields do not exist. maybe we would just need a GUI for providing the order of the changes to be applied. thinking of every change as a page the pagefield comes to my mind... there we already have such GUI. hmm, maybe it would be possible, but not for me right now - i have loads of client work to do i'll also wait for @teppo s response. maybe he can integrate my module into his more mature ProcessChangelog module... @szabesz thanks for the video. as i said above i'm not really happy with the current diff tool. i found this one (https://diff2html.xyz/demo?diff=https://github.com/rtfpessoa/diff2html/pull/106) but that needs a diff string to make the output and i found no easy solution for creating this diff string on the fly. there's xdiff php extension but i don't really like the idea of relying to a php extension not installed on most of the hosting platforms (or am i wrong here?). maybe you have some hints here?
  15. hi teppo, i totally missed this module... did you see my new SVN module for fields and templates? maybe you could integrate it into your module? i think that would make sense. i planned to create an overview page, but it seems it would be better to integrate that into your module, as the work is already done and quite same from functionality perspective. one idea to improve this list would be that you also integrate "versions" like i did in my SVN module. than one could make as many changes as one wanted and in the end bump the version number and see a list like that: // show changes from version 0.1 to 0.2 user | date of last change | action | changes | ----------------------------------------------------------------------------------- admin | 2.1.2016 | changed field body | 4 | admin | 1.1.2016 | changed page sample | 1 | maybe you could also use the diff tool for page changes? i've not looked into your module yet, so this are wild ideas what do you think? update: versions would totally make sense for both your and my module. having the option to set the version + add a comment (like a commit in github) and then making the version number clickable and see all changes for that version would be a great help.
  16. I needed to create some Fields and Templates via API and it was always a pain to get the right settings (like columwith, field context settings and so on). With the brand new (and ALPHA) RockSVN Module you can create your fields via the backend and then show a diff of your changes. Please see the comments on top of the module for todos and limitations. I'm not totally happy with the diff tool, so if anybody knows a better one or knows ho to change the behaviour to line-based diff (that would be better in this case i guess) feel free to comment. As @ryan is using the same diff tool in ProDrafts i guess there's not too much hope... anyway - i think the module can be a big timesaver and also help you to keep track of changes - an often requested feature and maybe also a good companion for @LostKobrakai s Migrations module! (Benjamin, jump in ) The module will create some Fields, Templates and Pages for you. All properly tagged and hidden, so it should not mess up things more than needed. Caution: Currently the module removes all those pages, templates and fields on uninstall! Requires my new basemodule called RockTools RockSVN.zip
  17. This Module is a Baseclass and Foundation of (hopefully) lots of Modules that will come in the future. Early ALPHA release just to give you a Preview of my new RockSVN Module and keep things organized Please see the comments on top of the module for todos and limitations (for example it does NOT remove the created pages and templates for now). Of course github will come, but i have to tidy things up a bit before i make them public. RockTools.zip
  18. the solution provided here did not work for me! i'm using pw 3.0.36 and this worked and is even easier $fg = new Fieldgroup(); $fg->name = 'rocksvns'; $fg->add($this->fields->get('title')); $fg->add($this->fields->get('rocksvn_version')); $fg->save(); // set version field visible for this template $fg->setFieldContextArray($this->fields->get('rocksvn_version')->id, array( 'collapsed' => 0, )); $fg->saveContext(); $t = new Template(); $t->name = 'rocksvns'; $t->fieldgroup = $fg; $t->save(); tracy helped a lot here again
  19. hi ivan, not related to processwire but i think you get the point: http://jsfiddle.net/3gz43tqq/3/ hope that helps
  20. hi @tpr, seems i found a little bug: when hovering over the publish button, the hover event is not tied to the button but to the page label. it appears only on smaller screens when the buttons are floating right! another little thing: i've noticed some times that when hovering the tooltips the color gets somewhat ugly: as you can see i'm using reno here. don't know where this comes from? thank you once more for sharing the module! makes working with processwire even more fun
  21. thanks for the input tpr, do you create a template file for that? something like /templates/_sandbox.php or which url do you call?
  22. update: i still (or again) think that this feature would be very helpful! for example i need to create some fields via api for my new module. it would be great to test this via the console. one window to create the field, one to delete it. that way i could test things very quickly without losing track. what do you think, @adrian ? edit: i solved it by implementing 2 methods in my module and then calling them from 2 different browser instances (1 on default browser, 1 on incognito) like this: // default $m = $modules->get('mymodule'); $m->tmp_create(); // incognito $m = $modules->get('mymodule'); $m->tmp_delete(); the methods look like this: public function tmp_create() { $log = $this->wire->log; $field = new Field(); $field->type = $this->modules->get('FieldtypeTextarea'); $field->name = 'test'; $field->save(); $msg = "field {$field->name} successfully created"; $this->message($msg); $log->save('rocknotes', $msg); d('done tmp_create'); } public function tmp_remove() { $this->deleteField('test'); d('done tmp_remove'); } i like this approach even more because i can write the code in my IDE now sorry for my monologue
  23. just wanted to mention that the new version has support for common tags: https://processwire.com/blog/posts/processwire-3.0.38-core-updates/#added-support-for-common-multi-language-translations
  24. to make file uploads work i had to make those adjustments on my laragon + win10: // php.ini (right click on laragon tray > php > php.ini date.timezone = Europe/Vienna // uncomment and set always_populate_raw_post_data = -1 // uncomment don't forget to reload laragon awesome tool so far, thanks for sharing @LostKobrakai and @pwired
×
×
  • Create New...