function getBlockCode_MyGroups() { $sAddImgTxt = _t("_ps_lcpt_add"); $sAddImgUrl = $this->getIconUrl('ps_add_members.png'); $sDeleteImgTxt = _t("_ps_lcpt_delete"); $sDeleteImgUrl = $this->getIconUrl('ps_delete_members.png'); $sExtendedTxt = _t("_ps_cpt_extended"); //--- Get Content ---// $aContent = array(); $aGroups = $this->_oDb->getGroupsBy(array('type' => 'owner', 'owner_id' => $this->_iOwnerId)); foreach ($aGroups as $aGroup) { if (!empty($aGroup['parent_id'])) { $aParentGroup = $this->_oDb->getGroupsBy(array('type' => 'id', 'id' => $aGroup['parent_id'])); $sTitle = (int) $aParentGroup['owner_id'] == 0 ? _t('_ps_group_' . $aParentGroup['id'] . '_title') : $aParentGroup['title']; $sExtend = ' ' . $sExtendedTxt . ' '; $sExtend .= !empty($aParentGroup['home_url']) ? '<a href="' . BX_DOL_URL_ROOT . $aParentGroup['home_url'] . '" target="_blank">' . $sTitle . '</a>' : $sTitle; } $aContent[] = array('group_id' => $aGroup['id'], 'group_title' => $aGroup['title'], 'group_members' => $aGroup['members_count'], 'bx_if:extended' => array('condition' => !empty($aGroup['parent_id']), 'content' => array('group_extended' => $sExtend)), 'add_img_url' => $sAddImgUrl, 'add_img_title' => $sAddImgTxt, 'delete_img_url' => $sDeleteImgUrl, 'delete_img_title' => $sDeleteImgTxt); } //--- Get Control ---// $aButtons = array('ps-my-groups-delete' => _t('_ps_btncpt_delete')); $sControl = BxDolPrivacySearch::showAdminActionsPanel('ps-my-groups-form', $aButtons, 'ps-my-groups-ids'); $sContent = $this->parseHtmlByName('ps_my_groups.html', array('bx_repeat:groups' => !empty($aContent) ? $aContent : MsgBox(_t('_Empty')), 'control' => $sControl)); return DesignBoxContent(_t("_ps_bcpt_my_groups"), $sContent, 1); }
function searchMembers($sValue) { $oSearch = new BxDolPrivacySearch($this->_iOwnerId, $sValue); return $oSearch->displayResultBlock(); }