Beispiel #1
0
function loadNewRef($idRef, $idStructure)
{
    if (!$idRef || !$idStructure) {
        return null;
    }
    $contentLoader = new Model\ContentLoader();
    $contentLoader->setId($idStructure);
    $content = $contentLoader->loadContents('id', $idRef);
    //$contents = new Model\ContentsDo();
    //$contents->add($content);
    return $content;
}
Beispiel #2
0
 public function testSaveNewContent()
 {
     $cl = new Model\ContentLoader();
     $cl->setId('programa_tv');
     $content = new \ACD\Model\ContentDo();
     $content->setIdStructure($cl->getId());
     $content->setData('Título', 'el campo Título');
     $content->setData('Destacada', 'el campo Destacada');
     $content->setData('Descripción', 'el campo Descripción');
     $result = $cl->saveContent($content);
     $this->assertTrue($result->getId() !== null);
     $this->assertEquals($result->getData('Título'), 'el campo Título');
 }
Beispiel #3
0
 $headerMenuOu = new View\HeaderMenu();
 $headerMenuOu->setType('menu');
 $toolsOu = new View\Tools();
 $toolsOu->setLogin($_SESSION['login']);
 $toolsOu->setRol($_SESSION['rol']);
 $contentOu = new View\ContentEditSearch();
 //$contentOu->setActionType('index');
 $contentOu->setId($idParent);
 $contentOu->setType($idStructureTypeParent);
 $contentOu->setIdField($idField);
 $contentOu->setPositionInField($positionInField);
 $contentOu->setStructures($structures);
 $contentOu->setTitleSeach($titleSearch);
 $contentOu->setStructureTypeSeach($idStructureTypeSearch);
 if ($action === 'search') {
     $contentLoader = new Model\ContentLoader();
     $contentLoader->setId($idStructureTypeSearch);
     $whereCondition = [];
     if ($titleSearch) {
         $whereCondition['title'] = $titleSearch;
     }
     if ($idStructureTypeSearch) {
         $whereCondition['idStructure'] = $idStructureTypeSearch;
     }
     $matchContents = $contentLoader->loadContents('editor-search', $whereCondition);
     //d($matchContents);
     $contentOu->setResultSearch($matchContents);
 }
 $skeletonOu = new View\BaseSkeleton();
 $skeletonOu->setBodyClass('indexContent');
 $skeletonOu->setHeadTitle('Manage content type');