We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31113
    • 45 Posts
    This is an auto-generated support/comment thread for Docmanager.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    Simple class for editing/creating/deleting documents
      • 31113
      • 45 Posts
      New version 0.5.3b
      Added: $doc->Duplicate() function
        • 22178
        • 7 Posts
        er, have looked all over, and googled...

        is there any detailed - or even not totally detailed - newbieish guide for the doc manager?

        tongue ...looks really powerful, but at this rate i’m gonna cut off my tongue...

          "...CTRL-what?"
          • 27889
          • 415 Posts
          I’m just going to give a try to your api, is it 0.9.5 compliant ?
            MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
            MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
            • 16429
            • 254 Posts
            I’m interested in the 095 compatibility, too. What’s the answer?
              kudo
              www.kudolink.com - webdesign (surprised?)

              [img]http://www.kudolink.com/kudolinkcom.png[/img] [sup]proudly uses[/sup] [img]http://www.kudolink.com/modx.png[/img]
              • 696
              • 46 Posts
              its 095 compliant im using it on 095 myself now...

              i would like to know however how i can get the id of the newly created document... i cant see anyway ATM... please get back ASAP...
                • 27889
                • 415 Posts
                I just make some test, the api seems to work well on the new version, you must add an escape function in the save() one, because fields aren’t correctly escaped if you have ", ’ ,... in your text fields.
                This API rocks !

                Very Quick Guide:
                Be carrefull : The doc group aren’t managed (for the moment ?).

                to create a new document:
                [tt]$doc = new Document(); // [/tt]
                to get an existing document:
                [tt]$doc = new Document($id); // Where $id contain the id of the document you want do get.[/tt]
                to get a field from a document:
                [tt]$pagetitle=$doc->Get(’pagetitle’);[/tt]
                to get a tv value from a document:
                [tt]$MyTvValue=$doc->Get(’tvMyTvName’);//add "tv" before the name of your tv.[/tt]
                to set a field: (you must call Save() to save the change in the db)
                [tt]$doc->Set(’pagetitle’,’My New PageTitle’);[/tt]
                to save your modifications in the db:
                [tt]$doc->Save();[/tt]
                after the save of a new doc you can get the new id created:
                [tt]$MyNewId=$doc->fields[’id’];[/tt]

                to duplicate a document (document are duplicated with their tv values):
                [tt]$doc = new Document($Id_Of_Document_You_Want_Duplicate);
                $doc->Duplicate();
                $doc->Save();
                [/tt]


                Hope this help.
                  MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
                  MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
                  • 696
                  • 46 Posts
                  Quote from: Soda at Dec 30, 2006, 03:33 AM

                  after the save of a new doc you can get the new id created:
                  $MyNewId=$doc->fields[’id’];

                  This is just what i wanted to know thank you... I can finish my application now laugh
                    • 7923
                    • 4,213 Posts
                    Quote from: Aikdo at Dec 30, 2006, 06:39 AM

                    Quote from: Soda at Dec 30, 2006, 03:33 AM

                    after the save of a new doc you can get the new id created:
                    $MyNewId=$doc->fields[’id’];

                    This is just what i wanted to know thank you... I can finish my application now laugh
                    And if you need the id before the document is saved, use $modx->db->getInsertId() (if no-one else can save a document in the mean while)


                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                      • 27889
                      • 415 Posts
                      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 ?
                        MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
                        MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]