public function documentlist()
    {
        if (!$this->getRequest()->getVar('pageID')) {
            return $this->httpError(400);
        }

        $page = SiteTree::get()->byId($this->getRequest()->getVar('pageID'));

        if ($page && $page->getAllDocuments()->count() > 0) {
            $list = '<ul>';

            foreach ($page->getAllDocuments() as $document) {
                $list .= sprintf(
                    '<li><a class="add-document" data-document-id="%s">%s</a></li>',
                    $document->ID,
                    $document->ID . ' - '. Convert::raw2xml($document->Title)
                );
            }

            $list .= '</ul>';

            return $list;
        }

        return sprintf(
            '<p>%s</p>',
            _t('DMSDocumentAddController.NODOCUMENTS', 'There are no documents attached to the selected page.')
        );
    }
public function documentlist()
    {
        if (!$this->getRequest()->getVar('pageID')) {
            return $this->httpError(400);
        }

        $page = SiteTree::get()->byId($this->getRequest()->getVar('pageID'));

        if ($page && $page->getAllDocuments()->count() > 0) {
            $list = '<ul>';

            foreach ($page->getAllDocuments() as $document) {
                $list .= sprintf(
                    '<li><a class="add-document" data-document-id="%s">%s</a></li>',
                    $document->ID,
                    $document->ID . ' - '. Convert::raw2xml($document->Title)
                );
            }

            $list .= '</ul>';

            return $list;
        }

        return sprintf(
            '<p>%s</p>',
            _t('DMSDocumentAddController.NODOCUMENTS', 'There are no documents attached to the selected page.')
        );
    }
public function documentlist ( ) { if ( ! $ this -> getRequest ( ) -> getVar ( 'pageID' ) ) { return $ this -> httpError ( 400 ) ; } $ page = SiteTree :: get ( ) -> byId ( $ this -> getRequest ( ) -> getVar ( 'pageID' ) ) ; if ( $ page && $ page -> getAllDocuments ( ) -> count ( ) > 0 ) { $ list = '<ul>' ; foreach ( $ page -> getAllDocuments ( ) as $ document ) { $ list .= sprintf ( '<li><a class="add-document" data-document-id="%s">%s</a></li>' , $ document -> ID , $ document -> ID . ' - ' . Convert :: raw2xml ( $ document -> Title ) ) ; } $ list .= '</ul>' ; return $ list ; } return sprintf ( '<p>%s</p>' , _t ( 'DMSDocumentAddController.NODOCUMENTS' , 'There are no documents attached to the selected page.' ) ) ; }
Returns HTML representing a list of documents that are associated with the given page ID, across all document
sets.

@return string HTML
Returns HTML representing a list of documents that are associated with the given page ID across all document sets .