Craft\ImportController::actionGetEntryTypes PHP Method

actionGetEntryTypes() public method

Get available entry types.
public actionGetEntryTypes ( )
    public function actionGetEntryTypes()
    {
        // Only ajax post requests
        $this->requirePostRequest();
        $this->requireAjaxRequest();
        // Get section
        $section = craft()->request->getPost('section');
        $section = craft()->sections->getSectionById($section);
        // Get entry types
        $entrytypes = $section->getEntryTypes();
        // Return JSON
        $this->returnJson($entrytypes);
    }