/**
  * Update config for given values
  * @param array $vals.  An array of values (presumably from $_POST) to update magic data from
  * @returns  true on sucess
  */
 public function processValues($vals)
 {
     if (array_key_exists('check_bad_percent', $vals) && is_scalar($c = $vals['check_bad_percent'])) {
         $this->setField('check_bad_percent', $c ? 1 : 0);
     }
     return parent::processValues($vals);
 }
 public function getChildType($child)
 {
     if ($child == 'reporting_functions') {
         return 'FormRelationship_ReportingFunctions';
     }
     return parent::getChildType();
 }
 /**
  * Update config for given values
  * @param array $vals.  An array of values (presumably from $_POST) to update magic data from
  * @returns  true on sucess
  */
 public function processValues($vals)
 {
     if (array_key_exists('unique', $vals) && is_scalar($un = $vals['unique'])) {
         $this->setField('unique', $un ? 1 : 0);
     }
     return parent::processValues($vals);
 }
 protected function getChildType($child)
 {
     if ($child == 'orders') {
         return 'MAPPED_orders';
     }
     return parent::getChildType();
 }
 protected function getChildType($child)
 {
     if ($child == 'display_args' || $child == 'sort_fields') {
         return 'ListClass_Meta_List_field_sorter';
     }
     return parent::getChildType($child);
 }
 protected function getChildType($child)
 {
     if (in_array($child, $this->getFormNames())) {
         return 'PageXMLRelationship_Form';
     }
     return parent::getChildType($child);
 }
예제 #7
0
 protected function getChildType($child)
 {
     if ($child == 'args') {
         return $this->getArgsHandler();
     }
     return parent::getChildType($child);
 }
 /**
  * Update config for given values
  * @param array $vals.  An array of values (presumably from $_POST) to update magic data from
  * @returns  true on sucess
  */
 public function processValues($vals)
 {
     if (array_key_exists('max_size_kb', $vals) && is_scalar($v = strval($vals['max_size_kb'])) && (ctype_digit($v) || $v === '')) {
         $this->setField('max_size_kb', $v);
     }
     return parent::processValues($vals);
 }
 /**
  * Update config for given values
  * @param array $vals.  An array of values (presumably from $_POST) to update magic data from
  * @returns  true on sucess
  */
 public function processValues($vals)
 {
     I2CE::raiseError(print_r($vals, true));
     if (!parent::processValues($vals)) {
         return false;
     }
     if (array_key_exists('val', $vals) && is_array($vals['val'])) {
         foreach ($vals['val'] as $key => $val) {
             if (!is_scalar($val) || !I2CE_MagicDataNode::checkKey($key)) {
                 continue;
             }
             $this->setTranslatableField($key, $val);
         }
     }
     if (array_key_exists('do_new', $vals) && array_key_exists('new_key', $vals) && array_key_exists('new_val', $vals) && $vals['do_new'] && is_scalar($key = $vals['new_key']) && is_scalar($val = $vals['new_val']) && I2CE_MagicDataNode::checkKey($key) && !in_array($key, $this->storage->getKeys())) {
         $this->setTranslatableField($key, $val);
     }
     if (array_key_exists('delete', $vals) && is_array($vals['delete'])) {
         foreach ($vals['delete'] as $key => $selected) {
             if (!$selected || !is_scalar($val) || !I2CE_MagicDataNode::checkKey($key) || !($mdNode = $this->storage->traverse($key, false, false)) instanceof I2CE_MagicDataNode) {
                 continue;
             }
             $mdNode->erase();
         }
     }
     return true;
 }
예제 #10
0
 public function getChildType($child)
 {
     if ($child = 'operand') {
         return 'Where_Operands';
     }
     return parent::getChildType($child);
 }
 protected function getChildType($child)
 {
     if ($child == 'child_form_data') {
         return 'Form_child_form_data_displays';
     } else {
         return parent::getChildType($child);
     }
 }
 protected function getChildType($child)
 {
     if (in_array($child, array('module', 'static'))) {
         return 'ENUM_method_' . $child;
     } else {
         return parent::getChildType($child);
     }
 }
 protected function getChildType($child)
 {
     if ($child == 'display') {
         return 'REFERENCE_displays';
     } else {
         return parent::getChildType($child);
     }
 }
예제 #14
0
 protected function getChildType($child)
 {
     if ($child == 'lists') {
         return 'SVS_Lists';
     } else {
         return parent::getChildType($child);
     }
 }
 protected function getChildType($child)
 {
     $handlers = array();
     if (!is_array($data = I2CE::getConfig()->getAsArray('/modules/form-builder/storage_handlers/' . $child)) || !array_key_exists('swiss', $data) || !is_scalar($swiss = $data['swiss'])) {
         return parent::getChildType($child);
     }
     return $swiss;
 }
예제 #16
0
 /**
  * Constructor
  * @param I2CE_MagicDataNode the storage for this swiss 
  */
 public function __construct($storage, $factory, $name = null, $parent = null)
 {
     parent::__construct($storage, $factory, $name, $parent);
     if ($this->storage->is_indeterminate()) {
         $this->storage->set_parent();
     }
     //$this->storage->resolution; //access the child resolution to make sure that this gets created as a parent
 }
 /**
  * Update config for given values
  * @param array $vals.  An array of values (presumably from $_POST) to update magic data from
  * @returns  true on sucess
  */
 public function processValues($vals)
 {
     foreach (self::$int_keys as $k) {
         if (array_key_exists($k, $vals) && ctype_digit($v = strval($vals[$k]))) {
             $this->setField($k, $v);
         }
     }
     return parent::processValues($vals);
 }
 /**
  * Get the swiss child type
  * @param string $child
  * @returns string
  */
 public function getChildType($child)
 {
     switch ($child) {
         case 'xslts':
             return 'XSLTS';
         default:
             return parent::getChildType($child);
     }
 }
 protected function getChildType($child)
 {
     if (in_array($child, self::$childNames)) {
         return 'MAP_' . $child . '_forms';
     }
     if ($child == 'reportSelect') {
         return 'MAP_reportSelect';
     }
     return parent::getChildType($child);
 }
 protected function getChildType($child)
 {
     if ($child == 'limits') {
         return 'child_form_data_where';
     } else {
         if ($child == 'order') {
             return 'child_form_data_order';
         } else {
             return parent::getChildType($child);
         }
     }
 }
 protected function getChildType($child)
 {
     // If the child type is printf_args, return a Printf object
     if ($child == 'printf_args') {
         return 'PageFormAutoView_ChildForm_Printf';
     }
     // If the child type is action_links then return an ActionLinks object
     if ($child == 'action_links') {
         return 'PageFormAutoView_ActionLinks';
     }
     return parent::getChildType($child);
 }
 /**
  * Update config for given values
  * @param array $vals.  An array of values (presumably from $_POST) to update magic data from
  * @returns  true on sucess
  */
 public function processValues($vals)
 {
     foreach (array_keys(self::$bool_keys) as $k) {
         if (array_key_exists($k, $vals) && is_scalar($vals[$k])) {
             $this->setField($k, $k ? 1 : 0);
         }
     }
     if (array_key_exists('key_sort', $vals) && is_scalar($sort = $vals['key_sort']) && in_array($sort, self::$allowed_sorts)) {
         $this->setField('key_sort', $sort);
     }
     return parent::processValues($vals);
 }
예제 #23
0
 protected function getChildType($child)
 {
     if ($child == 'meta') {
         return 'SVS_Meta';
     } else {
         if ($child == 'where') {
             return 'SVS_Where';
         } else {
             return parent::getChildType($child);
         }
     }
 }
예제 #24
0
 protected function getChildType($child)
 {
     if ($child == 'meta') {
         return 'Form_meta';
     } else {
         if ($child == 'storage_options') {
             return 'Form_storage_options';
         } else {
             return parent::getChildType($child);
         }
     }
 }
 protected function getChildType($child)
 {
     if ($child == 'headers') {
         return 'FormField_Headers';
     } else {
         if ($child == 'meta' && $this->hasMeta()) {
             return $this->metaSwiss();
         } else {
             return parent::getChildType($child);
         }
     }
 }
 protected function getChildType($child)
 {
     if ($child == 'forms') {
         return 'FormBuilder';
     } else {
         if ($child == 'formClasses') {
             return 'FormClassBuilder';
         } else {
             return parent::getChildType($child);
         }
     }
 }
 public function processValues($vals)
 {
     if (!parent::processValues($vals)) {
         return false;
     }
     $fieldnames = $this->getFieldNames();
     if (array_key_exists('required', $vals) && is_array($vals['required'])) {
         $required_fields = array();
         foreach ($vals['required'] as $field => $required) {
             if (!$required || !in_array($field, $fieldnames)) {
                 continue;
             }
             $required_fields[] = $field;
         }
         $this->storage->eraseChildren();
         $this->storage->setValue($required_fields);
     }
     return true;
 }
 public function initializeDisplay($action)
 {
     parent::initializeDisplay($action);
     $module_factory = I2CE_ModuleFactory::instance();
     $this->template->addHeaderLink('FormRelationship.css');
     $this->template->addHeaderLink('mootools-core.js');
     $this->template->addHeaderLink('mootools-more.js');
     $this->template->addHeaderLink('select_update.js');
     if ($module_factory->isEnabled("web-services-lists")) {
         $this->template->addHeaderLink('I2CE_AjaxList.js');
     }
     return true;
 }
 /**
  * Update config for given values
  * @param array $vals.  An array of values (presumably from $_POST) to update magic data from
  * @returns  true on sucess
  */
 public function processValues($vals)
 {
     if (array_key_exists('hook', $vals) && is_scalar($h = $vals['hook'])) {
         $this->setField('hook', $h);
     }
     if (array_key_exists('data', $vals) && is_array($vals['data'])) {
         foreach ($vals['data'] as $key => $val) {
             if (!I2CE_MagicDataNode::checkKey($key) || !is_scalar($val)) {
                 continue;
             }
             if ($val === '') {
                 if (($md = $this->storage->traverse("data/{$key}", false, false)) instanceof I2CE_MagicDataNode) {
                     I2CE::raiseError("Erasing");
                     $md->erase();
                 }
             } else {
                 if ($this->storage->is_scalar("data/{$key}") || $val) {
                     //either key was already set and we are ovewriting it, or we are adding a new key with a set value
                     $this->storage->data->{$key} = $val;
                 }
             }
         }
     }
     return parent::processValues($vals);
 }
 protected function getChildType($child)
 {
     // If the child is child_forms return a ChildForms object
     if ($child == 'child_forms') {
         return 'PageFormAutoView_ChildForms';
     }
     // If the child is action_links return an ActionLinks object
     if ($child == 'action_links') {
         return 'PageFormAutoView_ActionLinks';
     }
     // If not either type of child, call I2CE_Swiss->getChildType() to determine the child type
     return parent::getChildType($child);
 }