]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
some light standardization of the core libraries
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 26 Mar 2011 15:51:35 +0000 (15:51 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 26 Mar 2011 15:51:35 +0000 (15:51 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@8843 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/output.php
engine/lib/users.php
engine/lib/views.php
engine/lib/widgets.php

index 7a38e5b8cbe2929d90b43ee9efe1421c4af417e5..8c2a3d50d9913f9cc38a49de6a892377e8d3461a 100644 (file)
@@ -59,7 +59,7 @@ function autop($pee, $br = 1) {
        $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);
        }
@@ -238,25 +238,22 @@ function elgg_normalize_url($url) {
        // '#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, '/');
index 6733c9d3ec0576fec53fae6be1da2af5097b2c11..9877625768a4a5c10a87c8bf0c640f78055b427e 100644 (file)
@@ -1075,14 +1075,6 @@ function collections_submenu_items() {
                '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",
-       ));
- * 
- */
 }
 
 /**
@@ -1244,7 +1236,7 @@ function user_create_hook_add_site_relationship($event, $object_type, $object) {
  * @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) {
index ff308171fbfb487ae2855f14822109f6bb4e9772..d3d790f8bb3bd267539144378150a18f4b71defe 100644 (file)
@@ -1216,8 +1216,8 @@ function elgg_view_form($action, $form_vars = array(), $body_vars = array()) {
 /**
  * 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
@@ -1247,9 +1247,9 @@ function elgg_view_list_item($item, array $vars = array()) {
  * 
  * 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>";
@@ -1447,12 +1447,14 @@ function elgg_views_register_core_head_elements() {
 
 /**
  * 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";
index 21fbbcad9e051f0c96104a2233df31b85ebfec06..b20f92f746ffb402e8e3a4c796f50abb0c901772 100644 (file)
@@ -52,9 +52,10 @@ function elgg_get_widgets($user_guid, $context) {
 /**
  * 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