Sha256: 7338071ad168b3ec125681b3eee0b4d82b3ccd5d2ffc7dc0b4173e8ed784f94c

Contents?: true

Size: 1.06 KB

Versions: 11

Compression:

Stored size: 1.06 KB

Contents

<?php

class AbcForm extends Form {

	public static function getSubForms($className = null){

		global $_CLASS_MANIFEST;

		$classes = $_CLASS_MANIFEST;
		$subForms = array();
		if (!$className) $className = get_class();

		// ensure that classes are loaded for comparison
		if (!class_exists($className)) require($classes[strtolower($className)]);

		// Sort Classes
		foreach($classes as $class => $path){

			// generate case sensitve classname
			$pieces = explode('/', $path);
			$csClassName = str_replace('.php','',$pieces[count($pieces)-1]);

			// bypass sapphire classes
			if (stripos($path,'sapphire') === false ) {

				// ensure that classes are loaded for comparison (this wont work for some inbuilt ss classes)
				if ( !class_exists($csClassName) ) try{ require_once($path); }catch(Exception $e){ /* Do Nothing */ }
	 
				// test
				if ( class_exists($csClassName) && is_subclass_of($csClassName, $className) ) $subForms[$csClassName] = preg_replace('/([A-Z])/',' $1',$csClassName);
				
			}
		}

		return $subForms;		
	}

}

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
bonethug-0.0.17 skel/project_types/silverstripe3/public/abc/code/Forms/AddForm.php
bonethug-0.0.16 skel/project_types/silverstripe3/public/abc/code/Forms/AddForm.php
bonethug-0.0.15 skel/project_types/silverstripe3/public/abc/code/Forms/AddForm.php
bonethug-0.0.14 skel/project_types/silverstripe3/public/abc/code/Forms/AddForm.php
bonethug-0.0.13 skel/project_types/silverstripe3/public/abc/code/Forms/AddForm.php
bonethug-0.0.12 skel/project_types/silverstripe3/public/abc/code/Forms/AddForm.php
bonethug-0.0.11 skel/project_types/silverstripe3/public/abc/code/Forms/AddForm.php
bonethug-0.0.10 skel/project_types/silverstripe3/public/abc/code/Forms/AddForm.php
bonethug-0.0.7 skel/project_types/silverstripe3/public/abc/code/Forms/AddForm.php
bonethug-0.0.6 skel/project_types/silverstripe3/public/abc/code/Forms/AddForm.php
bonethug-0.0.5 skel/project_types/silverstripe3/public/abc/code/Forms/AddForm.php