Пример #1
0
                                    $control = true;
                                }
                            }
                        }
                    }
                }
                if (!$control) {
                    // es contenido
                    if (strlen(strstr($key, 'termino_')) > 0 == false && $post != '') {
                        $contenido->{$key} = $post;
                    } else {
                        if (strlen(strstr($key, 'termino_')) > 0) {
                            list($broza, $id_taxonomia) = explode('termino_', $key);
                            array_push($lista_terminos, $id_taxonomia);
                        } else {
                            header('Location: nuevo.php?tipo=' . $_GET['tipo'] . '&exito=error');
                            exit;
                        }
                    }
                }
            }
        }
        //    var_dump($contenido);
        //    var_dump($obj_campos_extra);
        $res = $contenido_controller->insertar_contenido($contenido, $obj_campos_extra, $lista_terminos);
        $url = $res ? 'todos.php?tipo=' . $_GET['tipo'] . '&exito=ok' : 'todos.php?tipo=' . $_GET['tipo'] . '&exito=error';
        header('Location:' . $url);
    } else {
        header('Location: nuevo.php?tipo=' . $_GET['tipo'] . '&exito=error');
    }
}