| 413 |
} |
} |
| 414 |
} |
} |
| 415 |
|
|
| 416 |
|
function _help_check_default_file(&$info, $module, &$path) { |
| 417 |
|
if (isset($path) && file_exists($path . '/about.html') && empty($info['about'])) { |
| 418 |
|
$info['about'] = array( |
| 419 |
|
'title' => t('About'), |
| 420 |
|
'file' => 'about', |
| 421 |
|
'weight' => -20, |
| 422 |
|
); |
| 423 |
|
} |
| 424 |
|
else if (empty($info) && empty($path)) { |
| 425 |
|
$info = array(); |
| 426 |
|
$help_example = drupal_get_path('module', 'help_example') . '/modules'; |
| 427 |
|
$module_path = drupal_get_path('module', $module); |
| 428 |
|
if (file_exists("$module_path/help/about.html")) { |
| 429 |
|
$path = "$module_path/help"; |
| 430 |
|
_help_check_default_file($info, $module, $path); |
| 431 |
|
} |
| 432 |
|
else if (file_exists("$help_example/$module/about.html")) { |
| 433 |
|
// Temporary support for core module helps files. |
| 434 |
|
$path = "$help_example/$module"; |
| 435 |
|
_help_check_default_file($info, $module, $path); |
| 436 |
|
} |
| 437 |
|
} |
| 438 |
|
} |
| 439 |
|
|
| 440 |
/** |
/** |
| 441 |
* Search the system for all available help topics. |
* Search the system for all available help topics. |
| 442 |
*/ |
*/ |
| 445 |
if (!isset($topics)) { |
if (!isset($topics)) { |
| 446 |
$topics = array(); |
$topics = array(); |
| 447 |
$help_example = drupal_get_path('module', 'help_example') . '/modules'; |
$help_example = drupal_get_path('module', 'help_example') . '/modules'; |
|
|
|
| 448 |
|
|
|
/* // From .info files. |
|
|
foreach (module_list() as $module) { |
|
|
$module_path = drupal_get_path('module', $module); |
|
|
$info = array(); |
|
|
if (file_exists("$module_path/help/$module.help.ini")) { |
|
|
$path = "$module_path/help"; |
|
|
$info = drupal_parse_info_file("./$module_path/$module.info", TRUE); |
|
|
$info = $info['help']; |
|
|
d($info); |
|
|
} |
|
|
else if (file_exists("$help_example/$module/$module.help.ini")) { |
|
|
// Temporary support for core module helps files. |
|
|
$path = "$help_example/$module"; |
|
|
$info = drupal_parse_info_file("./$help_example/$module/$module.help.ini", TRUE); |
|
|
}*/ |
|
|
|
|
|
/* From new hook_help(). |
|
|
foreach (module_implements('help_soc', TRUE) as $module) { |
|
|
$module_path = drupal_get_path('module', $module); |
|
|
$info = array(); |
|
|
$path = "$module_path/help"; |
|
|
$info = module_invoke($module, 'help_soc'); |
|
|
*/ |
|
| 449 |
foreach (module_list() as $module) { |
foreach (module_list() as $module) { |
| 450 |
$module_path = drupal_get_path('module', $module); |
$module_path = drupal_get_path('module', $module); |
| 451 |
$info = array(); |
$info = array(); |
| 452 |
|
$path = ''; |
| 453 |
if (file_exists("$module_path/help/$module.help.ini")) { |
if (file_exists("$module_path/help/$module.help.ini")) { |
| 454 |
$path = "$module_path/help"; |
$path = "$module_path/help"; |
| 455 |
$info = parse_ini_file("./$module_path/help/$module.help.ini", TRUE); |
$info = parse_ini_file("./$module_path/help/$module.help.ini", TRUE); |
| 456 |
|
_help_check_default_file($info, $module, $path); |
| 457 |
} |
} |
| 458 |
else if (file_exists("$help_example/$module/$module.help.ini")) { |
else if (file_exists("$help_example/$module/$module.help.ini")) { |
| 459 |
// Temporary support for core module helps files. |
// Temporary support for core module helps files. |
| 460 |
$path = "$help_example/$module"; |
$path = "$help_example/$module"; |
| 461 |
$info = parse_ini_file("./$help_example/$module/$module.help.ini", TRUE); |
$info = parse_ini_file("./$help_example/$module/$module.help.ini", TRUE); |
| 462 |
|
_help_check_default_file($info, $module, $path); |
| 463 |
|
} |
| 464 |
|
else { |
| 465 |
|
_help_check_default_file($info, $module, $path); |
| 466 |
} |
} |
| 467 |
|
|
| 468 |
if (!empty($info)) { |
if (!empty($info)) { |
| 493 |
); |
); |
| 494 |
} |
} |
| 495 |
} |
} |
| 496 |
|
$path = ''; |
| 497 |
|
$info = array(); |
| 498 |
} |
} |
| 499 |
} |
} |
| 500 |
return $topics; |
return $topics; |