Closed (fixed)
Project:
AJAXify
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Apr 2008 at 01:00 UTC
Updated:
28 May 2008 at 10:44 UTC
Calling to url /ajaxify/div.content/node/9 does work when node/9 has a div element with class=content:
<div class="content">
But it unable to find the requested content when the class of div element written like this:
<div class="node content">
So I modified this function:
function ajaxify_find_element($xml, $attr, $val) {
// Loop through all element's children
foreach ($xml->children() as $element) {
// Check if the first child matches
// find attribute, and if the attribute is class, we need to read it as
// array with spaces as delimiter
$attrvalue = ajaxify_find_attribute($element, $attr);
if ($attr == 'class')
$found = in_array((string)$val, explode(' ', $attrvalue));
else
$found = $attrvalue == (string)$val;
if ($found) {
return $element;
}
else {
// Else, iterate to deeper level in XML
$element = ajaxify_find_element($element, $attr, $val);
if (is_object($element)) {
// Return the found element from the previous iteration
return $element;
}
}
}
}
Comments
Comment #1
arhip commentedThis is a patch...
Comment #2
owahab commentedworks fine for me.
Comment #3
owahab commentedComment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.