You are here

function _privatemsg_folder_map in Privatemsg 5

Same name and namespace in other branches
  1. 5.3 privatemsg.module \_privatemsg_folder_map()
2 calls to _privatemsg_folder_map()
privatemsg_list in ./privatemsg.module
privatemsg_load_folders in ./privatemsg.module
Return an array of folders for a user.

File

./privatemsg.module, line 770

Code

function _privatemsg_folder_map($fid = NULL, $uid = NULL) {
  $map = array(
    PRIVATEMSG_FOLDER_SENT => t('Sent messages'),
    PRIVATEMSG_FOLDER_INBOX => t('Inbox'),
    PRIVATEMSG_FOLDER_RECYCLE_BIN => t('Recycle bin'),
  );
  if (!isset($fid)) {
    return $map;
  }
  return isset($map[$fid]) ? $map[$fid] : db_result(db_query('SELECT name FROM {privatemsg_folder} WHERE fid = %d AND uid = %d', $current_folder, $uid));
}