function _browseMy(&$aProfile, $sTitle = null)
{
// check access
if (!$this->_iProfileId) {
$this->_oTemplate->displayAccessDenied();
return;
}
$bAjaxMode = isset($_SERVER['HTTP_X_REQUESTED_WITH']) and $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' ? true : false;
// process delete action
if (bx_get('action_delete') && is_array(bx_get('entry'))) {
$aEntries = bx_get('entry');
foreach ($aEntries as $iEntryId) {
$iEntryId = (int) $iEntryId;
$aDataEntry = $this->_oDb->getEntryById($iEntryId);
if (!$this->isAllowedDelete($aDataEntry)) {
continue;
}
if ($this->_oDb->deleteEntryByIdAndOwner($iEntryId, $this->_iProfileId, 0)) {
$this->onEventDeleted($iEntryId);
}
}
}
bx_import('PageMy', $this->_aModule);
$sClass = $this->_aModule['class_prefix'] . 'PageMy';
$oPage = new $sClass($this, $aProfile);
// manage my data entries
if ($bAjaxMode && $this->_sPrefix . '_my_active' == bx_get('block')) {
header('Content-type:text/html;charset=utf-8');
echo $oPage->getBlockCode_My();
exit;
}
// manage my pending data entries
if ($bAjaxMode && $this->_sPrefix . '_my_pending' == bx_get('block')) {
header('Content-type:text/html;charset=utf-8');
echo $oPage->getBlockCode_Pending();
exit;
}
$this->_oTemplate->pageStart();
// display whole page
if (!$bAjaxMode) {
echo $oPage->getCode();
}
$this->_oTemplate->addJs('main.js');
$this->_oTemplate->addCss('main.css');
$this->_oTemplate->addCss('form.css');
$this->_oTemplate->addCss('admin.css');
$this->_oTemplate->addCss('forms_extra.css');
$this->_oTemplate->pageCode($sTitle, false, false);
}