Пример #1
0
}
if ($this->request->parameters['displaymode'] != '') {
    $smarty->assign("displaymode", $this->request->parameters['displaymode']);
}
$smarty->assign('extensiondir', $this->extensiondir);
if ($siteID == 'dummy' && $pageID == 'dummy') {
    // Entrymask Preview Mode
    $entrymaskMgr = new Entrymasks();
    $co_id = $this->request->parameters['co'];
    $co_info = $entrymaskMgr->get($co_id);
    if (!$co_info['FOLDER']) {
        $cos = array();
        $cos[0]['CONTENTAREA'] = 'dummy';
        $cos[0]['OBJECTID'] = 'dummy' . $co_id;
        $cos[0]['EMBEDDED'] = 1;
        $cos[0]['ENTRYMASKS'][0]['FORMFIELDS'] = $entrymaskMgr->getEntrymaskFormfields($co_id);
        $cos[0]['ENTRYMASKS'][0]['ENTRYMASKNAME'] = $co_info['NAME'];
        foreach ($cos[0]['ENTRYMASKS'][0]['FORMFIELDS'] as $formfield_idx => $formfield) {
            if ($formfield['FORMFIELD'] == 9) {
                $cos[0]['ENTRYMASKS'][0]['FORMFIELDS'][$formfield_idx]['LVALUES'] = $entrymaskMgr->getListValuesByLinkID($formfield['ID']);
            }
        }
    }
    $output = $cos;
    $smarty->assign('dummymode', true);
} elseif ($siteID == 'cblock' && $pageID == 'cblock') {
    // Contentblock Preview Mode
    $co_id = $this->request->parameters['co'];
    if ($co_id) {
        $cb = sCblockMgr()->getCblock($co_id);
        $co = $cb->get();
Пример #2
0
<?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);
Пример #3
0
 if (!is_array($formfield_indexes) && isset($formfield_indexes)) {
     $formfield_indexes = array($formfield_indexes);
 }
 $name = $this->params['name'];
 $code = $this->params['code'];
 // Set the new name
 if ($entrymaskMgr->setInfo($objectID, $name, $code) === false) {
     $koala->callJSFunction('Koala.yg_error', 'entrymask', $objectID . '-entrymask', 'code');
     $haderror = true;
 } else {
     $jsQueue->add($objectID, HISTORYTYPE_ENTRYMASK, 'UNHIGHLIGHT_ENTRYMASK', sGuiUS(), 'code');
     $jsQueue->add($objectID, HISTORYTYPE_ENTRYMASK, 'OBJECT_CHANGE', sGuiUS(), 'entrymask', NULL, NULL, $objectID . '-entrymask', 'name', $name);
 }
 if (!$haderror) {
     // Check which formfields to delete
     $old_formfields = $entrymaskMgr->getEntrymaskFormfields($objectID);
     $to_del = array();
     foreach ($old_formfields as $old_formfield) {
         $del = true;
         foreach ($formfields as $formfield) {
             if ($formfield == $old_formfield['ID']) {
                 $del = false;
             }
         }
         if ($del) {
             array_push($to_del, $old_formfield['ID']);
         }
     }
     foreach ($to_del as $to_del_item) {
         $entrymaskMgr->removeFormfield($to_del_item);
     }