Ejemplo n.º 1
0
    $form_name = $this->modx->getOption('formName', $scriptProperties, '');
    $criteria = array('name' => $form_name);
}
// $modx->log(modX::LOG_LEVEL_ERROR,'[RAD-UI->getRadForm] Build Criteria ' );
// get form db object
$radForm = $modx->getObject('RadForm', $criteria);
// $radForm->get('id');
if (!is_object($radForm)) {
    $modx->log(modX::LOG_LEVEL_ERROR, '[RAD-UI->getRadForm] Could not find the form ' . print_r($criteria, TRUE));
    return 'The form was not found';
}
// get all existing form elements:
$elements = '';
// put the form elements into an array
require_once $modx->RadUi->getConfig('raduiPath') . 'matericalizedpaths.class.php';
$paths = new MaterializedPaths($modx, $config = array());
//$paths->buildTree(array('form_id' => $item->get('form_id') ) );
// $this->modx->log(modX::LOG_LEVEL_ERROR,'[RAD-UI->EasyForms()->loadElements] Branch: '.$branch_id);
if ($branch_id == 0) {
    $elements = $paths->getTree(array('form_id' => $radForm->get('id')));
} else {
    $elements = $paths->getBranch($branch_id, array('form_id' => $radForm->get('id')));
}
$output = '';
$x = 0;
function arrayString($str)
{
    // from JSON string to array:
    if (is_string($str)) {
        $array = json_decode($str);
    } else {
Ejemplo n.º 2
0
 /**
  * Update Dependants, children, parents, ect..  
  * @Override this method is meant to be overridden 
  * @param (object) $item
  * @return Boolean
  */
 public function updateDependants($item)
 {
     require_once $this->modx->radui->getConfig('raduiPath') . 'matericalizedpaths.class.php';
     $paths = new MaterializedPaths($this->modx, $config = array());
     $paths->buildTree(array('form_id' => $item->get('form_id')));
     return TRUE;
 }