本文整理汇总了PHP中SugarFolder::getGroupFoldersForSettings方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarFolder::getGroupFoldersForSettings方法的具体用法?PHP SugarFolder::getGroupFoldersForSettings怎么用?PHP SugarFolder::getGroupFoldersForSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SugarFolder
的用法示例。
在下文中一共展示了SugarFolder::getGroupFoldersForSettings方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getShowAccountsOptions
/**
* Re-used option getter for Show Accounts multiselect pane
*/
function getShowAccountsOptions(&$ie)
{
global $current_user;
global $app_strings;
global $mod_strings;
$ieAccountsFull = $ie->retrieveAllByGroupId($current_user->id);
$ieAccountsShowOptionsMeta = array();
$showFolders = unserialize(base64_decode($current_user->getPreference('showFolders', 'Emails')));
$defaultIEAccount = $ie->getUsersDefaultOutboundServerId($current_user);
foreach ($ieAccountsFull as $k => $v) {
$selected = !empty($showFolders) && in_array($v->id, $showFolders) ? true : false;
$default = $defaultIEAccount == $v->id ? TRUE : FALSE;
$has_groupfolder = !empty($v->groupfolder_id) ? TRUE : FALSE;
$type = $v->is_personal ? $mod_strings['LBL_MAILBOX_TYPE_PERSONAL'] : $mod_strings['LBL_MAILBOX_TYPE_GROUP'];
$ieAccountsShowOptionsMeta[] = array("id" => $v->id, "name" => $v->name, 'is_active' => $selected, 'server_url' => $v->server_url, 'is_group' => !$v->is_personal, 'group_id' => $v->group_id, 'is_default' => $default, 'has_groupfolder' => $has_groupfolder, 'type' => $type);
}
//Retrieve the grou folders
$f = new SugarFolder();
$groupFolders = $f->getGroupFoldersForSettings($current_user);
foreach ($groupFolders as $singleGroup) {
//Retrieve the related IE accounts.
$relatedIEAccounts = $ie->retrieveByGroupFolderId($singleGroup['id']);
if (count($relatedIEAccounts) == 0) {
$server_url = $app_strings['LBL_EMAIL_MULT_GROUP_FOLDER_ACCOUNTS_EMPTY'];
} else {
if (count($relatedIEAccounts) == 1) {
if ($relatedIEAccounts[0]->status != 'Active' || $relatedIEAccounts[0]->mailbox_type == 'bounce') {
continue;
}
$server_url = $relatedIEAccounts[0]->server_url;
} else {
$server_url = $app_strings['LBL_EMAIL_MULT_GROUP_FOLDER_ACCOUNTS'];
}
}
$type = $mod_strings['LBL_MAILBOX_TYPE_GROUP_FOLDER'];
$ieAccountsShowOptionsMeta[] = array("id" => $singleGroup['id'], "name" => $singleGroup['origName'], 'is_active' => $singleGroup['selected'], 'server_url' => $server_url, 'is_group' => true, 'group_id' => $singleGroup['id'], 'is_default' => FALSE, 'has_groupfolder' => true, 'type' => $type);
}
return $ieAccountsShowOptionsMeta;
}