]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Merged [6573],[6574],[6582] from 1.7 branch into trunk
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 21 Aug 2010 22:37:45 +0000 (22:37 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 21 Aug 2010 22:37:45 +0000 (22:37 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@6841 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/actions.php
mod/groups/views/default/forms/groups/edit.php
views/default/graphics/icon.php

index b715577a9a54156f3a94b3c3db7b743b8406c9f1..47c0bf7af82bd6cce4ade4512cd276f8dbe7cf6f 100644 (file)
 * @param string $action The requested action
 * @param string $forwarder Optionally, the location to forward to
 */
-
 function action($action, $forwarder = "") {
        global $CONFIG;
 
+       $action = rtrim($action, '/');
+
        // @todo REMOVE THESE ONCE #1509 IS IN PLACE.
        // Allow users to disable plugins without a token in order to
-       // remove plugins that are imcompatible.
+       // remove plugins that are incompatible.
        // Installation cannot use tokens because it requires site secret to be
        // working. (#1462)
        // Login and logout are for convenience.
@@ -45,8 +46,8 @@ function action($action, $forwarder = "") {
        $forwarder = str_replace("http://", "", $forwarder);
        $forwarder = str_replace("@", "", $forwarder);
 
-       if (substr($forwarder,0,1) == "/") {
-               $forwarder = substr($forwarder,1);
+       if (substr($forwarder, 0, 1) == "/") {
+               $forwarder = substr($forwarder, 1);
        }
 
        if (isset($CONFIG->actions[$action])) {
@@ -90,6 +91,10 @@ function action($action, $forwarder = "") {
 function register_action($action, $public = false, $filename = "", $admin_only = false) {
        global $CONFIG;
 
+       // plugins are encouraged to call actions with a trailing / to prevent 301
+       // redirects but we store the actions without it
+       $action = rtrim($action, '/');
+
        if (!isset($CONFIG->actions)) {
                $CONFIG->actions = array();
        }
@@ -251,5 +256,5 @@ function elgg_action_exist($action) {
        return (isset($CONFIG->actions[$action]) && file_exists($CONFIG->actions[$action]['file']));
 }
 
-// Register some actions ***************************************************
+
 register_elgg_event_handler("init","system","actions_init");
index c02b279c1325d4516fb8e6b2bb93883fb4aecdf1..0c82f547128674c8be5ebbfe4a2d104bdea995f3 100644 (file)
@@ -78,17 +78,21 @@ if (is_array($vars['config']->group) && sizeof($vars['config']->group) > 0)
                        <?php 
                        
                        $this_owner = $vars['entity']->owner_guid;
-                       if (!$this_owner) $this_owner = get_loggedin_userid();
+                       if (!$this_owner) {
+                               $this_owner = get_loggedin_userid();
+                       }
                        
-                       $access = array(ACCESS_FRIENDS => elgg_echo("access:friends:label"), 1 => elgg_echo("LOGGED_IN"), 2 => elgg_echo("PUBLIC"));
-                       $collections = get_user_access_collections($this_owner);
-                       if (is_array($collections))
-                       {
+                       $access = array(ACCESS_FRIENDS => elgg_echo("access:friends:label"), ACCESS_LOGGED_IN => elgg_echo("LOGGED_IN"), ACCESS_PUBLIC => elgg_echo("PUBLIC"));
+                       $collections = get_user_access_collections($vars['entity']->guid);
+                       if (is_array($collections)) {
                                foreach ($collections as $c)
                                        $access[$c->id] = $c->name;
                        }
-                       
-                       echo elgg_view('input/access', array('internalname' => 'vis', 'value' =>  ($vars['entity']->access_id ? $vars['entity']->access_id : ACCESS_PUBLIC), 'options' => $access)); 
+
+                       $current_access = ($vars['entity']->access_id ? $vars['entity']->access_id : ACCESS_PUBLIC);
+                       echo elgg_view('input/access', array('internalname' => 'vis', 
+                                                                                               'value' =>  $current_access,
+                                                                                               'options' => $access));
                        
                        
                        ?>
index bc7c36e715277404c38af451e6d54bf25919faea..6b92a510db3c6db19d1def04ffcc876b274be918 100644 (file)
@@ -6,6 +6,12 @@
  * @subpackage Core
  * @author Curverider Ltd
  * @link http://elgg.org/
+ *
+ * @uses $vars['entity'] The entity the icon represents - uses getIcon() method
+ * @uses $vars['js'] Any JavaScript to add to img tag
+ * @uses $vars['size'] topbar, tiny, small, medium (default), large, master
+ * @uses $vars['link'] Optional link for the image
+ * @uses $vars['align'] Align attribute of the img tag
  */
 
 $entity = $vars['entity'];