$myUrl = substr($myUrl, 0, strpos($myUrl, 'wp-content') + 11); if (!defined('CONTENTPATH')) { define('CONTENTPATH', $myPath); } if (!defined('CONTENTURL')) { define('CONTENTURL', $myUrl); } $accion = isset($_POST['accion']) ? $_POST['accion'] : NULL; $idDocumento = isset($_POST['docId']) ? $_POST['docId'] : NULL; include_once WP_CONTENT_DIR . "/themes/twentyeleven-child/mpdf/mpdf.php"; $documento = Datos::getDocumentoData($idDocumento); if ($documento === false) { echo 'ERROR AL OBTENER DATOS DEL DOCUMENTO!!!<br/>'; } // Hallamos las páginas $tPaginas = Datos::getPaginas($idDocumento); // Lo metemos en un temporal para ordenar después if ($paginas === false) { echo '<div class="panel-error">Error al obtener las paacute;ginas del documento ' . $idDocumento . '</div>'; } if (!is_array($tPaginas)) { echo '<div class="panel-alert">No hay páginas para el documento ' . $idDocumento . '</div>'; } else { $portada = NULL; $contraportada = NULL; $paginas = NULL; foreach ($tPaginas as $pagina) { switch ($pagina['tipo']) { case 'portada': $portada = $pagina; break;