We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5463
    • 33 Posts
    Hi,

    I’m new to modx and don’tunderstand what docmanager exactly does and how it works.

    first of all, i don’t know where to add the classes. and what i have to do to run the instructions.

    my intention is to let anybody add an unpublished document via submitting a form. is this possible?

    any help would be great!
      • 31113
      • 45 Posts
      Quote from: Soda at Jan 13, 2007, 12:23 PM

      one thing I notice, be carefull, the tvs are filled only if you do a get field on it.
      line 126 in the GetTV function the call to getTVValues() , this function doesn’t exist, I replaced it with fillOldTVValues(), don’t know if its right, ur001 can you help me ?

      Yes, you right.
      I fix it.
      A your need doc group?

      May be, in the near future I’ll continue work with modx and Docmanager
        • 27889
        • 415 Posts
        Thanks for your answer ur001,
        doc group will be welcome so the api would be quite complete.

        I’m planning to add an addon for gallery to your api ( to work with maxigallery)
          MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
          MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
          • 27889
          • 415 Posts
          ur001 there is some great code for document group in the NewsPublisher snippet ( from Raymond Irving) arround line 218. It could be usefull for you (and for us smiley ).
            MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
            MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
            • 5727
            • 160 Posts
            I’ve been trying to use this class for my front-end management application. So far it’s been working great, except the fact that the TVs are getting duplicated instead of replacing the existing one. I was going to look into the class more in depth, but I wanted to ask here to see if people came across the same problem.
              Olivier Deland
              Montreal, Canada - Web Developer
              • 5727
              • 160 Posts
              Wow, after a week pulling my hairs, I finally found out the bug. I was retrieving an existing TV values, before saving changes, so the oldTVs array was getting filled, but then erased by the saveTVs function.

              There’s a check on the fourth line in the function and since the oldTVs was already created by my call to Get(), the oldTVs was being erased instead of getting filled.

              So replace:
               else 
                  $this->oldTVs = array();
              


               elseif ( !is_array( $this->oldTVs ) )
                  $this->oldTVs = array();
              


              Well, I hope this is clear. If you have questions, don’t hesitate!
                Olivier Deland
                Montreal, Canada - Web Developer
                • 10470
                • 48 Posts
                ConseilsWeb, would you mind posting a simple example of how you got this working? i.e a front-end form which uses doc manager. I am sure a lot of people would be very happy to see this grin

                Cheers,
                G
                  • 5727
                  • 160 Posts
                  Quote from: gareth84 at Apr 19, 2007, 02:15 AM

                  ConseilsWeb, would you mind posting a simple example of how you got this working? i.e a front-end form which uses doc manager. I am sure a lot of people would be very happy to see this grin

                  Cheers,
                  G

                  Well, I would need to know your level of knowledge before hand. Docmanager is a tool for snippet developers, so it means that you need programming skills in order to use it. Read the first couple posts in this thread to see if they help.

                  I’m still on my first couple projects with MODx, but I’m sure that sooner than later, I’ll be publishing helpful docs. In the mean time, you might want to have a look at http://modxcms.com/forums/index.php/topic,8111.0.html. This one requires knowledge of the MODx DB structure.
                    Olivier Deland
                    Montreal, Canada - Web Developer
                    • 33114
                    • 518 Posts
                    I noticed that if I make a document through this docmanager class, the new doc isnt displayed by Ditto calls until the site cache is cleared. Is this fixable without cleaning the cache?
                      http://modx.ru - российская поддержка MODx
                      http://newscup.ru - экспериментальный проект
                      http://yentsun.com - персональный сайт
                      • 7923
                      • 4,213 Posts
                      Add this function to Docmanager class and call it after save()

                      function clearCache() {
                          include_once $modx->config['base_path']."manager/processors/cache_sync.class.processor.php";
                          $sync = new synccache();
                          $sync->setCachepath($modx->config['base_path'].'assets/cache/');
                          $sync->setReport(false);
                          $sync->emptyCache();
                      }
                      


                        "He can have a lollipop any time he wants to. That's what it means to be a programmer."