Changeset 12641
- Timestamp:
- 02/22/08 20:20:19 (11 months ago)
- Files:
-
- 1 modified
-
util/branches/dev/jsdoc/jsdoc.module (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
util/branches/dev/jsdoc/jsdoc.module
r12639 r12641 254 254 $node = _jsdoc_node_load($node->nid); 255 255 256 $text = '<h1>'. str_replace('.', ' ', $node->title) .'</h1>'. $node->title . '' . jsdoc_get_teaser($node) . ' ' . jsdoc_get_body($node);256 $text = '<h1>'. implode(' ', _jsdoc_build_terms($node->title)) . '</h1> ' . jsdoc_get_teaser($node) . ' ' . jsdoc_get_body($node); 257 257 258 258 // Fetch extra data normally not visible … … 305 305 } 306 306 307 $find = do_search('(' . str_replace('.', ' ', $keys) . ') OR (' . $keys. ')', 'jsdoc_' . $version_title);307 $find = do_search('(' . implode('), (', _jsdoc_build_terms($keys)) . ')', 'jsdoc_' . $version_title); 308 308 $results = array(); 309 309 foreach ($find as $item) { 310 310 $node = _jsdoc_node_load($item->sid); 311 311 if ($version && jsdoc_get_version($node)->nid != $version->nid) { 312 continue; 313 } 314 if (!$private && jsdoc_is_private($node)) { 312 315 continue; 313 316 } … … 1488 1491 1489 1492 function jsdoc_is_private(&$node) { 1490 return $node->jsdoc_private || $node->jsdoc_private_parent; 1493 $query = db_query("SELECT jo.private, jo.private_parent FROM {jsdoc_objects} jo JOIN {node} n ON (n.vid = jo.vid) WHERE n.title = '%s' AND BINARY n.title = '%s' AND jo.version = %d GROUP BY jo.private, jo.private_parent", $node->title, $node->title, jsdoc_get_version($node)->nid); 1494 if (db_num_rows($query) == 1) { 1495 $result = db_fetch_object($query); 1496 return $result->private || $result->private_parent; 1497 } 1491 1498 } 1492 1499 … … 3280 3287 } 3281 3288 3289 function _jsdoc_build_terms($title) { 3290 $output = array($title, array()); 3291 $parts = explode('.', $title); 3292 foreach ($parts as $part) { 3293 if (preg_match('%^[_.$]*([a-zA-Z][a-z0-9_.$]*(?:[A-Z][a-z0-9_.$]*)+)%', $part, $match)) { 3294 if (preg_match_all('%(^[a-zA-Z][a-z0-9_.$]*|[A-Z][a-z0-9_.$]*)%', $match[1], $cased)) { 3295 $output[1] = array_merge($output[1], $cased[0]); 3296 } 3297 } 3298 } 3299 $output[1] = implode(' ', $output[1]); 3300 $output[2] = implode(' ', $parts); 3301 return $output; 3302 } 3303 3282 3304 function _jsdoc_build_taxonomy($names, $vid, $parent = false) 3283 3305 {