MINOR Merged from branches/2.3

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@81997 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-07-16 03:44:15 +00:00
parent faed7b0c14
commit 82a68dd3bd
4 changed files with 9 additions and 6 deletions

View File

@ -186,7 +186,7 @@ class Convert extends Object {
* @uses SimpleXMLElement * @uses SimpleXMLElement
*/ */
protected static function recursiveXMLToArray($xml) { protected static function recursiveXMLToArray($xml) {
if(get_class($xml) == 'SimpleXMLElement') { if(is_object($xml) && get_class($xml) == 'SimpleXMLElement') {
$attributes = $xml->attributes(); $attributes = $xml->attributes();
foreach($attributes as $k => $v) { foreach($attributes as $k => $v) {
if($v) $a[$k] = (string) $v; if($v) $a[$k] = (string) $v;

View File

@ -202,7 +202,7 @@ class RequestHandler extends ViewableData {
// check if specific action is set // check if specific action is set
if(isset($allowedActions[$actionOrAll])) { if(isset($allowedActions[$actionOrAll])) {
$test = $allowedActions[$actionOrAll]; $test = $allowedActions[$actionOrAll];
if($test === true) { if($test === true || $test === 1 || $test === '1') {
// Case 1: TRUE should always allow access // Case 1: TRUE should always allow access
return true; return true;
} elseif(substr($test, 0, 2) == '->') { } elseif(substr($test, 0, 2) == '->') {

View File

@ -176,9 +176,11 @@ class Hierarchy extends DataObjectDecorator {
*/ */
protected function markingFinished() { protected function markingFinished() {
// Mark childless nodes as expanded. // Mark childless nodes as expanded.
foreach($this->markedNodes as $id => $node) { if($this->markedNodes) {
if(!$node->isExpanded() && !$node->numChildren()) { foreach($this->markedNodes as $id => $node) {
$node->markExpanded(); if(!$node->isExpanded() && !$node->numChildren()) {
$node->markExpanded();
}
} }
} }
} }

View File

@ -651,7 +651,8 @@ JS;
$referrer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null; $referrer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null;
$closeLink = sprintf( $closeLink = sprintf(
'<small><a href="' . $referrer . '" onclick="javascript:window.top.GB_hide(); return false;">(%s)</a></small>', '<small><a href="%s" onclick="javascript:window.top.GB_hide(); return false;">(%s)</a></small>',
$referrer,
_t('ComplexTableField.CLOSEPOPUP', 'Close Popup') _t('ComplexTableField.CLOSEPOPUP', 'Close Popup')
); );