Jump to content

horst

PW-Moderators
  • Posts

    4,077
  • Joined

  • Last visited

  • Days Won

    87

Everything posted by horst

  1. sorry, but the most things are where they were before, at least it is how it looks to me. what taskbar are you talking about? can you please post a screenshot?
  2. Don't know how often the data will change, but it would be a possible solution to cache your template markup and rebuild it on storing new data. This would ommit the code execution everytime, without the first request after new data was stored.
  3. Hhhm, yes! For me it is it a bit too. But I thought to try it out and maybe it is lesser code to write. We will see how it goes.
  4. Ah, great. I figured it out myself! We need to add all fields into a children array: $this->add( array( array( 'type' => 'Fieldset', 'name' => '_myfieldset', 'label' => 'Fieldset Label', 'collapsed' => Inputfield::collapsedYes, // Inputfield::collapsedNo 'children' => array( array( 'type' => 'select', 'name' => 'kit_type', 'label' => 'Select the Kit you are using', 'options' => array('uikit' => 'uikit'), 'required' => true, 'columnWidth' => 50, ), array( 'type' => 'text', 'name' => 'kit_fullpath', 'label' => 'directory site path to your kits scss sources', 'columnWidth' => 50, ) ), // close children ), // close fieldset //.. add more fields ));
  5. As the subject says. With the ModuleConfig, we can define our fields in the MyModuleConfig.php __construct() method with calling $this->add() and pass it an array with lots of field-definition arrays. This is working fine with fields on one level. But how can I organize them into fieldsets? I have tried a bit with multidim arrays, but no luck. Has anyone does this before? Is anyone using this "new" config method? (implemented in PW 2.5.5)
  6. Hhm, looks like the OPCache class is not ready to use with PW3 namespaces. Unfortunately I have no PW3 installl with OPCache installed where I can test it. To the first error, I can say this sounds a bit weird, because I try to get the Page of Admin -> Setup (what is 22) and than checks if it has a children Page with the name of the OP-Cache Viewer. So this should return A) the page if existing, or B) a NullPage object. Both possible returns are objects. So, without able to test, it looks weird. What ID does your Admin Setup Page have? --- I suggest to uninstall the OPCache Viewer and only use the Admin Links In Frontend module until I got solved this. (What may take a while, )
  7. Not hundred percent sure, but maybe you can make use of the AdminCustomFiles module. Besides others, it lets you create an AdminThemeDefault.css and an AdminThemeReno.css file under site/templates/AdminCustomFiles/. There you can write all your custom css in regard to each theme. In regard how to determine which language is active, I must admit that I don't know this. This is left over for others to answer, sorry. --- And welcome to the forums, you PW-veteran.
  8. Many thanks @netcarver. I must admit that I have written the Textfile-driver only for this module to have a basic driver. Other as the SQLite-driver, it has not have much testing. I'm glad to hear that you have done this and you contribute to the module. I have you added as colaborator to it, so that you can change / add other improvements / enhancements as you like.
  9. If you have to select a lot of images out of a mass, it is of real help, if the images are presented in a way that does not visually show one sort more prominent. It was by no means design what I have talked about. It was definetly about "to get the job done as fast as possible", what can be done way faster if a redacteur does not have to abstract those massive differend presented formats when comparing images against each other. Believe me, also if Pros in that field are able to abstract that a lot faster and better than None-Pros, - after screening 1k or 2k images, they would kiss every one who brings them a more weightened images table for their work.
  10. From a photographers or images redacteurs perspective I would say that the best presentation option would be a weightened one, based upon amount of pixels! see in the comparision image the first and second set of images: https://processwire.com/talk/topic/8367-pia-pageimage-assistant/#entry81648 This way, neither landscape- nor portrait- oriented images, nor square dimensioned ones become visually more present than the others.
  11. Maybe you can keep it in the session only? When opening a page with the filefield, getItems() into a session var. After saving the page, compare it to the new getItems() values. You may even finegrain this a bit more: track changes of the filefield and only if there were changes, compare it with the new values.
  12. I can confirm this. This persist since a long time back in the past. Since then, we only upload bunches of images packed as zip archive. But until now, I wasn't aware that it may have to do with the SessionHandlerDB.
  13. When working with Namespaces, (PW3), it is allowed to use different namespaces in one file. Assuming you have a php file you want to include with this code: <?php echo "<p>I love $var!</p>"; you can have a template file like this: <?php namespace ProcessWire { // ... } namespace fake1 { $var = 'apples'; include('./_namespace-include-test.php'); } namespace fake2 { $var = 'bananas'; include('./_namespace-include-test.php'); } namespace ProcessWire { $var = 'oranges'; include('./_namespace-include-test.php'); // ... } The output will be: Why and how this works is in the PHP manual. There you also can read that this is bad practice.
  14. Maybe a bit OT, but: If you add files to a page, you use a filefield (or imagefield). You haven't told what you want to do, but maybe you also can use other hooks? https://github.com/ryancramerdesign/ProcessWire/blob/devns/wire/modules/Inputfield/InputfieldFile/InputfieldFile.module#L457 https://github.com/ryancramerdesign/ProcessWire/blob/devns/wire/modules/Inputfield/InputfieldFile/InputfieldFile.module#L491 ... and welcome to the forums!
  15. You don't need anything like this. Just make sure that your php files are really stored in utf-8 encoding!! (PHP files you need to check in this reagrd are: the calling template file(s), the WireMailSMTP module files and the base WireMail files) Normally they all should be in utf-8 encoding, but better you check this thouroughly. Then it works with simply using: $subject = 'Ö Ä Ü ö ä ü ß'; I tested this just yet. The source of the received email looks like: Subject: Wiremail-SMTP Test 15:57:23 =?UTF-8?q?=C3=A4=C3=B6=C3=BC_=C3=84=C3=96=C3=9C_=C3=9F?= X-Mailer: ProcessWire/WireMailSmtp Date: Wed, 8 Jun 2016 13:57:25 GMT +00:00 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable It does automated encoding, but you don't have to do anything by yourself.
  16. Not tested, but I assume you should get it with $this->modules->getModule('NameOfYourModule')->getDefaults(); wire('modules')->getModule('NameOfYourModule')->getDefaults(); or within a module: $this->getDefaults();
  17. Sorry, maybe I haven't said it 100% correct, but I meant this: when it is called the first time, so: when installing the module. (Maybe not directly in the install method) --- It wasn't me who initially has said we need something new. --- But back to the issue: I just try to understand what you are saying, but I'm missing a piece: Please can you point me to where the modules can pick up the default values?
  18. For what is your "It doesn't." meant? For the "pipeline" or for the "standardized way" how devs have to define the defaults? Robin_S asked for a way how it is possible to have the values available in the install method too. IMO this only can be done if the modules dev uses a standardized way to hardcode the default values into the modules file. Otherwise PW wouldn't be able to pick them up and merge with the configSettings. Once this is done, your suggestion is right and would be fine if PW do that automagically on init of a module.
  19. @tpr, maybe a new feature request: In Editpage mode, a HotKey for saving: ctrl+s But one that alltimes work, regardless if one are on the edit page, in a CKeditor field or another Editorfield. I know that there is a module from Soma with AdminHotkeys, but IIRR, it doesn't work when editing in a CKEditor field. But most of all, I would need it there!
  20. Where do it autosave the data? I think, not into the DB-field, but into some local storage, or I'm wrong? ( Haven't looked into it, just want to ask a dump question ;-) )
  21. see: https://processwire.com/talk/topic/13373-switching-hosts-may-25-at-noon-est/#entry121251
  22. Yep, but it would need a standardized way how devs have to define the default values, or I'm wrong? Do you know if something in this regard is in the pipeline?
  23. Filtering for filenames with images will / is be one of the most used functions of all for me. If you have done the images your self and use a naming convention, this is the fasted way to find specific images / images groups out of hundreds. Also, with an own naming convention, (and knowing the images), you don't need to tag the images. Thanks @tpr!
  24. There were several ways how people do this. You can see it in most of the modules out there in the repos. I haven't read or tried a new method for this. My, maybe old-schooled way is something like this: define default- or factorysettings in an array merge them with the modules config settings in the ready method keep them in a class var or write them back into the config settings Depending on how you store it, you further can access your class var or pull it from modules config settings. Example: private static $factorySettings = array( 'var1' => 'value1', 'var2' => false, 'var3' => true ); public function ready() { $this->data = array_merge(self::$factorySettings, wire('modules')->getModuleConfigData($this->className())); // optionally write it back wire('modules')->saveModuleConfigData($this->className()), $this->data); } A short version, only merging, without store it in a class var: public function ready() { wire('modules')->saveModuleConfigData($this->className()), array_merge(self::$factorySettings, wire('modules')->getModuleConfigData($this->className()))); } Haven't tested, but should be available then in install too. If not, try moving the above from the ready method into the init method.
×
×
  • Create New...