Hook::register('addon_settings_post', 'addon/showmore/showmore.php', 'showmore_addon_settings_post');
}
-function showmore_uninstall()
-{
- Hook::unregister('prepare_body', 'addon/showmore/showmore.php', 'showmore_prepare_body');
- Hook::unregister('addon_settings', 'addon/showmore/showmore.php', 'showmore_addon_settings');
- Hook::unregister('addon_settings_post', 'addon/showmore/showmore.php', 'showmore_addon_settings_post');
-}
-
function showmore_addon_settings(&$a, &$s)
{
if (!local_user()) {
$enable = (!empty($_POST['showmore-enable']) ? intval($_POST['showmore-enable']) : 0);
$disable = 1-$enable;
DI::pConfig()->set(local_user(), 'showmore', 'disable', $disable);
- info(DI::l10n()->t('Show More Settings saved.') . EOL);
}
}
// We need to get rid of hidden tags (display: none)
// Get rid of the warning. It would be better to have some valid html as input
- $dom = @DomDocument::loadHTML($body);
- $xpath = new DOMXPath($dom);
+ $doc = new DOMDocument();
+ @$doc->loadHTML($body);
+ $xpath = new DOMXPath($doc);
/*
* Checking any possible syntax of the style attribute with xpath is impossible
}
}
// Now we can get the body of our HTML DomDocument, it contains only what is visible
- $string = $dom->saveHTML();
+ $string = $doc->saveHTML();
$string = strip_tags($string);
return strlen($string);