Browse Source

Adding first draft of the timeline library see #4570 (no change in the database)

Julio Montoya 13 years ago
parent
commit
3998e0ba0f

+ 25 - 7
main/css/base.css

@@ -2878,6 +2878,12 @@ form .formw .freeze {
    -o-box-shadow: 2px 2px 19px #aaa;
    -webkit-box-shadow: 2px 2px 19px #aaa;
    -moz-box-shadow: 2px 2px 19px #aaa;
+   
+    -webkit-border-radius: 6px;
+    -opera-border-radius: 6px;
+    -moz-border-radius: 6px;
+    border-radius: 6px;
+        
 
     background-color: white;
     border: 0.1em dotted #D4E06B;
@@ -2889,7 +2895,7 @@ form .formw .freeze {
     padding-top: 0.9em;
     position: absolute;
     text-align: center;
-    width: 80px;
+    width: 120px;
     z-index: 40;
 }
 
@@ -2934,9 +2940,7 @@ form .formw .freeze {
     border: 2px dotted orange;
 }
 
-
 .edit_block {
-    font-size:14px;
     z-index: 200;    
 }
 
@@ -3260,10 +3264,7 @@ a:active{
     display:none;
 }
 
-
-
-#timeline {
-    
+#my_timeline {    
     background: url("dot.gif") repeat-x scroll left 45px;
     height: 350px;
     margin: 0px auto;
@@ -3572,4 +3573,21 @@ a.forum_group_link {
 
 #hide_bar_template:hover {
     background-color:#aaa;
+}
+
+.timeline-example {
+    background-color: #FFFFFF;
+    border: 1px solid #CCCCCC;
+    border-radius: 10px 10px 10px 10px;
+    box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.25);
+    margin-bottom: 20px;
+    padding-bottom: 20px;
+    padding-top: 20px;
+}
+
+#timeline {
+    clear: both;
+    height: 600px !important;
+    position: relative !important;
+    z-index: 100;
 }

+ 33 - 4
main/inc/ajax/model.ajax.php

@@ -21,7 +21,7 @@ if (!in_array($sord, array('asc','desc'))) {
     $sord = 'desc'; 
 }
 
-if (!in_array($action, array('get_exercise_results', 'get_work_user_list'))) {
+if (!in_array($action, array('get_exercise_results', 'get_work_user_list', 'get_timelines'))) {
 	api_protect_admin_script(true);
 }
 
@@ -112,6 +112,11 @@ switch ($action) {
         require_once $libpath.'sessionmanager.lib.php';        
         $count = SessionManager::get_count_admin();
         break;
+    case 'get_timelines':
+        require_once $libpath.'timeline.lib.php';
+        $obj        = new Timeline();
+        $count      = $obj->get_count();
+        break;
     case 'get_gradebooks':
         require_once $libpath.'gradebook.lib.php';
         $obj        = new Gradebook();
@@ -162,6 +167,7 @@ $is_tutor                   = api_is_allowed_to_edit(true);
 
 //5. Querying the DB for the elements
 $columns = array();
+
 switch ($action) {    
     case 'get_work_user_list':        
         if (isset($_GET['type'])  && $_GET['type'] == 'simple') {
@@ -186,6 +192,29 @@ switch ($action) {
     case 'get_sessions':
         $columns = array('name', 'nbr_courses','category_name', 'date_start','date_end', 'coach_name', 'session_active', 'visibility');            
         $result = SessionManager::get_sessions_admin(array('where'=> $where_condition, 'order'=>"$sidx $sord", 'limit'=> "$start , $limit"));        
+        break;    
+     case 'get_timelines': 
+        $columns = array('headline', 'actions');   
+        //$columns = array('headline', 'type', 'start_date', 'end_date', 'text', 'media', 'media_credit', 'media_caption', 'title_slide', 'parent_id');
+   
+        if(!in_array($sidx, $columns)) {
+        	$sidx = 'headline';
+        }
+        $course_id = api_get_course_int_id();
+        $result     = Database::select('*', $obj->table, array('where' => array('parent_id = ? AND c_id = ?' => array('0', $course_id)), 'order'=>"$sidx $sord", 'LIMIT'=> "$start , $limit"));
+        $new_result = array();
+        foreach ($result as $item) {
+            if (!$item['status']) {
+                $item['name'] = '<font style="color:#AAA">'.$item['name'].'</font>';                
+            }
+            $item['headline'] = Display::url($item['headline'], api_get_path(WEB_CODE_PATH).'timeline/view.php?id='.$item['id']);
+            $item['actions'] = Display::url(Display::return_icon('add.png', get_lang('AddItems')), api_get_path(WEB_CODE_PATH).'timeline/?action=add_item&parent_id='.$item['id']);
+            $item['actions'] .= Display::url(Display::return_icon('edit.png', get_lang('Edit')), api_get_path(WEB_CODE_PATH).'timeline/?action=edit&id='.$item['id']);
+            $item['actions'] .= Display::url(Display::return_icon('delete.png', get_lang('Delete')), api_get_path(WEB_CODE_PATH).'timeline/?action=delete&id='.$item['id']);
+            
+            $new_result[] = $item;
+        } 
+        $result = $new_result;        
         break;
     case 'get_gradebooks': 
         $columns = array('name', 'certificates','skills', 'actions', 'has_certificates');                
@@ -253,8 +282,7 @@ switch ($action) {
             }
             $new_result[] = $item;
         } 
-        $result = $new_result;      
-        
+        $result = $new_result;
         break;
     case 'get_usergroups':
         $columns = array('name', 'users', 'courses','sessions','actions');
@@ -281,7 +309,8 @@ switch ($action) {
 }
 //var_dump($result);
 
-$allowed_actions = array('get_careers', 'get_promotions', 'get_usergroups', 'get_gradebooks', 'get_sessions', 'get_exercise_results', 'get_work_user_list');
+$allowed_actions = array('get_careers', 'get_promotions', 'get_usergroups', 'get_gradebooks', 
+                         'get_sessions', 'get_exercise_results', 'get_work_user_list', 'get_timelines');
 //5. Creating an obj to return a json
 if (in_array($action, $allowed_actions)) {
     $response           = new stdClass();           

+ 18 - 0
main/inc/ajax/timeline.ajax.php

@@ -0,0 +1,18 @@
+<?php
+require_once '../global.inc.php';
+require_once api_get_path(LIBRARY_PATH).'timeline.lib.php';
+
+$timeline = new Timeline();
+
+$action = $_GET['a'];
+
+switch ($action) {		
+	case 'get_timeline_content':
+        $items = $timeline->get_timeline_content($_GET['id']);
+        echo json_encode($items);      
+        /*echo '<pre>';
+        echo json_encode($items);
+        echo '</pre>';
+        var_dump($items);*/
+    break;
+}

+ 1 - 0
main/inc/lib/database.constants.inc.php

@@ -329,3 +329,4 @@ define('TABLE_MAIN_SKILL_PROFILE',          'skill_profile');
 define('TABLE_MAIN_SKILL_REL_PROFILE',      'skill_rel_profile');
 
 define('TABLE_MAIN_CHAT',					'chat');
+define('TABLE_TIMELINE',                    'timeline');

+ 2 - 2
main/inc/lib/database.lib.php

@@ -1148,7 +1148,7 @@ class Database {
      * @example array('where'=> array('name = "Julio" AND lastname = "montoya"))
     */
 
-    public static function select($columns, $table_name,  $conditions = array(), $type_result = 'all', $option = 'ASSOC') {
+    public static function select($columns, $table_name, $conditions = array(), $type_result = 'all', $option = 'ASSOC') {
         $conditions = self::parse_conditions($conditions);
         
         //@todo we could do a describe here to check the columns ...
@@ -1164,7 +1164,7 @@ class Database {
         }
 
         $sql    = "SELECT $clean_columns FROM $table_name $conditions";
-        //echo $sql.'<br />';
+        //var_dump($sql);
         $result = self::query($sql);
         $array = array();
         //if (self::num_rows($result) > 0 ) {

File diff suppressed because it is too large
+ 10 - 0
main/inc/lib/javascript/timeline/timeline-min.js


BIN
main/inc/lib/javascript/timeline/timeline-texture.png


+ 135 - 0
main/inc/lib/javascript/timeline/timeline.css

@@ -0,0 +1,135 @@
+#timeline h1,#timeline h2,#timeline h3,#timeline h4,#timeline h5,#timeline h6,#timeline p,#timeline blockquote,#timeline pre,#timeline a,#timeline abbr,#timeline acronym,#timeline address,#timeline cite,#timeline code,#timeline del,#timeline dfn,#timeline em,#timeline img,#timeline q,#timeline s,#timeline samp,#timeline small,#timeline strike,#timeline strong,#timeline sub,#timeline sup,#timeline tt,#timeline var,#timeline dd,#timeline dl,#timeline dt,#timeline li,#timeline ol,#timeline ul,#timeline fieldset,#timeline form,#timeline label,#timeline legend,#timeline button,#timeline table,#timeline caption,#timeline tbody,#timeline tfoot,#timeline thead,#timeline tr,#timeline th,#timeline td{margin:0;padding:0;border:0;font-weight:normal;font-style:normal;font-size:100%;line-height:1;font-family:inherit;}
+#timeline table{border-collapse:collapse;border-spacing:0;}
+#timeline ol,#timeline ul{list-style:none;}
+#timeline q:before,#timeline q:after,#timeline blockquote:before,#timeline blockquote:after{content:"";}
+#timeline a:focus{outline:thin dotted;}
+#timeline a:hover,#timeline a:active{outline:0;}
+#timeline article,#timeline aside,#timeline details,#timeline figcaption,#timeline figure,#timeline footer,#timeline header,#timeline hgroup,#timeline nav,#timeline section{display:block;}
+#timeline audio,#timeline canvas,#timeline video{display:inline-block;*display:inline;*zoom:1;}
+#timeline audio:not([controls]){display:none;}
+#timeline sub,#timeline sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}
+#timeline sup{top:-0.5em;}
+#timeline sub{bottom:-0.25em;}
+#timeline img{border:0;-ms-interpolation-mode:bicubic;}
+#timeline button,#timeline input,#timeline select,#timeline textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;}
+#timeline button,#timeline input{line-height:normal;*overflow:visible;}
+#timeline button::-moz-focus-inner,#timeline input::-moz-focus-inner{border:0;padding:0;}
+#timeline button,#timeline input[type="button"],#timeline input[type="reset"],#timeline input[type="submit"]{cursor:pointer;-webkit-appearance:button;}
+#timeline input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;}
+#timeline input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}
+#timeline textarea{overflow:auto;vertical-align:top;}
+html,body{height:100%;padding:0px;margin:0px;}
+#timeline{width:100%;height:100%;padding:0px;margin:0px;background-color:#ffffff;position:absolute;overflow:hidden;}#timeline .feedback{position:absolute;display:table;overflow:hidden;top:0px;left:0px;z-index:2000;width:100%;height:100%;background-color:#e9e9e9;border:1px solid #cccccc;}#timeline .feedback .messege{display:table-cell;vertical-align:middle;font-size:28px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:bold;text-transform:uppercase;line-height:36px;width:75%;margin-left:auto;margin-right:auto;margin-top:auto;margin-bottom:auto;text-align:center;}
+#timeline .container.main{position:absolute;top:0px:	left:0px;padding-bottom:3px;width:auto;height:auto;margin:0px;clear:both;}
+#timeline img,#timeline embed,#timeline object,#timeline video,#timeline iframe{max-width:100%;}
+#timeline img{max-height:100%;border:1px solid #999999;}
+#timeline a{color:#0088cc;text-decoration:none;}
+#timeline a:hover{color:#005580;text-decoration:underline;}
+#timeline .twitter{text-align:left;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;background-color:#ffffff;margin-left:auto;margin-right:auto;margin-bottom:15px;clear:both;}#timeline .twitter blockquote{font-size:15px;line-height:20px;color:#666666;}#timeline .twitter blockquote p{font-size:28px;line-height:36px;margin-bottom:6px;padding-top:10px;background-color:#ffffff;font-family:"Georgia",Times New Roman,Times,serif;color:#000000;}
+#timeline .twitter blockquote .quote-mark{color:#666666;}
+#timeline .twitter .created-at{background-image:url(timeline.png);background-repeat:no-repeat;background-position:0 -889px;width:24px;height:24px;width:24px;height:24px;overflow:hidden;margin-left:15px;display:inline-block;float:right;filter:alpha(opacity=25);-khtml-opacity:0.25;-moz-opacity:0.25;opacity:0.25;}
+#timeline .twitter .created-at:hover{filter:alpha(opacity=100);-khtml-opacity:1;-moz-opacity:1;opacity:1;}
+#timeline .twitter .vcard{float:right;margin-bottom:15px;}#timeline .twitter .vcard a{color:#333333;}
+#timeline .twitter .vcard a:hover{text-decoration:none;}#timeline .twitter .vcard a:hover .fn{text-decoration:underline;}
+#timeline .twitter .vcard .fn,#timeline .twitter .vcard .nickname{padding-left:42px;}
+#timeline .twitter .vcard .fn{display:block;font-weight:bold;}
+#timeline .twitter .vcard .nickname{margin-top:3px;display:block;color:#666666;}
+#timeline .twitter .vcard .avatar{float:left;display:block;width:32px;height:32px;}#timeline .twitter .vcard .avatar img{-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;}
+#timeline .layout-media .twitter{max-width:70%;}
+#timeline .thumbnail{width:24px;height:24px;overflow:hidden;float:left;margin-right:5px;border:1px solid #cccccc;}
+#timeline .thumbnail.twitter{background-image:url(timeline.png);background-repeat:no-repeat;background-position:0 -889px;width:24px;height:24px;}
+#timeline .thumbnail.vimeo{background-image:url(timeline.png);background-repeat:no-repeat;background-position:0 -963px;width:24px;height:24px;}
+#timeline .thumbnail.youtube{background-image:url(timeline.png);background-repeat:no-repeat;background-position:0 -1111px;width:24px;height:24px;}
+#timeline .thumbnail.soundcloud{background-image:url(timeline.png);background-repeat:no-repeat;background-position:0 -659px;width:24px;height:24px;}
+#timeline .thumbnail.map{background-image:url(timeline.png);background-repeat:no-repeat;background-position:0 -514px;width:26px;height:21px;}
+#timeline .thumbnail.website{background-image:url(timeline.png);background-repeat:no-repeat;background-position:0 -1037px;width:24px;height:24px;}
+#timeline .zFront{z-index:500;}
+#timeline{}#timeline .feature{width:100%;}#timeline .feature .slider{width:100%;float:left;position:relative;z-index:10;padding-top:15px;-webkit-box-shadow:1px 1px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:1px 1px 7px rgba(0, 0, 0, 0.3);box-shadow:1px 1px 7px rgba(0, 0, 0, 0.3);}#timeline .feature .slider h2.date{line-height:24px;}
+#timeline .feature .slider .date a,#timeline .feature .slider .title a{color:#999999;}
+#timeline .feature .slider blockquote{font-size:28px;text-align:left;line-height:36px;margin-bottom:6px;padding-top:10px;background-color:#ffffff;font-family:"Georgia",Times New Roman,Times,serif;color:#000000;}
+.slider{width:100%;height:100%;overflow:hidden;}.slider .slider-container-mask{text-align:center;width:100%;height:100%;overflow:hidden;}.slider .slider-container-mask .slider-container{position:absolute;top:0px;left:-2160px;width:100%;height:100%;text-align:center;display:block;background-color:#ffffff;}.slider .slider-container-mask .slider-container .slider-item-container{display:table-cell;vertical-align:middle;}
+.slider img,.slider embed,.slider object,.slider video,.slider iframe{max-width:100%;}
+.slider .nav-previous,.slider .nav-next{position:absolute;top:0px;width:100px;color:#DBDBDB;font-size:11px;}.slider .nav-previous .nav-container,.slider .nav-next .nav-container{height:100px;position:absolute;}
+.slider .nav-previous .icon,.slider .nav-next .icon{margin-bottom:15px;}
+.slider .nav-previous .date,.slider .nav-next .date{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:15px;font-weight:bold;line-height:#e9e9e9;text-transform:uppercase;margin-bottom:5px;}
+.slider .nav-previous .date,.slider .nav-next .date,.slider .nav-previous .title,.slider .nav-next .title{line-height:14px;}.slider .nav-previous .date a,.slider .nav-next .date a,.slider .nav-previous .title a,.slider .nav-next .title a{color:#999999;}
+.slider .nav-previous .date small,.slider .nav-next .date small,.slider .nav-previous .title small,.slider .nav-next .title small{display:none;}
+.slider .nav-previous:hover,.slider .nav-next:hover{color:#333333;cursor:pointer;}
+.slider .nav-previous{float:left;text-align:left;}.slider .nav-previous .icon{margin-left:10px;padding-left:20px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAWCAMAAAD6gTxzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRF2dnZWVlZsrKyv7+/TU1NzMzMjY2Nc3Nz5eXlgICAQEBA8vLymZmZZmZmMzMz////CXz3iwAAABB0Uk5T////////////////////AOAjXRkAAAB1SURBVHjafNFXDsAgDAPQAKWDUd//tq2EnS6p+eNJECcYWLmzklFq2Ud1iAKlVNFG2c/zoCiJIJlkA6lOlFBFXU+vIM26lkHypxvzmCnjgg91J6TPRaDJktMVwvATFc+ur7Gb02MCrfA2py/6amGe2b/jEGAA5cYUouw7P64AAAAASUVORK5CYII=) no-repeat scroll 0% 50%;}
+.slider .nav-previous .date,.slider .nav-previous .title{text-align:left;padding-left:10px;}
+.slider .nav-previous:hover .icon{margin-left:5px;padding-left:20px;}
+.slider .nav-next{float:right;text-align:right;}.slider .nav-next .icon{margin-right:10px;padding-right:20px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAWCAMAAAD6gTxzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRF2dnZWVlZsrKyv7+/TU1NzMzMjY2Nc3Nz5eXlgICAQEBA8vLymZmZZmZmMzMz////CXz3iwAAABB0Uk5T////////////////////AOAjXRkAAABySURBVHjabNFLEoAgDAPQAiJ/ev/buqCJONjlm5GkVcKwEbWR5uaaq4E0V7NB0mg0b5J2mCdpMqpC+kasaNkjrE3Ac530RgSSDkaQ0kFbN6N9g0X5KPFTteAzLuSPtQVScJyGpx1PyNo8NH9HxB6PAAMAzkAUorcBvvAAAAAASUVORK5CYII=) no-repeat scroll 100% 50%;}
+.slider .nav-next .date,.slider .nav-next .title{text-align:right;padding-right:10px;}
+.slider .nav-next:hover .icon{margin-right:5px;padding-right:20px;}
+.slider .slider-item{position:absolute;width:700px;height:100%;padding:0px;margin:0px;overflow:hidden;display:table;}.slider .slider-item .content{display:table-cell;vertical-align:middle;}.slider .slider-item .content .content-container{display:table;vertical-align:middle;}.slider .slider-item .content .content-container .text{width:40%;max-width:50%;min-width:120px;display:table-cell;vertical-align:middle;}.slider .slider-item .content .content-container .text .container{display:table-cell;vertical-align:middle;text-align:left;padding-right:15px;}
+.slider .slider-item .content .content-container .media{width:100%;min-width:50%;float:left;}.slider .slider-item .content .content-container .media .media-wrapper{margin-left:auto;margin-right:auto;}.slider .slider-item .content .content-container .media .media-wrapper .media-container{display:inline-block;overflow:hidden;line-height:0px;padding:0px;}.slider .slider-item .content .content-container .media .media-wrapper .media-container img,.slider .slider-item .content .content-container .media .media-wrapper .media-container iframe{border:1px solid #cccccc;}
+.slider .slider-item .content .content-container .media .media-wrapper .media-container .credit,.slider .slider-item .content .content-container .media .media-wrapper .media-container .caption{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;}
+.slider .slider-item .content .content-container .media .media-wrapper .media-container .credit{color:#999999;text-align:right;font-size:10px;line-height:10px;display:block;margin:0 auto;margin-top:4px;}
+.slider .slider-item .content .content-container .media .media-wrapper .media-container .caption{text-align:left;margin-top:10px;color:#666666;font-size:11px;line-height:14px;}
+.slider .slider-item .content .content-container .media.text-media .media-wrapper .media-container{border:none;background-color:#ffffff;}
+.slider .slider-item .content .content-container.layout-text{width:100%;}.slider .slider-item .content .content-container.layout-text .text{width:100%;max-width:100%;}.slider .slider-item .content .content-container.layout-text .text .container{display:block;vertical-align:middle;text-align:left;padding:0px;width:60%;text-align:left;margin-left:auto;margin-right:auto;}
+.slider .slider-item .content .content-container.layout-media{width:100%;}.slider .slider-item .content .content-container.layout-media .text{width:100%;height:100%;max-width:100%;display:block;text-align:center;}.slider .slider-item .content .content-container.layout-media .text .container{display:block;text-align:center;width:100%;margin-left:none;margin-right:none;}
+.slider .slider-item .content .content-container.layout-media .media{width:100%;min-width:50%;float:none;}.slider .slider-item .content .content-container.layout-media .media .media-wrapper{display:block;}.slider .slider-item .content .content-container.layout-media .media .media-wrapper .media-container{margin-left:auto;margin-right:auto;overflow:hidden;line-height:0px;padding:0px;}
+#timeline .navigation{clear:both;cursor:move;width:100%;height:200px;border-top:1px solid #cccccc;position:relative;}#timeline .navigation .toolbar{position:absolute;top:45px;left:0px;z-index:1000;background-color:#ffffff;border:1px solid #cccccc;-webkit-box-shadow:1px 1px 0px rgba(0, 0, 0, 0.2);-moz-box-shadow:1px 1px 0px rgba(0, 0, 0, 0.2);box-shadow:1px 1px 0px rgba(0, 0, 0, 0.2);}#timeline .navigation .toolbar .zoom-in,#timeline .navigation .toolbar .zoom-out,#timeline .navigation .toolbar .back-home{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:10px;font-weight:normal;line-height:20px;top:0px;z-index:1000;width:18px;height:18px;color:#333333;text-align:center;font-weight:bold;border:1px solid #ffffff;padding:5px;filter:alpha(opacity=50);-khtml-opacity:0.5;-moz-opacity:0.5;opacity:0.5;}
+#timeline .navigation .toolbar .zoom-in:hover,#timeline .navigation .toolbar .zoom-out:hover,#timeline .navigation .toolbar .back-home:hover{color:#0088cc;cursor:pointer;filter:alpha(opacity=100);-khtml-opacity:1;-moz-opacity:1;opacity:1;}
+#timeline .navigation .toolbar .zoom-in .icon{background-image:url(timeline.png);background-repeat:no-repeat;background-position:0 -1507px;width:16px;height:16px;}
+#timeline .navigation .toolbar .zoom-out .icon{background-image:url(timeline.png);background-repeat:no-repeat;background-position:0 -1647px;width:16px;height:16px;}
+#timeline .navigation .toolbar .back-home .icon{background-image:url(timeline.png);background-repeat:no-repeat;background-position:0 -1303px;width:16px;height:12px;}
+#timeline .navigation .timenav-background{position:absolute;cursor:move;top:0px;left:0px;height:150px;width:100%;background-color:#e9e9e9;}#timeline .navigation .timenav-background .timenav-interval-background{position:absolute;top:151px;left:0px;background:#ffffff;width:100%;height:49px;}#timeline .navigation .timenav-background .timenav-interval-background .top-highlight{position:absolute;top:-1px;left:0px;z-index:30;width:100%;height:1px;background:#ffffff;filter:alpha(opacity=50);-khtml-opacity:0.5;-moz-opacity:0.5;opacity:0.5;-webkit-box-shadow:1px 1px 5px rgba(0, 0, 0, 0.2);-moz-box-shadow:1px 1px 5px rgba(0, 0, 0, 0.2);box-shadow:1px 1px 5px rgba(0, 0, 0, 0.2);}
+#timeline .navigation .timenav-background .timenav-line{position:absolute;top:0px;left:50%;width:3px;height:150px;background:#0088cc;z-index:500;-webkit-box-shadow:1px 1px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:1px 1px 7px rgba(0, 0, 0, 0.3);box-shadow:1px 1px 7px rgba(0, 0, 0, 0.3);}
+#timeline .navigation .timenav{position:absolute;top:0px;left:-250px;z-index:1;}#timeline .navigation .timenav .content{position:relative;}#timeline .navigation .timenav .content .marker.start{display:none;}
+#timeline .navigation .timenav .content .marker.active .dot{background:#0088cc;z-index:200;}
+#timeline .navigation .timenav .content .marker.active .line{z-index:199;background:#0088cc;width:1px;}#timeline .navigation .timenav .content .marker.active .line .event-line{background:#0088cc;filter:alpha(opacity=75);-khtml-opacity:0.75;-moz-opacity:0.75;opacity:0.75;}
+#timeline .navigation .timenav .content .marker.active .flag{z-index:200;background-image:url(timeline.png);background-repeat:no-repeat;background-position:0 -110px;width:153px;height:60px;}#timeline .navigation .timenav .content .marker.active .flag .flag-content h3{color:#0088cc;}
+#timeline .navigation .timenav .content .marker.active .flag.row1,#timeline .navigation .timenav .content .marker.active .flag.row2,#timeline .navigation .timenav .content .marker.active .flag.row3{z-index:200;}
+#timeline .navigation .timenav .content .marker.active:hover{cursor:default;}#timeline .navigation .timenav .content .marker.active:hover .flag .flag-content h3{color:#0088cc;}
+#timeline .navigation .timenav .content .marker.active:hover .flag .flag-content h4{color:#999999;}
+#timeline .navigation .timenav .content .marker:hover .line{z-index:500;background:#999999;}
+#timeline .navigation .timenav .content .marker{position:absolute;top:0px;left:150px;display:block;}#timeline .navigation .timenav .content .marker .dot{position:absolute;top:150px;left:0px;display:block;width:6px;height:6px;background:#333333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;z-index:21;}
+#timeline .navigation .timenav .content .marker .line{position:absolute;top:0px;left:3px;width:1px;height:150px;background:#cccccc;z-index:22;}#timeline .navigation .timenav .content .marker .line .event-line{position:absolute;z-index:22;left:0px;height:1px;width:1px;background:#0088cc;filter:alpha(opacity=15);-khtml-opacity:0.15;-moz-opacity:0.15;opacity:0.15;}
+#timeline .navigation .timenav .content .marker .flag{position:absolute;top:15px;left:3px;padding:0px;display:block;z-index:23;width:153px;height:56px;background-image:url(timeline.png);background-repeat:no-repeat;background-position:0 0;width:153px;height:60px;}#timeline .navigation .timenav .content .marker .flag .flag-content{padding:5px 7px 2px 5px;overflow:hidden;height:33px;}#timeline .navigation .timenav .content .marker .flag .flag-content h3{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:15px;font-weight:bold;line-height:20px;font-size:11px;line-height:11px;color:#999999;margin-bottom:2px;}#timeline .navigation .timenav .content .marker .flag .flag-content h3 small{display:none;}
+#timeline .navigation .timenav .content .marker .flag .flag-content h4{display:none;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:15px;font-weight:normal;line-height:20px;font-size:10px;line-height:10px;color:#aaaaaa;}#timeline .navigation .timenav .content .marker .flag .flag-content h4 small{display:none;}
+#timeline .navigation .timenav .content .marker .flag .flag-content .thumbnail{margin-bottom:15px;}
+#timeline .navigation .timenav .content .marker .flag:hover{cursor:pointer;background-image:url(timeline.png);background-repeat:no-repeat;background-position:0 -110px;width:153px;height:60px;}#timeline .navigation .timenav .content .marker .flag:hover .flag-content h3{color:#333333;}
+#timeline .navigation .timenav .content .marker .flag:hover .flag-content h4{color:#aaaaaa;}
+#timeline .navigation .timenav .content .marker .flag.row1{z-index:25;top:48px;}
+#timeline .navigation .timenav .content .marker .flag.row2{z-index:24;top:96px;}
+#timeline .navigation .timenav .content .marker .flag.row3{z-index:23;top:1px;}
+#timeline .navigation .timenav .content .marker .flag.zFront{z-index:100;}
+#timeline .navigation .timenav .content .era{position:absolute;top:138px;left:150px;height:12px;display:block;background:#0088cc;overflow:hidden;border-left:1px solid #cccccc;border-right:1px solid #cccccc;border-top:1px solid #cccccc;filter:alpha(opacity=75);-khtml-opacity:0.75;-moz-opacity:0.75;opacity:0.75;-moz-border-radius-topleft:7px;-webkit-border-top-left-radius:7px;border-top-left-radius:7px;-moz-border-radius-topright:7px;-webkit-border-top-right-radius:7px;border-top-right-radius:7px;z-index:-10;}#timeline .navigation .timenav .content .era h3{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:10px;font-weight:bold;line-height:10px;color:#ffffff;position:absolute;top:-1px;left:9px;}
+#timeline .navigation .timenav .time{position:absolute;left:0px;top:150px;height:50px;background-color:#ffffff;}#timeline .navigation .timenav .time .time-interval-minor{height:6px;white-space:nowrap;position:absolute;top:-9px;left:8px;z-index:10;}#timeline .navigation .timenav .time .time-interval-minor .minor{position:relative;top:0px;display:inline-block;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAMCAMAAACdvocfAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRFzMzM////040VdgAAAAJ0Uk5T/wDltzBKAAAAEklEQVR42mJgYAQCBopJgAADAAbwADHy2qHzAAAAAElFTkSuQmCC);width:100px;height:6px;background-position:center top;white-space:nowrap;color:#666666;margin-top:0px;padding-top:0px;}
+#timeline .navigation .timenav .time .time-interval{white-space:nowrap;position:absolute;top:5px;left:0px;}#timeline .navigation .timenav .time .time-interval div{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAMCAMAAACdvocfAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRFzMzM////040VdgAAAAJ0Uk5T/wDltzBKAAAAEklEQVR42mJgYAQCBopJgAADAAbwADHy2qHzAAAAAElFTkSuQmCC);background-position:left top;background-repeat:no-repeat;padding-top:3px;position:absolute;height:3px;left:0px;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:10px;font-weight:normal;line-height:20px;text-transform:uppercase;text-align:left;text-indent:0px;white-space:nowrap;color:#666666;margin-left:0px;margin-right:0px;margin-top:1px;z-index:2;}#timeline .navigation .timenav .time .time-interval div strong{font-weight:bold;color:#000000;}
+#timeline .navigation .timenav .time .time-interval-major{white-space:nowrap;position:absolute;top:5px;left:0px;}#timeline .navigation .timenav .time .time-interval-major div{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAMCAMAAACdvocfAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRFzMzM////040VdgAAAAJ0Uk5T/wDltzBKAAAAEklEQVR42mJgYAQCBopJgAADAAbwADHy2qHzAAAAAElFTkSuQmCC);background-position:left top;background-repeat:no-repeat;padding-top:15px;position:absolute;height:15px;left:0px;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-weight:bold;line-height:20px;text-transform:uppercase;text-align:left;text-indent:0px;white-space:nowrap;color:#333333;margin-left:0px;margin-right:0px;margin-top:1px;z-index:5;}#timeline .navigation .timenav .time .time-interval-major div strong{font-weight:bold;color:#000000;}
+#timeline{font-family:"Georgia",Times New Roman,Times,serif;-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;font-size:15px;font-weight:normal;line-height:20px;}#timeline p{font-size:15px;font-weight:normal;line-height:20px;margin-bottom:20px;color:#666666;}#timeline p small{font-size:13px;}
+#timeline p:first-child{margin-top:20px;}
+#timeline .navigation p{color:#999999;}
+#timeline .feature h3,#timeline .feature h4,#timeline .feature h5,#timeline .feature h6{margin-bottom:15px;}
+#timeline .feature p{color:#666666;}
+#timeline h1,#timeline h2,#timeline h3,#timeline h4,#timeline h5,#timeline h6{font-weight:normal;color:#000000;text-transform:none;}#timeline h1 a,#timeline h2 a,#timeline h3 a,#timeline h4 a,#timeline h5 a,#timeline h6 a{color:#999999;}
+#timeline h1 small,#timeline h2 small,#timeline h3 small,#timeline h4 small,#timeline h5 small,#timeline h6 small{color:#999999;}
+#timeline h1.date,#timeline h2.date,#timeline h3.date,#timeline h4.date,#timeline h5.date,#timeline h6.date{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:bold;}
+#timeline h2.start{font-size:42px;line-height:44px;}
+#timeline h1{margin-bottom:15px;font-size:32px;line-height:34px;}#timeline h1 small{font-size:18px;}
+#timeline h2{margin-bottom:15px;font-size:28px;line-height:30px;}#timeline h2 small{font-size:14px;line-height:16px;}
+#timeline h3,#timeline h4,#timeline h5,#timeline h6{line-height:40px;}#timeline h3 .active,#timeline h4 .active,#timeline h5 .active,#timeline h6 .active{color:#0088cc;}
+#timeline h3{font-size:24px;line-height:26px;}#timeline h3 small{font-size:14px;}
+#timeline h4{font-size:16px;line-height:18px;}#timeline h4 small{font-size:12px;}
+#timeline h5{font-size:14px;line-height:16px;}
+#timeline h6{font-size:13px;line-height:14px;text-transform:uppercase;}
+#timeline strong{font-weight:bold;}
+#timeline Q{quotes:'„' '“';font-style:italic;}
+#timeline .credit,#timeline .caption{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;}
+#timeline .credit{color:#999999;text-align:right;font-size:10px;line-height:10px;display:block;margin:0 auto;clear:both;}
+#timeline .caption{text-align:left;margin-top:5px;color:#666666;font-size:11px;line-height:14px;clear:both;}
+.tooltip{position:absolute;z-index:1020;display:block;visibility:visible;padding:5px;opacity:0;filter:alpha(opacity=0);font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:15px;font-weight:bold;line-height:20px;font-size:12px;line-height:12px;}
+.tooltip.in{opacity:0.8;filter:alpha(opacity=80);}
+.tooltip.top{margin-top:-2px;}
+.tooltip.right{margin-left:2px;}
+.tooltip.bottom{margin-top:2px;}
+.tooltip.left{margin-left:-2px;}
+.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;}
+.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000000;}
+.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000000;}
+.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000000;}
+.tooltip-inner{max-width:200px;padding:3px 8px;color:#ffffff;text-align:center;text-decoration:none;background-color:#000000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
+.tooltip-arrow{position:absolute;width:0;height:0;}

BIN
main/inc/lib/javascript/timeline/timeline.png


+ 30 - 9
main/inc/lib/model.lib.php

@@ -14,6 +14,7 @@ class Model {
     var $table;
     var $columns;
     var $required;
+    var $is_course_model =false;
     
     // var $pk; some day this will be implemented
     
@@ -39,8 +40,13 @@ class Model {
      */
     public function delete($id) {
         if (empty($id) or $id != strval(intval($id))) { return false; }
+        $params = array('id = ?' => $id);        
+        if ($this->is_course_model) {
+            $course_id = api_get_course_int_id();
+            $params = array('id = ? AND c_id = ?' => array($id, $course_id));
+        }
         // Database table definition
-        $result = Database :: delete($this->table, array('id = ?' => $id));        
+        $result = Database :: delete($this->table,$params );        
         if ($result != 1){
             return false;
         }       
@@ -64,20 +70,23 @@ class Model {
      */
     public function display() { 
     }    
-    
-
      
     /**
      * Gets an element
      */
     public function get($id) {
-        if (empty($id)) { return array(); }     
-        $result = Database::select('*',$this->table, array('where'=>array('id = ?'=>intval($id))),'first');
+        if (empty($id)) { return array(); }    
+        $params = array('id = ?'=>intval($id));
+        if ($this->is_course_model) {
+            $course_id = api_get_course_int_id();
+            $params = array('id = ? AND c_id = ?' => array($id, $course_id));
+        }
+        $result = Database::select('*',$this->table, array('where' => $params),'first');
         return $result;
     }
     
-    public function get_all($options = null) {        
-        return Database::select('*',$this->table, $options);
+    public function get_all($options = null) {
+        return Database::select('*', $this->table, $options);
     }
     
     /**
@@ -91,8 +100,7 @@ class Model {
     /**
      * a little bit of javascript to display
      */
-	public function javascript() {
-		
+	public function javascript() {		
 	}
 
 	/**
@@ -105,6 +113,11 @@ class Model {
 	public function save($params, $show_query = false) {
         $params = $this->clean_parameters($params);
         
+        if ($this->is_course_model) {            
+            if (!isset($params['c_id']) || empty($params['c_id'])) {
+                $params['c_id'] = api_get_course_int_id();
+            }
+        }
         
         if (!empty($this->required)) {
             $require_ok = true;     
@@ -122,6 +135,7 @@ class Model {
         if (in_array('created_at', $this->columns)) {        	
             $params['created_at'] = api_get_utc_datetime();
         }
+        
         if (!empty($params)) {
             $id = Database::insert($this->table, $params, $show_query);        
     		if (is_numeric($id)){
@@ -139,6 +153,13 @@ class Model {
      */
     public function update($params) {
         $params = $this->clean_parameters($params);
+           
+        if ($this->is_course_model) {            
+            if (!isset($params['c_id']) || empty($params['c_id'])) {
+                $params['c_id'] = api_get_course_int_id();
+            }
+        }
+        
         //If the class has the updated_at field we update the date
         if (in_array('updated_at', $this->columns)) {           
             $params['updated_at'] = api_get_utc_datetime();

+ 236 - 0
main/inc/lib/timeline.lib.php

@@ -0,0 +1,236 @@
+<?php
+/* For licensing terms, see /license.txt */
+/**
+*	This class provides methods for the notebook management.
+*	Include/require it in your code to use its features.
+*	@package chamilo.library
+*/
+/**
+ * Code
+ */
+
+/**
+ * @package chamilo.library
+ */
+define('TIMELINE_STATUS_ACTIVE', '1');
+define('TIMELINE_STATUS_INACTIVE', '2');
+
+class Timeline extends Model {    
+    var $table;
+    var $columns = array('headline', 'type', 'start_date', 'end_date', 'text', 'media', 'media_credit', 'media_caption', 'title_slide', 'parent_id', 'status','c_id');
+    var $is_course_model = true;
+    
+	public function __construct() {
+        $this->table =  Database::get_course_table(TABLE_TIMELINE);
+	}    
+    
+    /**
+     * Get the count of elements
+     */
+    public function get_count() {        
+        $course_id = api_get_course_int_id();
+        $row = Database::select('count(*) as count', $this->table, array('where' => array('parent_id = ? AND c_id = ?' => array('0', $course_id))), 'first');
+        return $row['count'];
+    }     
+    
+    public function get_all($where_conditions = array()) {        
+        return Database::select('*',$this->table, array('where'=>$where_conditions,'order' =>'headline ASC'));
+    }
+    
+    /**
+     * Displays the title + grid
+     */
+	public function listing() {
+		// action links
+		$html .= '<div class="actions">';
+        //$html .= '<a href="career_dashboard.php">'.Display::return_icon('back.png',get_lang('Back'),'','32').'</a>';     	
+		$html .= '<a href="'.api_get_self().'?action=add">'.Display::return_icon('add.png', get_lang('Add'),'','32').'</a>';        				
+		$html .= '</div>';
+        $html .= Display::grid_html('timelines');  
+        return $html;
+	}
+    
+    public function get_status_list() {
+        return array(TIMELINE_STATUS_ACTIVE => get_lang('Active'), TIMELINE_STATUS_INACTIVE => get_lang('Inactive'));
+    }
+    
+    /**
+     * Returns a Form validator Obj
+     * @todo the form should be auto generated
+     * @param   string  url
+     * @param   string  action add, edit
+     * @return  obj     form validator obj 
+     */
+    public function return_form($url, $action) {
+        $form = new FormValidator('timeline', 'post', $url);
+        // Settting the form elements
+        $header = get_lang('Add');        
+        if ($action == 'edit') {
+            $header = get_lang('Modify');
+        }        
+        $form->addElement('header', $header);
+        $id = isset($_GET['id']) ? intval($_GET['id']) : '';
+        $form->addElement('hidden', 'id', $id);
+        
+        $form->addElement('text', 'headline', get_lang('Name'), array('size' => '70'));
+        //$form->add_html_editor('description', get_lang('Description'), false, false, array('ToolbarSet' => 'careers','Width' => '100%', 'Height' => '250'));	   
+	    $status_list = $this->get_status_list();         
+        $form->addElement('select', 'status', get_lang('Status'), $status_list);
+        if ($action == 'edit') {
+            //$form->addElement('text', 'created_at', get_lang('CreatedAt'));
+            //$form->freeze('created_at');
+        }                
+        if ($action == 'edit') {
+        	$form->addElement('style_submit_button', 'submit', get_lang('Modify'), 'class="save"');
+        } else {
+        	$form->addElement('style_submit_button', 'submit', get_lang('Add'), 'class="save"');
+        }
+        
+        $form->addRule('headline', '<div class="required">'.get_lang('ThisFieldIsRequired'), 'required');
+    
+        // Setting the defaults
+        $defaults = $this->get($id);
+        
+        /*if (!empty($defaults['created_at'])) {
+        	$defaults['created_at'] = api_convert_and_format_date($defaults['created_at']);
+        }
+        if (!empty($defaults['updated_at'])) {
+        	$defaults['updated_at'] = api_convert_and_format_date($defaults['updated_at']);
+        }*/
+        $form->setDefaults($defaults);
+    
+        // Setting the rules
+        $form->addRule('headline', '<div class="required">'.get_lang('ThisFieldIsRequired'), 'required');               
+		return $form;                                
+    }
+    
+    public function return_item_form($url, $action) {	
+        
+        $form = new FormValidator('item_form', 'post', $url);
+        // Settting the form elements
+        $header = get_lang('Add');        
+        if ($action == 'edit') {
+            $header = get_lang('Modify');
+        }        
+        $form->addElement('header', $header);
+        $id = isset($_GET['id']) ? intval($_GET['id']) : '';
+        $parent_id = isset($_GET['parent_id']) ? intval($_GET['parent_id']) : '';
+        $form->addElement('hidden', 'parent_id', $parent_id);      
+        $form->addElement('hidden', 'id', $id);
+        $form->addElement('text', 'headline', get_lang('Name'), array('class' => 'span4'));
+        
+        //@todo fix this
+        $form->addElement('text', 'start_date', get_lang('start_date'), array('size' => '70'));
+        $form->addElement('text', 'end_date', get_lang('end_date'), array('size' => '70'));
+        $form->addElement('textarea', 'text', get_lang('text'), array('class' => 'span3'));
+        $form->addElement('text', 'media', get_lang('media'), array('size' => '70'));
+        $form->addElement('text', 'media_caption', get_lang('media_caption'), array('size' => '70'));
+        $form->addElement('text', 'media_credit', get_lang('media_credit'), array('size' => '70'));
+        $form->addElement('text', 'title_slide', get_lang('title_slide'), array('size' => '70'));
+        
+        $form->addRule('headline', '<div class="required">'.get_lang('ThisFieldIsRequired'), 'required');
+        $form->addRule('start_date', '<div class="required">'.get_lang('ThisFieldIsRequired'), 'required');
+       
+        
+        //$form->add_html_editor('description', get_lang('Description'), false, false, array('ToolbarSet' => 'careers','Width' => '100%', 'Height' => '250'));	   
+	    
+        if ($action == 'edit') {
+            // Setting the defaults
+            $defaults = $this->get($id);
+        	$form->addElement('style_submit_button', 'submit', get_lang('Modify'), 'class="save"');
+        } else {
+        	$form->addElement('style_submit_button', 'submit', get_lang('Add'), 'class="save"');
+        }
+        
+        /*if (!empty($defaults['created_at'])) {
+        	$defaults['created_at'] = api_convert_and_format_date($defaults['created_at']);
+        }
+        if (!empty($defaults['updated_at'])) {
+        	$defaults['updated_at'] = api_convert_and_format_date($defaults['updated_at']);
+        }*/
+        $form->setDefaults($defaults);
+    
+        // Setting the rules
+        $form->addRule('headline', '<div class="required">'.get_lang('ThisFieldIsRequired'), 'required');               
+		return $form; 
+        
+    }
+    
+    public function save_item($params) {
+        $params['c_id'] = api_get_course_int_id();        
+	    $id = parent::save($params);
+	    if (!empty($id)) {
+	    	//event_system(LOG_CAREER_CREATE, LOG_CAREER_ID, $id, api_get_utc_datetime(), api_get_user_id());
+   		}
+   		return $id;   
+    }
+    
+    public function save($params) {
+        $params['c_id'] = api_get_course_int_id();
+        $params['parent_id'] = '0';
+        $params['type'] = 'default';
+	    $id = parent::save($params);
+	    if (!empty($id)) {
+	    	//event_system(LOG_CAREER_CREATE, LOG_CAREER_ID, $id, api_get_utc_datetime(), api_get_user_id());
+   		}
+   		return $id;
+    }
+    
+    public function delete($id) {
+	    parent::delete($id);
+	    //event_system(LOG_CAREER_DELETE, LOG_CAREER_ID, $id, api_get_utc_datetime(), api_get_user_id());
+    }
+    
+    public function get_url($id) {
+        return api_get_path(WEB_AJAX_PATH).'timeline.ajax.php?a=get_timeline_content&id='.intval($id);
+    }
+    
+    public function get_timeline_content($id) {
+        $timeline = array();
+        $course_id = api_get_course_int_id();
+        $timeline['timeline'] = $this->process_item($this->get($id));        
+        $items = $this->process_items($this->get_all(array('parent_id = ? AND c_id = ? ' =>array($id, $course_id))));                
+        $timeline['timeline']['date'] = $items;
+        return $timeline;
+    }
+    
+    function process_items($items) {
+        foreach ($items as &$item) {
+            $item = $this->process_item($item);
+        }
+        $new_array = array();
+        foreach ($items as $item) {
+            $new_array[] = $item;
+        }
+        return $new_array;
+    }
+    function process_item($item) {
+        $item['startDate'] = $item['start_date'];
+        unset($item['start_date']);
+        if (!empty($item['end_date'])) {
+            $item['endDate'] = $item['end_date'];
+        } else {
+            unset($item['endDate']);            
+        }
+        unset($item['end_date']);
+        // Assets
+        $item['asset'] = array( 'media'     => $item['media'],
+                                'credit'    => $item['media_credit'],  
+                                'caption'   => $item['media_caption'],  
+         );
+        
+        //Cleaning items
+        unset($item['id']);
+        if (empty($item['type'])) {
+            unset($item['type']);
+        }
+        unset($item['media']);
+        unset($item['media_credit']);
+        unset($item['media_caption']);
+        unset($item['status']);
+        unset($item['title_slide']);
+        unset($item['parent_id']);        
+        unset($item['c_id']);
+        return $item;        
+    }
+}

+ 0 - 4
main/template/default/layout/layout_1_col.tpl

@@ -1,9 +1,7 @@
 {extends file="default/layout/main.tpl"}
 {* Header *}
 {block name="header"}
-{if $show_header}
 {include file="default/layout/main_header.tpl"}
-{/if}	
 {/block}
 {* 1 column *}
 {block name=body}
@@ -14,8 +12,6 @@
             {$plugin_content_top}
         </div>
     {/if}
-    
-    
     <div class="span12">            
         {include file="default/layout/page_body.tpl"}
         {if !empty($content)}

+ 6 - 6
main/template/default/layout/no_layout.tpl

@@ -1,12 +1,12 @@
-<!DOCTYPE html
-     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{$document_language}" lang="{$document_language}">
+<!DOCTYPE html>
+<!--[if lt IE 7]> <html lang="{$document_language}" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
+<!--[if IE 7]>    <html lang="{$document_language}" class="no-js lt-ie9 lt-ie8"> <![endif]-->
+<!--[if IE 8]>    <html lang="{$document_language}" class="no-js lt-ie9"> <![endif]-->
+<!--[if gt IE 8]><!--><html lang="{$document_language}" class="no-js"> <!--<![endif]-->
 <head>
 {include file="default/layout/head.tpl"}
 </head>
-
-<body dir="{$text_direction}">
+<body dir="{$text_direction}" class="{$section_name}">
 {block name="header"}{/block}
 {block name="body"}
 {$content}

+ 18 - 0
main/timeline/insert.sql

@@ -0,0 +1,18 @@
+-- Insert this in your Chamilo 1.9 Database
+
+CREATE TABLE c_timeline (
+  id INTEGER  NOT NULL AUTO_INCREMENT,
+  c_id INTEGER  NOT NULL,
+  headline VARCHAR(255)  NOT NULL,
+  type VARCHAR(255)  NOT NULL,
+  start_date VARCHAR(255)  NOT NULL,
+  end_date VARCHAR(255)  NOT NULL,
+  text VARCHAR(255)  NOT NULL,
+  media VARCHAR(255)  NOT NULL,
+  media_credit VARCHAR(255)  NOT NULL,
+  media_caption VARCHAR(255)  NOT NULL,
+  title_slide VARCHAR(255)  NOT NULL,
+  parent_id INTEGER  DEFAULT 0 NOT NULL,
+  status INTEGER  NOT NULL,
+  PRIMARY KEY (id, c_id)
+);

+ 40 - 0
main/timeline/view.php

@@ -0,0 +1,40 @@
+<?php
+/* For licensing terms, see /license.txt */
+/**	
+	@author Julio Montoya <gugli100@gmail.com> BeezNest 2011
+*	@package chamilo.timeline
+*/
+
+// name of the language file that needs to be included
+$language_file = array ('registration','admin');
+require_once '../inc/global.inc.php';
+
+require_once api_get_path(LIBRARY_PATH).'timeline.lib.php';  
+
+$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Timeline'));
+$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('Listing'));
+
+$timeline = new Timeline();
+if (empty($_GET['id'])) {
+    api_not_allowed();
+}
+$url = $timeline->get_url($_GET['id']);
+$item = $timeline->get($_GET['id']);
+$interbreadcrumb[]=array('url' => '#','name' => $item['headline']);
+
+$htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH).'javascript/timeline/timeline.css');
+$htmlHeadXtra[] = api_get_js('timeline/timeline-min.js');
+$htmlHeadXtra[] = '
+<script>
+	$(document).ready(function() {
+		var timeline = new VMM.Timeline();
+		timeline.init("'.$url.'");			
+	});
+</script>';
+$content = '<div class="timeline-example"><div id="timeline"></div></div>';
+
+$tpl = new Template($tool_name);
+$tpl->assign('actions', $actions);
+$tpl->assign('message', $message);
+$tpl->assign('content', $content);
+$tpl->display_one_col_template();

Some files were not shown because too many files changed in this diff