[dev] Patch for Category::getShortName

jvandal at infoteck.qc.ca jvandal at infoteck.qc.ca
Fri Oct 24 22:14:45 PDT 2003


Hi,

If I refer to the comment of Category::getShortName, this function is for display purpose only so if I change this function to get a "human text", I will not "break" any application, exact ? :) 

The first patch will add this support and I don't think this will cause any problem :P (I've do some test w/ other app that call getShortName and all work ok).

The second patch add "title" support for application on Perms::getAvailable();

Try this w/ the Permission system and you will understand the use of 

Index: Category.php
===================================================================
RCS file: /repository/horde/lib/Category.php,v
retrieving revision 1.95
diff -r1.95 Category.php
880,887c880,887
<         /* If there are several components to the name, explode and get the last
<            one, otherwise just return the name. */
<         if (strstr($category_name, ':')) {
<             return array_pop(explode(':', $category_name));
<         } else {
<             return $category_name;
<         }
<     }
---
>         /* Explode and remove the last one, then implode */
>       $_category_name = implode(':', array_splice(explode(':', $category_name), 0, -1));
>
>       /* Explode and get the last one */
>       $category_name = array_pop(explode(':', $category_name));
>
>       $perms = &Perms::singleton();
>       $_perms = $perms->getAvailable($_category_name);
888a889,895
>       if (isset($_perms[$category_name])) {
>           $category_name = $_perms[$category_name];
>       }
>
>       return $category_name;
>     }
>


Index: Perms.php
===================================================================
RCS file: /repository/horde/lib/Perms.php,v
retrieving revision 1.52
diff -r1.52 Perms.php
92a93,98
>
>           foreach ($apps as $app => $params) {
>               $_apps[$app] = $registry->getParam('name', $app);
>           }
>           $apps = $_apps;
>

--
Joel Vandal
Infoteck Internet
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-keys
Size: 1030 bytes
Desc: Clef publique PGP
Url : http://lists.horde.org/archives/dev/attachments/20031025/d8dee839/attachment.bin


More information about the dev mailing list