protected function postProcessOptions($options)
 {
     if (!array_key_exists('form', $options) || !$this->primaryObject instanceof I2CE_Form) {
         return $options;
     }
     if (!$options['mapped_field']) {
         $options['mapped_field'] = $this->primaryObject->getName();
     }
     $where = array('operator' => 'FIELD_LIMIT', 'field' => $options['mapped_field'], 'style' => 'equals', 'data' => array('value' => $this->primaryObject->getNameId()));
     if (count($options['where']) > 0) {
         $options['where'] = array('operator' => 'AND', 'operand' => array(0 => $where, 1 => $options['where']));
     } else {
         $options['where'] = $where;
     }
     $is_list = ($formClass = I2CE_FormFactory::instance()->getClassName($options['form'])) && I2CE_List::isList($formClass);
     if (count($options['orders']) == 0 && $is_list) {
         $options['orders'] = I2CE_List::getSortFields($options['form']);
     }
     if (count($options['printf_args']) == 0 || !$options['printf']) {
         if ($is_list) {
             $options['printf_args'] = I2CE_List::getDisplayFields($options['form'], $options['style']);
             $options['printf'] = I2CE_List::getDisplayString($options['form'], $options['style']);
         }
     }
     if (!$options['link']) {
         if ($this->page->module() == 'I2CE') {
             $url = $this->page->page() . '/' . implode('/', $this->page->request_remainder());
         } else {
             $url = $this->page->module() . '/' . $this->page->page() . '/' . implode('/', $this->page->request_remainder());
         }
         $options['link'] = $url . "?type=" . $options['form'] . "&id=";
     }
     if (is_scalar($options['link_field'])) {
         $options['link_field'] = explode(':', $options['link_field']);
     }
     return $options;
 }
Ejemplo n.º 2
0
 protected function getRemapAllLink($listConfig)
 {
     if ($this->user->getRole() != 'admin') {
         return false;
     }
     $form = false;
     if (array_key_exists('form', $listConfig) && is_scalar($listConfig['form'])) {
         $form = $listConfig['form'];
     }
     $ff = I2CE_FormFactory::instance();
     $formClass = $ff->getClassName($form);
     if (!$formClass || !I2CE_List::isList($formClass)) {
         return false;
     }
     return 'index.php/auto_list_remap?id=' . $form . '|*';
 }