Zikula_Core
[ class tree: Zikula_Core ] [ index: Zikula_Core ] [ all elements ]

Source for file pnuserapi.php

Documentation is available at pnuserapi.php

  1. <?php
  2. /**
  3.  * Zikula Application Framework
  4.  *
  5.  * @copyright Robert Gasch
  6.  * @link http://www.zikula.org
  7.  * @version $Id: pnuser.php 22343 2007-07-06 14:57:30Z rgasch $
  8.  * @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
  9.  * @author Robert Gasch rgasch@gmail.com
  10.  * @package Zikula_Core
  11.  */
  12.  
  13. /**
  14.  * get the roor category for a user
  15.  *
  16.  */
  17. {
  18.     $returnCategory = isset($args['returnCategory']$args['returnCategory'false;
  19.     $returnField    = isset($args['returnField'])    $args['returnField']    'id';
  20.  
  21.     $userRoot pnModGetVar ('Categories''userrootcat'0);
  22.     if (!$userRoot{
  23.     }
  24.  
  25.     Loader::loadClass ('CategoryUtil');
  26.     $userRootCat CategoryUtil::getCategoryByPath ($userRoot);
  27.     if (!$userRoot{
  28.         return LogUtil::registerError(_CATEGORIES_USERDOCROOT_INVALID "[$userRoot]");
  29.     }
  30.  
  31.     if ($userRootCat == 1{
  32.     }
  33.  
  34.     $userCatName Categories_userapi_getusercategoryname ();
  35.     $thisUserRootCatPath $userRoot '/' $userCatName;
  36.     $thisUserRootCat CategoryUtil::getCategoryByPath ($thisUserRootCatPath);
  37.  
  38.     if (!$thisUserRootCat{
  39.         return false;
  40.     }
  41.  
  42.     if ($returnCategory{
  43.         return $thisUserRootCat;
  44.     }
  45.  
  46.     return $thisUserRootCat[$returnField];
  47. }
  48.  
  49. /**
  50.  * get all categories for a user
  51.  *
  52.  */
  53. {
  54.     $args['returnCategory'1;
  55.     $userRootCat Categories_userapi_getuserrootcat ($args);
  56.  
  57.     if (!$userRootCat{
  58.         return LogUtil::registerError(_CATEGORIES_USERDOCROOT_INVALID "[$userRoot]");
  59.     }
  60.  
  61.     $relative (isset($args['relative']$args['relative'false);
  62.     return CategoryUtil::getCategoriesByParentID ($userRootCat['id']''$relative);
  63. }
  64.  
  65. /**
  66.  * get the username associated with a category
  67.  *
  68.  */
  69. {
  70.     $uid   = isset($args['uid']&& $args['uid'$args['uid'pnUserGetVar('uid');
  71.     $uname pnUserGetVar('uname'$uid);
  72.     
  73.     $userCatName "$uname [$uid]";
  74.     return $userCatName;
  75. }

Documentation generated on Fri, 18 Jul 2008 21:55:30 +0200 by phpDocumentor 1.4.1