function scald_index_included in scald_index 7
Determine atoms (expressed as SAS or DIV) embedded in a string.
Parameters
string $string: The string to search for SAS/DIV notation atoms.
Return value
array An array of SIDs which are included in the string in SAS/DIV notation.
See also
1 call to scald_index_included()
- scald_index_build_node_index in ./
scald_index.module - Builds index for a given node.
File
- ./
scald_index.module, line 409
Code
function scald_index_included($string) {
$atoms = array();
// Detect SAS atoms.
if (preg_match_all(SCALD_SAS_MATCH_PATTERN, $string, $sas_atoms)) {
$atoms = array_merge($atoms, $sas_atoms[1]);
}
// Detect DIV atoms.
if (preg_match_all('/<div.*data-scald-sid=\\"(\\d+)\\".*>/', $string, $div_atoms)) {
$atoms = array_merge($atoms, $div_atoms[1]);
}
return $atoms;
}