Merged pre-2.3-oct08

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66352 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-11-21 01:06:21 +00:00
parent 4e6036911e
commit ece0130baa
3 changed files with 17 additions and 10 deletions

View File

@ -508,6 +508,10 @@ class Object {
), ),
)); ));
} }
public static function remove_extension($className, $extensionName) {
Object::$extraStatics[$className]['extensions'] = array_diff(Object::$extraStatics[$className]['extensions'], array($extensionName));
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CACHE METHODS (added by simon_w (simon -at- simon -dot- geek -dot- nz)) // CACHE METHODS (added by simon_w (simon -at- simon -dot- geek -dot- nz))

View File

@ -663,7 +663,7 @@ class DataObjectSet extends ViewableData implements IteratorAggregate {
* @param string $ulExtraAttributes Extra attributes * @param string $ulExtraAttributes Extra attributes
* @return string * @return string
*/ */
protected function getChildrenAsUL($nestingLevels, $level = 0, $template = "<li id=\"record-\$ID\" class=\"\$EvenOdd\">\$Title", $ulExtraAttributes = null, &$itemCount = 0) { public function getChildrenAsUL($nestingLevels, $level = 0, $template = "<li id=\"record-\$ID\" class=\"\$EvenOdd\">\$Title", $ulExtraAttributes = null, &$itemCount = 0) {
$output = ""; $output = "";
$hasNextLevel = false; $hasNextLevel = false;
$ulExtraAttributes = " $ulExtraAttributes"; $ulExtraAttributes = " $ulExtraAttributes";
@ -675,14 +675,16 @@ class DataObjectSet extends ViewableData implements IteratorAggregate {
$currentTemplate = (!empty($currentNestingLevel)) ? $currentNestingLevel['template'] : $template; $currentTemplate = (!empty($currentNestingLevel)) ? $currentNestingLevel['template'] : $template;
$myViewer = SSViewer::fromString($currentTemplate); $myViewer = SSViewer::fromString($currentTemplate);
$childrenMethod = $nestingLevels[$level+1]['dataclass']; if(isset($nestingLevels[$level+1]['dataclass'])){
$childrenMethod = $nestingLevels[$level+1]['dataclass'];if($level==1){print_r($childrenMethod);die;}
}
// sql-parts // sql-parts
$filter = ($nestingLevels[$level+1]['filter']) ? $nestingLevels[$level+1]['filter'] : null;
$sort = ($nestingLevels[$level+1]['sort']) ? $nestingLevels[$level+1]['sort'] : null; $filter = (isset($nestingLevels[$level+1]['filter'])) ? $nestingLevels[$level+1]['filter'] : null;
$join = ($nestingLevels[$level+1]['join']) ? $nestingLevels[$level+1]['join'] : null; $sort = (isset($nestingLevels[$level+1]['sort'])) ? $nestingLevels[$level+1]['sort'] : null;
$limit = ($nestingLevels[$level+1]['limit']) ? $nestingLevels[$level+1]['limit'] : null; $join = (isset($nestingLevels[$level+1]['join'])) ? $nestingLevels[$level+1]['join'] : null;
$having = ($nestingLevels[$level+1]['having']) ? $nestingLevels[$level+1]['having'] : null; $limit = (isset($nestingLevels[$level+1]['limit'])) ? $nestingLevels[$level+1]['limit'] : null;
$having = (isset($nestingLevels[$level+1]['having'])) ? $nestingLevels[$level+1]['having'] : null;
foreach($this as $parent) { foreach($this as $parent) {
$evenOdd = ($itemCount % 2 == 0) ? "even" : "odd"; $evenOdd = ($itemCount % 2 == 0) ? "even" : "odd";
@ -692,7 +694,7 @@ class DataObjectSet extends ViewableData implements IteratorAggregate {
// if no output is selected, fall back to the id to keep the item "clickable" // if no output is selected, fall back to the id to keep the item "clickable"
$output .= $template . "\n"; $output .= $template . "\n";
if($childrenMethod) { if(isset($childrenMethod)) {
// workaround for missing groupby/having-parameters in instance_get // workaround for missing groupby/having-parameters in instance_get
// get the dataobjects for the next level // get the dataobjects for the next level
$children = $parent->$childrenMethod($filter, $sort, $join, $limit, $having); $children = $parent->$childrenMethod($filter, $sort, $join, $limit, $having);

View File

@ -17,11 +17,12 @@ class Group extends DataObject {
); );
static $has_one = array( static $has_one = array(
"Parent" => "SiteTree", "Parent" => "Group",
); );
static $has_many = array( static $has_many = array(
"Permissions" => "Permission", "Permissions" => "Permission",
"Groups" => "Group"
); );
static $many_many = array( static $many_many = array(