concrete/src/Page/Sitemap/DragRequestData.php
protected function whyCantMove()
    {
        $destinationPageChecker = new Checker($this->getDestinationPage());
        $destinationPageID = $this->getDestinationPage()->getCollectionID();
        foreach ($this->getOriginalPages() as $originalPage) {
            if ($originalPage->getCollectionParentID() == $destinationPageID) {
                return t('"%1$s" is already the parent page of "%2$s".', $this->getDestinationPage()->getCollectionName(), $originalPage->getCollectionName());
            }
            $originalPageChecker = new Checker($originalPage);
            if (!$originalPageChecker->canMoveOrCopyPage()) {
                return t('You don\'t have the permission move the page "%s".', $originalPage->getCollectionName());
            }
            if ($originalPage->getCollectionID() == $destinationPageID) {
                return t('It\'s not possible to move the page "%s" under itself.', $originalPage->getCollectionName());
            }
            if (in_array($destinationPageID, $originalPage->getCollectionChildrenArray())) {
                return t('It\'s not possible to move the page "%s" under one of its child pages.', $originalPage->getCollectionName());
            }
            $originalPageType = $originalPage->getPageTypeObject();
            if (!$destinationPageChecker->canAddSubpage($originalPageType)) {
                return t('You do not have sufficient privileges to move the page "%1$s" under "%2$s".', $originalPage->getCollectionName(), $this->getDestinationPage()->getCollectionName());
            }
        }

        return '';
    }
protected function whyCantMove()
    {
        $destinationPageChecker = new Checker($this->getDestinationPage());
        $destinationPageID = $this->getDestinationPage()->getCollectionID();
        foreach ($this->getOriginalPages() as $originalPage) {
            if ($originalPage->getCollectionParentID() == $destinationPageID) {
                return t('"%1$s" is already the parent page of "%2$s".', $this->getDestinationPage()->getCollectionName(), $originalPage->getCollectionName());
            }
            $originalPageChecker = new Checker($originalPage);
            if (!$originalPageChecker->canMoveOrCopyPage()) {
                return t('You don\'t have the permission move the page "%s".', $originalPage->getCollectionName());
            }
            if ($originalPage->getCollectionID() == $destinationPageID) {
                return t('It\'s not possible to move the page "%s" under itself.', $originalPage->getCollectionName());
            }
            if (in_array($destinationPageID, $originalPage->getCollectionChildrenArray())) {
                return t('It\'s not possible to move the page "%s" under one of its child pages.', $originalPage->getCollectionName());
            }
            $originalPageType = $originalPage->getPageTypeObject();
            if (!$destinationPageChecker->canAddSubpage($originalPageType)) {
                return t('You do not have sufficient privileges to move the page "%1$s" under "%2$s".', $originalPage->getCollectionName(), $this->getDestinationPage()->getCollectionName());
            }
        }

        return '';
    }
protected function whyCantMove ( ) { $ destinationPageChecker = new Checker ( $ this -> getDestinationPage ( ) ) ; $ destinationPageID = $ this -> getDestinationPage ( ) -> getCollectionID ( ) ; foreach ( $ this -> getOriginalPages ( ) as $ originalPage ) { if ( $ originalPage -> getCollectionParentID ( ) == $ destinationPageID ) { return t ( '"%1$s" is already the parent page of "%2$s".' , $ this -> getDestinationPage ( ) -> getCollectionName ( ) , $ originalPage -> getCollectionName ( ) ) ; } $ originalPageChecker = new Checker ( $ originalPage ) ; if ( ! $ originalPageChecker -> canMoveOrCopyPage ( ) ) { return t ( 'You don\'t have the permission move the page "%s".' , $ originalPage -> getCollectionName ( ) ) ; } if ( $ originalPage -> getCollectionID ( ) == $ destinationPageID ) { return t ( 'It\'s not possible to move the page "%s" under itself.' , $ originalPage -> getCollectionName ( ) ) ; } if ( in_array ( $ destinationPageID , $ originalPage -> getCollectionChildrenArray ( ) ) ) { return t ( 'It\'s not possible to move the page "%s" under one of its child pages.' , $ originalPage -> getCollectionName ( ) ) ; } $ originalPageType = $ originalPage -> getPageTypeObject ( ) ; if ( ! $ destinationPageChecker -> canAddSubpage ( $ originalPageType ) ) { return t ( 'You do not have sufficient privileges to move the page "%1$s" under "%2$s".' , $ originalPage -> getCollectionName ( ) , $ this -> getDestinationPage ( ) -> getCollectionName ( ) ) ; } } return '' ; }
Get the reason why the move operation can't be performed.

@return string empty string if the operation CAN be performed
Get the reason why the move operation can t be performed .