Exemple #1
0
function gen_tree($current, $site = 1, $icons, $imgpath, &$xml_tree, &$tree_id, &$tree_level, $maxlevels, $dnd, $cms, $subnodes, $itext, $action)
{
    if ($tree_level > $maxlevels) {
        $tree_level--;
        return;
    }
    $svrload = 'false';
    if ($tree_level == (int) $maxlevels) {
        $svrload = 'true';
    }
    $oldlevel = 0;
    $urlprefix = "";
    while (list($key, $value) = each($current)) {
        if ($current[$key]["RREAD"] > 0) {
            $iconData = getIconForPage($current[$key]);
            $img = $icons[$iconData['img']];
            $cststyle = $iconData['style'];
            if ($oldlevel != $current[$key]["LEVEL"]) {
                $pnames = sPageMgr($site)->getParents($current[$key]["ID"]);
                $oldlevel = $current[$key]["LEVEL"];
                $urlprefix = "";
                $pi = count($pnames);
                while ($pi > 0) {
                    if ($pnames[$pi - 1][0]["PNAME"] != "") {
                        $urlprefix .= $pnames[$pi - 1][0]["PNAME"] . "/";
                    }
                    $pi--;
                }
            }
            $url = sApp()->webroot . $urlprefix . $current[$key]["PNAME"] . "/";
            // Add path
            if ($img == '' || img != undefined) {
                $img = $imgpath . 'icons/' . $img;
            }
            $node_svrload = 'false';
            if ($svrload == 'true' && $current[$key]['CHILDREN'] != NULL) {
                $node_svrload = $svrload;
            }
            $props = array('TREE_ID' => ++$tree_id, 'TREE_LEVEL' => $tree_level, 'ID' => 'page_' . $current[$key]["ID"], 'CAPTION' => htmlspecialchars($current[$key]["NAME"]), 'URL' => $url, 'IC' => $img, 'EXP' => 'false', 'CHK' => 'false', 'CSTSTYLE' => $cststyle, 'TARGET' => '', 'TITLE' => '', 'DND' => $dnd, 'SVRLOAD' => $node_svrload, 'YG_ID' => $current[$key]["ID"] . '-' . $site, 'YG_TYPE' => 'page', 'YG_PROPERTY' => 'name', 'PNAME' => $current[$key]["PNAME"]);
            array_push($xml_tree, array('OBJECTID' => $tree_id, 'LEVEL' => $tree_level, 'PROPS' => $props));
            if (is_array($current[$key]["CHILDREN"])) {
                $tree_level++;
                gen_tree($current[$key]["CHILDREN"], $site, $icons, $imgpath, $xml_tree, $tree_id, $tree_level, $maxlevels, $dnd, $cms, $subnodes, $itext, $action);
            }
        }
    }
    if (!$action && !$subnodes && $tree_level == 1) {
        $props = array('TREE_ID' => ++$tree_id, 'TREE_LEVEL' => $tree_level, 'ID' => 'page_trash', 'CAPTION' => htmlspecialchars($itext['TXT_TRASHCAN']), 'URL' => $url, 'IC' => $imgpath . 'icons/ico_trashcan_s.png', 'EXP' => 'false', 'CHK' => 'false', 'CSTSTYLE' => 'nodrag nodrop nosub', 'TARGET' => '', 'TITLE' => '', 'DND' => 'false', 'SVRLOAD' => 'false', 'YG_ID' => 'trash-' . $site, 'YG_TYPE' => 'page', 'YG_PROPERTY' => 'name');
        array_push($xml_tree, array('OBJECTID' => $tree_id, 'LEVEL' => $tree_level, 'PROPS' => $props));
    }
    $tree_level--;
}
$obj_id = $yg_id[0];
$siteID = $yg_id[1];
$maxlevels = 5;
switch ($yg_type) {
    case 'pages':
        sUserMgr()->impersonate(sUserMgr()->getAdministratorID());
        $icons = new Icons();
        $pageMgr = new PageMgr($siteID);
        $page = $pageMgr->getPage($obj_id);
        if ($page) {
            $base = $page->get();
            $maxlevels = $base['LEVEL'] + 2;
            $objects = $pageMgr->getList($obj_id, array('SUBNODES'), $maxlevels, $roleid);
            $objects = $pageMgr->getAdditionalTreeInfo(false, $objects);
            foreach ($objects as $objectIndex => $object_item) {
                $iconData = getIconForPage($object_item);
                $objects[$objectIndex]['ICON'] = $iconData['iconclass'];
                $objects[$objectIndex]['STYLE'] = $iconData['style'];
                $objects[$objectIndex]['SITEID'] = $siteID;
            }
        }
        sUserMgr()->unimpersonate();
        break;
    case 'cblocks':
        sUserMgr()->impersonate(sUserMgr()->getAdministratorID());
        $cb = sCblockMgr()->getCblock($obj_id);
        if ($cb) {
            $base = $cb->get();
            $maxlevels = $base['LEVEL'] + 2;
            $objects = sCblockMgr()->getList($obj_id, array('SUBNODES'), $maxlevels, $roleid);
            $objects = sCblockMgr()->getAdditionalTreeInfo(false, $objects);
                             $addToArray = false;
                         }
                     }
                     if ($addToArray) {
                         $linkedpages[$a]["SITEID"] = $sites[$i]["ID"];
                         $linkedpages[$a]["SITENAME"] = $sites[$i]["NAME"];
                         $linkedpages[$a]["PAGEID"] = $linkpageid;
                         $linkedpages[$a]["HASH"] = $sites[$i]["ID"] . '-' . $linkpageid;
                         $linkedpages[$a]["PAGENAME"] = $linkedPageInfo["NAME"];
                         $linkedpages[$a]["HASCHANGED"] = $linkedtosite[$x]["HASCHANGED"];
                         $linkedpages[$a]["PARENTS"] = $linkpageparents;
                         $linkedpages[$a]["VERSIONS"] = $pageversions;
                         $linkedPageInfo['RWRITE'] = $lPage->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $linkpageid, "RWRITE");
                         $linkedPageInfo['RDELETE'] = $lPage->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $linkpageid, "RDELETE");
                         $linkedpages[$a]['PAGEINFO'] = $linkedPageInfo;
                         $iconData = getIconForPage($linkedPageInfo);
                         $linkedpages[$a]['ICON'] = $iconData['iconclass'];
                         $linkedpages[$a]['STYLE'] = $iconData['style'];
                         $a++;
                     }
                 }
             }
         }
     }
 }
 $pagesHash = '';
 foreach ($linkedpages as $linkedpagesItem) {
     $pagesHash .= $linkedpagesItem['HASH'] . '#';
 }
 foreach ($linkedpages as $linkedpagesItem) {
     $contentblocks_blind[$idx]['PAGES'][] = $linkedpagesItem;
Exemple #4
0
 $pageDirOrderBy = $pageDirInfo['pageDirOrderBy'];
 $pageDirLimit = $pageDirInfo['pageDirLimit'];
 // END for paging
 $assignedComments = $commentsObject->getAllComments($filterArray, $pageDirLimit);
 $fileMgr = sFileMgr();
 foreach ($assignedComments as $assignedCommentIdx => $assignedComment) {
     switch ($assignedComment['OBJECTTYPE']) {
         case 'PAGE':
             $PageMgr = new PageMgr($assignedComment['SITEID']);
             $assignedComments[$assignedCommentIdx]['PARENTS'] = $PageMgr->getParents($assignedComment['OBJECTID']);
             $cPage = $PageMgr->getPage($assignedComment['OBJECTID']);
             $cPageInfo = $cPage->get();
             $cPageInfo['RWRITE'] = $cPage->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $assignedComment['OBJECTID'], "RWRITE");
             $cPageInfo['RDELETE'] = $cPage->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $assignedComment['OBJECTID'], "RDELETE");
             $assignedComments[$assignedCommentIdx]['PAGEINFO'] = $cPageInfo;
             $iconData = getIconForPage($cPageInfo);
             $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");
                         break;
                     case 'HEADLINE':
                         $tempformfield['FORMFIELD'] = 13;
                         break;
                     case 'CUTLINE':
                         $tempformfield['FORMFIELD'] = 14;
                         break;
                     case 'PAGE':
                         $tempformfield['FORMFIELD'] = 15;
                         if ($props[$c]['VALUE']['site'] && $props[$c]['VALUE']['page']) {
                             $tmpPageMgr = new PageMgr($props[$c]['VALUE']['site']);
                             $tmpPage = $tmpPageMgr->getPage($props[$c]['VALUE']['page']);
                             $info = $tmpPage->get();
                             $info['RWRITE'] = $tmpPage->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $props[$c]['VALUE']['page'], "RWRITE");
                             $info['RDELETE'] = $tmpPage->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $props[$c]['VALUE']['page'], "RDELETE");
                             $iconData = getIconForPage($info);
                             $tempformfield['ICON'] = $iconData['iconclass'];
                             $tempformfield['STYLE'] = $iconData['style'];
                             $tempformfield['DISPLAYNAME'] = $info['NAME'];
                         }
                         break;
                 }
                 $tempformfield['ENTRYMASKFORMFIELD'] = $tempformfield['FORMFIELD'];
                 array_push($tempformfields, $tempformfield);
             }
         }
         $ex['ENTRYMASKS'][0]['FORMFIELDS'] = $tempformfields;
         $output[] = $ex;
         $loop++;
     }
 }
function gen_tree($current, $site = 1, $icons, $imgpath, &$xml_tree, &$tree_id, &$tree_level, $itext, $maxlevels, $currentnode)
{
    if ($tree_level > $maxlevels) {
        $tree_level--;
        return;
    }
    $svrload = 'false';
    if ($tree_level == (int) $maxlevels) {
        $svrload = 'true';
    }
    if (is_array($currentnode['CONTENTAREAS']) && count($currentnode['CONTENTAREAS']) > 0 && $currentnode['ID'] != 1) {
        $props = array('TREE_ID' => ++$tree_id, 'TREE_LEVEL' => $tree_level, 'ID' => 'contentareacontainer_' . $currentnode['ID'], 'CAPTION' => '<i>' . ($itext['TXT_CONTENTAREAS'] != '') ? $itext['TXT_CONTENTAREAS'] : '$TXT_CONTENTAREAS' . '</i>', 'URL' => $url, 'IC' => $imgpath . '/icons/' . $icons['contentareas_small'], 'EXP' => 'false', 'CHK' => 'false', 'CSTSTYLE' => '', 'TARGET' => '', 'TITLE' => '', 'YG_ID' => $currentnode['ID'] . '-contentareacontainer', 'YG_TYPE' => 'contentareacontainer', 'YG_PROPERTY' => 'name', 'DND' => 'false', 'XTRA' => 'noclick');
        array_push($xml_tree, array('OBJECTID' => $tree_id, 'LEVEL' => $tree_level, 'PROPS' => $props));
        $tree_level++;
        foreach ($currentnode['CONTENTAREAS'] as $contentarea) {
            $props = array('TREE_ID' => ++$tree_id, 'TREE_LEVEL' => $tree_level, 'ID' => 'contentarea' . $currentnode['ID'] . '_' . $contentarea['ID'], 'CAPTION' => '<i>' . htmlspecialchars($contentarea['NAME']) . '</i>', 'URL' => $url, 'IC' => $imgpath . '/icons/' . $icons['contentarea_small'], 'EXP' => 'false', 'CHK' => 'false', 'CSTSTYLE' => '', 'TARGET' => '', 'TITLE' => '', 'YG_ID' => $contentarea['ID'] . '-contentarea' . $current[$key]['ID'], 'YG_TYPE' => 'contentarea', 'YG_PROPERTY' => 'name', 'DND' => 'false', 'XTRA' => 'noclick');
            array_push($xml_tree, array('OBJECTID' => $tree_id, 'LEVEL' => $tree_level, 'PROPS' => $props));
            foreach ($contentarea['LIST'] as $co_item) {
                if ($co_item['EMBEDDED'] != 1) {
                    $tmpCblock = sCblockMgr()->getCblock($co_item['OBJECTID']);
                    if ($tmpCblock) {
                        $cBlockInfo = $tmpCblock->get();
                        $co_item['NAME'] = $cBlockInfo['NAME'];
                    }
                    $props = array('TREE_ID' => ++$tree_id, 'TREE_LEVEL' => $tree_level, 'ID' => 'co' . $current[$key]['ID'] . '_' . $co_item['OBJECTID'] . '_' . $co_item['LINKID'], 'CAPTION' => htmlspecialchars($co_item['NAME']), 'URL' => $url, 'IC' => $imgpath . '/icons/' . $icons['cblock_small'], 'EXP' => 'false', 'CHK' => 'false', 'CSTSTYLE' => '', 'TARGET' => '', 'TITLE' => '', 'YG_ID' => $co_item['OBJECTID'] . '-cblock' . $current[$key]['ID'], 'YG_TYPE' => 'cblock', 'YG_PROPERTY' => 'name');
                    array_push($xml_tree, array('OBJECTID' => $tree_id, 'LEVEL' => $tree_level, 'PROPS' => $props));
                }
            }
        }
        $tree_level--;
    }
    while (list($key, $value) = each($current)) {
        if ($current[$key]['RREAD'] > 0) {
            $iconData = getIconForPage($current[$key]);
            $img = $icons[$iconData['img']];
            $cststyle = $iconData['style'];
            // Add path
            if ($img == '' || img != undefined) {
                $img = $imgpath . 'icons/' . $img;
            }
            $node_svrload = 'false';
            if ($svrload == 'true' && $current[$key]['CHILDREN'] != NULL) {
                $node_svrload = $svrload;
            }
            $props = array('TREE_ID' => ++$tree_id, 'TREE_LEVEL' => $tree_level, 'ID' => 'page_' . $current[$key]["ID"], 'CAPTION' => htmlspecialchars($current[$key]["NAME"]), 'URL' => $url, 'IC' => $img, 'EXP' => 'false', 'CHK' => 'false', 'CSTSTYLE' => $cststyle, 'TARGET' => '', 'TITLE' => '', 'SVRLOAD' => $node_svrload, 'YG_ID' => $current[$key]["ID"] . '-' . $site, 'YG_TYPE' => 'page', 'YG_PROPERTY' => 'name', 'XTRA' => 'noclick');
            array_push($xml_tree, array('OBJECTID' => $tree_id, 'LEVEL' => $tree_level, 'PROPS' => $props));
            if (is_array($current[$key]['CONTENTAREAS']) && count($current[$key]['CONTENTAREAS']) > 0) {
                $tree_level++;
                $props = array('TREE_ID' => ++$tree_id, 'TREE_LEVEL' => $tree_level, 'ID' => 'contentareacontainer_' . $current[$key]['ID'], 'CAPTION' => '<i>' . ($itext['TXT_CONTENTAREAS'] != '') ? $itext['TXT_CONTENTAREAS'] : '$TXT_CONTENTAREAS' . '</i>', 'URL' => $url, 'IC' => $imgpath . '/icons/' . $icons['contentareas_small'], 'EXP' => 'false', 'CHK' => 'false', 'CSTSTYLE' => '', 'TARGET' => '', 'TITLE' => '', 'YG_ID' => $current[$key]['ID'] . '-contentareacontainer', 'YG_TYPE' => 'contentareacontainer', 'YG_PROPERTY' => 'name', 'XTRA' => 'noclick');
                array_push($xml_tree, array('OBJECTID' => $tree_id, 'LEVEL' => $tree_level, 'PROPS' => $props));
                $tree_level++;
                foreach ($current[$key]['CONTENTAREAS'] as $contentarea) {
                    $props = array('TREE_ID' => ++$tree_id, 'TREE_LEVEL' => $tree_level, 'ID' => 'contentarea' . $current[$key]['ID'] . '_' . $contentarea['ID'], 'CAPTION' => '<i>' . htmlspecialchars($contentarea['NAME']) . '</i>', 'URL' => $url, 'IC' => $imgpath . '/icons/' . $icons['contentarea_small'], 'EXP' => 'false', 'CHK' => 'false', 'CSTSTYLE' => '', 'TARGET' => '', 'TITLE' => '', 'YG_ID' => $contentarea['ID'] . '-contentarea' . $current[$key]['ID'], 'YG_TYPE' => 'contentarea', 'YG_PROPERTY' => 'name', 'XTRA' => 'noclick');
                    array_push($xml_tree, array('OBJECTID' => $tree_id, 'LEVEL' => $tree_level, 'PROPS' => $props));
                    foreach ($contentarea['LIST'] as $co_item) {
                        if ($co_item['EMBEDDED'] != 1) {
                            $tmpCblock = sCblockMgr()->getCblock($co_item['OBJECTID']);
                            if ($tmpCblock) {
                                $cBlockInfo = $tmpCblock->get();
                                $co_item['NAME'] = $cBlockInfo['NAME'];
                            }
                            $props = array('TREE_ID' => ++$tree_id, 'TREE_LEVEL' => $tree_level, 'ID' => 'co' . $current[$key]['ID'] . '_' . $co_item['OBJECTID'] . '_' . $co_item['LINKID'], 'CAPTION' => htmlspecialchars($co_item['NAME']), 'URL' => $url, 'IC' => $imgpath . '/icons/' . $icons['cblock_small'], 'EXP' => 'false', 'CHK' => 'false', 'CSTSTYLE' => '', 'TARGET' => '', 'TITLE' => '', 'YG_ID' => $co_item['OBJECTID'] . '-cblock' . $current[$key]['ID'], 'YG_TYPE' => 'cblock', 'YG_PROPERTY' => 'name');
                            /*
                            											'YG_PROPERTY' => 'name',
                            											 );
                            */
                            array_push($xml_tree, array('OBJECTID' => $tree_id, 'LEVEL' => $tree_level, 'PROPS' => $props));
                        }
                    }
                }
                $tree_level--;
                $tree_level--;
            }
            if (is_array($current[$key]['CHILDREN'])) {
                $tree_level++;
                gen_tree($current[$key]['CHILDREN'], $site, $icons, $imgpath, $xml_tree, $tree_id, $tree_level, $itext, $maxlevels, $current[$key]);
            }
        }
    }
    $tree_level--;
}
Exemple #7
0
                 $history[$i]['NEWVALUE'] = '<span onmouseover="$K.yg_hoverFileHint(\'' . $target_id . '\', event);"><span style="display:inline-block;" class="filetype ' . $objectInfo['COLOR'] . '">' . $objectInfo['CODE'] . '</span> ' . "<a onclick=\"\$K.yg_openObjectDetails('" . $target_id . "', 'file', '" . $objectInfo['NAME'] . "', {color:'" . $objectInfo['COLOR'] . "',typecode:'" . $objectInfo['CODE'] . "'});\">" . $objectInfo['NAME'] . "</a></span>";
             }
         }
     } else {
         if ($internal[2][0] == 'page') {
             preg_match_all($this->URLRegEx2, $history[$i]['NEWVALUE'], $linkinfo);
             $target_type = 'PAGE';
             $oldsite = $siteID;
             if ($linkinfo[3][0] && $linkinfo[4][0]) {
                 $iPageMgr = new PageMgr($linkinfo[3][0]);
                 $iPage = $iPageMgr->getPage($linkinfo[4][0]);
                 if ($iPage) {
                     $objectInfo = $iPage->get();
                     $objectInfo['RWRITE'] = $page->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $linkinfo[4][0], "RWRITE");
                     $objectInfo['RDELETE'] = $page->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $linkinfo[4][0], "RDELETE");
                     $iconData = getIconForPage($objectInfo);
                     $history[$i]['NEWVALUE'] = '<div class="icon' . $iconData['iconclass'] . '"></div>' . "<a onclick=\"\$K.yg_openObjectDetails('" . $linkinfo[4][0] . '-' . $linkinfo[3][0] . "', 'page', '" . $objectInfo['NAME'] . "', '" . $iconData['iconclass'] . "', '" . $iconData['style'] . "');\">" . $objectInfo['NAME'] . "</a>";
                 }
             }
         } else {
             if ($internal[2][0] == 'image') {
                 $target_type = 'IMAGE';
                 $target_id = $internal[3][0];
             }
         }
     }
 } else {
     if (strpos($history[$i]['NEWVALUE'], 'mailto:') === 0) {
         $history[$i]['NEWVALUE'] = '<div class="iconemail"></div>' . str_replace('mailto:', '', $history[$i]['NEWVALUE']);
     } else {
         $linkInfo = checkLinkInternalExternal($history[$i]['NEWVALUE']);
Exemple #8
0
 $objectInfo['RWRITE'] = $page->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $object, "RWRITE");
 $objectInfo['RDELETE'] = $page->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $object, "RDELETE");
 $iconData = getIconForPage($objectInfo);
 $objectInfo['ICON'] = $iconData['iconclass'];
 $objectInfo['STYLE'] = $iconData['style'];
 $objectparents = $pageMgr->getParents($object);
 array_pop($objectparents);
 // Gather all required info from parents
 foreach ($objectparents as $objectparent_idx => $objectparent_item) {
     $tmpPage = $pageMgr->getPage($objectparent_item[0]['ID']);
     $tmpObjectinfo = $tmpPage->get();
     $objectparents[$objectparent_idx][0]['NAVIGATIONID'] = $tmpObjectinfo['NAVIGATIONID'];
     $objectparents[$objectparent_idx][0]['HASCHANGED'] = $tmpObjectinfo['HASCHANGED'];
     $objectparents[$objectparent_idx][0]['RWRITE'] = $tmpPage->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $objectparent_item[0]['ID'], "RWRITE");
     $objectparents[$objectparent_idx][0]['RDELETE'] = $tmpPage->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $objectparent_item[0]['ID'], "RDELETE");
     $iconData = getIconForPage($objectparents[$objectparent_idx][0]);
     $objectparents[$objectparent_idx][0]['ICON'] = $iconData['iconclass'];
     $objectparents[$objectparent_idx][0]['STYLE'] = $iconData['style'];
 }
 // Get page properties
 $object_properties = $pageMgr->properties->getList('LISTORDER');
 $object_permissions = array();
 $object_permissions['RWRITE'] = $page->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $object, "RWRITE");
 $object_permissions['RSTAGE'] = $page->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 = $pageMgr->getLocksByToken($lockToken);
Exemple #9
0
                             $incoming[$ic]['HASCHANGED'] = $cblockInfo['HASCHANGED'];
                             $viacnt = 0;
                             $refcohash[$cblockInfo["ID"]] = $ic;
                             $ic++;
                         } else {
                             $viacnt = count($incoming[$refcohash[$cblockInfo["ID"]]]["VIATARGETS"]);
                         }
                         if (!isset($refphash[$sites[$s]["ID"] . $linkedtosite[$p]["ID"]])) {
                             $incoming[$refcohash[$cblockInfo["ID"]]]["VIATARGETS"][$viacnt]["TARGETTYPE"] = REFTYPE_PAGE;
                             $incoming[$refcohash[$cblockInfo["ID"]]]["VIATARGETS"][$viacnt]["NAME"] = $linkedtosite[$p]["NAME"];
                             $incoming[$refcohash[$cblockInfo["ID"]]]["VIATARGETS"][$viacnt]["ID"] = $linkedtosite[$p]["PID"];
                             $incoming[$refcohash[$cblockInfo["ID"]]]["VIATARGETS"][$viacnt]["SITE"] = $sites[$s]["ID"];
                             $incoming[$refcohash[$cblockInfo["ID"]]]["VIATARGETS"][$viacnt]['PAGEINFO'] = $referredPage->get();
                             $incoming[$refcohash[$cblockInfo["ID"]]]["VIATARGETS"][$viacnt]['PAGEINFO']['RWRITE'] = $referredPage->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $linkedtosite[$p]["PID"], "RWRITE");
                             $incoming[$refcohash[$cblockInfo["ID"]]]["VIATARGETS"][$viacnt]['PAGEINFO']['RDELETE'] = $referredPage->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $linkedtosite[$p]["PID"], "RDELETE");
                             $iconData = getIconForPage($incoming[$refcohash[$cblockInfo["ID"]]]["VIATARGETS"][$viacnt]['PAGEINFO']);
                             $incoming[$refcohash[$cblockInfo["ID"]]]["VIATARGETS"][$viacnt]['ICON'] = $iconData['iconclass'];
                             $incoming[$refcohash[$cblockInfo["ID"]]]["VIATARGETS"][$viacnt]['STYLE'] = $iconData['style'];
                             $incoming[$refcohash[$cblockInfo["ID"]]]["VIATARGETS"][$viacnt]['HASCHANGED'] = $incoming[$refcohash[$cblockInfo["ID"]]]["VIATARGETS"][$viacnt]['PAGEINFO']['HASCHANGED'];
                             $lPageMgr = new PageMgr($sites[$s]["ID"]);
                             $pr = $lPageMgr->getParents($linkedtosite[$p]["ID"]);
                             $pr[count($pr) - 1][0]['NAME'] = $siteMgr->getname($sites[$s]["ID"]);
                             $incoming[$refcohash[$cblockInfo["ID"]]]["VIATARGETS"][$viacnt]["PARENTS"] = $pr;
                             $refphash[$sites[$s]["ID"] . $linkedtosite[$p]["ID"]] = $p;
                         }
                     }
                 }
             }
         }
     }
 }
Exemple #10
0
            $iconData = getIconForPage($tmpPageInfo);
            $pages[$curr_idx]['ICON'] = $iconData['iconclass'];
            $pages[$curr_idx]['STYLE'] = $iconData['style'];
            $pages[$curr_idx]['HASCHANGED'] = $tmpPageInfo['HASCHANGED'];
        }
        $all_pages = array_merge($all_pages, $pages);
    }
}
$all_mailings = array();
$mailings = sMailingMgr()->getMailingsByTemplate($template);
if (count($mailings) > 0) {
    foreach ($mailings as $curr_idx => $curr_mailing) {
        $tmpMailing = sMailingMgr()->getMailing($curr_mailing['ID']);
        $tmpMailingInfo = $tmpMailing->get();
        $tmpMailingInfo['RWRITE'] = $tmpMailing->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $curr_mailing['ID'], "RWRITE");
        $tmpMailingInfo['RDELETE'] = $tmpMailing->permissions->checkInternal(sUserMgr()->getCurrentUserID(), $curr_mailing['ID'], "RDELETE");
        $mailings[$curr_idx]['PAGEINFO'] = $tmpMailingInfo;
        $iconData = getIconForPage($tmpMailingInfo);
        $mailings[$curr_idx]['ICON'] = 'mailing';
        if ($tmpMailingInfo['HASCHANGED']) {
            $mailings[$curr_idx]['STYLE'] = 'changed';
        }
        $mailings[$curr_idx]['HASCHANGED'] = $tmpMailingInfo['HASCHANGED'];
    }
    $all_mailings = array_merge($all_mailings, $mailings);
}
$smarty->assign("all_pages", $all_pages);
$smarty->assign("all_mailings", $all_mailings);
$smarty->assign("refresh", $refresh);
$smarty->assign("win_no", $this->request->parameters['win_no']);
$smarty->display('file:' . $this->page_template);
Exemple #11
0
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']);
            }
        }
    }
}