// Get all contentblocks with this entrymask $contentblock_ids = sCblockMgr()->getCblockLinkByEntrymaskId($entrymask); $contentblocks = array(); $contentblocks_blind = array(); foreach ($contentblock_ids as $contentblock_id) { $dcb = sCblockMgr()->getCblock($contentblock_id['CBLOCKID']); if ($dcb) { $co_data = $dcb->get(); $objectparents = sCblockMgr()->getParents($contentblock_id['CBLOCKID']); array_pop($objectparents); $co_data['PARENTS'] = $objectparents; $dcb = sCblockMgr()->getCblock($contentblock_id['CBLOCKID']); $co_data['CBLOCKINFO'] = $dcb->get(); $co_data['CBLOCKINFO']['RWRITE'] = $dcb->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $contentblock_id['CBLOCKID'], "RWRITE"); $co_data['CBLOCKINFO']['RDELETE'] = $dcb->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $contentblock_id['CBLOCKID'], "RDELETE"); $styleData = getStyleForContentblock($co_data['CBLOCKINFO']); $co_data['STYLE'] = $styleData; $co_data['HASCHANGED'] = $co_data['CBLOCKINFO']['HASCHANGED']; if ($objectparents[0][0]['ID'] == $embeddedCblockFolder || $co_data['CBLOCKINFO']['EMBEDDED'] == 1) { $contentblocks_blind[] = $co_data; } else { $contentblocks[] = $co_data; } } } // Get all pages & mailings for all normal contentblocks foreach ($contentblocks as $idx => $contentblock) { // Get links to pages $a = 0; $linkedpages = array(); $cbb = sCblockMgr()->getCblock($contentblock['OBJECTID']);
$assignedComments[$assignedCommentIdx]['ICON'] = $iconData['iconclass']; $assignedComments[$assignedCommentIdx]['STYLE'] = $iconData['style']; $assignedComments[$assignedCommentIdx]['HASCHANGED'] = $assignedComments[$assignedCommentIdx]['HASCHANGED']; $assignedComments[$assignedCommentIdx]['RMODERATE'] = $cPage->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $assignedComment['OBJECTID'], 'RMODERATE'); $assignedComments[$assignedCommentIdx]['RCOMMENT'] = $cPage->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $assignedComment['OBJECTID'], 'RCOMMENT'); $commentsObject = $cPage->comments; break; case 'CO': $assignedComments[$assignedCommentIdx]['PARENTS'] = sCblockMgr()->getParents($assignedComment['OBJECTID']); array_pop($assignedComments[$assignedCommentIdx]['PARENTS']); $acb = sCblockMgr()->getCblock($assignedComment['OBJECTID']); if ($acb) { $assignedComments[$assignedCommentIdx]['CBLOCKINFO'] = $acb->get(); $assignedComments[$assignedCommentIdx]['CBLOCKINFO']['RWRITE'] = $acb->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $assignedComment['OBJECTID'], "RWRITE"); $assignedComments[$assignedCommentIdx]['CBLOCKINFO']['RDELETE'] = $acb->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $assignedComment['OBJECTID'], "RDELETE"); $styleData = getStyleForContentblock($assignedComments[$assignedCommentIdx]['CBLOCKINFO']); $assignedComments[$assignedCommentIdx]['STYLE'] = $styleData; $assignedComments[$assignedCommentIdx]['HASCHANGED'] = $assignedComments[$assignedCommentIdx]['CBLOCKINFO']['HASCHANGED']; $assignedComments[$assignedCommentIdx]['RMODERATE'] = $acb->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $assignedComment['OBJECTID'], 'RMODERATE'); $assignedComments[$assignedCommentIdx]['RCOMMENT'] = $acb->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $assignedComment['OBJECTID'], 'RCOMMENT'); $commentsObject = $acb->comments; } break; case 'FILE': $assignedComments[$assignedCommentIdx]['PARENTS'] = $fileMgr->getParents($assignedComment['OBJECTID']); array_pop($assignedComments[$assignedCommentIdx]['PARENTS']); $file = sFileMgr()->getFile($assignedComment['OBJECTID']); if ($file) { $assignedComments[$assignedCommentIdx]['FILEINFO'] = $file->get(); $assignedComments[$assignedCommentIdx]['RMODERATE'] = $file->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $assignedComment['OBJECTID'], 'RMODERATE'); $assignedComments[$assignedCommentIdx]['RCOMMENT'] = $file->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $assignedComment['OBJECTID'], 'RCOMMENT');
$styleData = getStyleForContentblock($objectInfo, true); $objectInfo['STYLE'] = $styleData; // Remove changed style if object is a folder if ($objectInfo['FOLDER'] == 1) { $objectInfo['STYLE'] = ''; } $objectparents = sCblockMgr()->getParents($object); // Gather all required info from parents foreach ($objectparents as $objectparent_idx => $objectparent_item) { if ($objectparent_item[0]['ID']) { $tmpCb = sCblockMgr()->getCblock($objectparent_item[0]['ID']); $tmpObjectinfo = $tmpCb->get(); $objectparents[$objectparent_idx][0]['HASCHANGED'] = $tmpObjectinfo['HASCHANGED']; $objectparents[$objectparent_idx][0]['RWRITE'] = $tmpCb->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $objectparent_item[0]['ID'], "RWRITE"); $objectparents[$objectparent_idx][0]['RDELETE'] = $tmpCb->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $objectparent_item[0]['ID'], "RDELETE"); $styleData = getStyleForContentblock($objectparents[$objectparent_idx][0]); $objectparents[$objectparent_idx][0]['STYLE'] = $styleData['style']; } } $objectparents[count($objectparents) - 1][0]['NAME'] = $itext['TXT_CONTENTBLOCKS'] != '' ? $itext['TXT_CONTENTBLOCKS'] : '$TXT_CONTENTBLOCKS'; $object_properties = sCblockMgr()->properties->getList('LISTORDER'); $object_permissions = array(); $object_permissions['RWRITE'] = $cb->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $object, "RWRITE"); $object_permissions['RSTAGE'] = $cb->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $object, "RSTAGE"); if ($objectInfo['DELETED'] == 1) { $object_permissions['RWRITE'] = false; $object_permissions['RSTAGE'] = false; } // Get current locks for this token (and unlock them) $lockToken = sGuiUS() . '_' . $this->request->parameters['win_no']; $lockedObjects = sCblockMgr()->getLocksByToken($lockToken);
$history[$i]['NEWVALUE'] = '<span onmouseover="$K.yg_hoverFileHint(\'' . $linkInfo['INFO']['FILE_ID'] . '\', event);"><span style="display:inline-block;" class="filetype ' . $linkInfo['INFO']['COLOR'] . '">' . $linkInfo['INFO']['CODE'] . '</span> ' . "<a onclick=\"\$K.yg_openObjectDetails('" . $linkInfo['INFO']['FILE_ID'] . "', 'file', '" . $linkInfo['NAME'] . "', {color:'" . $linkInfo['INFO']['COLOR'] . "',typecode:'" . $linkInfo['INFO']['CODE'] . "'});\">" . $linkInfo['NAME'] . "</a></span>"; break; } } } } } // Special Case for Contentblocks if ($history[$i]['TEXT'] == 'TXT_COMMON_H_COEDIT_FRMFLD_7') { if ($history[$i]['NEWVALUE']) { $cb = sCblockMgr()->getCblock($history[$i]['NEWVALUE']); if ($cb) { $cblockInfo = $cb->get(); $cblockInfo['RWRITE'] = $cb->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $history[$i]['NEWVALUE'], "RWRITE"); $cblockInfo['RDELETE'] = $cb->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $history[$i]['NEWVALUE'], "RDELETE"); $styleData = getStyleForContentblock($cblockInfo, true); $history[$i]['NEWVALUE'] = "<a onclick=\"\$K.yg_openObjectDetails('" . $history[$i]['NEWVALUE'] . "', 'cblock', '" . $cblockInfo['NAME'] . "', 'cblock', '" . $styleData . "');\">" . $cblockInfo['NAME'] . "</a>"; } } } // Special Case for Tags if ($history[$i]['TEXT'] == 'TXT_COMMON_H_COEDIT_FRMFLD_8') { $tagInfo = $page->tags->get($history[$i]['NEWVALUE']); $history[$i]['NEWVALUE'] = "<a onclick=\"\$K.yg_openObjectDetails('" . $history[$i]['NEWVALUE'] . "', 'tag', '" . $tagInfo['NAME'] . "', 'tag', '');\">" . $tagInfo['NAME'] . "</a>"; } // Special Case for Date if ($history[$i]['TEXT'] == 'TXT_COMMON_H_COEDIT_FRMFLD_11') { $history[$i]['NEWVALUE'] = date($itext['DATE_FORMAT'], TStoLocalTS($history[$i]['NEWVALUE'])); } // Special Case for Datetime if ($history[$i]['TEXT'] == 'TXT_COMMON_H_COEDIT_FRMFLD_12') {
$styleData = getStyleForContentblock($cblockInfo, true); array_pop($pr); $objectparents = $pr; array_push($incoming_cos, array('ID' => $cblockInfo['OBJECTID'], 'STYLE' => $styleData, 'NAME' => $cblockInfo['NAME'], 'FOLDER' => $cblockInfo['FOLDER'], 'PARENTS' => $objectparents)); } // Get all mailings with this tag $filterArray = array(); $filterArray[] = array('TYPE' => 'DELETED', 'OPERATOR' => 'is_not', 'VALUE' => 1); $tagged_mailings = sMailingMgr()->tags->getByTag($tag_id, "OBJECTORDER DESC", "OR", false, $filterArray); foreach ($tagged_mailings as $tagged_mailing_item) { $pr = sMailingMgr()->getParents($tagged_mailing_item['OBJECTID']); $mailing = sMailingMgr()->getMailing($tagged_mailing_item['OBJECTID']); $mailingInfo = $mailing->get(); $mailingInfo['RWRITE'] = $mailing->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $tagged_mailing_item['OBJECTID'], "RWRITE"); $mailingInfo['RDELETE'] = $mailing->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $tagged_mailing_item['OBJECTID'], "RDELETE"); $styleData = getStyleForContentblock($mailingInfo, true); array_pop($pr); $objectparents = $pr; array_push($incoming_mailings, array('ID' => $mailingInfo['OBJECTID'], 'STYLE' => $styleData, 'NAME' => $mailingInfo['NAME'], 'PARENTS' => $objectparents)); } // Get all sites $sites = sSites()->getList(); foreach ($sites as $currentSite) { // Get all pages with this tag $pageMgr = new PageMgr($currentSite['ID']); $filterArray = array(); $filterArray[] = array('TYPE' => 'DELETED', 'OPERATOR' => 'is_not', 'VALUE' => 1); $tagged_pages = $pageMgr->tags->getByTag($tag_id, "OBJECTORDER DESC", "OR", false, $filterArray); foreach ($tagged_pages as $tagged_page_item) { $page = $pageMgr->getPage($tagged_page_item['OBJECTID']); if ($page) {