Ejemplo n.º 1
0
<?php

//print_r($_POST);
$templateids = array($_POST['id']);
//print_r($templateids);
$btc = new blox_Template_Collection($templateids, $this);
//$settingslist=array('blox_template','ditto_hiddenfields','xedit_tabs');
$settingFields = explode(',', $this->container['params']['template_SettingFields']);
//print_r($settingFields);
if (count($settingFields) > 0) {
    foreach ($settingFields as $settingField) {
        $settingField = explode(':', $settingField);
        //$bcc->setSetting($_POST['name'],$settingname,$_POST[$settingname]);
        $btc->settings[$_POST['id']][$settingField[0]] = $_POST[$settingField[0]];
    }
    //print_r($btc->settings);
    $btc->saveSettings();
}
//$modx->db-pinsert();
Ejemplo n.º 2
0
 function getChunkContainers($docid, $containerNames = array())
 {
     global $modx;
     if (!count($containerNames) > 0) {
         $doc = $modx->getPageInfo($docid, 0, 'template');
         $templateid = $doc['template'];
         $templateids = explode(',', $templateid);
         $btc = new blox_Template_Collection($templateids, $this);
         $containerNames = $btc->getContainerNames($templateid);
     }
     /*
     	print_r($containerNames);
     $dTv_ids = $this->getContainerTVids($docid);
     $tmplvars = $modx->getTemplateVars(array_flip($dTv_ids), $fields = "*", $docid);
     */
     $childids = $this->getChildrenIds($docid);
     $childtitles = array_flip($childids);
     $chunkContainers = array();
     if (count($containerNames) > 0) {
         foreach ($containerNames as $containerName) {
             //echo $tmplvar['caption'];
             if (isset($childids[$containerName])) {
                 $parentid = $childids[$containerName];
                 $childrenoutput = $this->getChildChunks($parentid);
             } else {
                 $parentid = 'new';
             }
             $container = array();
             $container['value'] = $childrenoutput;
             $container['name'] = $containerName;
             $container['caption'] = $containerName;
             $chunkContainers[$containerName] = $container;
         }
     }
     $this->chunkContainers = $chunkContainers;
     //print_r ($this->chunkContainers);
     return;
 }