public function testRenderWithNestedFormattedText()
 {
     $cite = Cite::create()->appendText(Bold::create()->appendText('Some ')->appendText(Italic::create()->appendText('nested formatting'))->appendText('.'));
     $expected = '<cite>' . '<b>Some <i>nested formatting</i>.</b>' . '</cite>';
     $rendered = $cite->render();
     $this->assertEquals($expected, $rendered);
 }
 public function getDatosCite($idCite)
 {
     $sql = "SELECT ci.id, ci.cite, ci.fecha, ci.idtipocite, ci.idfuncionario\n\t\t\t\tFROM cite ci \n                where ci.id=" . $idCite;
     $this->conexionDB();
     $consulta = $this->ejecutarConsulta($sql);
     if ($this->filasAfectadas($consulta) > 0) {
         $cite = new Cite();
         while ($listadatos = $this->listaDatos($consulta)) {
             $cite->setId($listadatos["id"]);
             $cite->setCite($listadatos["cite"]);
             $cite->setFecha($listadatos["fecha"]);
             $cite->setIdTipoCite($listadatos["idtipocite"]);
             $cite->setIdFuncionario($listadatos["idfuncionario"]);
         }
         return $cite;
     } else {
         return null;
     }
     $this->desconexionDB();
 }
 public function testInitWithConstructorData()
 {
     $cite = new Cite();
     $this->assertEquals('', $cite->getAuthor());
     $this->assertEquals('', $cite->getText());
     $this->assertEquals('', $cite->getTitle());
     $cite = new Cite(array('author' => '  Foo  Bar  ', 'text' => "  A \tstring with\nlinebreaks.   ", 'title' => 'A Title'));
     $this->assertEquals('Foo Bar', $cite->getAuthor());
     $this->assertEquals('A string with linebreaks.', $cite->getText());
     $this->assertEquals('A Title', $cite->getTitle());
     $data = new stdClass();
     $data->author = '  Foo  Bar  ';
     $data->text = "  A \tstring with\nlinebreaks.   ";
     $cite = new Cite($data);
     $this->assertEquals('Foo Bar', $cite->getAuthor());
     $this->assertEquals('A string with linebreaks.', $cite->getText());
     $this->assertEquals('', $cite->getTitle());
 }
Esempio n. 4
0
/**
 * Performs the hook registration.
 * Note that several extensions (and even core!) try to detect if Cite is
 * installed by looking for wfCite().
 *
 * @param $parser Parser
 *
 * @return bool
 */
function wfCite($parser)
{
    return Cite::setHooks($parser);
}
Esempio n. 5
0
 /**
  * Initialize the parser hooks
  *
  * @param $parser Parser
  *
  * @return bool
  */
 static function setHooks($parser)
 {
     global $wgHooks;
     $parser->extCite = new self();
     if (!Cite::$hooksInstalled) {
         $wgHooks['ParserClearState'][] = array($parser->extCite, 'clearState');
         $wgHooks['ParserAfterParse'][] = array($parser->extCite, 'checkRefsNoReferences', true);
         $wgHooks['ParserBeforeTidy'][] = array($parser->extCite, 'checkRefsNoReferences', false);
         $wgHooks['InlineEditorPartialAfterParse'][] = array($parser->extCite, 'checkAnyCalls');
         Cite::$hooksInstalled = true;
     }
     $parser->setHook('ref', array($parser->extCite, 'ref'));
     $parser->setHook('references', array($parser->extCite, 'references'));
     return true;
 }
Esempio n. 6
0
 public function getCSLItem()
 {
     return Cite::convertItem($this);
 }
        case "161":
            $nombrecompleto = "Helen Calderon Callejas";
            break;
        case "167":
            $nombrecompleto = "Carla Flores Bueno";
            break;
        default:
            $nombrecompleto = "";
            break;
    }
}
//if(isset($_GET['idCertificado'])){
if (isset($idCertificado)) {
    //$idCertificado = $_GET['idCertificado'];
    $certificado = new Certificado();
    $cite = new Cite();
    $fondocomplementario = new FondoComplementario();
    //variables y resultados
    $usuario = 66;
    $resultado = $certificado->getCertificadoGeneral($idCertificado);
    $idCite = $resultado->getIdCite();
    $resultado2 = $cite->getDatosCite($idCite);
    $citeNota = $resultado2->getCite();
    $solicitante = $resultado->getNombreSolicitante();
    $fechaCertificado = $resultado->getFechaCertificado();
    $articulo = $resultado->getArticulo();
    $persona = $resultado->getNombreCompleto();
    $ci = $resultado->getCi();
    $cargo = $resultado->getCargo();
    $fechaInicio = $resultado->getFechaInicio();
    $fechaFin = $resultado->getFechaFin();