public function crear()
 {
     $req = $this->request;
     $vdt = $this->validarDocumento($req->post(), true);
     $autor = $this->session->getUser();
     $documento = new Documento();
     $documento->descripcion = $vdt->getData('descripcion');
     $documento->ultima_version = 1;
     $documento->save();
     $docVersion = new VersionDocumento();
     $docVersion->version = 1;
     $docVersion->documento()->associate($documento);
     $docVersion->save();
     $parrafos = $this->parsearParrafos($vdt->getData('cuerpo'));
     foreach ($parrafos as $i => $parrafo) {
         $docParrafo = new ParrafoDocumento();
         $docParrafo->cuerpo = $parrafo;
         $docParrafo->ubicacion = $i;
         $docParrafo->version()->associate($docVersion);
         $docParrafo->save();
     }
     $contenido = new Contenido();
     $contenido->titulo = $vdt->getData('titulo');
     $contenido->puntos = 0;
     $contenido->categoria_id = $vdt->getData('categoria');
     $contenido->autor()->associate($autor);
     $contenido->contenible()->associate($documento);
     $contenido->save();
     TagCtrl::updateTags($contenido, TagCtrl::getTagIds($vdt->getData('tags')));
     UserlogCtrl::createLog('newDocumen', $autor->id, $documento);
     $autor->increment('puntos', 25);
     $this->flash('success', 'Su documento abierto se creó exitosamente.');
     $this->redirectTo('shwDocumen', array('idDoc' => $documento->id));
 }
 public function mostrarCuerpo()
 {
     imprimirTabulados(3);
     echo '<div id="cuerpo">';
     $this->contenido->mostrarContenido();
     $this->barraLateral->mostrarBarraLateral();
     echo '<div style="clear: both; height: 1px"></div>';
     imprimirTabulados(3);
     echo '</div>';
 }
 public function actionView($id)
 {
     if (!empty($id)) {
         $contenido = Contenido::model()->findByPk($id);
     }
     if (isset($_POST['Contenido'])) {
         $contenido->texto = $_POST['Contenido']['texto'];
         $log = new Logs();
         try {
             $log->accion = 'Edito el contenido  de ' . $contenido->nombre . ' como admin';
             $log->usuario = Yii::app()->user->id;
             $log->msg = 'IP: ' . $_SERVER['REMOTE_ADDR'] . ' : ' . $_SERVER['REMOTE_PORT'];
             $log->fecha = date('Y-m-d G:i:s');
             $log->save();
         } catch (Exception $e) {
             $log->accion = 'Error log';
             $log->msg = '';
             $log->fecha = '';
             $log->save();
         }
         $contenido->save('update');
     }
     // render - 1. vista 2. array con los objetos de tipo CActiveReord
     $this->render('form', array('model' => $contenido));
 }
Beispiel #4
0
 public function queryModel($meth, $repr)
 {
     switch ($meth) {
         case 0:
             return Contenido::query();
         case 1:
             return Contenido::with(['contenible', 'tags']);
     }
 }
Beispiel #5
0
 public function crear()
 {
     $req = $this->request;
     $vdt = $this->validarNovedad($req->post());
     $autor = $this->session->getUser();
     $novedad = new Novedad();
     $novedad->cuerpo = $vdt->getData('cuerpo');
     $novedad->save();
     $contenido = new Contenido();
     $contenido->titulo = $vdt->getData('titulo');
     $contenido->puntos = 0;
     $contenido->categoria_id = $vdt->getData('categoria');
     $contenido->autor()->associate($autor);
     $contenido->contenible()->associate($novedad);
     $partido = $autor->partido;
     if (isset($partido) && $vdt->getData('asociar')) {
         $contenido->impulsor()->associate($partido);
     }
     $contenido->save();
     TagCtrl::updateTags($contenido, TagCtrl::getTagIds($vdt->getData('tags')));
     $log = UserlogCtrl::createLog('newNovedad', $autor->id, $novedad);
     if ($contenido->impulsor) {
         NotificacionCtrl::createNotif($partido->afiliados()->lists('id'), $log);
     }
     $this->flash('success', 'Su novedad fue creada exitosamente.');
     $this->redirectTo('shwNovedad', array('idNov' => $novedad->id));
 }
Beispiel #6
0
 public function crear()
 {
     $req = $this->request;
     $vdt = $this->validarEvento($req->post());
     $autor = $this->session->getUser();
     $evento = new Evento();
     $evento->cuerpo = $vdt->getData('cuerpo');
     $evento->lugar = $vdt->getData('lugar');
     $evento->fecha = Carbon\Carbon::parse($vdt->getData('fecha'));
     $evento->save();
     $contenido = new Contenido();
     $contenido->titulo = $vdt->getData('titulo');
     $contenido->puntos = 0;
     $contenido->categoria_id = $vdt->getData('categoria');
     $contenido->autor()->associate($autor);
     $contenido->contenible()->associate($evento);
     $partido = $autor->partido;
     if (isset($partido) && $vdt->getData('asociar')) {
         $contenido->impulsor()->associate($partido);
     }
     $contenido->save();
     TagCtrl::updateTags($contenido, TagCtrl::getTagIds($vdt->getData('tags')));
     $log = UserlogCtrl::createLog('newEventoo', $autor->id, $evento);
     if ($contenido->impulsor) {
         NotificacionCtrl::createNotif($partido->afiliados()->lists('id'), $log);
     }
     $this->flash('success', 'Su evento fue creado exitosamente.');
     $this->redirectTo('shwEvento', array('idEve' => $evento->id));
 }
Beispiel #7
0
 public function eliminarItem($IdContenido)
 {
     $item = Contenido::where('IdContenido', $IdContenido)->first();
     if ($item != NULL) {
         DB::transaction(function () use($IdContenido) {
             $item = Contenido::where('IdContenido', $IdContenido)->first();
             $item->delete();
         });
         return 1;
     } else {
         return 0;
     }
 }
Beispiel #8
0
 public function guardar($contenido_id = null)
 {
     $this->load->helper('file');
     $respuesta = new stdClass();
     if ($contenido_id) {
         $contenido = Doctrine::getTable('Contenido')->find($contenido_id);
     } else {
         $contenido = new Contenido();
     }
     $this->form_validation->set_rules('titulo', 'Título', 'trim|required');
     $this->form_validation->set_rules('contenido', 'Contenido', 'required');
     if ($this->form_validation->run() == TRUE) {
         try {
             $url = !$this->input->post('url') ? $this->input->post('titulo') : $this->input->post('url');
             $contenido->titulo = $this->input->post('titulo');
             $contenido->url = url_slug($url, array('transliterate' => true));
             $contenido->contenido = $this->input->post('contenido');
             $contenido->plantilla = $this->input->post('plantilla');
             $contenido->maestro = 1;
             $contenido->save();
             $contenido->generarVersion();
             $this->session->set_flashdata('message', 'Contenido ' . ($contenido_id ? 'actualizado' : 'creado') . ' exitosamente');
             $respuesta->validacion = TRUE;
             redirect('backend/contenidos/ver/' . $contenido->id);
         } catch (Exception $e) {
             $respuesta->validacion = FALSE;
             $respuesta->errores = "<p class='error'>" . $e . "</p>";
         }
     } else {
         $respuesta->validacion = FALSE;
         $respuesta->errores = validation_errors('<p class="error">', '</p>');
     }
     $data['plantillas'] = get_filenames('application/views/contenido/');
     $data['contenido'] = $contenido;
     $data['content'] = 'backend/contenidos/form';
     $data['title'] = 'Backend - Guardar contenido';
     $this->load->view('backend/template', $data);
 }
 public function crear()
 {
     $req = $this->request;
     $vdt = $this->validarProblematica($req->post());
     $autor = $this->session->getUser();
     $problematica = new Problematica();
     $problematica->cuerpo = $vdt->getData('cuerpo');
     $problematica->afectados_directos = 0;
     $problematica->afectados_indirectos = 0;
     $problematica->afectados_indiferentes = 0;
     $problematica->save();
     $contenido = new Contenido();
     $contenido->titulo = $vdt->getData('titulo');
     $contenido->puntos = 0;
     $contenido->categoria_id = $vdt->getData('categoria');
     $contenido->autor()->associate($autor);
     $contenido->contenible()->associate($problematica);
     $contenido->save();
     TagCtrl::updateTags($contenido, TagCtrl::getTagIds($vdt->getData('tags')));
     UserlogCtrl::createLog('newProblem', $autor->id, $problematica);
     $autor->increment('puntos', 25);
     $this->flash('success', 'Su problemática se creó exitosamente.');
     $this->redirectTo('shwProblem', array('idPro' => $problematica->id));
 }
Beispiel #10
0
$conteni->save();
$eventoo = new Evento();
$eventoo->cuerpo = 'Evento creada para hacer pruebas.';
$eventoo->lugar = 'Calle Test 123';
$eventoo->fecha = Carbon\Carbon::parse('2035-07-25 12:00:00');
$eventoo->save();
$conteni = new Contenido();
$conteni->titulo = 'Primer Evento';
$conteni->categoria_id = 1;
$conteni->autor()->associate($usuario);
$conteni->contenible()->associate($eventoo);
$conteni->save();
$novedad = new Novedad();
$novedad->cuerpo = 'Novedad creada para hacer pruebas.';
$novedad->save();
$conteni = new Contenido();
$conteni->titulo = 'Primer Novedad';
$conteni->categoria_id = 1;
$conteni->autor()->associate($usuario);
$conteni->contenible()->associate($novedad);
$conteni->save();
$usuario = new Usuario();
$usuario->email = '*****@*****.**';
$usuario->password = password_hash('12345678', PASSWORD_DEFAULT);
$usuario->nombre = 'Usuario';
$usuario->apellido = 'Test';
$usuario->puntos = 20;
$usuario->img_tipo = 1;
$usuario->img_hash = md5(strtolower(trim($usuario->email)));
$usuario->save();
$usuario = new Usuario();
Beispiel #11
0
 public function modificar($idPro)
 {
     $vdt = new Validate\QuickValidator(array($this, 'notFound'));
     $vdt->test($idPro, new Validate\Rule\NumNatural());
     $propuesta = Propuesta::with(array('contenido', 'votos'))->findOrFail($idPro);
     $contenido = $propuesta->contenido;
     $usuario = $this->session->getUser();
     $req = $this->request;
     $vdt = $this->validarPropuesta($req->post());
     if ($vdt->getData('referido')) {
         $referido = Contenido::find($vdt->getData('referido'));
         if (is_null($referido) || $referido->contenible_type != 'Problematica') {
             throw new TurnbackException('La problematica asociada no existe.');
         }
     }
     $propuesta->cuerpo = $vdt->getData('cuerpo');
     $propuesta->save();
     $contenido->titulo = $vdt->getData('titulo');
     $contenido->categoria_id = $vdt->getData('categoria');
     $contenido->referido_id = $vdt->getData('referido');
     $contenido->save();
     TagCtrl::updateTags($contenido, TagCtrl::getTagIds($vdt->getData('tags')));
     $log = UserlogCtrl::createLog('modPropues', $usuario->id, $propuesta);
     NotificacionCtrl::createNotif($propuesta->votos->lists('usuario_id'), $log);
     $this->flash('success', 'Los datos de la propuesta fueron modificados exitosamente.');
     $this->redirectTo('shwPropues', array('idPro' => $idPro));
 }
Beispiel #12
0
<?php

include "../clases/Sesion.php";
include "../modelos/contenido.php";
$contenido = new Contenido();
$sesion = new Sesion();
if ($sesion->sesion_iniciada() == false) {
    header('location:../login.php');
}
$tipos = $contenido->getTipos();
$eventos = $contenido->getEventos();
?>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Llamar Paciente</title>
    <script src="../js/jquery.min.js"></script>
    <!-- Bootstrap -->
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="../font-awesome/css/font-awesome.css">
    <link rel="stylesheet" href="../css/vistas.css">
    <link rel="stylesheet" href="../css/bootstrap-clockpicker.css">
    <link rel="stylesheet" href="../css/bootstrap.switch.css">
    <script src="../js/bootstrap.min.js"></script>
    <script src="../js/jquery.form.js"></script>
    <script src="../js/bootstrap-clockpicker.min.js"></script>
    <script src="../js/bootstrap.switch.js"></script>
    <script src="../js/subir_archivo.js?r=<?php 
echo date('d-m-Y H:i:s');
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Contenido the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Contenido::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
 public static function GetAllByFechaLimite($fecha_limite, $limit)
 {
     //Collection<Contenido> contenidos = Contenido.getAll(TipoContenido.PELICULA, $fecha_limite, $limit);
     $contenidos = Contenido::getAll(TipoContenido::PELICULA, $fecha_limite, $limit);
     return WrapContenidoList($contenidos);
 }
Beispiel #15
0
<?
include_once("./Contenido.class.php");
$filename = '';
if(!empty($_GET['id']) ){
	$id = $_GET['id'];
	$width = (!empty($_GET['width']))? $_GET['width']: null;
	$height = (!empty($_GET['height']))? $_GET['height']: null;
	$logo = (!empty($_GET['logo']))? $_GET['logo']: '';
	$ext = (!empty($_GET['ext']))? $_GET['ext']: '';
	$contenido = new Contenido($id,$logo);
	if($ext!="") $contenido->setExtension($ext);
	$filename = $contenido->getPath($width,$height,"#ff00ff");
}else{
	echo 'falta el id.';
	exit();
}
header('Content-type: image/jpeg');
header('Content-length: '.filesize($filename));
readfile($filename);

?>
Beispiel #16
0
 public function eliminarItem()
 {
     if (Auth::User()->Rol_Id == 7 or Auth::User()->Rol_Id == 1) {
         $IdContenido = Request::get('IdContenido');
         $areaActual = Request::get('IdArea');
         $IdSeccion = Request::get('IdSeccion');
         $IdATS = Request::get('IdATS');
         $IdTipoContenido = Request::get('TipoContenido');
         $Item = new Contenido();
         $areaActualNombre = Area::where('IdArea', $areaActual)->first();
         $Seccion = Secciones::where('IdSeccion', $IdSeccion)->first();
         if ($Item->eliminarItem($IdContenido)) {
             echo '<script type="text/javascript">alert("' . 'Se ha eliminado el Item' . '")</script>';
             $TablaDeContenido = Contenido::join('area_tiene_secciones', 'ATS_Id', '=', 'area_tiene_secciones.IdATS')->where('area_tiene_secciones.Area_Id', '=', $areaActual)->where('area_tiene_secciones.Secciones_Id', '=', $IdSeccion)->get();
             Session::flash('msg', 'Item eliminado correctamente.');
             return View::make('SIG.editarContenido', array('areaActual' => $areaActual, 'areaActualNombre' => $areaActualNombre, 'Seccion' => $Seccion, 'IdATS' => $IdATS, 'Items' => $TablaDeContenido, 'TipoDeContenido' => $IdTipoContenido));
         } else {
             $TablaDeContenido = Contenido::join('area_tiene_secciones', 'ATS_Id', '=', 'area_tiene_secciones.IdATS')->where('area_tiene_secciones.Area_Id', '=', $areaActual)->where('area_tiene_secciones.Secciones_Id', '=', $IdSeccion)->get();
             Session::flash('msgWarning', 'Error en la aplicación, vuelva a intentarlo');
             return View::make('SIG.editarContenido', array('areaActual' => $areaActual, 'areaActualNombre' => $areaActualNombre, 'Seccion' => $Seccion, 'IdATS' => $IdATS, 'Items' => $TablaDeContenido, 'TipoDeContenido' => $IdTipoContenido));
         }
     } else {
         return Redirect::to('/SIG');
     }
 }
 /**
  * {@inheritdoc }
  */
 function __construct()
 {
     parent::__construct();
     $this->gestorPeriodos = new GestorPeriodos();
 }
<?php

include_once '../modelos/contenido.php';
$band = $_REQUEST["band"];
$contenido = new Contenido();
switch ($band) {
    case 'eliminarEvento':
        $id = intval($_REQUEST["id"]);
        echo $contenido->eliminarEvento($id);
        break;
    case 'reordenarEvento':
        $id_temp = $_REQUEST["id_temp"];
        $id_new = $_REQUEST["id_new"];
        echo $contenido->reordenarEvento($id_temp, $id_new);
        break;
}
Beispiel #19
0
        <div class="container" id="page">



            <div id="mainmenu" class="row">

<?php 
$programas = Programa::model()->findAll(array('condition' => 'activo =1 and programa_tipo_id = ' . $this->programas));
$bloqueos = Programa::model()->findAll(array('condition' => 'activo =1 and programa_tipo_id = ' . $this->bloqueos));
$otroDestinos = Programa::model()->findAll(array('condition' => 'activo =1 and programa_tipo_id = ' . $this->otroDestino));
$turismoSaluds = Programa::model()->findAll(array('condition' => 'activo =1 and programa_tipo_id = ' . $this->turismoSalud));
$otroServicios = Programa::model()->findAll(array('condition' => 'activo =1 and programa_tipo_id = ' . $this->otroServicio));
$quienesSomos = Contenido::model()->findAllByAttributes(array('contenido_tipo_id' => $this->quienessomos));
$informaciones = Contenido::model()->findAllByAttributes(array('contenido_tipo_id' => $this->informaciones));
$otros = Contenido::model()->findAllByAttributes(array('contenido_tipo_id' => $this->otros));
$turismos = Contenido::model()->findAllByAttributes(array('contenido_tipo_id' => $this->turismo));
$programa = array();
foreach ($programas as $pro) {
    $programa[] = array('label' => $pro->nombre, 'url' => array('site/programa', 'id' => $pro->id));
}
$bloqueo = array();
foreach ($bloqueos as $blo) {
    $bloqueo[] = array('label' => $blo->nombre, 'url' => array('site/programa', 'id' => $blo->id));
}
/* $otroDestino = array();

  foreach($otroDestinos as $otro){

  $otroDestino[] = array('label' => $otro->nombre, 'url' => array('site/programa','id'=>$otro->id));

  } */
Beispiel #20
0
<?php

use clases_generales\Sql;
include_once '../db/Sql.php';
include_once '../db/parametros_bd.php';
include "../modelos/contenido.php";
$contenido = new Contenido();
function convertirSegundos($time)
{
    $sec = 0;
    foreach (array_reverse(explode(':', $time)) as $k => $v) {
        $sec += pow(60, $k) * $v;
    }
    return $sec;
}
$conex = new Sql();
$dir = "../recursos/";
$tipo = $_REQUEST["selTipo"];
switch ($tipo) {
    case '1':
        $formatos = array('mp4', 'MP4', 'avi', 'AVI', 'swf', 'SWF', 'webm', 'WEBM', 'ogv', 'OGV');
        $archivo = $_FILES["archivo"]["name"];
        $ext = pathinfo($archivo, PATHINFO_EXTENSION);
        if (!in_array($ext, $formatos)) {
            die('error_formato');
        }
        $direccion = str_replace(' ', '_', $dir . basename($_FILES["archivo"]["name"]));
        move_uploaded_file($_FILES["archivo"]["tmp_name"], $direccion);
        chmod($direccion, 0777);
        $url = "http://" . SERVIDOR_BD . "/q-sort/recursos/" . str_replace(' ', '_', basename($_FILES["archivo"]["name"]));
        $duracion = convertirSegundos($_REQUEST["duracion"]);
<?php

include_once "common.php";
include_once "HTML/Template/Flexy.php";
include_once "classes/Contenido.php";
$tpl = new stdClass();
$cursor = $sql->readDB("CONTENIDO,CATEGORIA", "ESTADO__CON='A' AND ID______CAT=CATEGORICON");
if ($cursor->num_rows > 0) {
    while ($row = $cursor->fetch_assoc()) {
        $group = $row['ID______CAT'];
        $key = $row['ID______CON'];
        $cont = new Contenido($row['ID______CON']);
        $tpl->CONTENIDO[$group][$key] = $cont->getHTML();
    }
}
$tpl->CONFIGURACION = array();
$cursor = $sql->readDB("CONFIGURACION");
if ($cursor->num_rows > 0) {
    while ($row = $cursor->fetch_assoc()) {
        $key = url_slug($row['NOMBRE__CFG']);
        $tpl->CONFIGURACION[$key] = $row['VALOR___CFG'];
    }
}
$options = array('compileDir' => $install . '/tmp/', 'templateDir' => $install . '/template/');
$output = new HTML_Template_Flexy($options);
$output->compile('index.html');
$output->outputObject($tpl);
/*
function($string){
    return strip_tags($string);
}
                             $cont = new Contenido($rrr['ID______CON']);
                             $proyectos[$f][$rrr['ID______CON']] = $cont->getHTML(true);
                             $c++;
                             if ($c >= 4) {
                                 $c = 0;
                                 $f++;
                             }
                         }
                     }
                 }
             }
             if (empty($proyectos)) {
                 $cat = $row['ID______CAT'];
                 if ($subCursor2 = $sql->readDB("CONTENIDO", "ESTADO__CON='A' AND CATEGORICON='{$cat}'", "ORDEN___CON")) {
                     while ($rrr = $subCursor2->fetch_assoc()) {
                         $cont = new Contenido($rrr['ID______CON']);
                         $proyectos[$f][$rrr['ID______CON']] = $cont->getHTML(true);
                         $c++;
                         if ($c >= 4) {
                             $c = 0;
                             $f++;
                         }
                     }
                 }
             }
         }
     }
 }
 if (isset($proyectos[0])) {
     $tpl->COLS = "3";
     if (count($proyectos[0]) < 4) {
Beispiel #23
0
 public function actionOtros()
 {
     Yii::app()->controller->menu_activo = 'otros';
     $id = Yii::app()->request->getParam('id');
     $model = Contenido::model()->findByPk($id);
     $top = false;
     $rigth = false;
     $bottom = false;
     $top_model = '';
     $right_model = '';
     $bottom_model = '';
     if (count($model->contenidoAdicionals) > 0) {
         foreach ($model->contenidoAdicionals as $adicional) {
             if ($adicional->contenido_adicional_posicion_id == 1) {
                 //top
                 $top_model = $adicional;
                 $top = true;
             } else {
                 if ($adicional->contenido_adicional_posicion_id == 2) {
                     //right
                     $right_model = $adicional;
                     $rigth = true;
                 } else {
                     if ($adicional->contenido_adicional_posicion_id == 3) {
                         //bottom
                         $bottom_model = $adicional;
                         $bottom = true;
                     }
                 }
             }
         }
     }
     $this->render('contenido', array('model' => $model, 'top' => $top, 'top_model' => $top_model, 'right' => $rigth, 'right_model' => $right_model, 'bottom' => $bottom, 'bottom_model' => $bottom_model));
 }
Beispiel #24
0
$usuario->apellido = 'Mathurin';
$usuario->puntos = 0;
$usuario->suspendido = false;
$usuario->es_funcionario = false;
$usuario->es_jefe = false;
$usuario->img_tipo = 1;
$usuario->img_hash = md5(strtolower(trim('*****@*****.**')));
$usuario->save();
$problematica = new Problematica();
$problematica->cuerpo = <<<EOT
El servicio de barrido público no está funcionando correctamente, pasan en horarios irregulares o incluso hay días en los que no aparecen.
Este es el reporte de los últimos días:
[ul]
[li][u]Lunes[/u]: no pasó.[/li]
[li][u]Martes[/u]: pasaron pero muy tarde.[/li]
[li][u]Miércoles[/u]: no pasó.[/li]
[li][u]Jueves[/u]: pasaron normalmente.[/li]
[/ul]
EOT;
$problematica->afectados_directos = 0;
$problematica->afectados_indirectos = 0;
$problematica->afectados_indiferentes = 0;
$problematica->save();
$contenido = new Contenido();
$contenido->titulo = 'Barrido público irregular';
$contenido->puntos = 0;
$contenido->categoria_id = 1;
$contenido->autor()->associate($usuario);
$contenido->contenible()->associate($problematica);
$contenido->save();
echo 'done!';
 /**
  * {@inheritdoc }
  */
 function __construct()
 {
     parent::__construct();
     $this->gestorHorarios = new GestorHorarios();
 }
Beispiel #26
0
 */
function twentyfifteen_search_form_modify($html)
{
    return str_replace('class="search-submit"', 'class="search-submit screen-reader-text"', $html);
}
add_filter('get_search_form', 'twentyfifteen_search_form_modify');
/**
 * Implement the Custom Header feature.
 *
 * @since Twenty Fifteen 1.0
 */
require get_template_directory() . '/inc/custom-header.php';
/**
 * Custom template tags for this theme.
 *
 * @since Twenty Fifteen 1.0
 */
require get_template_directory() . '/inc/template-tags.php';
/**
 * Customizer additions.
 *
 * @since Twenty Fifteen 1.0
 */
require get_template_directory() . '/inc/customizer.php';
/**
 * Instanciar estructura contenido
 * Ofertaski
 */
require_once ABSPATH . 'wp-admin/core/Contenido.php';
$contenido = new Contenido();
$contenido->init();
 /**
  * {@inheritdoc }
  */
 function __construct()
 {
     parent::__construct();
 }
Beispiel #28
0
 /**
  * Compara el contenido con una version especificada
  *
  * @param Doctrine_Record $version_anterior contenido a comparar.
  *
  * @return string
  */
 public function compareWith(Contenido $version_anterior)
 {
     $comparacion = array();
     $left = $this->toArray(false);
     $right = $version_anterior->toArray(false);
     $exclude = array('id', 'maestro', 'maestro_id', 'publicado', 'publicado_at', 'updated_at', 'created_at');
     foreach ($left as $field => $value) {
         if (!in_array($field, $exclude)) {
             if ($right[$field] != $left[$field]) {
                 $diff = trim(htmlDiff(strip_tags($right[$field]), strip_tags($left[$field])));
                 $comparacion[$field]->left[] = $diff;
                 $comparacion[$field]->right[] = $right[$field];
             }
         }
     }
     return $comparacion;
 }