/** * Display the fill workspace form and process its input. */ function method_fill() { $this->foowd->track('foowd_workspace->method_fill'); include_once INPUT_DIR . 'input.form.php'; include_once INPUT_DIR . 'input.dropdown.php'; include_once INPUT_DIR . 'input.textbox.php'; $limitForm = new input_form('limitForm', NULL, SQ_POST, _("Limit Selection"), NULL); $limitSelect = new input_dropdown('limitSelect', NULL, getFoowdClassNames(), _("Class Types") . ':', 6, TRUE); $beforeDay = new input_textbox('beforeDay', '/^[1-3]?[0-9]$/', NULL, NULL, 2, 2, NULL, FALSE); $beforeMonth = new input_textbox('beforeMonth', '/^[0|1]?[0-9]$/', NULL, NULL, 2, 2, NULL, FALSE); $beforeYear = new input_textbox('beforeYear', '/^[1|2][0-9]{3}$/', NULL, NULL, 4, 4, NULL, FALSE); $afterDay = new input_textbox('afterDay', '/^[1-3]?[0-9]$/', NULL, NULL, 2, 2, NULL, FALSE); $afterMonth = new input_textbox('afterMonth', '/^[0|1]?[0-9]$/', NULL, NULL, 2, 2, NULL, FALSE); $afterYear = new input_textbox('afterYear', '/^[1|2][0-9]{3}$/', NULL, NULL, 4, 4, NULL, FALSE); $objects =& $this->getFillObjects($limitSelect->value, $beforeDay->value, $beforeMonth->value, $beforeYear->value, $afterDay->value, $afterMonth->value, $afterYear->value); $items = $this->getFillSelectionItems($objects); $objectForm = new input_form('objectForm', NULL, SQ_POST, _("Clone Objects"), NULL); $objectForm->addSubmitButton('moveObjects', _("Move Objects")); $objectSelect = new input_dropdown('objectSelect', NULL, $items, _("Select Objects") . ':', 10, TRUE); $result = $this->fillWorkspace($objects, $objectSelect->value, $objectForm->submitted(), $objectForm->otherSubmitted('moveObjects')); switch ($result) { case 0: // cloned successfully // cloned successfully case 1: // moved successfully $this->foowd->template->assign('success', TRUE); $this->foowd->template->assign('objectid', $this->objectid); break; case 2: // nothing selected to clone/move $this->foowd->template->assign('success', FALSE); $this->foowd->template->assign('error', 2); break; case 3: // display forms $this->foowd->template->assign_by_ref('limit_select', $limitSelect); $limitForm->addObject($beforeDay); $limitForm->addObject($beforeMonth); $limitForm->addObject($beforeYear); $limitForm->addObject($afterDay); $limitForm->addObject($afterMonth); $limitForm->addObject($afterYear); $this->foowd->template->assign_by_ref('limit_form', $limitForm); if ($items == NULL) { $this->foowd->template->assign('success', FALSE); $this->foowd->template->assign('error', 3); } else { $objectForm->addObject($objectSelect); $this->foowd->template->assign_by_ref('object_form', $objectForm); } break; } $this->foowd->track(); }
* </pre> * * @package smdoc * @subpackage extern */ /** * Initial configuration, start session * @see config.default.php */ require 'smdoc_init.php'; /* * Initialize smdoc/FOOWD environment */ $foowd = new smdoc($smdoc_parameters); $class_list = array(); $classes = getFoowdClassNames(); foreach ($classes as $classid => $className) { if ($foowd->hasPermission($className, 'create', 'class') && strpos($className, 'user') === false) { $class_list[$className] = getClassDescription($classid); } } $foowd->template->assign('title', _("Create New Resource")); $foowd->template->assign('method', ''); $foowd->template->assign_by_ref('classlist', $class_list); $foowd->template->assign('body_template', 'smdoc_external.create.tpl'); $foowd->template->display(); /* * destroy Foowd - triggers cleanup of database object and * display of debug information. */ $foowd->__destruct();