public function init() { //busca todas as paginas cadastradas na tabela content $returnResult = new HttpResult(); //iniciando o resultado para o html $retornoDaPaginaHTML = new HttpContentModule(); $slug_category = "404"; if (count($this->arrayRestFolder) > 0) { $slug_category = $this->arrayRestFolder[0]; } $ContentDAO = ContentDAO::getInstance(); $ReturnDataVO = $ContentDAO->selectBySlugAndTableId($this->arrayRestFolder[0], "category", "18", NULL, ContentDAO::RETURN_VO); //iniciando o retorno padrao em http result //fazendo o que precisa fazer para ter os dados //setando sucesso true caso tenha dado certo $returnResult->setSuccess(count($ReturnDataVO->result) > 0); //Debug::print_r($retornoDaPaginaHTML); //$retornoDaPaginaHTML->content_module = $ReturnDataVO->result[0]; $retornoDaPaginaHTML->arrayVariable = $this->arrayVariable; $retornoDaPaginaHTML->setFetchArray($ReturnDataVO->result); //Debug::print_r($retornoDaPaginaHTML); //salvando o objeto de resultado de html no retorno $item1 = $this->getContent(16, 480, 287); //forçando a barra $item1->image_url = array('http://www.espacolaser.com.br/carta-ygor.jpg'); $item2 = $this->getContent(15, 480, 287); $item3 = $this->getContent(17, 480, 287); $retornoDaPaginaHTML->items = array($item1, $item2, $item3); $returnResult->setHttpContentResult($retornoDaPaginaHTML); return $returnResult; }
public function contato() { //busca todas as paginas cadastradas na tabela content $returnResult = new HttpResult(); //iniciando o resultado para o html $retornoDaPaginaHTML = new HttpContentModule(); $slug_category = "404"; if (count($this->arrayRestFolder) > 0) { $slug_category = $this->arrayRestFolder[0]; } $ContentDAO = ContentDAO::getInstance(); $ReturnDataVO = $ContentDAO->selectByTableId("category", $ReturnDataVO->result[0]->id, ContentDAO::RETURN_VO); // echo Debug::print_r($ReturnDataVO); //iniciando o retorno padrao em http result //fazendo o que precisa fazer para ter os dados //setando sucesso true caso tenha dado certo $returnResult->setSuccess(count($ReturnDataVO->result) > 0); //Debug::print_r($retornoDaPaginaHTML); $retornoDaPaginaHTML->content_module = $ReturnDataVO->result; $retornoDaPaginaHTML->arrayVariable = $this->arrayVariable; $retornoDaPaginaHTML->setFetchArray($ReturnDataVO->result); //Debug::print_r($retornoDaPaginaHTML); //salvando o objeto de resultado de html no retorno $returnResult->setHttpContentResult($retornoDaPaginaHTML); return $returnResult; }
public function __construct($connection, $config) { self::$conn = $connection; $dir = Config::get('dir'); self::$dir = $dir; include $dir . 'lib/Content.php'; }
public static function getInstance() { if (!self::$instance) { self::$instance = new ContentDAO(); } return self::$instance; }
public function products($return_js = TRUE) { $DAO = ContentDAO::getInstance(); $result = $DAO->selectByTableId("category", 2); if ($return_js) { echo "var array_products = " . json_encode($result->result) . ";"; exit; } return $result; }
public function init() { //busca todas as paginas cadastradas na tabela content $returnResult = new HttpResult(); //iniciando o resultado para o html $retornoDaPaginaHTML = new HttpContentModule(); $slug_category = "404"; if (count($this->arrayRestFolder) > 0) { $slug_category = $this->arrayRestFolder[0]; } $ContentDAO = ContentDAO::getInstance(); $ReturnDataVO = $ContentDAO->selectBySlugAndTableId($this->arrayRestFolder[0], "category", "18", NULL, ContentDAO::RETURN_VO); //iniciando o retorno padrao em http result //fazendo o que precisa fazer para ter os dados //setando sucesso true caso tenha dado certo $returnResult->setSuccess(count($ReturnDataVO->result) > 0); //Debug::print_r($retornoDaPaginaHTML); $retornoDaPaginaHTML->content_module = $ReturnDataVO->result[0]; $retornoDaPaginaHTML->arrayVariable = $this->arrayVariable; $retornoDaPaginaHTML->setFetchArray($ReturnDataVO->result); //Debug::print_r($retornoDaPaginaHTML); //salvando o objeto de resultado de html no retorno //serviços $item1 = $this->getContent(18, 480, 286); //como funciona $item2 = $this->getContent(19, 480, 286); //precauçoes $item3 = $this->getContent(20, 480, 286); $parte = new stdClass(); $parte->title = 'Parte 1'; $parte->x = 300; $parte->y = 200; $parte->content = ""; //varre a categoria de partes do homem $partes_homem = $this->getAreas(17); $retornoDaPaginaHTML->homem = $partes_homem; $retornoDaPaginaHTML->mulher = $this->getAreas(18); $retornoDaPaginaHTML->items = array($item1, $item2, $item3); $returnResult->setHttpContentResult($retornoDaPaginaHTML); return $returnResult; }
public function init() { //busca todas as paginas cadastradas na tabela content $returnResult = new HttpResult(); //iniciando o resultado para o html $retornoDaPaginaHTML = new HttpContentModule(); $slug_category = "404"; //id das demais categorias que nao vao ser agrupadas $category_id = 86; if (count($this->arrayRestFolder) > 1) { $slug_category = $this->arrayRestFolder[1]; $category_id = $this->arrayRestFolder[0] == "segmento" ? 125 : 126; } else { $slug_category = $this->arrayRestFolder[0]; } $ContentDAO = ContentDAO::getInstance(); $ReturnDataVO = $ContentDAO->selectBySlugAndTableId($slug_category, "category", $category_id, NULL, ContentDAO::RETURN_VO); // "category", $ReturnDataVO->result[0]->id, ContentDAO::RETURN_VO); //echo Debug::print_r($ReturnDataVO);exit(); //iniciando o retorno padrao em http result //fazendo o que precisa fazer para ter os dados //setando sucesso true caso tenha dado certo $returnResult->setSuccess(count($ReturnDataVO->result) > 0); //Debug::print_r($retornoDaPaginaHTML); $retornoDaPaginaHTML->content_module = count($ReturnDataVO->result) > 0 ? $ReturnDataVO->result[0] : NULL; if ($retornoDaPaginaHTML->content_module) { $contentSiteVO = new ContentSiteVO(); $contentSiteVO->setId($retornoDaPaginaHTML->content_module->id, TRUE); $retornoDaPaginaHTML->content_module = $contentSiteVO; } $retornoDaPaginaHTML->arrayVariable = $this->arrayVariable; $retornoDaPaginaHTML->array_segment = $this->getContents(125); $retornoDaPaginaHTML->array_estrutura = $this->getContents(126); //Debug::print_r($retornoDaPaginaHTML); //salvando o objeto de resultado de html no retorno $returnResult->setHttpContentResult($retornoDaPaginaHTML); return $returnResult; }
</script> <?php } else { //print_r($_POST); //print_r($_FILES); echo "<div hidden>"; $name = $_FILES['avatar']['name']; $email_owner = "admin_off"; $_type = "admin"; $children = array(); // UPLOAD SUR S3 $s3 = new S3Access(S3ClientBuilder::get()); $url = $s3->createFile($name, $_FILES['avatar']['tmp_name']); //$path); // INSERT SUR DYNAMO $contentDao = new ContentDAO(DynamoDbClientBuilder::get()); $content = new Content(); $content->setUrl($url); $content->setEmailOwner($email_owner); $content->setName($name); $content->setType($_type); $contentDao->create($content, $children); echo "</div>La slide a été ajouter : <a href='https://s3-eu-west-1.amazonaws.com/cherry-shared-content2/" . $name . "'>" . $name . "</a>"; } ?> </body> <footer class="footer"> <div class="container-fluid"> <img height="60px" src="img/logo.jpg"/>
function getContentPage($content_id) { include_once TR_INCLUDE_PATH . 'classes/DAO/ContentDAO.class.php'; $contentDAO = new ContentDAO(); return $contentDAO->get($content_id); }
function getContentsChild($child) { $contentsFamilial = $child->getContentByType("family"); $contentsPedagogique = $child->getContentByType("teacher"); $contentsMedical = $child->getContentByType("doctor"); $reponse = array(); if (count($contentsMedical) > 0) { //$reponse[]= 'medical_'; foreach ($contentsMedical as $contentM) { //print_r($contentM); $owner = $contentM['M']['owner']['S']; $name = $contentM['M']['name']['S']; $contentDao = new ContentDAO(DynamoDbClientBuilder::get()); $contents = $contentDao->getContentsOfUser($owner); foreach ($contents as $c) { $name2 = $c->getName(); //echo $name2.' =? '.$name; if ($name2 == $name) { $reponse[] = $name; $reponse[] = $c->getUrl(); } //echo $c->getUrl(); //echo 'temp '.$reponse; } //print_r($contents); } } if (count($contentsFamilial) > 0) { //$reponse[]= 'family_'; foreach ($contentsFamilial as $contentF) { $owner = $contentF['M']['owner']['S']; $name = $contentF['M']['name']['S']; $contentDao = new ContentDAO(DynamoDbClientBuilder::get()); $contents = $contentDao->getContentsOfUser($owner); foreach ($contents as $c) { $name2 = $c->getName(); //echo $name2.' =? '.$name; if ($name2 == $name) { $reponse[] = $name; $reponse[] = $c->getUrl(); } //echo $c->getUrl(); //echo 'temp '.$reponse; } } } if (count($contentsPedagogique) > 0) { //$reponse[]= 'teaching_'; foreach ($contentsPedagogique as $contentP) { $owner = $contentP['M']['owner']['S']; $name = $contentP['M']['name']['S']; $contentDao = new ContentDAO(DynamoDbClientBuilder::get()); $contents = $contentDao->getContentsOfUser($owner); foreach ($contents as $c) { $name2 = $c->getName(); //echo $name2.' =? '.$name; if ($name2 == $name) { $reponse[] = $name; $reponse[] = $c->getUrl(); } //echo $c->getUrl(); //echo 'temp '.$reponse; } } } print_r($reponse); }
<?php /* IMPORTS */ require '../../DTO/Content/ContentDTO.php'; require '../../DAO/Content/ContentDAO.php'; /* RECEPCION DE DATOS */ session_start(); $idrol = $_SESSION["TypeUser"]; $page = isset($_GET['page']) ? $_GET['page'] : ""; /* DEFINICION DE OBJETOS */ $obj = new ContentDTO($page, $idrol); $conex = new ContentDAO(); /* CONTROL DE ACCIONES */ $conex->ValidatePage($obj);
<?php // Désactiver le rapport d'erreurs error_reporting(0); session_start(); $root = "./"; require "includes.php"; $ecoute = htmlspecialchars($_GET['ecoute']); //recherche un contenue ayant comme titre $name et owner "admin_off" $contentDao = new ContentDAO(DynamoDbClientBuilder::get()); $contentDAOExist = $contentDao->get("ecoute", "admin_ecoute"); $contentExist = new Content(); //recupere les valeurs $contentExist = $contentDAOExist; $urlExist = $contentExist->getUrl(); $ownerExist = $contentExist->getEmailOwner(); //print_r ($contentExist); //si le contenue est trouve (qu'il y a bien une url) if ($ecoute) { echo $ecoute; //le owner est "admin_off" ==> le change en "admin_on" (pour lancer la video) $contentExist->setUrl($ecoute); $children = array(); //$children[] = array('email' => $_POST['child'], 'dateStart' => $_POST['date_debut'], 'dateEnd' => $_POST['date_fin']); $contentDao->UpDate($contentExist, $children); // echo $urlExist; $contentDao0->delete($name, "admin_off"); } else { echo $urlExist; $_SESSION['switch'] = 1; }
foreach ($etapes as $etape) { $etape = explode("]]", $etape); $etape[] = $diapo; //print_r($etape);echo "<br/><br/>ALL en construction : <br/>"; $lignes[] = $etape; //print_r($lignes);echo "<br/><br/>"; } } echo "<br/>"; $url = print_r($lignes, true); echo $url; //si ce contenu existe //getItem $emailOwner = $_SESSION['email']; $name = $_POST['name']; $contentDao = new ContentDAO(DynamoDbClientBuilder::get()); $contentDAOExist = $contentDao->get($name, $emailOwner); echo '<br/><br/>URL EXISTANTE :'; //print_r($contentDAOExist); $contentExist = new Content(); $contentExist = $contentDAOExist; $urlExist = $contentExist->getUrl(); $typeExist = $contentExist->getType(); $dateExistDebut = $_POST['dateDebut0']; $dateExistFin = $_POST['dateFin0']; echo '<br/><br/>'; echo $urlExist; /* * MISE A JOUR $contentExist->setUrl($url);
} else { if (intval($_POST['_cid']) > 0) { $_content_id = intval($_POST['_cid']); } } if (intval($_REQUEST['_course_id']) > 0) { $_course_id = intval($_REQUEST['_course_id']); } else { if (intval($_POST['_course_id']) > 0) { $_course_id = intval($_POST['_course_id']); } } // find course_id thru content_id if ($_content_id > 0) { include_once TR_INCLUDE_PATH . 'classes/DAO/ContentDAO.class.php'; $contentDAO = new ContentDAO(); $content_row = $contentDAO->get($_content_id); $_course_id = $content_row['course_id']; } // Generate $_SESSION['s_cid']: record the last visited content_id // for authors and the users who have the current course in "my courses" list, // save the last visited content_id into user_courses and set the session var. // @see ContentUtility::saveLastCid() // for the users who don't have the current course in "my courses" list, // set the session var as $_GET['cid'] if ($_course_id > 0) { if ($_SESSION['user_id'] > 0) { include_once TR_INCLUDE_PATH . 'classes/DAO/UserCoursesDAO.class.php'; $userCoursesDAO = new UserCoursesDAO(); $user_courses_row = $userCoursesDAO->get($_SESSION['user_id'], $_course_id); if ($user_courses_row && $user_courses_row['last_cid'] > 0) {
/* echo '<div class="dropdown"> <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Dropdown Example <span class="caret"></span></button> <ul class="dropdown-menu"> <li><a href="#">HTML</a></li> <li><a href="#">CSS</a></li> <li><a href="#">JavaScript</a></li> </ul> </div>'; * * */ $userDao = new UserDAO(DynamoDbClientBuilder::get()); $email = "admin_off"; $user = $userDao->get($email); $contentDaoD = new ContentDAO(DynamoDbClientBuilder::get()); $contents = $contentDaoD->getContentsOfUser($email); //print_r($contents); // echo "<div>".$translArray[4]. ": <textarea name='contenueTexte".($ligne+1+2)."' id='ameliorer' rows='1' cols='100' style='margin-left: 38px;'>".$translArray[$ligne+2+4]."</textarea></div><br/>"; echo '<div class="dropdown"> <input type="hidden" name="Slide[]" class="Slide"> ' . $translArray[4] . ' : <button class="btn btn-warning dropdown-toggle " type="button" data-toggle="dropdown" style="margin-left: 40px;">' . $translArray[$ligne + 2 + 4] . ' <span class="caret"></span></button> <ul class="dropdown-menu">'; foreach ($contents as $c) { echo '<li ><a href="#" name="' . $c->getName() . '">' . $c->getName() . ' </a></li>'; } echo ' </ul> </div><br/>'; echo "<br/><HR size=1 width ='80%' align=center><br/>";
/** * inicia internamente a DAO * @return void */ public function startDAO() { $this->DAO = ContentDAO::getInstance(); }
/** * Delete course * @access public * @param course ID * @return true, if successful * false and add error into global var $msg, if unsuccessful * @author Cindy Qi Li */ public function Delete($courseID) { require_once TR_INCLUDE_PATH . 'classes/FileUtility.class.php'; require_once TR_INCLUDE_PATH . 'classes/DAO/ContentDAO.class.php'; require_once TR_INCLUDE_PATH . 'classes/DAO/ForumsCoursesDAO.class.php'; $contentDAO = new ContentDAO(); $forumsCoursesDAO = new ForumsCoursesDAO(); unset($_SESSION['s_cid']); // delete course content dir $content_dir = TR_CONTENT_DIR . $courseID . '/'; FileUtility::clr_dir($content_dir); // delete tests and tests related data $sql = "DELETE FROM " . TABLE_PREFIX . "content_tests_assoc\n\t\t WHERE content_id in (SELECT content_id FROM " . TABLE_PREFIX . "content WHERE course_id = " . $courseID . ")"; $this->execute($sql); $sql = "DELETE FROM " . TABLE_PREFIX . "tests_questions_categories WHERE course_id = " . $courseID; $this->execute($sql); $sql = "DELETE FROM " . TABLE_PREFIX . "tests_questions_assoc \n\t\t WHERE test_id in (SELECT test_id FROM " . TABLE_PREFIX . "tests WHERE course_id = " . $courseID . ")"; $this->execute($sql); $sql = "DELETE FROM " . TABLE_PREFIX . "tests_questions WHERE course_id = " . $courseID; $this->execute($sql); $sql = "DELETE FROM " . TABLE_PREFIX . "tests WHERE course_id = " . $courseID; $this->execute($sql); // delete forums that are associated with this course $forumsCoursesDAO->DeleteByCourseID($courseID); // loop thru content to delete using ContentDAO->Delete(), which deletes a4a objects as well $content_rows = $contentDAO->getContentByCourseID($courseID); if (is_array($content_rows)) { foreach ($content_rows as $content) { $contentDAO->Delete($content['content_id']); } } $sql = "DELETE FROM " . TABLE_PREFIX . "content WHERE course_id = " . $courseID; $this->execute($sql); // delete user <-> course association $sql = "DELETE FROM " . TABLE_PREFIX . "user_courses WHERE course_id = " . $courseID; $this->execute($sql); // delete the course $sql = "DELETE FROM " . TABLE_PREFIX . "courses WHERE course_id = " . $courseID; return $this->execute($sql); }
// Check if all the files exists in the manifest, iff it's a IMS CC package. if ($content_type == 'IMS Common Cartridge') { checkResources($import_path); } // Check if there are any errors during parsing. if ($msg->containsErrors()) { if (isset($_GET['tile'])) { header('Location: ' . $_base_path . 'tools/tile/index.php'); } else { header('Location: ../index.php'); } exit; } /* initialize DAO objects */ $coursesDAO = new CoursesDAO(); $contentDAO = new ContentDAO(); /* generate a unique new package base path based on the package file name and date as needed. */ /* the package name will be the dir where the content for this package will be put, as a result */ /* the 'content_path' field in the content table will be set to this path. */ /* $package_base_name_url comes from the URL file name (NOT the file name of the actual file we open)*/ if (!$package_base_name && $package_base_name_url) { $package_base_name = substr($package_base_name_url, 0, -4); } else { if (!$package_base_name) { $package_base_name = substr($_FILES['file']['name'], 0, -4); } } // create course if (isset($_POST['hide_course'])) { $access = 'private'; } else {
} ?> </tr> </tbody> </table> </div> <div class="col-md-offset-2 col-md-4"> <div class="containerFiles"> <!-- mouton.txt <button class="btn btn-danger"> <span class="glyphicon glyphicon-remove"></span> </button> --> </div> <div class="filesToAdd none"> <?php $contentDao = new ContentDAO(DynamoDbClientBuilder::get()); $contents = $contentDao->getContentsOfUser($_SESSION['email']); $files = array(); foreach ($contents as $content) { array_push($files, $content->getName()); } //$files =['insecte.txt','f2.txt','f3.txt']; //fichiers en dur pour l'instant foreach ($files as $file) { echo '<div class="newFileRow row"><div class="col-md-8" > <div class="input-group"> <input type="text" class="datepicker form-control" placeholder="Choisir une date" aria-describedby="basic-addon2"><span class="input-group-addon" id="basic-addon2">Date de fin</span></div> </div>' . '<div class="col-md-4" > <input type="checkbox" name="file" value="' . $file . '">' . $file . '</div></div> <br/>'; } //<input type="checkbox" name="file" value="' . $file. '">'. //$file . ?> <br/> <button id="addFilesButton" class="btn btn-default">Ajouter les fichiers à l'enfant</button>
<?php session_start(); $root = "./"; require "includes.php"; ?> </head> <body> <?php print_r($_POST); //echo '<br/>email : '.$_SESSION['email'].' et type : '.$_SESSION['type'].'<br/>'; // INSERT SUR DYNAMO $emailOwner = $_SESSION['email']; $type = $_SESSION['type']; $contentDao = new ContentDAO(DynamoDbClientBuilder::get()); $content = new Content(); //url reprensente le contenu texte if ($_POST['contenueTexte'] != "") { $url = $_POST['contenueTexte']; } else { //le reconstruit $ligne0 = array(); $tab = array(); $ligne0[] = $_POST['contenueTexte0']; $ligne0[] = $_POST['contenueTexte1']; $ligne0[] = $_POST['contenueTexte2']; $tab[] = $ligne0; for ($i = 3; $i <= $_POST['contenueTexteNBRE']; $i += 4) { $ligne = array(); //behave
/** * serve para buscar um unico item especifico, baseado no id * @return ReturnResultVO */ public function get() { //inicia um retorno de ReturnResultVO $ReturnResultVO = new ReturnResultVO(); $table = DataHandler::forceString($this->ContentInfoPostVO->request_table); $table_id = DataHandler::forceInt($this->ContentInfoPostVO->request_table_id); $content_id = DataHandler::forceInt($this->ContentInfoPostVO->request_content_id); $slug = DataHandler::forceString($this->ContentInfoPostVO->request_slug); $locale = DataHandler::forceString($this->ContentInfoPostVO->request_locale); $type_of_return = DataHandler::forceString($this->ContentInfoPostVO->request_type_of_return); //verifica se foram passados os parametros necessarios para o slect if ($table_id > 0 && $slug != NULL) { $DAO = ContentDAO::getInstance(); //se foi passado locale o retorno vai ser em stClassVO //se nao o retorno vem em VO para depois buscar os locales $ReturnDataVO = $DAO->selectBySlugAndTableId($slug, $table, $table_id, $locale, $type_of_return); //print_r($ReturnDataVO); //se deu erro retorna if (!$ReturnDataVO->success || count($ReturnDataVO->result) <= 0) { //deu erro ao vincular $ReturnResultVO->success = false; $ReturnResultVO->array_messages[] = Translation::text("LibraryLanguage::ERROR_CONTENT_NOT_FOUND"); return $ReturnResultVO; } //se foi passado o locale vei pegar os campos com locale if ($locale != NULL) { //faz o get com locale $tempResult = array(); foreach ($ReturnDataVO->result as $vo) { $tempResult = $vo->toStdClass($locale); } $ReturnResultVO->success = $ReturnDataVO->success; $ReturnResultVO->result = $ReturnDataVO->result; return $ReturnResultVO; } //se estiver tudo certo prepara o retorno no objeto ReturnResultVO $ReturnResultVO->success = $ReturnDataVO->success; $ReturnResultVO->result = $ReturnDataVO->result; return $ReturnResultVO; } else { //Debug::print_r($this->ContentInfoPostVO); $ReturnResultVO->success = FALSE; $ReturnResultVO->result = array(); $ReturnResultVO->array_messages[] = Translation::text("LibraryLanguage::ERROR_CONTENT_NOT_FOUND"); return $ReturnResultVO; } }
<?php /************************************************************************/ /* AContent */ /************************************************************************/ /* Copyright (c) 2010 */ /* Inclusive Design Institute */ /* */ /* This program is free software. You can redistribute it and/or */ /* modify it under the terms of the GNU General Public License */ /* as published by the Free Software Foundation. */ /************************************************************************/ define('TR_INCLUDE_PATH', '../../include/'); require TR_INCLUDE_PATH . 'vitals.inc.php'; require_once TR_INCLUDE_PATH . 'classes/DAO/ContentDAO.class.php'; global $db; if (trim($_POST['field']) != "" && trim($_POST['value']) != "") { $fields = explode('-', $_POST['field']); $content_id = intval($fields[1]); if ($content_id > 0) { $contentDAO = new ContentDAO(); if ($contentDAO->UpdateField($content_id, 'title', $_POST['value'])) { $rtn['status'] = 'success'; $rtn['success'][] = _AT('TR_FEEDBACK_ACTION_COMPLETED_SUCCESSFULLY'); } else { $rtn['status'] = 'fail'; $rtn['success'][] = _AT('TR_ERROR_UNABLE_UPDATE_DB'); } echo json_encode($rtn); } }
//echo $nbr_c_affichee; if ($nbr_c_affichee == 0) { echo "<p>Aucun document n'est disponible pour cet enfant.</p>"; } echo '</div>'; //echo "<div id ='".$nomEnfant."_' hidden>TEST + id = ".$nomEnfant."</div> "; } echo '</div>'; ?> </div> <div class="col-sm-6" style="margin-bottom: 60px; border-left: 1px solid gainsboro;"> <div style='background-color: #6ED397; padding: 10px;'> <h1 style="margin-left: 27px; margin-bottom: 30px;"><span class="glyphicon glyphicon-blackboard"></span> Gestion des Scénarios de Présentation</h1> <?php $contentDao = new ContentDAO(DynamoDbClientBuilder::get()); $name_fileToDelete = $_GET['name']; $owner_fileToDelete = $_GET['owner']; // DELETE File if needed if (!empty($name_fileToDelete) && !empty($owner_fileToDelete)) { $s3 = new S3Access(S3ClientBuilder::get()); $s3->deleteFile($name_fileToDelete); $contentDao->delete($name_fileToDelete, $owner_fileToDelete); } /* echo "<a href=\"./listOfChildren.php\">Calendriers des enfants</a></br></br>"; echo "<a href=\"./drop.php\">Ajouter un fichier</a></br></br>"; echo "<a href=\"./contenueTexte.php\">Créer un contenue texte</a></br></br>"; */ echo '<div style="margin-left:15px;">'; echo '<form class="formB" action="listOfChildren.php"><button type="submit" class="btn btn-default" name="Valider" onclick > <span class="glyphicon glyphicon-calendar"></span> Calendriers des enfants </button></form>';
<?php include 'head.php'; ?> <title>Content </title> </head> <body> <?php include 'nav.php'; ?> <h1>Gestion de contenus de l'enfant</h1> <?php $root = './'; include "includes.php"; $contentDao = new ContentDAO(DynamoDbClientBuilder::get()); $childDao = new ChildDAO(DynamoDbClientBuilder::get()); $email = $_SESSION['email']; $child = $childDao->get($email); // URL parameter // parameter 'type', possible values : {teacher, family, doctor} $type = $_GET['type']; // use method getContentyType ?? if ($type == 'teacher') { $contents = $child->getTeachingContent(); } else { if ($type == 'family') { $contents = $child->getFamilyContent(); } else { if ($type == 'doctor') { $contents = $child->getMedicalContent();
public function getMenu() { $ContentDAO = ContentDAO::getInstance(); $ReturnDataVO = $ContentDAO->selectByTableId("category", 3, ContentDAO::RETURN_VO); return $ReturnDataVO; }
if (isset($_POST['cancel'])) { $msg->addFeedback('EXPORT_CANCELLED'); header('Location: ../index.php'); exit; } $zipfile = new zipfile(); $zipfile->create_dir('resources/'); /* get all the content */ $content = array(); $paths = array(); $top_content_parent_id = 0; $handler = new ContentOutputParser(); $parser = new XML_HTMLSax(); $parser->set_object($handler); $parser->set_element_handler('openHandler', 'closeHandler'); $contentDAO = new ContentDAO(); $rows = $contentDAO->getContentByCourseID($course_id); //if (authenticate(TR_PRIV_CONTENT, TR_PRIV_RETURN)) { // $sql = "SELECT *, UNIX_TIMESTAMP(last_modified) AS u_ts FROM ".TABLE_PREFIX."content WHERE course_id=$course_id ORDER BY content_parent_id, ordering"; //} else { // $sql = "SELECT *, UNIX_TIMESTAMP(last_modified) AS u_ts FROM ".TABLE_PREFIX."content WHERE course_id=$course_id ORDER BY content_parent_id, ordering"; //} //$result = mysql_query($sql, $db); //$cid = $_REQUEST['cid']; //takes care of some system which lost the REQUEST[cid] //while ($row = mysql_fetch_assoc($result)) { // if (authenticate(TR_PRIV_CONTENT, TR_PRIV_RETURN) || $contentManager->isReleased($row['content_id']) === TRUE) { if (is_array($rows)) { foreach ($rows as $row) { $content[$row['content_parent_id']][] = $row; if ($cid == $row['content_id']) { $top_content = $row;
public function delete() { $ReturnResultVO = new ReturnResultVO(); if (DataHandler::getValueByArrayIndex($this->arrayVariable, 'id') > 0) { $LinkDAO = new LinkDAO(); //deleta vinculos com categoria $ReturnDataVO = $LinkDAO->deleteAllFromLinkedTableByTableAndTableId('content', $this->content_id, 'category'); if ($ReturnDataVO->success) { $ContentDAO = ContentDAO::getInstance(); $ContentDAO->delete($this->content_id); if ($ReturnDataVO->success) { $ReturnResultVO->success = TRUE; $ReturnResultVO->addMessage("conteúdo apagado"); } else { $ReturnResultVO->addMessage("erro ao apagar o conteúdo"); } } else { $ReturnResultVO->addMessage("erro ao apagar o conteúdo"); } } // print_r($ReturnResultVO);exit(); return $ReturnResultVO; }