public function getCblockList($id = 0, $maxlevel = 0, $roleid = 0, $filterArray) { if ($filterArray[0]['CBID']) { $limit = array('CBID' => $filterArray[0]['CBID']); $coList = \sCblockMgr()->filterEntrymasks(false, $this->getFilter(), $limit, false); } else { $limit = array('FOLDER' => $id); $coList = \sCblockMgr()->filterEntrymasks(false, $this->getFilter(), $limit, false); } // Get additional data for each formfield (and strip folders) $finalCoList = array(); foreach ($coList as $coListItem) { if ($coListItem['FOLDER'] == 0) { // get last modifier $history = \sCblockMgr()->history->getList($coListItem['CBID']); if ($allMailingsItem['CHANGEDBY']) { $userObj = new \user($history[0]['UID'] ? $history[0]['UID'] : $coListItem['CHANGEDBY']); } else { $userObj = new \user($history[0]['UID'] ? $history[0]['UID'] : $coListItem['CREATEDBY']); } $userInfo = $userObj->get(); $userProps = $userObj->properties->getValues($userInfo['ID']); $userInfo['PROPS'] = $userProps; // Get controls $cb = new \Cblock($coListItem['CBID']); $coListItem['ENTRYMASKS'] = $cb->getEntrymasks(); // Get additional control info $col1Data = array(array('CO_NAME' => $coListItem['NAME'], 'FORMFIELD' => 101, 'OBJECTIDENTIFIER' => true)); $col2Data = array(array('USER_NAME' => trim($userInfo['PROPS']['FIRSTNAME'] . ' ' . $userInfo['PROPS']['LASTNAME']), 'USER_ID' => $userInfo['ID'], 'FORMFIELD' => 100)); $col3Data = array(array('CHANGEDTS' => TStoLocalTS($coListItem['CHANGEDTS']), 'FORMFIELD' => 103)); $result[0] = $col1Data; $result[1] = $col2Data; $result[2] = $col3Data; $data = array('CBID' => $coListItem['CBID'], 'CBVERSION' => $coListItem['CBVERSION'], 'NAME' => $coListItem['NAME'], 'HASCHANGED' => $coListItem['HASCHANGED'], 'FIELDS' => $result, 'RREAD' => $coListItem['RREAD'], 'RWRITE' => $coListItem['RWRITE'], 'RDELETE' => $coListItem['RDELETE'], 'RSUB' => $coListItem['RSUB'], 'RSTAGE' => $coListItem['RSTAGE'], 'RMODERATE' => $coListItem['RMODERATE'], 'RCOMMENT' => $coListItem['RCOMMENT']); array_push($finalCoList, $data); } } if (!$filterArray[0]['CBID']) { $pageDirOrderBy = $filterArray[1]['VALUE']; $pageDirOrderDir = $filterArray[1]['VALUE2']; if (strlen($pageDirOrderBy) && strlen($pageDirOrderDir)) { $listColumns = $this->getListColumns(); usort($finalCoList, array('com\\nt\\DefaultCblockListView', $listColumns['COLUMNS'][$pageDirOrderBy]['SORTFUNC'])); if ($pageDirOrderDir == -1) { $finalCoList = array_reverse($finalCoList); } } $pageDirFrom = $filterArray[0]['VALUE']; $pageDirCount = $filterArray[0]['VALUE2']; if (strlen($pageDirFrom) && strlen($pageDirCount)) { $finalCoList = array_slice($finalCoList, $pageDirFrom, $pageDirCount); } } return $finalCoList; }
<?php $ygid = $this->request->parameters['yg_id']; $entrymask = explode('-', $ygid); $entrymask = $entrymask[0]; $entrymaskMgr = new Entrymasks(); $entrymaskInfo = $entrymaskMgr->get($entrymask); $objectparents = $entrymaskMgr->getParents($entrymask); $objectparents[count($objectparents) - 1][0]['NAME'] = $itext['TXT_ENTRYMASKS'] != '' ? $itext['TXT_ENTRYMASKS'] : '$TXT_ENTRYMASKS'; $entrymasks = $entrymaskMgr->getEntrymaskFormfields($entrymask); foreach ($entrymasks as $entrymask_idx => $entrymask) { if (($entrymask['FORMFIELD'] == 11 || $entrymask['FORMFIELD'] == 12) && $entrymasks[$entrymask_idx]['PRESET']) { $entrymasks[$entrymask_idx]['PRESET'] = TStoLocalTS($entrymasks[$entrymask_idx]['PRESET']); } if ($entrymask['FORMFIELD'] == 9) { $entrymasks[$entrymask_idx]['LVALUES'] = $entrymaskMgr->getListValuesByLinkID($entrymask['ID']); } } $smarty->assign("entrymaskInfo", $entrymaskInfo); $smarty->assign("objectparents", $objectparents); $smarty->assign("objecttype", "entrymask"); $smarty->assign("entrymasks", $entrymasks); $smarty->assign('win_no', $this->request->parameters['win_no']); $smarty->assign("uinfo", $uinfo); $smarty->assign("controls", $controls); $smarty->display('file:' . $this->page_template);
$versions = $mailing->getVersions(); // Remove version '0' $realVersions = array(); foreach ($versions as $versionsItem) { if ($versionsItem['VERSION'] > 0) { array_push($realVersions, $versionsItem); } } $versions = $realVersions; if (!$version || $version == 'live') { $version = $mailing->getPublishedVersion(true); } else { if ($version == 'working') { $version = $versions[0]['VERSION']; } } $smarty->assign('url', $url); } foreach ($versions as $versionsIdx => $versionItem) { $versions[$versionsIdx]['CHANGEDTS'] = TStoLocalTS($versionItem['CHANGEDTS']); } $smarty->assign("win_no", $this->request->parameters['win_no']); $smarty->assign("onload", $onload); $smarty->assign("site", $siteID); $smarty->assign("name", $name); $smarty->assign("id", $id); $smarty->assign("userinfo", $userinfo); $smarty->assign("version", $version); $smarty->assign("versions", $versions); $smarty->assign('objecttype', $objecttype); $smarty->display('file:' . $this->page_template);
if ($version != ALWAYS_LATEST_APPROVED_VERSION) { $cb->history->add(HISTORYTYPE_CO, TStoLocalTS($timestamp), $version, 'TXT_CBLOCK_H_AUTOPUBLISH_ADDED', $schedule_id); } else { $lastfinalversion = $cb->getLatestApprovedVersion(); $cb->history->add(HISTORYTYPE_CO, TStoLocalTS($timestamp), $lastfinalversion, 'TXT_CBLOCK_H_AUTOPUBLISH_ADDED', $schedule_id); } } elseif ($haschanged) { if (sCblockMgr()->scheduler->updateAction($id, 'SCH_AUTOPUBLISH', $timestamp, $parameters) === false) { $koala->alert($itext['TXT_ERROR_ACCESS_DENIED']); } else { // Add to history if ($version != ALWAYS_LATEST_APPROVED_VERSION) { $cb->history->add(HISTORYTYPE_CO, TStoLocalTS($timestamp), $version, 'TXT_CBLOCK_H_AUTOPUBLISH_CHANGED', $id); } else { $lastfinalversion = $cb->getLatestApprovedVersion(); $cb->history->add(HISTORYTYPE_CO, TStoLocalTS($timestamp), $lastfinalversion, 'TXT_CBLOCK_H_AUTOPUBLISH_CHANGED', $id); } } } } } $koala->queueScript("Koala.yg_resetPublishSettingsEditState('" . $wid . "');"); break; case 'removeCBlockAutopublishItem': $itemID = (int) $this->params['itemID']; $cblockID = $this->params['page']; $cb = sCblockMgr()->getCblock($cblockID); $item_data = sCblockMgr()->scheduler->get($itemID); sCblockMgr()->scheduler->removeJob($itemID); // Add to history if ($item_data['PARAMETERS']['VERSION'] != ALWAYS_LATEST_APPROVED_VERSION) {
} $assignedComments[$assignedCommentIdx]['STATUS'] = $commentsObject->getStatus($assignedComment['OBJECTID']); } } else { // Get amount of comments $commentsCount = $commentsObject->getCommentsCount($filterArray); // for paging $pageDirInfo = calcPageDir($commentsCount, 'created'); // X $pageDirOrderBy = $pageDirInfo['pageDirOrderBy']; $pageDirLimit = $pageDirInfo['pageDirLimit']; // END for paging $assignedComments = $commentsObject->getComments($filterArray, $pageDirLimit, false); $commentStatus = $commentsObject->getStatus(); foreach ($assignedComments as $assignedCommentIdx => $assignedComment) { $assignedComments[$assignedCommentIdx]['CREATEDTS'] = TStoLocalTS($assignedComments[$assignedCommentIdx]['CREATEDTS']); } } if ($displayType == 'allcomments') { foreach ($assignedComments as $currentCommentIdx => $currentComment) { $currUser = sUserMgr()->getUser($currentComment['USERID']); $currUserInfo = $currUser->get(); $assignedComments[$currentCommentIdx]['USERNAME'] = trim($currUserInfo['FIRSTNAME'] . ' ' . $currUserInfo['LASTNAME']); } } else { // Get user information for comments foreach ($assignedComments as $currentCommentIdx => $currentComment) { $assignedComments[$currentCommentIdx]['STATUS'] = $commentStatus; } // Only lock/unlock if in object-related mode if ($lockedFailed) {
$props[$prop_idx]['DISPLAYNAME'] = $fileInfo['NAME']; } } } if ($props[$prop_idx]['TYPE'] == 'FILEFOLDER') { if (strlen(trim($props[$prop_idx]['VALUE'])) > 0) { $file = sFileMgr()->getFile($props[$prop_idx]['VALUE']); if ($file) { $fileInfo = $file->get(); $props[$prop_idx]['DISPLAYNAME'] = $fileInfo['NAME']; } } } if ($props[$prop_idx]['TYPE'] == 'DATETIME') { if (strlen(trim($props[$prop_idx]['VALUE'])) > 0) { $props[$prop_idx]['VALUE'] = TStoLocalTS($props[$prop_idx]['VALUE']); } } } $ex['OBJECTID'] = $extension_id; $ex['CO_CONTENTAREA'] = $contentarea_id; $ex['LINKID'] = $colnkid; $ex['EMBEDDED'] = 1; if ($extension->info['ASSIGNMENT'] == EXTENSION_ASSIGNMENT_EXT_CONTROLLED) { $ex['NODELETE'] = true; } else { $ex['NODELETE'] = false; } $ex['ENTRYMASKS'] = array(); $ex['ENTRYMASKS'][0]['ENTRYMASKNAME'] = $ex['NAME']; $ex['ENTRYMASKS'][0]['EXTENSIONINFO'] = $extensioninfo;
if ($version != ALWAYS_LATEST_APPROVED_VERSION) { $page->history->add(HISTORYTYPE_PAGE, TStoLocalTS($timestamp), $version, 'TXT_PAGE_H_AUTOPUBLISH_ADDED', $schedule_id); } else { $lastfinalversion = $page->getLatestApprovedVersion(); $page->history->add(HISTORYTYPE_PAGE, TStoLocalTS($timestamp), $lastfinalversion, 'TXT_PAGE_H_AUTOPUBLISH_ADDED', $schedule_id); } } elseif ($haschanged) { if ($page->scheduler->updateAction($id, 'SCH_AUTOPUBLISH', $timestamp, $parameters) === false) { $koala->alert($itext['TXT_ERROR_ACCESS_DENIED']); } else { // Add to history if ($version != ALWAYS_LATEST_APPROVED_VERSION) { $page->history->add(HISTORYTYPE_PAGE, TStoLocalTS($timestamp), $version, 'TXT_PAGE_H_AUTOPUBLISH_CHANGED', $id); } else { $lastfinalversion = $page->getLatestApprovedVersion(); $page->history->add(HISTORYTYPE_PAGE, TStoLocalTS($timestamp), $lastfinalversion, 'TXT_PAGE_H_AUTOPUBLISH_CHANGED', $id); } } } } } $koala->queueScript("Koala.yg_resetPublishSettingsEditState('" . $wid . "');"); break; case 'removePageAutopublishItem': $itemID = (int) $this->params['itemID']; $item_data = $page->scheduler->get($itemID); $page->scheduler->removeJob($itemID); // Add to history if ($item_data['PARAMETERS']['VERSION'] != ALWAYS_LATEST_APPROVED_VERSION) { $page->history->add(HISTORYTYPE_PAGE, $item_data['TIMESTAMP'], $item_data['PARAMETERS']['VERSION'], 'TXT_PAGE_H_AUTOPUBLISH_DELETED', $itemID); } else {
/** * Function to get the queued commands from the history */ public function getQueuedCommands() { $entrymaskMgr = new Entrymasks(); $jsQueue = new JSQueue(NULL); $tagMgr = new Tags(); $queuedCommands = array(); $currentQueueId = sGuiLH(); if (!$currentQueueId || $currentQueueId == 'false') { return; // if running first time (only) //$currentQueueId = $jsQueue->getLastQueueId(); } if ($currentQueueId) { $queuedCommandsRaw = $jsQueue->getQueue($currentQueueId, sGuiUS()); $templateMgr = new Templates(); $viewMgr = new Views(); foreach ($queuedCommandsRaw as $queuedCommandRaw) { // Check permissions $permissionsObj = NULL; $objectID = $queuedCommandRaw['OID']; $siteID = $queuedCommandRaw['SITEID']; $icons = new Icons(); $url = $imgurl = ''; switch ($queuedCommandRaw['TYPE']) { case HISTORYTYPE_MAILING: $mailingMgr = new MailingMgr(); $mailingObj = $mailingMgr->getMailing($objectID); $permissionsObj = $mailingObj->permissions; break; case HISTORYTYPE_PAGE: if ($siteID > 0 && $objectID > 0) { $pageMgr = new PageMgr($siteID); $pageObj = $pageMgr->getPage($objectID); if ($pageObj) { $url = $pageObj->getUrl(); $permissionsObj = $pageObj->permissions; } } break; case HISTORYTYPE_CO: if (!$objectID) { continue; } $cb = sCblockMgr()->getCblock($objectID); $permissionsObj = $cb->permissions; break; case HISTORYTYPE_ENTRYMASK: $permissionsObj = $entrymaskMgr->permissions; break; case HISTORYTYPE_FILE: $permissionsObj = sFileMgr()->permissions; if ($objectID) { $file = sFileMgr()->getFile($objectID); if ($file) { $info = $file->get(); $url = sApp()->webroot . "download/" . $info['PNAME'] . "/"; $hiddenviews = $file->views->getHiddenViews(); foreach ($hiddenviews as $hiddenview) { if ($hiddenview['IDENTIFIER'] == "YGSOURCE") { $tmpviewinfo = $file->views->getGeneratedViewInfo($hiddenview['ID']); if ($tmpviewinfo[0]['TYPE'] == FILE_TYPE_WEBIMAGE) { $imgurl = sApp()->webroot . "image/" . $info['PNAME'] . "/"; } } } } } break; case HISTORYTYPE_TEMPLATE: $permissionsObj = $templateMgr->permissions; break; case HISTORYTYPE_TAG: $permissionsObj = $tagMgr->permissions; break; case HISTORYTYPE_SITE: $pageMgr = new PageMgr($siteID); $sitePages = $pageMgr->tree->get(0, 1); $tmpPageID = $sitePages[0]["ID"]; if ($tmpPageID) { $pageObj = $pageMgr->getPage($tmpPageID); $permissionsObj = $pageObj->permissions; } break; case HISTORYTYPE_USER: $permissionsObj = sUsergroups()->usergroupPermissions; break; case HISTORYTYPE_USERGROUP: case HISTORYTYPE_EXTERNAL: case HISTORYTYPE_IMAGE: case HISTORYTYPE_FILETYPES: case HISTORYTYPE_FILEVIEWS: case HISTORYTYPE_JSQUEUE: case HISTORYTYPE_PERMISSION: default: break; } if ($queuedCommandRaw['TEXT'] == 'NOPERMISSIONCHECK' || strpos($queuedCommandRaw['OLDVALUE'], 'HIGHLIGHT') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'UNHIGHLIGHT') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'PAGE_MOVE') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'PAGE_HIDE') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'PAGE_UNHIDE') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'PAGE_ACTIVATE') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'RELOAD_WINDOW') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'CLEAR_USERINFOS') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'SET_USERINFOS') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'CLEAR_FILEINFOS') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'REFRESH_WINDOW') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'ADD_FILE') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'OBJECT_DELETE') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'OBJECT_ADD_TAG') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'OBJECT_CHANGE') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'OBJECT_CHANGECLASS') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'OBJECT_CHANGEPNAME') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'OBJECT_CHANGEBGIMAGE') === 0 || strpos($queuedCommandRaw['OLDVALUE'], 'OBJECT_CHANGE_LOCK_STATE') === 0) { $allowed = true; } else { if ($permissionsObj != NULL) { $allowed = $permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RREAD"); } } if ($permissionsObj != NULL || $allowed) { if ($allowed) { $itext = sItext(); switch ($queuedCommandRaw['OLDVALUE']) { case 'UNHIGHLIGHT': if ($queuedCommandRaw['TEXT']) { //$queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_unHilite(\''.$queuedCommandRaw['TEXT'].'\', \''.$objectID.'-template\', \''.$queuedCommandRaw['TEXT'].'\');'; $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_unHilite(\'' . $queuedCommandRaw['TEXT'] . '\', \'' . $queuedCommandRaw['VALUE1'] . '\', \'' . $queuedCommandRaw['VALUE2'] . '\');'; } break; case 'OBJECT_CHANGE_LOCK_STATE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_changeWindowLockStateForObject(\'' . $queuedCommandRaw['TEXT'] . '\', \'' . $queuedCommandRaw['VALUE1'] . '\', \'' . $queuedCommandRaw['VALUE2'] . '\');'; } break; case 'OBJECT_CHANGEBGIMAGE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_changeBGImage(\'' . $queuedCommandRaw['TEXT'] . '\', \'' . $queuedCommandRaw['VALUE1'] . '\', \'' . $queuedCommandRaw['VALUE2'] . '\', \'' . $queuedCommandRaw['VALUE3'] . '\');'; } break; case 'OBJECT_CHANGECLASS': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_changeClass(\'' . $queuedCommandRaw['TEXT'] . '\', \'' . $queuedCommandRaw['VALUE1'] . '\', \'' . $queuedCommandRaw['VALUE2'] . '\', \'' . $queuedCommandRaw['VALUE3'] . '\');'; } break; case 'OBJECT_CHANGEPNAME': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_changePName(\'' . $queuedCommandRaw['TEXT'] . '\', \'' . $queuedCommandRaw['VALUE1'] . '\', \'' . $queuedCommandRaw['VALUE2'] . '\', \'' . $queuedCommandRaw['VALUE3'] . '\', \'' . $url . '\', \'' . $imgurl . '\');'; } break; case 'OBJECT_CHANGE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_change(\'' . $queuedCommandRaw['TEXT'] . '\', \'' . addslashes($queuedCommandRaw['VALUE1']) . '\', \'' . addslashes($queuedCommandRaw['VALUE2']) . '\', \'' . addslashes($queuedCommandRaw['VALUE3']) . '\');'; } break; case 'OBJECT_ADD_TAG': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_addTag(\'' . $queuedCommandRaw['TEXT'] . '\', \'' . $queuedCommandRaw['VALUE1'] . '\', \'' . $queuedCommandRaw['VALUE2'] . '\', \'' . $queuedCommandRaw['VALUE3'] . '\', \'' . $queuedCommandRaw['VALUE4'] . '\', ' . stripslashes($queuedCommandRaw['VALUE5']) . ', \'' . $queuedCommandRaw['VALUE6'] . '\', \'' . $queuedCommandRaw['VALUE7'] . '\');'; } break; case 'OBJECT_DELETE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_del(\'' . $queuedCommandRaw['TEXT'] . '\', \'' . $queuedCommandRaw['VALUE1'] . '\', \'' . $queuedCommandRaw['VALUE2'] . '\', \'' . $queuedCommandRaw['VALUE3'] . '\', \'' . $queuedCommandRaw['VALUE4'] . '\');'; } break; case 'ADD_FILE': $file = new File($objectID); $latestVersion = $file->getLatestApprovedVersion(); $file = new File($objectID, $latestVersion); $fileInfo = $file->get(); $reftracker = new Reftracker(); if ($fileInfo['CREATEDBY']) { $user = new User($fileInfo['CREATEDBY']); $userInfo = $user->get(); $userInfo['PROPS'] = $user->properties->getValues($fileInfo['CREATEDBY']); } $fileInfo['CUSTOM_DATE'] = date('d.m.Y', TStoLocalTS($fileInfo['CHANGEDTS'])); $fileInfo['CUSTOM_TIME'] = date('G:i', TStoLocalTS($fileInfo['CHANGEDTS'])); $fileInfo['REFS'] = $reftracker->getIncomingForFile($fileInfo['OBJECTID']); $tags = $file->tags->getAssigned(); for ($t = 0; $t < count($tags); $t++) { $tp = array(); $tp = $file->tags->tree->getParents($tags[$t]['ID']); $tp2 = array(); for ($p = 0; $p < count($tp); $p++) { $tinfo = $file->tags->get($tp[$p]); $tp2[$p]['ID'] = $tinfo['ID']; $tp2[$p]['NAME'] = $tinfo['NAME']; } $tp2[count($tp2) - 1]['NAME'] = $itext['TXT_TAGS'] != '' ? $itext['TXT_TAGS'] : '$TXT_TAGS'; $tags[$t]['PARENTS'] = $tp2; } $fileInfo['TAGS'] = $tags; $fileInfo['THUMB'] = 1; if ($queuedCommandRaw['TEXT'] == 'nothumb') { $fileInfo['THUMB'] = 0; } $views = $file->views->getAssigned(); foreach ($views as $view) { if ($view["IDENTIFIER"] == "YGSOURCE") { $viewinfo = $file->views->getGeneratedViewInfo($view["ID"]); $fileInfo["WIDTH"] = $viewinfo[0]["WIDTH"]; $fileInfo["HEIGHT"] = $viewinfo[0]["HEIGHT"]; } } $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_addFile(\'file\', \'' . $fileInfo['PARENT'] . '-file\', \'' . $objectID . '\', \'' . $fileInfo['THUMB'] . '\', \'' . $fileInfo['COLOR'] . '\', \'' . $fileInfo['CODE'] . '\', \'' . $fileInfo['NAME'] . '\', \'' . $fileInfo['PNAME'] . '\', \'' . json_encode($fileInfo['TAGS']) . '\', \'' . $fileInfo['FILESIZE'] . '\', \'' . count($fileInfo['REFS']) . '\', \'' . TStoLocalTS($fileInfo['CHANGEDTS']) . '\', \'' . $fileInfo['CUSTOM_DATE'] . '\', \'' . $fileInfo['CUSTOM_TIME'] . '\', \'' . $fileInfo['UID'] . '\', \'' . $userInfo['PROPS']['FIRSTNAME'] . ' ' . $userInfo['PROPS']['LASTNAME'] . '\', \'' . $fileInfo['FILENAME'] . '\', \'' . $fileInfo["WIDTH"] . '\', \'' . $fileInfo['HEIGHT'] . '\');'; break; case 'REFRESH_TAGS': if ($queuedCommandRaw['TEXT']) { switch ($queuedCommandRaw['TYPE']) { case HISTORYTYPE_CO: $objType = 'cblock'; break; case HISTORYTYPE_FILE: $objType = 'file'; break; } } $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_refreshTags(\'' . $objType . '\', \'' . $objectID . '-' . $objType . '\', \'tags\', \'' . $queuedCommandRaw['TEXT'] . '\');'; break; case 'REFRESH_WINDOW': if ($queuedCommandRaw['TEXT']) { switch ($queuedCommandRaw['TYPE']) { case HISTORYTYPE_CO: $objType = 'cblock'; break; case HISTORYTYPE_PAGE: $objType = 'page'; break; case HISTORYTYPE_FILE: $objType = 'file'; break; case HISTORYTYPE_TAG: $objType = 'tag'; break; case HISTORYTYPE_TEMPLATE: $objType = 'template'; break; case HISTORYTYPE_ENTRYMASK: $objType = 'entrymask'; break; case HISTORYTYPE_SITE: $objType = 'site'; break; } // Special cases switch ($queuedCommandRaw['TYPE']) { case HISTORYTYPE_PAGE: $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_refreshWin(\'' . $objType . '\',\'' . $objectID . '-' . $siteID . '\',\'' . $queuedCommandRaw['TEXT'] . '\');'; break; case HISTORYTYPE_FILE: $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_refreshWin(\'' . $objType . '\',\'' . $objectID . '-' . $objType . '\',\'' . $queuedCommandRaw['TEXT'] . '\');'; $queuedCommands[$queuedCommandRaw['ID']] .= 'Koala.yg_refreshWin(\'' . $objType . 'folder\',\'' . $objectID . '-' . $objType . '\',\'' . $queuedCommandRaw['TEXT'] . '\');'; break; default: $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_refreshWin(\'' . $objType . '\',\'' . $objectID . '-' . $objType . '\',\'' . $queuedCommandRaw['TEXT'] . '\');'; break; } } break; case 'CLEAR_FILEINFOS': $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_fileInfos[' . $objectID . '] = null;'; break; case 'SET_FILEINFOS': $file = sFileMgr()->getFile($objectID); if ($file) { $latestFinalVersion = $file->getLatestApprovedVersion(); $file = new File($objectID, $latestFinalVersion); $fileInfo = $file->get(); $fileTypes = sFileMgr()->getFiletypes(); $user = new User(sUserMgr()->getCurrentUserID()); $fileInfo['DATE'] = date($itext['DATE_FORMAT'], TStoLocalTS($fileInfo['CHANGEDTS'])); $fileInfo['TIME'] = date($itext['TIME_FORMAT'], TStoLocalTS($fileInfo['CHANGEDTS'])); $fileInfo['FILESIZE'] = formatFileSize($fileInfo['FILESIZE']); $views = $file->views->getAssigned(true); $viewInfo = $file->views->getGeneratedViewInfo($views[0]["ID"]); $fileInfo['WIDTH'] = $viewInfo[0]["WIDTH"]; $fileInfo['HEIGHT'] = $viewInfo[0]["HEIGHT"]; $fileInfo['TAGS'] = $file->tags->getAssigned(); $tags = array(); foreach ($fileInfo['TAGS'] as $tag) { array_push($tags, $tag['NAME']); } $fileTags = implode(', ', $tags); if (strlen($fileTags) > 40) { $fileTags = substr($fileTags, 0, 40); $fileTags .= '...'; } $fileInfo['TAGS'] = $fileTags; if (strlen($fileInfo['NAME']) > 40) { $fileInfo['NAME'] = substr($fileInfo['NAME'], 0, 40); $fileInfo['NAME'] .= '...'; } if (strlen($fileInfo['FILENAME']) > 40) { $fileInfo['FILENAME'] = substr($fileInfo['FILENAME'], 0, 40); $fileInfo['FILENAME'] .= '...'; } if ($fileInfo['CREATEDBY']) { $user = new User($fileInfo['CREATEDBY']); $userInfo = $user->get(); $userInfo['PROPS'] = $user->properties->getValues($fileInfo['CREATEDBY']); $fileInfo['USERNAME'] = $userInfo['PROPS']['FIRSTNAME'] . ' ' . $userInfo['PROPS']['LASTNAME']; } foreach ($fileTypes as $fileTypes_item) { if ($fileTypes_item['ID'] == $fileInfo['FILETYPE']) { $fileInfo['FILETYPE_TXT'] = $fileTypes_item['NAME']; } } $fileInfo['THUMB'] = 0; $hiddenViews = $file->views->getHiddenViews(); foreach ($hiddenViews as $view) { if ($view['IDENTIFIER'] == 'yg-preview') { $tmpviewinfo = $file->views->getGeneratedViewInfo($view["ID"]); if ($tmpviewinfo[0]["TYPE"] == FILE_TYPE_WEBIMAGE) { $fileInfo['THUMB'] = 1; $fileInfo['PREVIEWWIDTH'] = $tmpviewinfo[0]["WIDTH"]; $fileInfo['PREVIEWHEIGHT'] = $tmpviewinfo[0]["HEIGHT"]; } } } $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_fileInfos[' . $objectID . '] = ' . json_encode($fileInfo) . ';Koala.yg_showFileHint(\'' . $objectID . '\');'; } break; case 'SET_USERINFOS': $user = new User($objectID); $userInfo = $user->get(); $userInfo['PROPS'] = $user->properties->getValues($objectID); $userInfo['USERGROUPS'] = $user->getUsergroups($objectID); $roles = array(); foreach ($userInfo['USERGROUPS'] as $role) { array_push($roles, $role['NAME']); } $user_roles = implode(', ', $roles); if (strlen($user_roles) > 30) { $user_roles = substr($user_roles, 0, 30); $user_roles .= '...'; } if (file_exists(sApp()->app_root . sApp()->userpicdir . $objectID . '-picture.jpg')) { $internPrefix = (string) sConfig()->getVar('CONFIG/REFTRACKER/INTERNALPREFIX'); $user_picture = $internPrefix . 'userimage/' . $objectID . '/48x48?rnd=' . rand(); } else { $user_picture = sApp()->imgpath . 'content/temp_userpic.png'; } $user_company = $userInfo['PROPS']['COMPANY']; $user_name = $userInfo['PROPS']['FIRSTNAME'] . ' ' . $userInfo['PROPS']['LASTNAME']; $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_userInfos[' . $objectID . '] = {name: \'' . $user_name . '\', groups: \'' . $user_roles . '\', pic: \'' . $user_picture . '\', company: \'' . $user_company . '\'}'; break; case 'CLEAR_USERINFOS': $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_userInfos[' . $objectID . '] = null;'; break; case 'CLEAR_REFRESH': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_clearRefresh(\'' . $objectID . '-' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'RELOAD_WINDOW': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_reloadWin(null, \'' . $objectID . '-' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'PAGE_DEACTIVATE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_deActivate(\'page\', \'' . $objectID . '-' . $siteID . '\', \'name\');'; } break; case 'PAGE_ACTIVATE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_activate(\'page\', \'' . $objectID . '-' . $siteID . '\', \'name\');'; } break; case 'PAGE_UNHIDE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_unHide(\'page\', \'' . $objectID . '-' . $siteID . '\', \'name\');'; } break; case 'PAGE_HIDE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_hide(\'page\', \'' . $objectID . '-' . $siteID . '\', \'name\');'; } break; case 'FILE_DELVIEW': if ($queuedCommandRaw['TEXT']) { $file = sFileMgr()->getFile($objectID); $fileInfo = $file->get(); if ($fileInfo['FOLDER'] == 1) { $isFolder = 'true'; } else { $isFolder = 'false'; } $queuedCommands[$queuedCommandRaw['ID']] = 'if (Koala.yg_delViewArr[' . $queuedCommandRaw['TEXT'] . ']) Koala.yg_delViewArr[' . $queuedCommandRaw['TEXT'] . '](' . $objectID . ', ' . $isFolder . ');'; } break; case 'FILE_CLEAR_DELVIEW': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'if (Koala.yg_delViewArr[' . $queuedCommandRaw['TEXT'] . ']) Koala.yg_delViewArr[' . $queuedCommandRaw['TEXT'] . ']=undefined;'; } break; case 'FILE_ADDVIEW': if ($queuedCommandRaw['TEXT']) { $file = sFileMgr()->getFile($objectID); $fileInfo = $file->get(); $viewInfo = $viewMgr->get($queuedCommandRaw['TEXT']); if ($fileInfo['FOLDER'] == 1) { $isFolder = 'true'; } else { $isFolder = 'false'; } $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_addView(\'' . $objectID . '\', \'' . $viewInfo['ID'] . '\', \'' . $viewInfo['IDENTIFIER'] . '\', \'' . $viewInfo['NAME'] . '\', \'' . $viewInfo['WIDTH'] . '\', \'' . $viewInfo['HEIGHT'] . '\', \'' . $isFolder . '\');'; } break; case 'FILE_GENERATEDVIEW': if ($queuedCommandRaw['TEXT']) { $file = sFileMgr()->getFile($objectID); $viewInfo = $viewMgr->get($queuedCommandRaw['TEXT']); $generatedViewInfo = $file->views->getGeneratedViewInfo($viewInfo['ID']); if ($generatedViewInfo[0]['TYPE'] == FILE_TYPE_WEBIMAGE) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_addGenerated(\'' . $objectID . '\',\'' . $viewInfo['IDENTIFIER'] . '\', \'' . $viewInfo['WIDTH'] . '\', \'' . $viewInfo['HEIGHT'] . '\');'; } else { if ($generatedViewInfo[0]) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_addGenerated(\'' . $objectID . '\',\'NULL\');'; } } } break; case 'UNHIGHLIGHT_TEMPLATE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_unHilite(\'template\', \'' . $objectID . '-template\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'HIGHLIGHT_PAGE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_hilite(\'page\', \'' . $objectID . '-' . $siteID . '\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'UNHIGHLIGHT_PAGE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_unHilite(\'page\', \'' . $objectID . '-' . $siteID . '\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'HIGHLIGHT_CBLOCK': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_hilite(\'cblock\', \'' . $objectID . '-cblock\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'UNHIGHLIGHT_CBLOCK': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_unHilite(\'cblock\', \'' . $objectID . '-cblock\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'UNHIGHLIGHT_ENTRYMASK': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_unHilite(\'entrymask\', \'' . $objectID . '-entrymask\', \'' . $queuedCommandRaw['TEXT'] . '\');' . 'Koala.yg_unHilite(\'page\', \'' . $objectID . '-entrymask\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'UNHIGHLIGHT_SITE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_unHilite(\'page\', \'' . $objectID . '-site\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'HIGHLIGHT_SITE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_hilite(\'page\', \'' . $objectID . '-site\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'HIGHLIGHT_MAILING': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_hilite(\'mailing\', \'' . $objectID . '-mailing' . '\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'UNHIGHLIGHT_MAILING': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_unHilite(\'mailing\', \'' . $objectID . '-mailing' . '\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'PAGE_MOVE': if ($queuedCommandRaw['TEXT']) { if ($queuedCommandRaw['TARGETID'] == 1) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_moveTreeNode(\'page\', \'' . $objectID . '-' . $siteID . '\', \'' . $queuedCommandRaw['TEXT'] . '\', 2);'; } else { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_moveTreeNode(\'page\', \'' . $objectID . '-' . $siteID . '\', \'' . $queuedCommandRaw['TEXT'] . '\', 1);'; } } break; case 'PAGE_MOVEUP': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_moveUp(\'page\', \'' . $objectID . '-' . $siteID . '\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'PAGE_MOVEDOWN': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_moveDown(\'page\', \'' . $objectID . '-' . $siteID . '\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } break; case 'CBLOCK_MOVE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_moveTreeNode(\'cblock\', \'' . $objectID . '-cblock\', \'' . $queuedCommandRaw['TEXT'] . '-cblock\', 1);'; } break; case 'FILE_MOVE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_moveTreeNode(\'file\', \'' . $objectID . '-file\', \'' . $queuedCommandRaw['TEXT'] . '-file\', 1);'; } break; case 'TAG_MOVE': if ($queuedCommandRaw['TEXT']) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_moveTreeNode(\'tag\', \'' . $objectID . '-tag\', \'' . $queuedCommandRaw['TEXT'] . '-tag\', 1);'; } break; case 'TAG_ADD': $objectInfo = $tagMgr->get($objectID); $icon = $icons->icon['tag_small']; $statusClass = ''; if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RWRITE")) { // Nur Leserecht (hellgrau) $statusClass .= " nowrite"; } if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RDELETE")) { // Nur Leserecht (hellgrau) $statusClass .= " nodelete"; } if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RSUB")) { $statusClass .= " nosub"; } $objectName = $objectInfo['NAME']; $objectParents = $tagMgr->getParents($objectID); $parentNodeId = $objectParents[0][0]["ID"]; if ($queuedCommandRaw['NEWVALUE'] == sGuiUS()) { $andSelect = 'true'; } else { $andSelect = 'false'; } $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_addChild(\'tag\', \'' . $parentNodeId . '-tag\', \'name\', \'' . $objectName . '\', \'tag\', \'' . $objectID . '-tag\', \'name\', \'' . $icon . '\', \'' . $statusClass . '\', ' . $andSelect . ');'; break; case 'FILE_ADD': case 'FILEFOLDER_ADD': $file = sFileMgr()->getFile($objectID); if ($file) { $objectInfo = $file->get(); $icon = $icons->icon['folder']; $statusClass = ''; if ($objectInfo["VERSIONPUBLISHED"] + 2 != $objectInfo["VERSION"] && $objectInfo["VERSIONPUBLISHED"] != ALWAYS_LATEST_APPROVED_VERSION && $objectInfo["HASCHANGED"] == "1") { // Editiert (grĂ¼n) $statusClass = "changed"; } elseif ($objectInfo["HASCHANGED"] == "1") { $statusClass = "changed"; } if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RWRITE")) { // Nur Leserecht (hellgrau) $statusClass .= " nowrite"; } if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RDELETE")) { // Nur Leserecht (hellgrau) $statusClass .= " nodelete"; } if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RSUB")) { $statusClass .= " nosub"; } $objectName = $objectInfo['NAME']; $objectParents = sFileMgr()->getParents($objectID); $parentNodeId = $objectParents[0][0]["ID"]; if ($queuedCommandRaw['NEWVALUE'] == sGuiUS()) { $andSelect = 'true'; } else { $andSelect = 'false'; } $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_addChild(\'file\', \'' . $parentNodeId . '-file\', \'name\', \'' . $objectName . '\', \'file\', \'' . $objectID . '-file\', \'name\', \'' . $icon . '\', \'' . $statusClass . '\', ' . $andSelect . ');'; } break; case 'CBLOCK_ADD': $cb = sCblockMgr()->getCblock($objectID); $objectInfo = $cb->get(); $icon = $icons->icon['cblock_small']; $statusClass = ''; if ($objectInfo['FOLDER'] != 1) { if ($objectInfo["VERSIONPUBLISHED"] + 2 != $objectInfo["VERSION"] && $objectInfo["VERSIONPUBLISHED"] != ALWAYS_LATEST_APPROVED_VERSION && $objectInfo["HASCHANGED"] == "1") { // Editiert (grĂ¼n) $statusClass .= "changed changed1 nosub"; } elseif ($objectInfo["HASCHANGED"] == "1") { $statusClass .= "changed changed2 nosub"; } } else { if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RSUB")) { $statusClass .= " nosub"; } $icon = $icons->icon['folder']; $statusClass .= " folder"; } if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RWRITE")) { // Nur Leserecht (hellgrau) $statusClass .= " nowrite"; } if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RDELETE")) { // Nur Leserecht (hellgrau) $statusClass .= " nodelete"; } $objectName = $objectInfo['NAME']; $objectParents = sCblockMgr()->getParents($objectID); $parentNodeId = $objectParents[0][0]["ID"]; if ($queuedCommandRaw['NEWVALUE'] == sGuiUS() && $queuedCommandRaw['TEXT'] != 'list') { $andSelect = 'true'; } else { $andSelect = 'false'; } if ($queuedCommandRaw['NEWVALUE'] == sGuiUS()) { $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_addListItem(\'' . $parentNodeId . '-cblock\', \'' . addslashes(json_encode($objectInfo)) . '\', \'' . $queuedCommandRaw['TEXT'] . '\');'; } $queuedCommands[$queuedCommandRaw['ID']] .= 'Koala.yg_addChild(\'cblock\', \'' . $parentNodeId . '-cblock\', \'name\', \'' . $objectName . '\', \'cblock\', \'' . $objectID . '-cblock\', \'name\', \'' . $icon . '\', \'' . $statusClass . '\', ' . $andSelect . ');'; break; case 'PAGE_ADD': if ($pageObj) { $objectInfo = $pageObj->get(); $icon = $icons->icon['page_small']; $statusClass = ''; $inactive = false; if ($objectInfo["ACTIVE"] == "0") { $icon = $icons->icon['page_inactive_small']; $inactive = true; } $naviinfo = NULL; $navis = $templateMgr->getNavis($objectInfo["TEMPLATEID"]); for ($i = 0; $i < count($navis); $i++) { if ($navis[$i]["ID"] == $objectInfo["NAVIGATIONID"]) { $naviinfo = $navis[$i]; } } if ($objectInfo["HIDDEN"] == "1" || $objectInfo["TEMPLATEID"] == "0" || !$naviinfo['ID']) { $icon = $icons->icon['page_hidden_small']; if ($inactive == true) { $icon = $icons->icon['page_inactive_hidden_small']; } } if ($objectInfo["VERSIONPUBLISHED"] + 2 != $objectInfo["VERSION"] && $objectInfo["VERSIONPUBLISHED"] != ALWAYS_LATEST_APPROVED_VERSION && $objectInfo["HASCHANGED"] == "1") { // Editiert (grĂ¼n) $statusClass = "changed"; } elseif ($objectInfo["HASCHANGED"] == "1") { $statusClass = "changed"; } if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RWRITE")) { // Nur Leserecht (hellgrau) $statusClass .= " nowrite"; } if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RDELETE")) { // Nur Leserecht (hellgrau) $statusClass .= " nodelete"; } if (!$permissionsObj->checkInternal(sUserMgr()->getCurrentUserID(), $objectID, "RSUB")) { $statusClass .= " nosub"; } $objectName = $objectInfo['NAME']; $objectParents = $pageMgr->getParents($objectID); $parentNodeId = $objectParents[0][0]["ID"]; if (!$parentNodeId) { $parentNodeId = 1; } $url = $pageObj->getUrl(); if ($queuedCommandRaw['NEWVALUE'] == sGuiUS()) { $andSelect = 'true'; } else { $andSelect = 'false'; } $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_addChild(\'page\', \'' . $parentNodeId . '-' . $siteID . '\', \'name\', \'' . $objectName . '\', \'page\', \'' . $objectID . '-' . $siteID . '\', \'name\', \'' . $icon . '\', \'' . $statusClass . '\', ' . $andSelect . ', \'' . $url . '\');' . "\n"; } break; case 'MAILING_ADD': $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_refreshMailingsWindow();' . "\n"; break; case 'MAILING_DELETE': $queuedCommands[$queuedCommandRaw['ID']] = 'Koala.yg_refreshMailingsWindow(true);' . "\n"; break; default: $queuedCommands[$queuedCommandRaw['ID']] = stripslashes($queuedCommandRaw['OLDVALUE']) . "\n"; break; } } } } if (count($queuedCommandsRaw)) { $currentQueueId = $queuedCommandsRaw[count($queuedCommandsRaw) - 1]['ID']; } } $output = "\n<script>\n"; $output .= "parent.Koala.currentGuiSyncHistoryId = " . $currentQueueId . ";\n"; $output .= "parent.Koala.yg_executeGuiJSQueue( " . json_encode($queuedCommands) . " );\n"; $output .= "</script>\n"; print $output; }
$latestversion = 1; $neverpublished = true; } $pageLatestFinalVersion = $pageMgr->getPage($pageID, $latestversion); $latestversioninfo = $pageLatestFinalVersion->get(); break; } // Get timezone offset $user = new User(sUserMgr()->getCurrentUserID()); foreach ($autopublish as $autopublish_idx => $autopublish_item) { $autopublish[$autopublish_idx]['TIMESTAMP'] = TStoLocalTS($autopublish[$autopublish_idx]['TIMESTAMP']); } foreach ($versions as $version_idx => $version_item) { $versions[$version_idx]['CHANGEDTS'] = TStoLocalTS($version_item['CHANGEDTS']); } $latestversioninfo['CHANGEDTS'] = TStoLocalTS($latestversioninfo['CHANGEDTS']); if ($lockedFailed) { // Get user who locked this object $userWithLock = new User($lockStatus['LOCKUID']); $lockedByUser = $userWithLock->get($lockStatus['LOCKUID']); $lockedByUser['PROPS'] = $userWithLock->properties->getValues($lockStatus['LOCKUID']); $smarty->assign('lockedByUser', $lockedByUser); $objectInfo['RSTAGE'] = false; $objectInfo['NOSTAGE'] = true; $koala->queueScript('Koala.windows[\'wid_' . $this->request->parameters['win_no'] . '\'].setStageButton( \'0\' );'); } else { $koala->queueScript('Koala.windows[\'wid_' . $this->request->parameters['win_no'] . '\'].setStageButton( \'' . $objectInfo['RSTAGE'] . '\' );'); } $koala->queueScript('Koala.windows[\'wid_' . $this->request->parameters['win_no'] . '\'].setLocked( \'' . $lockedByUser['ID'] . '\' );'); $smarty->assign('userinfo', $userinfo); $smarty->assign("versions", $versions);
$currentObject->releaseLock($lockedObject['TOKEN']); } } } // Check for lock, and lock if not locked $lockStatus = $page->getLock(); if ($lockStatus['LOCKED'] == 0) { $lockedFailed = !$page->acquireLock($lockToken); } else { $lockedFailed = true; } } break; } foreach ($real_history as $real_history_idx => $real_history_item) { $real_history[$real_history_idx]['DATETIME'] = TStoLocalTS($real_history_item['DATETIME']); } if ($lockedFailed) { // Get user who locked this object $userWithLock = new User($lockStatus['LOCKUID']); $lockedByUser = $userWithLock->get($lockStatus['LOCKUID']); $lockedByUser['PROPS'] = $userWithLock->properties->getValues($lockStatus['LOCKUID']); $smarty->assign('lockedByUser', $lockedByUser); $objectInfo['RWRITE'] = false; if ($objecttype == 'cblock' || $objecttype == 'page') { $koala->queueScript('Koala.windows[\'wid_' . $this->request->parameters['win_no'] . '\'].setStageButton( \'0\');'); } } else { if ($objecttype == 'cblock' || $objecttype == 'page') { $koala->queueScript('Koala.windows[\'wid_' . $this->request->parameters['win_no'] . '\'].setStageButton( \'' . $objectInfo['RSTAGE'] . '\');'); }
foreach (array('PAGES', 'CONTENT', 'FILES', 'MAILING') as $item) { foreach ($lastchanges[$item] as $lastchanges_idx => $lastchanges_item) { $lastchanges[$item][$lastchanges_idx]['DATETIME'] = TStoLocalTS($lastchanges_item['DATETIME']); $user = new User($lastchanges_item['UID']); $userinfo = $user->get(); if ($userinfo['ID']) { $userinfo['FIRSTNAME'] = $user->properties->getValue('FIRSTNAME'); $userinfo['LASTNAME'] = $user->properties->getValue('LASTNAME'); } $lastchanges[$item][$lastchanges_idx]['USERINFO'] = $userinfo; } } // Enrich information for comments foreach ($lastchanges['COMMENT'] as $lastchanges_idx => $lastchanges_item) { $lastchanges['COMMENT'][$lastchanges_idx]['CREATEDTS'] = TStoLocalTS($lastchanges['COMMENT'][$lastchanges_idx]['CREATEDTS']); $lastchanges['COMMENT'][$lastchanges_idx]['CHANGEDTS'] = TStoLocalTS($lastchanges['COMMENT'][$lastchanges_idx]['CHANGEDTS']); if ($lastchanges_item['USERID']) { $user = new User($lastchanges_item['USERID']); $userinfo = $user->get(); if ($userinfo['ID']) { $userinfo['FIRSTNAME'] = $user->properties->getValue('FIRSTNAME'); $userinfo['LASTNAME'] = $user->properties->getValue('LASTNAME'); } $lastchanges['COMMENT'][$lastchanges_idx]['USERINFO'] = $userinfo; } } $user = new User(sUserMgr()->getCurrentUserID()); $smarty->assign("RPAGES", $user->checkPermission("RPAGES")); $smarty->assign("RCONTENTBLOCKS", $user->checkPermission("RCONTENTBLOCKS")); $smarty->assign("RFILES", $user->checkPermission("RFILES")); $smarty->assign("RCOMMENTS", $user->checkPermission("RCOMMENTS"));
$cblockInfo = $tmpCb->get(); $objectdynprops[$objectdynprops_cnt]['CBLOCKTITLE'] = $cblockInfo['NAME']; } } } if ($object_property['TYPE'] == 'PAGE') { if ($objectdynprops[$objectdynprops_cnt]['VALUE']['site'] && $objectdynprops[$objectdynprops_cnt]['VALUE']['page']) { $pageMgr = new PageMgr($objectdynprops[$objectdynprops_cnt]['VALUE']['site']); $currPage = $pageMgr->getPage($objectdynprops[$objectdynprops_cnt]['VALUE']['page']); $pageInfo = $currPage->get(); $objectdynprops[$objectdynprops_cnt]['PAGETITLE'] = $pageInfo['NAME']; } } if ($object_property['TYPE'] == 'DATETIME' || $object_property['TYPE'] == 'DATE') { if ($objectdynprops[$objectdynprops_cnt]['VALUE']) { $objectdynprops[$objectdynprops_cnt]['VALUE'] = TStoLocalTS($objectdynprops[$objectdynprops_cnt]['VALUE']); } } if ($object_property['TYPE'] == 'LINK') { $special_url = resolveSpecialURL($objectdynprops[$objectdynprops_cnt]['VALUE']); if ($special_url !== false) { $special_url_info = getSpecialURLInfo($objectdynprops[$objectdynprops_cnt]['VALUE']); if ($special_url_info['TYPE'] == 'IMG' || $special_url_info['TYPE'] == 'DOWN') { $objectdynprops[$objectdynprops_cnt]['IS_FILE'] = true; if ($special_url_info['ID']) { $tmpFile = sFileMgr()->getFile($special_url_info['ID']); if ($tmpFile) { $link_fileinfo = $tmpFile->get(); $objectdynprops[$objectdynprops_cnt]['LINKTITLE'] = $link_fileinfo['NAME']; $link_filetype = $filetypeMgr->get($link_fileinfo['FILETYPE']); $objectdynprops[$objectdynprops_cnt]['FILEIDENTIFIER'] = $link_filetype['IDENTIFIER'];
$pageDirLimit = explode(',', $pageDirInfo['pageDirLimit']); $pageDirLimitFrom = $pageDirLimit[0]; $pageDirLimitLength = $pageDirLimit[1]; // END for paging $filterArray = array(); $filterArray[] = array('TYPE' => 'LIMITER', 'VALUE' => $pageDirLimitFrom, 'VALUE2' => $pageDirLimitLength); $filterArray[] = array('TYPE' => 'ORDER', 'VALUE' => $pageDirOrderBy, 'VALUE2' => $pageDirOrderDir); $filterArray[] = array('TYPE' => 'STATUS', 'VALUE' => $filterStatus); $mailings = $mailingMgr->getList($mailingMgr->tree->getRoot(), array('SUBNODES'), 2, NULL, $filterArray); // Get additional user information $allMailings = array(); foreach ($mailings as $mailingsIdx => $mailingsItem) { $currMailing = $mailingMgr->getMailing($mailingsItem['ID']); if ($currMailing) { $mailings[$mailingsIdx]['CREATEDTS'] = TStoLocalTS($mailings[$mailingsIdx]['CREATEDTS']); $mailings[$mailingsIdx]['CHANGEDTS'] = TStoLocalTS($mailings[$mailingsIdx]['CHANGEDTS']); // Get assigned groups $currMailingGroups = $currMailing->getUsergroups(); $mailings[$mailingsIdx]['GROUPS'] = $currMailingGroups; // Check groups permissions (and set RWRITE to 0) if one of the groups has no RREAD $mailings[$mailingsIdx]['RWRITE'] = $currMailing->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $mailingsItem['ID'], "RREAD"); foreach ($currMailingGroups as $currMailingGroupsItem) { if (!sUsergroups()->usergroupPermissions->checkInternal(sUserMgr()->getCurrentUserID(), $currMailingGroupsItem['ID'], "RREAD")) { // NO RREAD $mailings[$mailingsIdx]['RWRITE'] = 0; } } // Get # of receipients $receipients = 0; $userIds = array(); foreach ($currMailingGroups as $currMailingGroup) {
$cb->history->add(HISTORYTYPE_CO, $item_timestamp, $lastfinalversion, 'TXT_CBLOCK_H_AUTOPUBLISH_ADDED', $item_index); break; default: case 'page': // Pages $objecttype = 'page'; $PageMgr = new PageMgr($siteID); $page = $PageMgr->getPage($objectID); $versions = $page->getVersions($objectID); $item_index = $page->scheduler->schedule($objectID, 'SCH_AUTOPUBLISH', $item_timestamp, $parameters); // Add to history $lastfinalversion = $page->getLatestApprovedVersion($objectID); $page->history->add(HISTORYTYPE_PAGE, $item_timestamp, $lastfinalversion, 'TXT_PAGE_H_AUTOPUBLISH_ADDED', $item_index); break; } for ($i = 0; $i < count($versions); $i++) { $uid = $versions[$i]['CREATEDBY']; $user = new User($uid); $uinfo = $user->get(); $uinfo['PROPS'] = $user->properties->getValues($uid); $versions[$i]['USERNAME'] = $uinfo['PROPS']['LASTNAME']; $versions[$i]['VORNAME'] = $uinfo['PROPS']['FIRSTNAME']; } $smarty->assign('userinfo', $userinfo); $smarty->assign('objecttype', $objecttype); $smarty->assign('versions', $versions); $smarty->assign('item_index', $item_index); $smarty->assign('item_version', $item_version); $smarty->assign('item_timestamp', TStoLocalTS($item_timestamp)); $smarty->assign('item_added', true); $smarty->display('file:' . $this->page_template);
$sortby = $this->request->parameters['sortby']; $show = $this->request->parameters['show']; $view = $this->request->parameters['view']; $fileId = explode('-', $ygid); $fileId = $fileId[0]; // Get timezone offset $user = new User(sUserMgr()->getCurrentUserID()); $fileMgr = sFileMgr(); $reftracker = new Reftracker(); $filelist = $fileMgr->getFilesFromFolder($fileId, $sortby, $show); for ($i = 0; $i < count($filelist); $i++) { $file = new File($filelist[$i]['OBJECTID']); $finalVersion = $file->getLatestApprovedVersion(); $file = new File($filelist[$i]['OBJECTID'], $finalVersion); $fileInfo = $file->get(); $filelist[$i]['DATETIME'] = TStoLocalTS($fileInfo['CHANGEDTS']); $filelist[$i]['NODELETE'] = !$file->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $filelist[$i]['OBJECTID'], 'RDELETE'); $filelist[$i]['NOWRITE'] = !$file->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $filelist[$i]['OBJECTID'], 'RWRITE'); $views = $file->views->getAssigned(true); $viewinfo = $file->views->getGeneratedViewInfo($views[0]["ID"]); $filelist[$i]['WIDTH'] = $viewinfo[0]["WIDTH"]; $filelist[$i]['HEIGHT'] = $viewinfo[0]["HEIGHT"]; if ($filelist[$i]['COLOR'] == 'NONE') { $filelist[$i]['COLOR'] = 'black'; } $tags = $file->tags->getAssigned(); for ($t = 0; $t < count($tags); $t++) { $tp = array(); $tp = $file->tags->tree->getParents($tags[$t]['ID']); $tp2 = array(); for ($p = 0; $p < count($tp); $p++) {
function getAdditionalFormfieldData(&$controlFormfields) { $entrymaskMgr = new Entrymasks(); $tagMgr = new Tags(); $filetypeMgr = new Filetypes(); for ($w = 0; $w < count($controlFormfields); $w++) { $controlFormfields[$w]['LVALUES'] = NULL; $controlFormfields[$w]['DISPLAYNAME'] = NULL; // Date & Datetime if ($controlFormfields[$w]['TYPE'] == 'DATE' || $controlFormfields[$w]['TYPE'] == 'DATETIME') { if ($controlFormfields[$w]['VALUE']) { $controlFormfields[$w]['VALUE'] = TStoLocalTS($controlFormfields[$w]['VALUE']); } } // Link if ($controlFormfields[$w]['TYPE'] == 'LINK') { $special_url = resolveSpecialURL($controlFormfields[$w]['URL']); if ($special_url !== false) { $special_url_info = getSpecialURLInfo($controlFormfields[$w]['VALUE01']); if ($special_url_info['TYPE'] == 'IMG' || $special_url_info['TYPE'] == 'DOWN') { $controlFormfields[$w]['IS_FILE'] = true; $file = sFileMgr()->getFile($special_url_info['ID']); $link_fileinfo = $file->get(); $controlFormfields[$w]['DISPLAYNAME'] = $link_fileinfo['NAME']; $link_filetype = $filetypeMgr->get($link_fileinfo['FILETYPE']); $controlFormfields[$w]['IDENTIFIER'] = $link_filetype['IDENTIFIER']; $controlFormfields[$w]['TYPECODE'] = $link_filetype['CODE']; $controlFormfields[$w]['COLOR'] = $link_filetype['COLOR']; $controlFormfields[$w]['FILE_ID'] = $special_url_info['ID']; } else { $pageMgr = new PageMgr($special_url_info['SITE']); $page = $pageMgr->getPage($special_url_info['ID']); $link_pageInfo = $page->get(); $controlFormfields[$w]['DISPLAYNAME'] = $link_pageInfo['NAME']; $controlFormfields[$w]['IS_INTERNAL'] = true; } } else { if (preg_match_all(sApp()->URLRegEx1, $controlFormfields[$w]['VALUE01'], $internal) > 0) { if ($internal[2][0] == 'download') { $controlFormfields[$w]['IS_FILE'] = true; $link_file = str_replace('/', '', $internal[3][0]); $file = sFileMgr()->getFile($link_file); $link_fileinfo = $file->get(); $controlFormfields[$w]['DISPLAYNAME'] = $link_fileinfo['NAME']; $link_filetype = $filetypeMgr->get($link_fileinfo['FILETYPE']); $controlFormfields[$w]['IDENTIFIER'] = $link_filetype['IDENTIFIER']; $controlFormfields[$w]['TYPECODE'] = $link_filetype['CODE']; $controlFormfields[$w]['COLOR'] = $link_filetype['COLOR']; $controlFormfields[$w]['FILE_ID'] = $link_file; } else { $link_site = $internal[3][0]; $link_page = str_replace('/', '', $internal[5][0]); $pageMgr = new PageMgr($link_site); $page = $pageMgr->getPage($link_page); $link_pageInfo = $page->get(); $controlFormfields[$w]['DISPLAYNAME'] = $link_pageInfo['NAME']; $controlFormfields[$w]['IS_INTERNAL'] = true; } } elseif (substr($controlFormfields[$w]['URL'], 0, 7) == 'mailto:') { $controlFormfields[$w]['IS_EMAIL'] = true; } else { $linkInfo = checkLinkInternalExternal($controlFormfields[$w]['URL']); switch ($linkInfo['TYPE']) { case 'external': $controlFormfields[$w]['DISPLAYNAME'] = $controlFormfields[$w]['URL']; break; case 'internal': $controlFormfields[$w]['DISPLAYNAME'] = $linkInfo['NAME']; $controlFormfields[$w]['IS_INTERNAL'] = true; break; case 'file': $controlFormfields[$w]['IS_FILE'] = true; $controlFormfields[$w]['DISPLAYNAME'] = $linkInfo['NAME']; $controlFormfields[$w]['IDENTIFIER'] = $linkInfo['INFO']['IDENTIFIER']; $controlFormfields[$w]['TYPECODE'] = $linkInfo['INFO']['CODE']; $controlFormfields[$w]['COLOR'] = $linkInfo['INFO']['COLOR']; $controlFormfields[$w]['FILE_ID'] = $linkInfo['INFO']['FILE_ID']; break; } } } } // File if ($controlFormfields[$w]['TYPE'] == 'FILE') { if (trim($controlFormfields[$w]['FILE_ID'])) { $file = sFileMgr()->getFile($controlFormfields[$w]['FILE_ID']); if ($file) { $fileInfo = $file->get(); $controlFormfields[$w]['DISPLAYNAME'] = $fileInfo['NAME']; $controlFormfields[$w]['IDENTIFIER'] = $fileInfo['IDENTIFIER']; $controlFormfields[$w]['TYPECODE'] = $fileInfo['CODE']; $controlFormfields[$w]['COLOR'] = $fileInfo['COLOR']; } } } // File if ($controlFormfields[$w]['TYPE'] == 'FILEFOLDER') { if (trim($controlFormfields[$w]['FILE_ID'])) { $file = sFileMgr()->getFile($controlFormfields[$w]['FILE_ID']); if ($file) { $fileInfo = $file->get(); $controlFormfields[$w]['DISPLAYNAME'] = $fileInfo['NAME']; } } } // Contentblock if ($controlFormfields[$w]['TYPE'] == 'CO') { if (trim($controlFormfields[$w]['CBLOCK_ID'])) { $cb = sCblockMgr()->getCblock($controlFormfields[$w]['CBLOCK_ID']); $info = $cb->get(); $controlFormfields[$w]['DISPLAYNAME'] = $info['NAME']; } } // Tag if ($controlFormfields[$w]['TYPE'] == 'TAG') { if (trim($controlFormfields[$w]['TAG_ID'])) { $info = $tagMgr->get($controlFormfields[$w]['TAG_ID']); $controlFormfields[$w]['DISPLAYNAME'] = $info['NAME']; } } // Page if ($controlFormfields[$w]['TYPE'] == 'PAGE') { if (trim($controlFormfields[$w]['SITE_ID']) && trim($controlFormfields[$w]['PAGE_ID'])) { $tmpPageMgr = new PageMgr($controlFormfields[$w]['SITE_ID']); $tmpPage = $tmpPageMgr->getPage($controlFormfields[$w]['PAGE_ID']); $info = $tmpPage->get(); $info['RWRITE'] = $tmpPage->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $controlFormfields[$w]['PAGE_ID'], "RWRITE"); $info['RDELETE'] = $tmpPage->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $controlFormfields[$w]['PAGE_ID'], "RDELETE"); $iconData = getIconForPage($info); $controlFormfields[$w]['ICON'] = $iconData['iconclass']; $controlFormfields[$w]['STYLE'] = $iconData['style']; $controlFormfields[$w]['DISPLAYNAME'] = $info['NAME']; } } // List if ($controlFormfields[$w]['TYPE'] == 'LIST') { if (trim($controlFormfields[$w]['ENTRYMASKFORMFIELD'])) { $controlFormfields[$w]['LIST_VALUES'] = $entrymaskMgr->getListValuesByLinkID($controlFormfields[$w]['ENTRYMASKFORMFIELD']); } } } }