We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6661
    • 119 Posts
    Quote from: aNoble at Aug 08, 2005, 10:48 PM

    About the plugin vs. core decision. There was a lot of talk with opinions on both sides but in the end it was decided that we would get the best of both worlds and make it a core plugin. It’s planned that it will be a plugin but be distributed with the default installation. So it will still be a "core" feature event though it won’t be hard coded into the core.

    As far as editing "hidden" TVs we’ve thought about that too. At this point I’m thinking it would be easiest to have a simple snippet that would output a "header" with links to edit all of the TVs on the page. This should be a simple solution and won’t require any modifications to the existing frontend editing code.

    Well as other features are added, the API will have to grow to accomodate integrating these with existing plugins. Workflow and permissioning are good examples here. You may only want to give a certain group or user a right to edit certain TVs on a page. You probrbaly want an editor to be able to modify the body text and headline but a graphic artist to be able to go in later and drop in header images. This should all be possible via front-end editing. So you can’t just expose all TVs, hidden or otherwise, to all users for editing.
      • 1764
      • 680 Posts
      The ability to set permissions on TVs should be working for both the manager and the frontend editing.

      If you set the access permissions on a TV the edit button should be hidden for those who don’t have permission.

      Let me know if this is not working for some reason. I’ll make sure to get it fixed if there are problems.
        • 1764
        • 680 Posts
        I started on the conversion of the frontend editing code to a module today. It’s coming along well and I’m very happy so far with what I’m able to do within the module structure. I hope to have the Module working before the end of the week, which should be very easy if I don’t have any major distractions between now and then.

        I did have one question though. Is there any way to create a sort of a "library" with Modules? In other words I have functions that I’d like to be able to access not only form my module but also from dependent Plugins and Snippets. Is there any easy way of doing this? I know that you can share paramaters but I don’t see any way of sharing code. Of course it wouldn’t be a huge deal to just copy and paste the code between resources but it would be nice if there could be one central area in a module where code could be written and accessed by all dependents.

        I have a few other module questions floating around in my head but I’ll wait ’till I’m further along and have a better idea of the whole process.

        In closing, Great work Raymond! I’ve already thought up a long list of modules I’d like to write. This certainly gives us a LOT more power than Snippets alone (which is what I’ve been living with for a while). grin
          • 32963
          • 1,732 Posts
          Sure you can

          Just create a folder and store your shared libraries there.

          example:

          assets/modules/frontendeditor

          In the above folder you can add all your library files.

          From within your Modules, Plugins, Snippets you could setup a shared parameter that allows the user to specify the path to the module

          &modpath=Path to Module;string;assets/modules/frontendeditor

          now from within your code you could do something like this:

          $modPath = $modx->config[’base_path’].$modpath;

          include_once $modPath."/mylibrary.php";
            xWisdom
            www.xwisdomhtml.com
            The fear of the Lord is the beginning of wisdom:
            MODx Co-Founder - Create and do more with less.
            • 1764
            • 680 Posts
            Okay. So once we get the Module Packager done we’ll be able to include actual files and create directory structures? I think that would be a great feature as long as we can handle them well when installing and uninstalling modules.
              • 32963
              • 1,732 Posts
              Well I’m sure it will handle installs very well but for uninstalls it might have to leave some files behind. For example, system files (manager/) will not be removed after they have been installed.


                xWisdom
                www.xwisdomhtml.com
                The fear of the Lord is the beginning of wisdom:
                MODx Co-Founder - Create and do more with less.
                • 25663 MODX Staff
                • 12,272 Posts
                Why do system files have to be left behind? Can we not define a shared "dependency" check for all installed system components and other installed modules?
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 32963
                  • 1,732 Posts
                  That’s going to be a tough call. There’s no guarantee that the file is not in use. A shared dependency check migth just miss out on an external library file.

                  Just my 2 cents but maybe someone can come up with a solution that will work just fine.
                    xWisdom
                    www.xwisdomhtml.com
                    The fear of the Lord is the beginning of wisdom:
                    MODx Co-Founder - Create and do more with less.