$pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee);
$pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee);
$pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines
- if ( strpos($pee, '<object') !== false ) {
+ if (strpos($pee, '<object') !== false) {
$pee = preg_replace('|\s*<param([^>]*)>\s*|', "<param$1>", $pee); // no pee inside object/embed
$pee = preg_replace('|\s*</embed>\s*|', '</embed>', $pee);
}
// '#target', '?query=string'
if (preg_match("#^(\#|\?|(https?:)?//)#i", $url)) {
return $url;
- }
- // 'javascript:'
- elseif (stripos($url, 'javascript:') === 0) {
+ } elseif (stripos($url, 'javascript:') === 0) {
+ // 'javascript:'
return $url;
- }
- // 'install.php', 'install.php?step=step'
- elseif (preg_match("#^[^/]*\.php(\?.*)?$#i", $url)) {
- return elgg_get_site_url().$url;
- }
+ } elseif (preg_match("#^[^/]*\.php(\?.*)?$#i", $url)) {
+ // 'install.php', 'install.php?step=step'
+ return elgg_get_site_url() . $url;
- // 'example.com', 'example.com/subpage'
- elseif (preg_match("#^[^/]*\.#i", $url)) {
+ } elseif (preg_match("#^[^/]*\.#i", $url)) {
+ // 'example.com', 'example.com/subpage'
return "http://$url";
- }
- // 'page/handler', 'mod/plugin/file.php'
- else {
+ } else {
+ // 'page/handler', 'mod/plugin/file.php'
+
// trim off any leading / because the site URL is stored
// with a trailing /
return elgg_get_site_url() . ltrim($url, '/');
'text' => elgg_echo('friends:collections'),
'href' => "collections/$user->username",
));
-/*
- elgg_register_menu_item('page', array(
- 'name' => 'friends:collections:add',
- 'text' => elgg_echo('friends:collections:add'),
- 'href' => "collections/add",
- ));
- *
- */
}
/**
* @param string $hook
* @param string $entity_type
* @param string $returnvalue
- * @param array $params
+ * @param array $params
* @return string
*/
function user_avatar_hook($hook, $entity_type, $returnvalue, $params) {
/**
* View an item in a list
*
- * @param object $item ElggEntity or ElggAnnotation
- * @param array $vars Additional parameters for the rendering
+ * @param object $item ElggEntity or ElggAnnotation
+ * @param array $vars Additional parameters for the rendering
*
* @return string
* @since 1.8.0
*
* Shorthand for <span class="elgg-icon elgg-icon-$name"></span>
*
- * @param string $type The specific icon to display
+ * @param string $name The specific icon to display
*
- * @returns string The html for displaying an icon
+ * @return string The html for displaying an icon
*/
function elgg_view_icon($name) {
return "<span class=\"elgg-icon elgg-icon-$name\"></span>";
/**
* Add the rss link to the extras when if needed
+ *
+ * @return void
*/
function elgg_views_add_rss_link() {
global $autofeed;
if (isset($autofeed) && $autofeed == true) {
$url = full_url();
- if (substr_count($url,'?')) {
+ if (substr_count($url, '?')) {
$url .= "&view=rss";
} else {
$url .= "?view=rss";
/**
* Create a new widget instance
*
- * @param int $entity_guid GUID of entity that owns this widget
- * @param string $handler The handler for this widget
- * @param int $access_id If not specified, it is set to the default access level
+ * @param int $owner_guid GUID of entity that owns this widget
+ * @param string $handler The handler for this widget
+ * @param string $context The context for this widget
+ * @param int $access_id If not specified, it is set to the default access level
*
* @return int|false Widget GUID or false on failure
* @since 1.8.0