Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. If you're fine with updating it with every PW core update, yes.
  2. You can since latest version of InputfieldTinyMCE add custom plugins from within outside core. It has a field "Third Party plugins" you can enter name and path to plugin , and put plugin for example into a folder /site/tinymce/... I'm not sure about adding it to the core. Since it also is a browser feature, and the plugin doesn't seem to have localized feature (most important)
  3. You can also uninstall, change and install to change it. It doesn't change DB when only changing module code "autoload" => false,
  4. No, there's no way to exactly define order, but if done right it should load after jquery core. Can you show full module code? It depends on more than just the init. What type etc... Edit: Also see here : And here : And here :
  5. I tend to use http://caniuse.com or the list interobang posted. Thanks for tips, I'm sure someone find them interesting. BTW now you only need a more clever post title
  6. It is already double click to edit. If you train some you get pretty fast with it.
  7. I think it would be possible merging 2 results, but it may not as optimized loading the page array ( though not whole page object ) for thousands of pages. But if it's not 100'000 I think it should work. Also it would be possible to create a pagination by hand. On the other hand building sql queries aren't really save maybe but can be most optimized choice. Though what you could do which would be as optimized is use a hidden field on template so store parent title. Create a autojoin field "parent_title". Then populate that field using a hook module. Then you can do: $results = $pages->find("parent_title|title%=searchtext"); So you could write and autoload that stores the parent title on page save or move and parent save to update all children pages. Also a bootstrap script that you can update after changes or a lazy cronjob or cronjob that update's all in one call (all parents children)
  8. But this really works, there's no bug here: $allResults = $results1->import($results2)->sort('-modified')->find("limit=5"); Do you mean with making it one selector? This has never worked I think, also MadeMyDay has found about it some time ago.
  9. Would this makes sense or even easy possible to add a property, so you could simply check in moules/templates if you're in admin or frontend using: $config->isAdmin; Something like the $config->isAjax; If not, so those are the common checks that can be used to determine this (for reference): if( wire("page")->template == 'admin' ) { // is in admin } if( wire("page")->template != 'admin' ) { // is frontend } if( strpos( $_SERVER['REQUEST_URI'], wire('config')->urls->admin) !== false ) { // in admin } checking for only certain admin processes or areas is also possible // in a autoload module you could also use if( wire("process") == 'ProcessPageEdit' ) { // is editing page } if( strpos( $_SERVER['REQUEST_URI'], wire('config')->urls->admin . 'page/edit' ) !== false ) { // in editing page }
  10. While testing this again, noticed a problem with my flourish include in the header.inc. Defines function like this: <?php // include flourish lib function flourish_loader( $class_name ) { // Customize this to your root Flourish directory $flourish_root = wire("config")->paths->root . '.libs/flourish/'; $file = $flourish_root . $class_name . '.php'; if (file_exists($file)) { include $file; } } spl_autoload_register( 'flourish_loader', true ); When the preview popup loads, it throws an Fatal Error, that the function is already defined. Somehow it renders or loads the page 2 times it seems. Not sure where this comes from, and if this could lead to problems elsewhere too. However to avoid it one can write the flourish include like this (for reference) <?php if( !function_exists(flourish_loader)){ function flourish_loader( $class_name ) { // Customize this to your root Flourish directory $flourish_root = wire("config")->paths->root . '.libs/flourish/'; $file = $flourish_root . $class_name . '.php'; if (file_exists($file)) { include $file; } } } spl_autoload_register( 'flourish_loader', true ); Still my #2 still persists. When I change text on page and hit preview it doesn't show changes. Only after I close and click preview again it show the changed text.
  11. Sorry to bother you, any news on this?
  12. Have you added the check already? Creating modules means also maintaining them, continue to fix stuff. Edit: I also would suggest to name the module "PageListActionDelete". So it's a little more clear its extending the actions on the page list. Also before I forget it, would be nice to have it translateable too.
  13. +1 look here and there
  14. To get url of an image: echo $page->image_uploader->url; And from the thumbnail doc: echo $page->image_uploader->eq(0)->getThumb('thumbnail') If single image field echo $page->image_uploader->getThumb('thumbnail')
  15. So cool what you have done here. I'll for sure check it out a little closer soon. This is actually nice food for the community to learn and checkout, but also a very nice blog system. And even responsive! Keep up the good work, thanks!
  16. Thanks Nico, this is basicly what I do. Though I got other github url to deal with (though it could be easily changed) but good to know github api.. I actualy also looked at your module when creating my module. New update 0.0.8 I commited a new update yesterday. Added additonal check for "allow_url_fopen" and throw error if not enabled. I changed to use copy() instead of curl. I tested it locally and on a low budget hosting and a good one, now it works on all without problems (though locally I got permission problems though not relevant). I found that using copy or file_get_contents would work better, curl gave me "open_basdir" (low budget shared hosting) error on which would cause problems if not configured correctly on server. So this should be better now. Not sure about other restrictions and limits (size?). Also improved the remove function to recusively remove the extracted folder after content is copied, it now also deleted .* files like .htaccess. If you already got it installed just click "refresh" then "update" the module. Oh and let me know if any issues arises. Edit: Heh, just refreshed and new categories and modules pop up! Love it.
  17. have you tried to write checked="checked" ? Also PW I think stores it using value 1 or 0, but for the input html field you either only need checked="checked" or nothing (no value) attribute and it will be in the post as 1 or not at all, depending on it.
  18. does that help ?
  19. Thanks Ryan it works! Like this it can be used with a callback. Not sure what about jQuery adding it's own with random number and =timestamp, but using data: {} to overwrite it works. function callback_json(data){ console.log(data); } $(function(){ var $res = $.ajax({ url : "http://modules.processwire.com/export-json/admin-hot-keys/?apikey=pw223", dataType: 'jsonp', data: {callback : 'callback_json', 'of' : 1 } }); });
  20. What apeisa said -
  21. I know apeisa. If adding this callback it will be valid. I know I could also cache it and download it but wanted to have it responsive for mouse hover. But I added the summary as this is loaded already. I think any makes not much sense to show whole description in the admin. It would be nice to be able to make requests using ajax.
  22. MacOSX Github App first steps Since ProcessWire modules directory supports and encourages you to use github for publishing modules and third-party content here's a little help getting started with github for mac. Go and install the app for mac here http://mac.github.com/ You'll have to first create a github account to where you can connect. Creating public repos is free, on top you'll see a "Free for open source" and a small button. https://github.com/plans Login in from your newly installed github app. Create new local repository by simply dragging the folder (your module) right into the app. The folder can be anywhere on your computer, maybe you choose to use the github folder automaticly created under ~user folder, or you decide. After you added it to github you'll see added a ".git" folder in your local repositiory. Now you'll see your files added in the app. Maybe you'll see the annoying ".DS_Store" file in there too. To ignore files simply right click on them and select "ignore". It will get added to the .gitignore file which now also appears in the files. Do the same and ignore it too. Now push the newly created repo to github using the button top right "Push to github". You'll be asked to enter a title and description then you can push it. It now will appear on github, but still empty. Now make your first initial commit, add a description i.e. "inital commit" and press "Commit" button. You'll see it add's a "Unsynced Commits" panel underneath. Press the button on top right "Publish branch" button and it will push it to the remote repository. You should now be able to see the files commited on your github page. On the repository page you'll see a "ZIP" download button. You can use that url to enter in the download field for the module when you add it to http://modules.processwire.com. Once you update the module, you have to enter a new version both in the module getModuleInfo() and on the module page. This makes sure people, also some apps using the webservice, know it is new and can update it. Screencats The following is a short screencats (no audio) showing me adding a new repositiory to github and update it using the mac github app. Screencast using MacGithubApp
  23. https://github.com/apeisa/AdminBar/blob/master/AdminBar.js#L4
  24. Yeah, I was faster and even right this time maybe!
×
×
  • Create New...