Jump to content

bernhard

Members
  • Posts

    5,624
  • Joined

  • Last visited

  • Days Won

    257

Everything posted by bernhard

  1. hi tpr, do you plan to publish your work as a module? could be quite helpful to many others i think
  2. making a page select field display as thumbnails should not be too hard to do: http://rvera.github.io/image-picker/ but that's only good for few images. if you have lots of pages to select it would get trickier and even trickier with an autocomplete field... not much help from my side, i know good luck
  3. Only thing that comes to my mind is that you could create a text formatter for that. It would do quite the same as your php example but you could easily append it to any textarea field you want and make changes at a single location
  4. On mobile. You can use wire('log')->save('debug', $yourVar); Or var_dump(...); And/or die(); Or chromephp logger.
  5. thank you elabx, that was my intention as i'm quite new to hooking and already find my way through the basics but i think it could be very handy to click a button in backend and have all the called hookable methods showing up somewhere. maybe with some helpful information inside a toggleable div (like pageid/title from the triggering page or descriptions from above the medhod (maybe links to github like this one for pages::saveReady(): https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/core/Pages.php#L2086) edit: github won't be a good idea because it should show the info of the currently installed version of processwire so it would be better to fetch the information directly from the file system.
  6. thanks. unfortunately not... for example if you want to have a crop "slider" it would be great to NOT allow upscaling as it would lead to bad quality images on your site's frontpage slideshow. but you could have for example a "facebook" crop that automatically creates a facebook image that will fill up maximum size of your facebook posting. can't think of a better example at the moment. maybe i'll switch it globally to false in my case
  7. hi bora, thanks for your answer. so i can only set those settings globally? is there no way to set upscaling for "crop1" to true whereas upscaling for "crop2" would be set to false?
  8. anyway - thanks for your opinion. i'm happy that it is not a monologue any more i would have been interested in more experienced pirates' opinions if that would be helpful or it was better to look through the code manually... it's also not showing hooks in the /site/modules folder right now...
  9. hi danjuan, welcome to the forum - have fun with processwire you can also mark questions as solved: https://processwire.com/talk/topic/10838-wirerenderfile-not-returning-string-output/#entry101930
  10. that's strange. the issues are gone! i'm on 2.6.17 and the dev version of BCE. though i started with the master BCE and maybe the video was taken with that version. i can't remember, sorry
  11. hi adam, thank you. i don't think performance is an issue as it is only intended to be used during development from just one superuser... it's a pity i've no time to take this further at the moment
  12. really great module! you got several new likes 3 little bugs i think: don't know if the shift-click bug is related to this module or should be reported at github? https://processwire.com/blog/posts/processwire-core-updates-2.5.24/#shift-click-with-multi-checkbox-fields (maybe interesting for you tpr)
  13. what do you think - would modifying captain hook in this direction make sense? https://processwire.com/talk/topic/10857-making-hooks-visible-hookrecorder/?p=102219
  14. nobody? some news: changed logging from the internal wire('log')->save() to hardcoded file log and that works! fwrite(fopen('/var/www/html/hooklogger.txt', 'a'), __METHOD__ . "\n"); added linebreaks after ___finished() method for better reading protected function ___finished() { fwrite(fopen('/var/www/html/hooklogger.txt', 'a'), __METHOD__ . "\n\n\n\n"); added some info to all methods of class page fwrite(fopen('/var/www/html/hooklogger.txt', 'a'), __METHOD__ . " (pageid " . $this->id . ", pagetitle: " . $this->title . "\n"); we could show any useful informations here... wouldn't it be great to have a module to install that enables logging (only on dev ofcourse) and makes it visible on an admin page. maybe filterable to only show relevant entries like macrura did on this site from the showcase section: http://ohmspeaker.com/speaker-filter/ ? couldn't that be a great addition to captain hook? as it alters all the hookable methods from the current installation it would not need any updating like captain hook does need. i think i read captain hook is quite outdated some time. wouldn't that solve this problem? this is the log of one save action on page "about" (changing title from "about" to "hookloggerrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr") WireSaveableItems::___load Fieldgroups::___load WireSaveableItemsLookup::___load WireSaveableItems::___load Fieldtype::___wakeupValue Fieldtype::___wakeupValue Page::___loaded (pageid 1, pagetitle: Home) Fieldtype::___wakeupValue Page::___loaded (pageid 2, pagetitle: Admin) Fieldtype::___wakeupValue Page::___loaded (pageid 28, pagetitle: Access) Fieldtype::___wakeupValue Page::___loaded (pageid 29, pagetitle: Users) Fieldtype::___wakeupValue Page::___loaded (pageid 30, pagetitle: Roles) Page::___loaded (pageid 37, pagetitle: ) Page::___loaded (pageid 38, pagetitle: ) Page::___loaded (pageid 40, pagetitle: ) Session::___init Session::___isValidSession Fieldtype::___wakeupValue Page::___loaded (pageid 41, pagetitle: ) Fieldtype::___loadPageField Page::___path (pageid 2, pagetitle: Admin) ProcessWire::___init Pages::___find PageFinder::___find PageFinder::___getQuery PageFinder::___getQueryJoinPath Pages::___find Fieldtype::___wakeupValue Page::___loaded (pageid 3, pagetitle: Pages) Fieldtype::___wakeupValue Page::___loaded (pageid 10, pagetitle: Edit Page) ProcessWire::___ready TemplateFile::___render Page::___path (pageid 2, pagetitle: Admin) Page::___path (pageid 3, pagetitle: Pages) Fieldtype::___formatValue Fieldtype::___formatValue Fieldtype::___formatValue ProcessController::___execute Pages::___find Pages::___find Fieldtype::___wakeupValue Page::___loaded (pageid 7, pagetitle: Trash) Fieldtype::___wakeupValue Fieldtype::___wakeupValue Page::___loaded (pageid 1001, pagetitle: About) Page::___setEditor (pageid 1001, pagetitle: About) Field::___getInputfield (id: 1, title: ) Field::___getInputfield (id: 78, title: ) Fieldtype::___loadPageField Fieldtype::___wakeupValue Field::___getInputfield (id: 79, title: ) Field::___getInputfield (id: 76, title: ) Fieldtype::___loadPageField Fieldtype::___wakeupValue Field::___getInputfield (id: 82, title: ) Fieldtype::___loadPageField Field::___getInputfield (id: 44, title: ) Fieldtype::___loadPageField PagefilesManager::___path Page::___isPublic (pageid 1001, pagetitle: About) User::___hasPagePermission User::___hasPagePermission User::___hasPagePermission User::___hasPagePermission User::___hasPagePermission User::___hasPagePermission User::___hasPagePermission InputfieldWrapper::___processInput InputfieldWrapper::___processInput Inputfield::___processInput Wire::___changed Inputfield::___processInput Inputfield::___processInput PagefilesManager::___path InputfieldWrapper::___processInput Inputfield::___processInput Inputfield::___processInput Inputfield::___processInput InputfieldWrapper::___processInput Inputfield::___processInput Wire::___changed User::___hasPagePermission User::___hasPagePermission User::___hasPagePermission User::___hasPagePermission User::___hasPagePermission User::___hasPagePermission Page::___path (pageid 1001, pagetitle: hookloggerrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr) Pages::___save Pages::___saveReady Page::___isPublic (pageid 1001, pagetitle: hookloggerrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr) PagefilesManager::___save Fieldtype::___savePageField Fieldtype::___sleepValue Fieldtype::___savePageField Fieldtype::___savePageField Fieldtype::___savePageField Fieldtype::___savePageField FieldtypeMulti::___savePageField Pages::___saved Session::___redirect Wire::___changed Wire::___changed ProcessWire::___finished WireSaveableItems::___load Fieldgroups::___load WireSaveableItemsLookup::___load WireSaveableItems::___load Fieldtype::___wakeupValue Fieldtype::___wakeupValue Page::___loaded (pageid 1, pagetitle: Home) Fieldtype::___wakeupValue Page::___loaded (pageid 2, pagetitle: Admin) Fieldtype::___wakeupValue Page::___loaded (pageid 28, pagetitle: Access) Fieldtype::___wakeupValue Page::___loaded (pageid 29, pagetitle: Users) Fieldtype::___wakeupValue Page::___loaded (pageid 30, pagetitle: Roles) Page::___loaded (pageid 37, pagetitle: ) Page::___loaded (pageid 38, pagetitle: ) Page::___loaded (pageid 40, pagetitle: ) Session::___init Session::___isValidSession Fieldtype::___wakeupValue Page::___loaded (pageid 41, pagetitle: ) Fieldtype::___loadPageField Page::___path (pageid 2, pagetitle: Admin) ProcessWire::___init Pages::___find PageFinder::___find PageFinder::___getQuery PageFinder::___getQueryJoinPath Pages::___find Fieldtype::___wakeupValue Page::___loaded (pageid 3, pagetitle: Pages) Fieldtype::___wakeupValue Page::___loaded (pageid 10, pagetitle: Edit Page) ProcessWire::___ready TemplateFile::___render Page::___path (pageid 2, pagetitle: Admin) Page::___path (pageid 3, pagetitle: Pages) Fieldtype::___formatValue Fieldtype::___formatValue Fieldtype::___formatValue ProcessController::___execute Pages::___find Pages::___find Fieldtype::___wakeupValue Page::___loaded (pageid 7, pagetitle: Trash) Fieldtype::___wakeupValue Fieldtype::___wakeupValue Page::___loaded (pageid 1001, pagetitle: hookloggerrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr) Process::___headline Fieldtype::___formatValue Process::___breadcrumb Process::___breadcrumb ModuleJS::___use Page::___setEditor (pageid 1001, pagetitle: hookloggerrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr) Field::___getInputfield (id: 1, title: ) Field::___getInputfield (id: 78, title: ) Fieldtype::___loadPageField Fieldtype::___wakeupValue Field::___getInputfield (id: 79, title: ) Field::___getInputfield (id: 76, title: ) Fieldtype::___loadPageField Fieldtype::___wakeupValue Field::___getInputfield (id: 82, title: ) Fieldtype::___loadPageField Field::___getInputfield (id: 44, title: ) Fieldtype::___loadPageField PagefilesManager::___path Page::___isPublic (pageid 1001, pagetitle: hookloggerrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr) Pages::___find PageFinder::___find PageFinder::___getQuery Fieldtype::___formatValue User::___hasPagePermission User::___hasPagePermission User::___hasPagePermission User::___hasPagePermission User::___hasPagePermission User::___hasPagePermission User::___hasPagePermission Page::___path (pageid 7, pagetitle: Trash) Wire::___changed InputfieldWrapper::___render InputfieldWrapper::___renderInputfield InputfieldWrapper::___render InputfieldWrapper::___renderInputfield InputfieldWrapper::___renderInputfield InputfieldWrapper::___renderInputfield InputfieldWrapper::___renderInputfield ModuleJS::___use InputfieldWrapper::___renderInputfield InputfieldWrapper::___renderInputfield InputfieldWrapper::___renderInputfield Page::___path (pageid 10, pagetitle: Edit Page) InputfieldWrapper::___renderInputfield InputfieldWrapper::___render InputfieldWrapper::___renderInputfield Page::___path (pageid 7, pagetitle: Trash) InputfieldWrapper::___renderInputfield InputfieldWrapper::___renderInputfield Page::___path (pageid 10, pagetitle: Edit Page) InputfieldWrapper::___renderInputfield InputfieldWrapper::___renderInputfield Page::___path (pageid 10, pagetitle: Edit Page) InputfieldWrapper::___renderInputfield InputfieldWrapper::___render InputfieldWrapper::___renderInputfield InputfieldWrapper::___render InputfieldWrapper::___renderInputfield InputfieldWrapper::___renderInputfield InputfieldWrapper::___renderInputfield InputfieldWrapper::___renderInputfield User::___hasPagePermission AdminTheme::___getExtraMarkup Pages::___find PageFinder::___find PageFinder::___getQuery Fieldtype::___wakeupValue Page::___loaded (pageid 21, pagetitle: Modules) Fieldtype::___wakeupValue Page::___loaded (pageid 22, pagetitle: Setup) Pages::___find PageFinder::___find PageFinder::___getQuery Fieldtype::___wakeupValue Page::___loaded (pageid 6, pagetitle: Add Page) Fieldtype::___wakeupValue Page::___loaded (pageid 8, pagetitle: Tree) Fieldtype::___wakeupValue Page::___loaded (pageid 1007, pagetitle: Find) Fieldtype::___wakeupValue Page::___loaded (pageid 1009, pagetitle: Recent) Page::___path (pageid 10, pagetitle: Edit Page) Page::___path (pageid 3, pagetitle: Pages) Page::___path (pageid 3, pagetitle: Pages) Page::___path (pageid 10, pagetitle: Edit Page) Page::___path (pageid 8, pagetitle: Tree) Page::___path (pageid 8, pagetitle: Tree) Page::___path (pageid 10, pagetitle: Edit Page) Page::___path (pageid 1007, pagetitle: Find) Page::___path (pageid 1007, pagetitle: Find) Page::___path (pageid 1009, pagetitle: Recent) Page::___path (pageid 1009, pagetitle: Recent) Page::___path (pageid 1009, pagetitle: Recent) Page::___path (pageid 1009, pagetitle: Recent) Page::___path (pageid 1009, pagetitle: Recent) Page::___path (pageid 1009, pagetitle: Recent) Page::___path (pageid 1009, pagetitle: Recent) Page::___path (pageid 1009, pagetitle: Recent) Page::___path (pageid 1009, pagetitle: Recent) Page::___path (pageid 1009, pagetitle: Recent) Page::___path (pageid 1009, pagetitle: Recent) Page::___path (pageid 3, pagetitle: Pages) Pages::___find PageFinder::___find PageFinder::___getQuery Fieldtype::___wakeupValue Page::___loaded (pageid 11, pagetitle: Templates) Fieldtype::___wakeupValue Page::___loaded (pageid 16, pagetitle: Fields) Fieldtype::___wakeupValue Page::___loaded (pageid 1011, pagetitle: Logs) Page::___path (pageid 10, pagetitle: Edit Page) Page::___path (pageid 22, pagetitle: Setup) Page::___path (pageid 22, pagetitle: Setup) Page::___path (pageid 11, pagetitle: Templates) Page::___path (pageid 11, pagetitle: Templates) Page::___path (pageid 16, pagetitle: Fields) Page::___path (pageid 16, pagetitle: Fields) Page::___path (pageid 1011, pagetitle: Logs) Page::___path (pageid 1011, pagetitle: Logs) Page::___path (pageid 22, pagetitle: Setup) Page::___path (pageid 10, pagetitle: Edit Page) Page::___path (pageid 21, pagetitle: Modules) Page::___path (pageid 21, pagetitle: Modules) Page::___path (pageid 21, pagetitle: Modules) Page::___path (pageid 21, pagetitle: Modules) Page::___path (pageid 21, pagetitle: Modules) Page::___path (pageid 21, pagetitle: Modules) Page::___path (pageid 21, pagetitle: Modules) Page::___path (pageid 21, pagetitle: Modules) Page::___path (pageid 21, pagetitle: Modules) Page::___path (pageid 21, pagetitle: Modules) Page::___path (pageid 21, pagetitle: Modules) Page::___path (pageid 21, pagetitle: Modules) Pages::___find PageFinder::___find PageFinder::___getQuery Fieldtype::___wakeupValue Page::___loaded (pageid 31, pagetitle: Permissions) Page::___path (pageid 10, pagetitle: Edit Page) Page::___path (pageid 28, pagetitle: Access) Page::___path (pageid 28, pagetitle: Access) Page::___path (pageid 29, pagetitle: Users) Page::___path (pageid 29, pagetitle: Users) Page::___path (pageid 30, pagetitle: Roles) Page::___path (pageid 30, pagetitle: Roles) Page::___path (pageid 31, pagetitle: Permissions) Page::___path (pageid 31, pagetitle: Permissions) Page::___path (pageid 28, pagetitle: Access) User::___hasPagePermission Page::___path (pageid 2, pagetitle: Admin) Fieldtype::___formatValue User::___hasPagePermission ProcessWire::___finished
  15. had also problems with that so i included it manually... i thought i was doing something wrong with those instructions of the module's page For advanced usage, you can also get the mPDF instance from the module: $pdf = $modules->get('WirePDF'); // Get mPDF instance $mpdf = $pdf->mpdf; // Set back mPDF instance $pdf->mpdf = $mpdf;
  16. There's also a Page Delete Module: http://modules.processwire.com/modules/process-page-delete/ Don't know if that works with the new versions of PW. The compatibility note says yes. I've only worked with it some time ago (PW2.4 or so...). nfil, maybe you can try that and share your experience? +1 for having the delete button optionally visible for other roles
  17. hi guys, i'm in a hurry so i try it short i wanted to make it visible what happens behind the scenes when you do different things in processwire backend, especially WHEN all the hookable methods are called (render > saveReady > save or the like) i tried a simple wire('log')->save('hookrecorder', __METHOD__); inside the pages::saveReady() method and that worked! next step: i tried to add this line to all hookable functions here: <?php $rustart = getrusage(); include('index.php'); wireCopy('wire_original', 'wire_tmp'); $dir_iterator = new RecursiveDirectoryIterator("wire_tmp"); $iterator = new RecursiveIteratorIterator($dir_iterator, RecursiveIteratorIterator::SELF_FIRST); foreach ($iterator as $file) { if ($file->isFile() AND $file->getExtension() === "php") { $content = file_get_contents($file); $pattern = "/(\w+) function ___(\w+(?<!log))\((.*)\) *{/"; $replace = "$1 function ___$2($3) {\n wire('log')->save('hookrecorder', __METHOD__);"; /* // for debugging preg_match_all($pattern, $content, $matches); echo $file . "<br>"; if(is_array($matches[0]) AND count($matches[0]) > 0) { foreach($matches[0] as $match) { echo $match . '<br>'; } } echo "<br><br>";*/ $content = preg_replace($pattern, $replace, $content); file_put_contents($file, $content); } } //wireRmdir('wire_tmp', true); // Script end function rutime($ru, $rus, $index) { return ($ru["ru_$index.tv_sec"]*1000 + intval($ru["ru_$index.tv_usec"]/1000)) - ($rus["ru_$index.tv_sec"]*1000 + intval($rus["ru_$index.tv_usec"]/1000)); } $ru = getrusage(); echo "This process used " . rutime($ru, $rustart, "utime") . " ms for its computations\n"; echo "It spent " . rutime($ru, $rustart, "stime") . " ms in system calls\n"; ?> it creates a directory wire_tmp with all the inserted log-statements. i replaced wire folder with wire_tmp folder (renamed it) and this does not work unfortunately (white screen, don't know if it would be different with debuggin true). i also tried to replace the wire/core/Wire.php file with the original one and to not log calls of "wire('log')" as i thought this may leed to errors (it's excluded in the regex) the idea is to save a page and then look all the hookable method calls up under setup > logs > hookrecorder and have a list like just now | pagexy | pages::save() just now | pagexy | pages::saveReady() just now | pagexy | pages::render() looking forward to hearing your opinions. should i exclude private methods or the like? or should i exclude whole files? or can i achieve what i want much simpler (eg server logging tools)?
  18. where do i define these settings?
  19. please mark your topic as solved so that others can immediately see it - saves time
  20. seems that mandrill updated their pricing as of 2015-07-15: http://blog.mandrill.com/new-simpler-pricing.html does this update also affect existing users? just curious, i have no account yet... btw: sendgrid has a free plan of 25.000 mails if you signup via their google partner site: https://sendgrid.com/partner/google
  21. Hi diogo, that's a pity but I can understand that this has no priority. Did some research and found https://github.com/layerssss/paste.js/blob/master/README.md
  22. I think "view" is good. there have been some additions to the core page field. it supports edit links with asmselect now: https://processwire.com/blog/posts/processwire-2.6.16-core-updates-more-on-prodrafts/#asmselect-gets-new-option-to-edit-selected-pages still i'm a huge fan of this module! thank you
×
×
  • Create New...