protected function getCanCreateContext($args)
    {
        // Inspect second parameter to canCreate for a 'Parent' context
        if (isset($args[1]['Parent'])) {
            return $args[1]['Parent'];
        }
        // Hack in currently edited page if context is missing
        if (Controller::has_curr() && Controller::curr() instanceof CMSMain) {
            return Controller::curr()->currentPage();
        }

        // No page being edited
        return null;
    }
protected function getCanCreateContext($args)
    {
        // Inspect second parameter to canCreate for a 'Parent' context
        if (isset($args[1]['Parent'])) {
            return $args[1]['Parent'];
        }
        // Hack in currently edited page if context is missing
        if (Controller::has_curr() && Controller::curr() instanceof CMSMain) {
            return Controller::curr()->currentPage();
        }

        // No page being edited
        return null;
    }
protected function getCanCreateContext ( $ args ) { // Inspect second parameter to canCreate for a 'Parent' context if ( isset ( $ args [ 1 ] [ 'Parent' ] ) ) { return $ args [ 1 ] [ 'Parent' ] ; } // Hack in currently edited page if context is missing if ( Controller :: has_curr ( ) && Controller :: curr ( ) instanceof CMSMain ) { return Controller :: curr ( ) -> currentPage ( ) ; } // No page being edited return null ; }
Helper method to check the parent for this object

@param array $args List of arguments passed to canCreate
@return SiteTree Parent page instance
Helper method to check the parent for this object