示例#1
0
 public function delete($name, $owner)
 {
     try {
         // DELETE the file from DynamoDB, table 'Contents'
         $this->client->deleteItem(array('TableName' => ContentDAO::$TABLE_NAME, 'Key' => array('name' => array('S' => $name), 'owner' => array('S' => $owner))));
         // GET the owner's type of the file
         $userDao = new UserDAO($this->client);
         $user = $userDao->get($owner);
         $type = $user->getType();
         // GET the children of the owner
         $childDao = new ChildDAO($this->client);
         $children = $childDao->getChildren($owner);
         // DELETE the file from children arrays
         $length = count($children);
         for ($i = 0; $i < $length; $i++) {
             $child = $children[$i];
             $child->deleteContent($name, $owner, $type);
             $childDao->update($child);
         }
     } catch (Exception $e) {
         echo '<p>Exception reçue : ', $e->getMessage(), "\n</p>";
     }
 }
 /**
  * Show a users profile
  * @param <type> $userid
  */
 public function actionProfile($userid)
 {
     //    TODO Add possibility to view by username
     $this->_assert($userid);
     $dao = UserDAO::get('User');
     $user = $dao->findById($userid);
     $this->_assert($user);
     // prepare the view
     $this->addView('user/profile', 'content');
     $this->pagetitle = 'User Profile';
     $this->content->user = $user;
 }
 private static function _toTimeline(Timeline $timelineDb)
 {
     return new TimelineModel($timelineDb->getId(), $timelineDb->getName(), UserDAO::get($timelineDb->getId()));
 }
示例#4
0
 echo "<div style='margin-bottom: 30px;'>" . $translArray[3] . ": <textarea name='contenueTexte" . ($ligne + 1 + 1) . "' id='ameliorer' rows='2' cols='100' style='margin-left: 40px;margin-bottom: -31px;'>" . $translArray[$ligne + 1 + 4] . "</textarea></div><br/>";
 /*                   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() . '&nbsp;</a></li>';
 }
 echo '  </ul>
                   </div><br/>';
示例#5
0
        <?php 
include $root . 'nav.php';
?>
        
        <?php 
$doy = new DaysOfYear();
$year = date('Y');
$calendar = $doy->getAll($year);
$access_rights = Rights::$NONE;
$child_email = $_GET['email'];
$adult_email = $_SESSION['email'];
if (!empty($child_email) && !empty($adult_email)) {
    $childDao = new ChildDAO(DynamoDbClientBuilder::get());
    $child = $childDao->get($child_email);
    $usrDao = new UserDAO(DynamoDbClientBuilder::get());
    $user = $usrDao->get($adult_email);
    if ($child->isFather($user->getEmail())) {
        $access_rights = Rights::$FULL_ACCESS;
        // pour l'instant en dur, plus tard dans la base
    }
    echo '<span class="email" email="' . $child_email . '"></span>';
    echo '<span class="adultEmail" email="' . $adult_email . '"   type="' . $user->getType() . '"></span>';
}
?>
    
        
           
        
        
        
        <div class ='periods'>