// fp> we basically need to add a "move" action. /* class Controler { method get_params() // and init object method do_action() method display_payload() } the $AdminUI->foo() structural calls would move to the dispatcher. */ // fp> TODO: find 4 other cases before refactoring this way. (fp) param('action', 'string', 'list'); // Init fadeout result array: $result_fadeout = array(); if (param($ChapterCache->dbIDname, 'integer', NULL, true, false, false)) { if (($edited_Chapter =& $ChapterCache->get_by_ID(${$ChapterCache->dbIDname}, false, true, $subset_ID)) === false) { // We could not find the element to edit: unset($edited_Chapter); $Messages->add(sprintf(T_('Requested «%s» object does not exist any longer.'), T_('Category')), 'error'); $action = 'nil'; } } if (!is_null(param($ChapterCache->dbprefix . 'parent_ID', 'integer', NULL))) { $edited_parent_Chapter =& $ChapterCache->get_by_ID(${$ChapterCache->dbprefix . 'parent_ID'}, false, true, $subset_ID); if ($edited_parent_Chapter === false) { // Parent chapter doesn't exist any longer. unset($ChapterCache->dbIDname); $Messages->add(sprintf(T_('Requested «%s» object does not exist any longer.'), T_('Category')), 'error'); $action = 'nil'; } }
// fp> we basically need to add a "move" action. /* class Controler { method get_params() // and init object method do_action() method display_payload() } the $AdminUI->foo() structural calls would move to the dispatcher. */ // fp> TODO: find 4 other cases before refactoring this way. (fp) param('action', 'string', 'list'); // Init fadeout result array: $result_fadeout = array(); if (param($GenericCategoryCache->dbIDname, 'integer', NULL, true, false, false)) { if (($edited_GenericCategory =& $GenericCategoryCache->get_by_ID(${$GenericCategoryCache->dbIDname}, false, true, $subset_ID)) === false) { // We could not find the element to edit: unset($edited_GenericCategory); $Messages->add(sprintf(T_('Requested «%s» object does not exist any longer.'), T_('Category')), 'error'); $action = 'nil'; } } if (!is_null(param($GenericCategoryCache->dbprefix . 'parent_ID', 'integer', NULL))) { $edited_parent_GenericElement =& $GenericCategoryCache->get_by_ID(${$GenericCategoryCache->dbprefix . 'parent_ID'}, false, true, $subset_ID); if ($edited_parent_GenericElement === false) { // Parent generic category doesn't exist any longer. unset($GenericCategoryCache->dbIDname); $Messages->add(sprintf(T_('Requested «%s» object does not exist any longer.'), T_('Category')), 'error'); $action = 'nil'; } }