public function PageTypes()
    {
        $classes = SiteTree::page_type_classes();

        $result = new ArrayList();

        foreach ($classes as $class) {
            $instance = SiteTree::singleton($class);
            if ($instance instanceof HiddenClass) {
                continue;
            }

            // skip this type if it is restricted
            $needPermissions = $instance->config()->get('need_permission');
            if ($needPermissions && !$this->can($needPermissions)) {
                continue;
            }

            $result->push(new ArrayData(array(
                'ClassName' => $class,
                'AddAction' => $instance->i18n_singular_name(),
                'Description' => $instance->i18n_classDescription(),
                'IconURL' => $instance->getPageIconURL(),
                'Title' => $instance->i18n_singular_name(),
            )));
        }

        $result = $result->sort('AddAction');

        return $result;
    }
public function PageTypes()
    {
        $classes = SiteTree::page_type_classes();

        $result = new ArrayList();

        foreach ($classes as $class) {
            $instance = SiteTree::singleton($class);
            if ($instance instanceof HiddenClass) {
                continue;
            }

            // skip this type if it is restricted
            $needPermissions = $instance->config()->get('need_permission');
            if ($needPermissions && !$this->can($needPermissions)) {
                continue;
            }

            $result->push(new ArrayData(array(
                'ClassName' => $class,
                'AddAction' => $instance->i18n_singular_name(),
                'Description' => $instance->i18n_classDescription(),
                'IconURL' => $instance->getPageIconURL(),
                'Title' => $instance->i18n_singular_name(),
            )));
        }

        $result = $result->sort('AddAction');

        return $result;
    }
public function PageTypes ( ) { $ classes = SiteTree :: page_type_classes ( ) ; $ result = new ArrayList ( ) ; foreach ( $ classes as $ class ) { $ instance = SiteTree :: singleton ( $ class ) ; if ( $ instance instanceof HiddenClass ) { continue ; } // skip this type if it is restricted $ needPermissions = $ instance -> config ( ) -> get ( 'need_permission' ) ; if ( $ needPermissions && ! $ this -> can ( $ needPermissions ) ) { continue ; } $ result -> push ( new ArrayData ( array ( 'ClassName' => $ class , 'AddAction' => $ instance -> i18n_singular_name ( ) , 'Description' => $ instance -> i18n_classDescription ( ) , 'IconURL' => $ instance -> getPageIconURL ( ) , 'Title' => $ instance -> i18n_singular_name ( ) , ) ) ) ; } $ result = $ result -> sort ( 'AddAction' ) ; return $ result ; }
Populates an array of classes in the CMS
which allows the user to change the page type.

@return SS_List
Populates an array of classes in the CMS which allows the user to change the page type .