Esempio n. 1
0
     $config = $db->selectObject($_GET['module'] . '_config', "location_data='" . serialize($loc) . "'");
     if (empty($config->location_data)) {
         $config->location_data = serialize($loc);
     }
     $form = call_user_func(array($_GET['module'] . '_config', 'form'), $config);
     if (isset($form->controls['submit'])) {
         $submit = $form->controls['submit'];
         $form->unregister('submit');
     }
     $hasConfig = 1;
     //We have a configuration stored in its own table
 }
 $container = $db->selectObject('container', "internal='" . serialize($loc) . "'");
 if ($container) {
     $values = $container->view_data != '' ? unserialize($container->view_data) : array();
     $form = expTemplate::getViewConfigForm($loc->mod, $container->view, $form, $values);
     if (isset($form->controls['submit'])) {
         // Still have a submit button.
         $submit = $form->controls['submit'];
         $form->unregister('submit');
     }
     $hasConfig = 1;
     //We have a per-view, per-container configuration stored in the container data
 }
 //FIXME PLEASE EVALUATE: since expTemplate::getViewConfigForm is called only here, is it necessary to make it add
 //the submit button to the config form just to unregister and re-register it down here?
 if ($hasConfig) {
     $form->location($loc);
     $form->meta('action', 'saveconfig');
     $form->meta('_common', '1');
 }