Exemplo n.º 1
0
 function process_confirm()
 {
     foreach ($this->admin_page->request['orphan'] as $type_id => $orphans) {
         $type_site = htmlspecialchars($this->admin_page->request['type_site_' . $type_id], ENT_QUOTES);
         $sites = $this->omi->get_types_to_sites($type_id);
         foreach ($orphans as $orphan_id => $action) {
             $orphan = new entity($orphan_id);
             if (!$orphan->get_owner()) {
                 if ($action == 'move' && isset($type_site) && array_key_exists($type_site, $sites)) {
                     if ($orphan->get_value('type') == id_of('minisite_page') && $orphan->has_relation_with_entity($orphan_id)) {
                         $this->delete_orphan_page_parent($orphan_id);
                     }
                     $this->omi->move_into_site($orphan_id, $type_id, $type_site);
                     $site = $sites[$type_site];
                     echo 'Moved orphan id ' . $orphan_id . ' into site: ' . $site->get_value('name') . '<br />';
                 } else {
                     if ($action == 'delete') {
                         $this->omi->delete_orphan($orphan_id);
                         echo 'Deleted orphan id ' . $orphan_id . '<br />';
                     }
                 }
             }
         }
     }
 }