Julio Montoya 12 years ago
parent
commit
b07929ba24

+ 5 - 6
main/admin/user_edit.php

@@ -20,7 +20,7 @@ $user_id = isset($_GET['user_id']) ? intval($_GET['user_id']) : intval($_POST['u
 api_protect_super_admin($user_id);
 
 $htmlHeadXtra[] = '
-<script type="text/javascript">
+<script>
 <!--
 function enable_expiration_date() { //v2.0
 	document.user_edit.radio_expiration_date[0].checked=false;
@@ -348,14 +348,13 @@ if ( $form->validate()) {
 			}
 		}
 
-		$extras = array();
-		foreach($user as $key => $value) {
+		foreach ($user as $key => $value) {
 			if(substr($key, 0, 6) == 'extra_') { //an extra field
-				$myres = UserManager::update_extra_field_value($user_id, substr($key, 6), $value);
+				UserManager::update_extra_field_value($user_id, substr($key, 6), $value);
 			}
 		}
 
-		if (!empty ($email) && $send_mail) {
+		if (!empty($email) && $send_mail) {
 			$recipient_name = api_get_person_name($firstname, $lastname, null, PERSON_NAME_EMAIL_ADDRESS);
 			$emailsubject = '['.api_get_setting('siteName').'] '.get_lang('YourReg').' '.api_get_setting('siteName');
 			$sender_name = api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'), null, PERSON_NAME_EMAIL_ADDRESS);
@@ -370,7 +369,7 @@ if ( $form->validate()) {
 			} else {
 				$emailbody=get_lang('Dear')." ".stripslashes(api_get_person_name($firstname, $lastname)).",\n\n".get_lang('YouAreReg')." ". api_get_setting('siteName') ." ".get_lang('WithTheFollowingSettings')."\n\n".get_lang('Username')." : ". $username . (($reset_password > 0) ? "\n". get_lang('Pass')." : ".stripslashes($password) : "") . "\n\n" .get_lang('Address') ." ". api_get_setting('siteName') ." ". get_lang('Is') ." : ". $_configuration['root_web'] ."\n\n". get_lang('Problem'). "\n\n". get_lang('Formula').",\n\n".api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))."\n". get_lang('Manager'). " ".api_get_setting('siteName')."\nT. ".api_get_setting('administratorTelephone')."\n" .get_lang('Email') ." : ".api_get_setting('emailAdministrator');
 			}
-			@api_mail($recipient_name, $email, $emailsubject, $emailbody, $sender_name, $email_admin);
+			@api_mail_html($recipient_name, $email, $emailsubject, $emailbody, $sender_name, $email_admin);
 		}
 		$tok = Security::get_token();
 		header('Location: user_list.php?action=show_message&message='.urlencode(get_lang('UserUpdated')).'&sec_token='.$tok);

+ 38 - 24
main/css/base.css

@@ -153,6 +153,15 @@ form .formw input {
     padding: 19px;
 }
 
+.well_login {
+    margin: 0 auto; 
+    width: 200px;
+}
+
+.well_login button {
+    margin-left: 0px;
+}
+
 #progress_bar img {
     height:26px;
 }
@@ -1981,13 +1990,18 @@ input.maininput:focus {
 
 /* LP tool*/
 
+
+#lp_overview .thumbnail {
+    text-align: center;    
+}
+
 .lp_resource {
     padding:5px 10px;    
     list-style-type: none;
     margin: 0;
     padding: 0;
     float:left;
-    width:70%;
+    width:50%;
 }
 
 .lp_resource_element, .lp_resource_element_no_link {
@@ -2004,18 +2018,8 @@ input.maininput:focus {
     list-style: none outside none;    
 }   
 
-.lp_resource_element_new {
-    background-image:-moz-linear-gradient(top,#fefefe,#eee);
-    background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#fdfdfd),color-stop(1,#eee));
-    border: 1px solid #CCCCCC;
-    color: #444444;
-    cursor: pointer;
-    font-weight: bold;
-    text-decoration: none;
-    text-shadow: 0 1px 1px #F6F6F6;
-    margin:5px;
-    padding:5px;    
-    list-style: none outside none; 
+.lp_resource_element_new a {
+   font-size: 14px;
 }
 
 .doc_resource {
@@ -2036,9 +2040,6 @@ table.lp_build td.tree {
     min-height:380px;
 }
 
-#logo {    
-}
-
 div.system_announcement {
     background-color: #EEEEEE;
 }
@@ -2066,7 +2067,6 @@ div.system_announcement {
     width: 98%;
 }
 
-
 div.admin_section {
      min-height: 260px;
 }
@@ -2737,6 +2737,8 @@ form .formw .freeze {
     color:#999;
 }
 
+
+
 /* jsPlumb */
 
 .skill_root {
@@ -3073,7 +3075,7 @@ a:active{
     margin-right: 4px;    
 }
 
-.thumbnail .caption {
+#online_grid_container .thumbnail .caption {
     text-align:center;
 }
 
@@ -3847,13 +3849,16 @@ footer {
     font-weight: normal;
 }
 
+.ui-state-highlight_lp {
+    border: 1px solid #FEAA18; 
+    background: #FFB738; 
+    color: #363636;
+    height:20px;
+    width: 70%;
+}
+
 
-.bottom_actions {
- 	/*background:#efefef;
-    border:1px solid #ccc;         
-    padding:10px;
-    vertical-align:middle;    
-    */
+.bottom_actions {	
     display: block; 
     width: 100%;    
 }
@@ -3864,4 +3869,13 @@ footer {
     bottom: 0;   
     left: 0px;    
     margin-bottom: 0px;
+}
+
+.doc_folder {
+    margin-right:5px;
+    margin-top:5px;
+}
+
+.doc_resource{
+   margin: 5px;    
 }

BIN
main/img/icons/64/settings.png


BIN
main/img/icons/64/tools.png


BIN
main/img/icons/64/view.png


+ 1 - 1
main/inc/ajax/lp.ajax.php

@@ -27,7 +27,7 @@ switch ($action) {
             $sections	= explode('^', $new_order);            
             $new_array = array();
             $i = 0;
-            foreach($sections as $items) {
+            foreach ($sections as $items) {
             	list($id, $parent_id) = explode('|', $items);
             	$new_array[$i]['id'] = intval($id);
             	$new_array[$i]['parent_id'] = intval($parent_id);

+ 12 - 9
main/inc/lib/document.lib.php

@@ -2498,10 +2498,10 @@ class DocumentManager {
 					"ORDER BY docs.title ASC";
     	$res_doc 	= Database::query($sql_doc);
     	$resources  = Database::store_result($res_doc, 'ASSOC');
-    	$return 	= '';
+    	
     	
     	$resources_sorted = array();
-    	    	
+        $return 	= '';    	    	
     	if ($lp_id) {
 	    	$return .= '<div class="lp_resource_element">';    	
 	    	$return .= Display::return_icon('new_doc.gif', '', array(), ICON_SIZE_SMALL);    	
@@ -2565,11 +2565,10 @@ class DocumentManager {
 
     	$new_array[$label] = array('id' => 0, 'files' => $resources_sorted);
     	
-    	$write_result = self::write_resources_tree($course_info, $session_id, $new_array, 0, $lp_id, $target, $add_move_button);
+    	$write_result = self::write_resources_tree($course_info, $session_id, $new_array, 0, $lp_id, $target, $add_move_button, true);
     	    	
     	$return .= $write_result ;
-    	
-    	$return = Display::div($return, array('class'=>'lp_resource'));    	
+    	    	
     	$img_path = api_get_path(WEB_IMG_PATH);
     	
     	if ($lp_id == false) {
@@ -2593,9 +2592,11 @@ class DocumentManager {
     		function testResources(id, img) {
 	    		if (document.getElementById(id).style.display=='block'){
 	    			document.getElementById(id).style.display='none';
+                    var id = id.split('_')[1];
 	    			document.getElementById('img_'+id).src='".$img_path."nolines_plus.gif';
 	    		} else {
 	    			document.getElementById(id).style.display='block';
+                    var id = id.split('_')[1];
     				document.getElementById('img_'+id).src='".$img_path."nolines_minus.gif';
     			}
     		}
@@ -2615,7 +2616,7 @@ class DocumentManager {
     * @param	integer Enables the tree display by shifting the new elements a certain distance to the right
     * @return	string	The HTML list
     */
-    public function write_resources_tree($course_info, $session_id, $resources_sorted, $num = 0, $lp_id = false, $target = '', $add_move_button = false) {
+    public function write_resources_tree($course_info, $session_id, $resources_sorted, $num = 0, $lp_id = false, $target = '', $add_move_button = false, $first = false) {
     	require_once api_get_path(LIBRARY_PATH).'fileDisplay.lib.php';
     	
     	$img_path 		= api_get_path(WEB_IMG_PATH);
@@ -2623,6 +2624,7 @@ class DocumentManager {
     	$web_code_path 	= api_get_path(WEB_CODE_PATH);
     	
     	$return = '';
+        
     	if (count($resources_sorted) > 0) {
     		foreach ($resources_sorted as $key => $resource) {              
     			$title = isset($resource['title']) ? $resource['title'] : null;
@@ -2663,8 +2665,9 @@ class DocumentManager {
     				}
     				    
     				$return .= '<ul class="lp_resource">';
+                     
                     
-                        $return .= '<div class="doc_folder"  id="doc_id_'.$resource['id'].'"  style="margin-left:'.($num * 18).'px; margin-right:5px;">';
+                        $return .= '<li class="doc_folder"  id="doc_id_'.$resource['id'].'"  style="margin-left:'.($num * 18).'px; ">';
                         if ($lp_id) {    				    				
                             $return .= '<img style="cursor: pointer;" src="'.$img_path.'nolines_plus.gif" align="absmiddle" id="img_' . $resource['id'] . '"  '.$onclick.' >';
                         } else {
@@ -2673,7 +2676,7 @@ class DocumentManager {
                         $return .= '<img alt="" src="'.$img_path.'lp_folder.gif" title="" align="absmiddle" />&nbsp;';    				
 
                         $return .= '<span '.$onclick.' style="cursor: pointer;" >'.$title.'</span>';    				
-                        $return .= '</div>
+                        $return .= '</li>
                                     <div style="display: none;" id="res_'.$resource['id'].'">';
 
                         if (isset($resource['files'])) {    					
@@ -2712,7 +2715,7 @@ class DocumentManager {
     					
     					$link = Display::url('<img alt="" src="'.$img.'" title="" />&nbsp;' . $my_file_title, $url, array('target' => $target));    					 
     					
-                        $return .= '<li class="doc_resource lp_resource_element" data_id="'.$key.'" data_type="document" title="'.$my_file_title.'" >';
+                        $return .= '<li class="doc_resource " data_id="'.$key.'" data_type="document" title="'.$my_file_title.'" >';
                         
                         $return .= '<div style="margin-left:' . (($num +1) * 18) . 'px;margin-right:5px;">';
                         

+ 9 - 67
main/inc/lib/mail.lib.inc.php

@@ -28,73 +28,10 @@ require_once api_get_path(LIBRARY_PATH).'phpmailer/class.phpmailer.php';
  * @param subject           email subject
  * @return                  returns true if mail was sent
  * @see                     class.phpmailer.php
+ * @deprecated use api_mail_html()
  */
 function api_mail($recipient_name, $recipient_email, $subject, $message, $sender_name = '', $sender_email = '', $extra_headers = '') {
-	if (!api_valid_email($recipient_email)) {
-		return 0;
-	}
-    //global $regexp_rfc3696; // Deprecated, 13-OCT-2010.
-    global $platform_email;
-
-    $mail = new PHPMailer();
-    $mail->Mailer  = $platform_email['SMTP_MAILER'];
-    $mail->Host    = $platform_email['SMTP_HOST'];
-    $mail->Port    = $platform_email['SMTP_PORT'];
-    $mail->CharSet = $platform_email['SMTP_CHARSET'];
-    $mail->WordWrap = 200; // Stay far below SMTP protocol 980 chars limit.
-
-    if ($platform_email['SMTP_AUTH']) {
-        $mail->SMTPAuth = 1;
-        $mail->Username = $platform_email['SMTP_USER'];
-        $mail->Password = $platform_email['SMTP_PASS'];
-    }
-
-    $mail->Priority = 3; // 5 = low, 1 = high
-    $mail->AddCustomHeader('Errors-To: '.$platform_email['SMTP_FROM_EMAIL']);
-    $mail->IsHTML(0);
-    $mail->SMTPKeepAlive = true;
-
-    // Attachments
-    // $mail->AddAttachment($path);
-    // $mail->AddAttachment($path, $filename);
-
-    if ($sender_email != '') {
-        $mail->From         = $sender_email;
-        $mail->Sender       = $sender_email;
-        //$mail->ConfirmReadingTo = $sender_email; // Disposition-Notification
-    } else {
-        $mail->From         = $platform_email['SMTP_FROM_EMAIL'];
-        $mail->Sender       = $platform_email['SMTP_FROM_EMAIL'];
-        //$mail->ConfirmReadingTo = $platform_email['SMTP_FROM_EMAIL']; // Disposition-Notification
-    }
-
-    if ($sender_name != '') {
-        $mail->FromName = $sender_name;
-    } else {
-        $mail->FromName = $platform_email['SMTP_FROM_NAME'];
-    }
-    $mail->Subject = $subject;    
-    $mail->Body    = $message;
-
-    // Only valid addresses are accepted.
-    //if (eregi($regexp_rfc3696, $recipient_email)) { // Deprecated, 13-OCT-2010.
-    if (api_valid_email($recipient_email)) {
-        $mail->AddAddress($recipient_email, $recipient_name);
-    }
-
-    if ($extra_headers != '') {
-        $mail->AddCustomHeader($extra_headers);
-    }
-
-    // Send the mail message.
-    if (!$mail->Send()) {
-        error_log('ERROR: mail not sent to '.$recipient_name.' ('.$recipient_email.') because of '.$mail->ErrorInfo.'<br />');
-        return 0;
-    }
-
-    // Clear all the addresses.
-    $mail->ClearAddresses();
-    return 1;
+	api_mail_html($recipient_name, $recipient_email, $subject, $message, $sender_name, $sender_email, $extra_headers);
 }
 
 /**
@@ -138,7 +75,7 @@ function api_mail_html($recipient_name, $recipient_email, $subject, $message, $s
 
     $mail->Priority = 3; // 5 = low, 1 = high
     $mail->AddCustomHeader('Errors-To: '.$platform_email['SMTP_FROM_EMAIL']);
-    $mail->IsHTML(0);
+        
     $mail->SMTPKeepAlive = true;
 
     if (($sender_email != '') && ($sender_name != '')) {
@@ -196,7 +133,7 @@ function api_mail_html($recipient_name, $recipient_email, $subject, $message, $s
 	            $x++;
 	         }
 	    }
-    }    
+    }
     $message = str_replace(array("\n\r", "\n", "\r"), '<br />', $message);
     $mail->Body = '<html><head></head><body>'.$message.'</body></html>';
 
@@ -242,6 +179,10 @@ function api_mail_html($recipient_name, $recipient_email, $subject, $message, $s
                     break;
             }
         }
+    } else {
+        if (!empty($extra_headers)) {
+            $mail->AddCustomHeader($extra_headers);
+        }
     }
 
     // WordWrap the html body (phpMailer only fixes AltBody) FS#2988
@@ -250,6 +191,7 @@ function api_mail_html($recipient_name, $recipient_email, $subject, $message, $s
     // Send the mail message.
     if (!$mail->Send()) {
         //echo 'ERROR: mail not sent to '.$recipient_name.' ('.$recipient_email.') because of '.$mail->ErrorInfo.'<br />';
+        error_log('ERROR: mail not sent to '.$recipient_name.' ('.$recipient_email.') because of '.$mail->ErrorInfo.'<br />');
         return 0;
     }
 

+ 12 - 8
main/inc/lib/main_api.lib.php

@@ -2712,6 +2712,7 @@ function api_not_allowed($print_headers = false, $message = null) {
     if ((!headers_sent() || $print_headers) && $origin != 'learnpath') {
         $show_headers = 1;
     }
+    
     $tpl = new Template(null, $show_headers, $show_headers);
     $tpl->assign('content', $msg);	
     if (($user!=0 && !api_is_anonymous()) && (!isset($course) || $course == -1) && empty($_GET['cidReq'])) {
@@ -2730,18 +2731,22 @@ function api_not_allowed($print_headers = false, $message = null) {
             $tpl->display_one_col_template();
             exit;
         }
-        // If the user has no user ID, then his session has expired
-        require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
+        // If the user has no user ID, then his session has expired        
         $form = new FormValidator('formLogin', 'post', api_get_self().'?'.Security::remove_XSS($_SERVER['QUERY_STRING']), null, array('class'=>'form-stacked'));
-        $form->addElement('text', 'login', get_lang('UserName'), array('size' => 17));
-        $form->addElement('password', 'password', get_lang('Password'), array('size' => 17));
-        $form->addElement('style_submit_button', 'submitAuth', get_lang('LoginEnter'),'class="btn"');
+        
+        //$form->addElement('text', 'login', get_lang('UserName'), array('size' => 17)); //old
+        $form->addElement('text', 'login', null, array('placeholder' => get_lang('UserName'), 'class' => 'span3')); //new
+        
+        //$form->addElement('password', 'password', get_lang('Password'), array('size' => 17)); //old
+        $form->addElement('password', 'password', null, array('placeholder' => get_lang('Password'), 'class' => 'span3')); //new
+        $form->addElement('style_submit_button', 'submitAuth', get_lang('LoginEnter'), array('class' => 'btn span3'));
 
         $content = Display::return_message(get_lang('NotAllowed').'<br />'.get_lang('PleaseLoginAgainFromFormBelow').'<br />', 'error', false);
 
-        $content .= '<div style="margin: 0 auto; width: 200px;">';		
+        $content .= '<div class="well_login">';		
         $content .= $form->return_form();
         $content .='</div>';
+        
         $tpl->assign('content', $content);
         $tpl->display_one_col_template();	
         exit;
@@ -2755,8 +2760,7 @@ function api_not_allowed($print_headers = false, $message = null) {
     // Check if the cookies are enabled. If are enabled and if no course ID was included in the requested URL, then the user has either lost his session or is anonymous, so redirect to homepage
 	if( !isset($_COOKIE["TestCookie"]) && empty($_COOKIE["TestCookie"]) ) {
 		$msg = Display::return_message(get_lang('NoCookies').'<br /><br /><a href="'.$home_url.'">'.get_lang('BackTo').' '.get_lang('CampusHomepage').'</a><br />', 'error', false);
-	}
-	else {
+	} else {
 		$msg = Display::return_message(get_lang('NotAllowed').'<br /><br /><a href="'.$home_url.'">'.get_lang('PleaseLoginAgainFromHomepage').'</a><br />', 'error', false);
 	}
     $msg = Display::div($msg, array('align'=>'center'));

+ 27 - 21
main/newscorm/learnpath.class.php

@@ -2687,16 +2687,16 @@ class learnpath {
                 if ($display_action_links_with_icons) {
                     $html .= '<div class = "btn-group">';
                     $html .= "<a href='lp_controller.php?" . api_get_cidreq() . "&amp;action=build&amp;lp_id=" . $this->lp_id . "' target='_parent'>" . Display :: return_icon('build_learnpath.png', get_lang('Build'),'',ICON_SIZE_MEDIUM)."</a>";
-                    $html .= "<a href='lp_controller.php?" . api_get_cidreq() . "&amp;action=admin_view&amp;lp_id=" . $this->lp_id . "' target='_parent'>" . Display :: return_icon('move_learnpath.png', get_lang('BasicOverview'),'',ICON_SIZE_MEDIUM)."</a>";
+                    //$html .= "<a href='lp_controller.php?" . api_get_cidreq() . "&amp;action=admin_view&amp;lp_id=" . $this->lp_id . "' target='_parent'>" . Display :: return_icon('move_learnpath.png', get_lang('BasicOverview'),'',ICON_SIZE_MEDIUM)."</a>";
                     //$html .= '<span>' . Display :: return_icon('view_remove_na.png', get_lang('Display'),'',ICON_SIZE_MEDIUM).'</span><br />';
                     $html .= '<a href="lp_controller.php?' . api_get_cidreq() . '">'. get_lang('ReturnToLPList') . '</a>';
                     $html .= '</div>';
                 } else {
                     $html .= '<div class="btn-group">';
-                    $html .= "<a class='btn' href='lp_controller.php?" . api_get_cidreq() . "&amp;gradebook=$gradebook&amp;action=build&amp;lp_id=" . $this->lp_id . "' target='_parent'>" . get_lang('Build') . "</a>";
-                    $html .= "<a class='btn' href='lp_controller.php?" . api_get_cidreq() . "&amp;action=admin_view&amp;lp_id=" . $this->lp_id . "' target='_parent'>" . get_lang('BasicOverview') . "</a>";
+                    $html .= "<a class='btn' href='lp_controller.php?" . api_get_cidreq()."&amp;gradebook=$gradebook&amp;action=build&amp;lp_id=" . $this->lp_id . "' target='_parent'>" . get_lang('Overview') . "</a>";
+                    $html .= "<a class='btn' href='lp_controller.php?" . api_get_cidreq()."&amp;action=add_item&amp;type=step&amp;lp_id=" . $this->lp_id . "' target='_parent'>" . get_lang('Edit') . "</a>";
                     //$html .= '<span><b>' . get_lang('Display') . '</b></span><br />';
-                    $html .= '<a class="btn" href="lp_controller.php?'.api_get_cidreq().'">'.get_lang('Back').'</a>';
+                    $html .= '<a class="btn" href="lp_controller.php?'.api_get_cidreq()."&amp;gradebook=$gradebook&amp;action=edit&amp;lp_id=" . $this->lp_id.'">'.get_lang('Settings').'</a>';
                     $html .= '</div>';
                 }
                 $html .= '</div>';
@@ -4755,27 +4755,28 @@ class learnpath {
         $return = '';
 
         $update_audio = isset($_GET['updateaudio']) ? $_GET['updateaudio'] : null;        
-        if ($is_allowed_to_edit) {            
-
+        if ($is_allowed_to_edit) {
             $gradebook = isset($_GET['gradebook']) ? Security :: remove_XSS($_GET['gradebook']) : null;
             $return .= '<div class="actions">';
-            $return .= '<a href="' . api_get_self() . '?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&amp;gradebook=' . $gradebook . '&amp;action=build&amp;lp_id=' . $this->lp_id . '" title="' . get_lang('Build') . '">' . Display :: return_icon('build_learnpath.png', get_lang('Build'),'',ICON_SIZE_MEDIUM).'</a>';
+            //$return .= '<a href="' . api_get_self() . '?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&amp;gradebook=' . $gradebook . '&amp;action=build&amp;lp_id=' . $this->lp_id . '" title="' . get_lang('Build') . '">' . Display :: return_icon('build_learnpath.png', get_lang('Build'),'',ICON_SIZE_MEDIUM).'</a>';
             if ($update_audio == 'true') {
-                $return .='<a href="lp_controller.php?cidReq='.Security::remove_XSS($_GET['cidReq']) .'&amp;gradebook='.$gradebook.'&amp;action=admin_view&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" title="'.get_lang('BasicOverview').'">'.Display::return_icon('move_learnpath.png', get_lang('BasicOverview'),'',ICON_SIZE_MEDIUM).'</a>';
+                //$return .='<a href="lp_controller.php?cidReq='.Security::remove_XSS($_GET['cidReq']) .'&amp;gradebook='.$gradebook.'&amp;action=admin_view&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" title="'.get_lang('BasicOverview').'">'.Display::return_icon('move_learnpath.png', get_lang('BasicOverview'),'',ICON_SIZE_MEDIUM).'</a>';
             } else {
-                $return .= Display :: return_icon('move_learnpath_na.png', get_lang('BasicOverview'),'',ICON_SIZE_MEDIUM);
+                //$return .= Display :: return_icon('move_learnpath_na.png', get_lang('BasicOverview'),'',ICON_SIZE_MEDIUM);
             }
             
             $return .= '<a href="lp_controller.php?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&action=view&lp_id=' . $this->lp_id . '">' . Display :: return_icon('view_left_right.png', get_lang('Display'),'',ICON_SIZE_MEDIUM).'</a>';
-            $return .= ' '.Display :: return_icon('i.gif');	
-            $return .= '<a href="' . api_get_self() . '?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&amp;gradebook=' . $gradebook . '&amp;action=add_item&amp;type=step&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" title="' . get_lang('NewStep') . '">
+            //$return .= ' '.Display :: return_icon('i.gif');	
+            /*$return .= '<a href="' . api_get_self() . '?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&amp;gradebook=' . $gradebook . '&amp;action=add_item&amp;type=step&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" title="' . get_lang('NewStep') . '">
 			 '. Display :: return_icon('new_learnigpath_object.png', get_lang('NewStep'),'',ICON_SIZE_MEDIUM).'</a>';            
+             * 
+             */
             if ($update_audio == 'true') {            
-                $return .= Display::url(Display :: return_icon('upload_audio_na.png', get_lang('UpdateAllAudioFragments'),'',ICON_SIZE_MEDIUM),'#');
+//                $return .= Display::url(Display :: return_icon('upload_audio_na.png', get_lang('UpdateAllAudioFragments'),'',ICON_SIZE_MEDIUM),'#');
             } else {
-                $return .= '<a href="' . api_get_self() . '?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&amp;action=' . Security :: remove_XSS($_GET['action']) . '&amp;lp_id=' . $_SESSION['oLP']->lp_id . '&amp;updateaudio=true">' . Display :: return_icon('upload_audio.png', get_lang('UpdateAllAudioFragments'),'',ICON_SIZE_MEDIUM).'</a>';
+//                $return .= '<a href="' . api_get_self() . '?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&amp;action=' . Security :: remove_XSS($_GET['action']) . '&amp;lp_id=' . $_SESSION['oLP']->lp_id . '&amp;updateaudio=true">' . Display :: return_icon('upload_audio.png', get_lang('UpdateAllAudioFragments'),'',ICON_SIZE_MEDIUM).'</a>';
             }
-            $return .= '<a href="lp_controller.php?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&amp;action=edit&amp;lp_id=' . $_SESSION['oLP']->lp_id . '">' . Display :: return_icon('settings.png', get_lang('CourseSettings'),'',ICON_SIZE_MEDIUM).'</a>';
+            //$return .= '<a href="lp_controller.php?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&amp;action=edit&amp;lp_id=' . $_SESSION['oLP']->lp_id . '">' . Display :: return_icon('settings.png', get_lang('CourseSettings'),'',ICON_SIZE_MEDIUM).'</a>';
             $return .= '</div>';
         }
 
@@ -4983,7 +4984,12 @@ class learnpath {
         }    
         
         $return = '<ul id="lp_item_list" class="well">';
-        $return .= self::print_recursive($elements, $default_data, $default_content);
+        $tree = self::print_recursive($elements, $default_data, $default_content);
+        if (!empty($tree)) {
+            $return .= $tree;
+        } else {
+            $return .= Display::return_message(get_lang("DragAndDropElementHere"));
+        }
         $return .= '</ul>';
         if ($update_audio == 'true') {
             $return = $return_audio;
@@ -5024,15 +5030,15 @@ class learnpath {
     public function build_action_menu() {
         $gradebook = isset($_GET['gradebook']) ? Security :: remove_XSS($_GET['gradebook']) : null;
         echo '<div class="actions">';
-        echo Display :: return_icon('build_learnpath_na.png', get_lang('Build'),'',ICON_SIZE_MEDIUM);
+        //echo Display :: return_icon('build_learnpath_na.png', get_lang('Build'),'',ICON_SIZE_MEDIUM);
         
-        echo '<a href="' . api_get_self().'?'.api_get_cidreq().'&amp;gradebook=' . $gradebook . '&amp;action=admin_view&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" title="' . get_lang('BasicOverview') . '">' . Display :: return_icon('move_learnpath.png', get_lang('BasicOverview'),'',ICON_SIZE_MEDIUM).'</a>';
+        //echo '<a href="' . api_get_self().'?'.api_get_cidreq().'&amp;gradebook=' . $gradebook . '&amp;action=admin_view&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" title="' . get_lang('BasicOverview') . '">' . Display :: return_icon('move_learnpath.png', get_lang('BasicOverview'),'',ICON_SIZE_MEDIUM).'</a>';
         echo '<a href="lp_controller.php?'.api_get_cidreq().'&amp;gradebook=' . $gradebook . '&action=view&lp_id=' . $_SESSION['oLP']->lp_id . '">' . Display :: return_icon('view_left_right.png', get_lang('Display'),'',ICON_SIZE_MEDIUM).'</a> ';
-        Display :: display_icon('i.gif');
-        echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;gradebook=' . $gradebook . '&amp;action=add_item&amp;type=step&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" title="' . get_lang('NewStep') . '">' . Display :: return_icon('new_learnigpath_object.png', get_lang('NewStep'),'',ICON_SIZE_MEDIUM).'</a>';        
+        
+        //echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;gradebook=' . $gradebook . '&amp;action=add_item&amp;type=step&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" title="' . get_lang('NewStep') . '">' . Display :: return_icon('new_learnigpath_object.png', get_lang('NewStep'),'',ICON_SIZE_MEDIUM).'</a>';        
 //		echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;gradebook=' . $gradebook . '&amp;action=add_item&amp;type=chapter&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" title="' . get_lang('NewChapter') . '">' . Display :: return_icon('add_learnpath_section.png', get_lang('NewChapter'),'',ICON_SIZE_MEDIUM).'</a>';
-        echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;action=admin_view&amp;lp_id=' . $_SESSION['oLP']->lp_id . '&amp;updateaudio=true">' . Display :: return_icon('upload_audio.png', get_lang('UpdateAllAudioFragments'),'',ICON_SIZE_MEDIUM).'</a>';
-        echo '<a href="lp_controller.php?'.api_get_cidreq().'&amp;action=edit&amp;lp_id=' . $_SESSION['oLP']->lp_id . '">' . Display :: return_icon('settings.png', get_lang('CourseSettings'),'',ICON_SIZE_MEDIUM).'</a>';
+        //echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;action=admin_view&amp;lp_id=' . $_SESSION['oLP']->lp_id . '&amp;updateaudio=true">' . Display :: return_icon('upload_audio.png', get_lang('UpdateAllAudioFragments'),'',ICON_SIZE_MEDIUM).'</a>';
+        //echo '<a href="lp_controller.php?'.api_get_cidreq().'&amp;action=edit&amp;lp_id=' . $_SESSION['oLP']->lp_id . '">' . Display :: return_icon('settings.png', get_lang('CourseSettings'),'',ICON_SIZE_MEDIUM).'</a>';
         echo '</div>';
     }
 

+ 14 - 18
main/newscorm/lp_add_item.php

@@ -60,14 +60,14 @@ $(function() {
     $(".item_data").live("mouseover", function(event) {        
         $(".button_actions", this).show();        
     });
-    
+
     $(".item_data").live("mouseout", function() {
         $(".button_actions",this).hide();
     });
-    
+
     $(".button_actions").hide();
 
-  $( ".lp_resource" ).sortable({
+    $( ".lp_resource" ).sortable({
         items: ".lp_resource_element ",        
         handle: ".moved", //only the class "moved"
         cursor: "move",
@@ -75,7 +75,7 @@ $(function() {
         placeholder: "ui-state-highlight", //defines the yellow highlight        
     });
     
-    $("#lp_item_list").sortable({ 
+    $("#lp_item_list").sortable({
 		items: "li",
 		handle: ".moved", //only the class "moved" 
 		cursor: "move",
@@ -107,7 +107,7 @@ $(function() {
             var order = "new_order="+ newOrderData + "&a=update_lp_item_order";
             $.post("'.$ajax_url.'", order, function(reponse){
                 $("#message").html(reponse);
-            });        
+            });            
         },
         receive: function(event, ui) {
         
@@ -135,25 +135,22 @@ $(function() {
                         data: params,                        
                         async: false, 
                         success: function(data) {
-                            if (data == -1) {
-                                
+                            if (data == -1) {                                
                             } else {
+                            
+                                $(".normal-message").hide();
                                 $(ui.item).attr("id", data);
                                 $(ui.item).addClass("lp_resource_element_new");
+                                $(ui.item).addClass("record li_container");
                                 $(ui.item).removeClass("lp_resource_element");
-                                $(ui.item).removeClass("doc_resource");
-                                
-                                
-                            }
+                                $(ui.item).removeClass("doc_resource");                                
+                            }                            
                         }
                     });
                 }
-            }
-        }
-	});	
-
-
-  
+            }//            
+        }//end receive
+	});      
 });
 
 
@@ -307,7 +304,6 @@ if (!empty($gradebook) && $gradebook == 'view') {
         );
 }
 
-
 $interbreadcrumb[] = array('url' => 'lp_controller.php?action=list', 'name' => get_lang('LearningPaths'));
 $interbreadcrumb[] = array('url' => api_get_self()."?action=build&lp_id=$learnpath_id", 'name' => $_SESSION['oLP']->get_name());
 

+ 2 - 4
main/newscorm/lp_admin_view.php

@@ -92,12 +92,10 @@ $show_learn_path = true;
 $lp_theme_css = $_SESSION['oLP']->get_theme();
 
 Display::display_header(null, 'Path');
-//api_display_tool_title($therow['name']);
-
 $suredel = trim(get_lang('AreYouSureToDelete'));
-//$suredelstep = trim(get_lang('AreYouSureToDeleteSteps'));
+
 ?>
-<script type='text/javascript'>
+<script>
 
 var newOrderData= "";
 //source code found in http://www.swartzfager.org/blog/dspNestedList.cfm

+ 35 - 12
main/newscorm/lp_build.php

@@ -122,15 +122,17 @@ function confirmation(name) {
 
 /* DISPLAY SECTION */
 
-echo $_SESSION['oLP']->build_action_menu();
+//echo $_SESSION['oLP']->build_action_menu();
+
 echo '<div class="row-fluid">';
-echo '<div class="span3">';
-    echo '<div class="lp_tree">';
+echo '<div class="span12">';
+
+/*    echo '<div class="lp_tree">';
         // Build the tree with the menu items in it.
         echo $_SESSION['oLP']->build_tree();
     echo '</div>';
 echo '</div>';        
-echo '<div class="span9">';        
+echo '<div class="span9">';        */
 if (isset($is_success) && $is_success === true) {
     Display::display_confirmation_message(get_lang('ItemRemoved'));
 } else {
@@ -140,14 +142,35 @@ if (isset($is_success) && $is_success === true) {
     // Display::display_normal_message(get_lang('LPCreatedAddChapterStep'), false);
     $gradebook = isset($_GET['gradebook']) ? Security::remove_XSS($_GET['gradebook']) : null;
 
-    $learnpathadded  = '<p><h2>'.get_lang('LearnPathAddedTitle').'</h2><br />';
-    $learnpathadded .= '<a href="lp_controller.php?'.api_get_cidreq().'&amp;gradebook='.$gradebook.'&amp;action=add_item&amp;type=step&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" title="'.get_lang('NewStep').'">'.Display::return_icon('new_learnigpath_object.png', get_lang('NewStep'), array('style' => 'vertical-align: middle;'),ICON_SIZE_SMALL).' '.get_lang('NewStep').'</a>: '.get_lang('NewStepComment').'<br />';
-    //$learnpathadded .= '<a href="lp_controller.php?'.api_get_cidreq().'&amp;gradebook='.$gradebook.'&amp;action=add_item&amp;type=chapter&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" title="'.get_lang('NewChapter').'">'.Display::return_icon('add_learnpath_section.png', get_lang('NewChapter'), array('style' => 'vertical-align: middle;'),ICON_SIZE_SMALL).' '.get_lang('NewChapter').'</a>: '.get_lang('NewChapterComment').'<br />';
-    $learnpathadded .= '<a href="lp_controller.php?'.api_get_cidreq().'&amp;action=build&amp;lp_id='.Security::remove_XSS($_GET['lp_id']).'" target="_parent">'.Display::return_icon('build_learnpath.png', get_lang('Build'), array('style' => 'vertical-align: middle;'),ICON_SIZE_SMALL).' '.get_lang('Build')."</a>: ".get_lang('BuildComment').'<br />';
-    $learnpathadded .= '<a href="lp_controller.php?'.api_get_cidreq().'&amp;gradebook='.$gradebook.'&amp;action=admin_view&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" title="'.get_lang("BasicOverview").'">'.Display::return_icon('move_learnpath.png', get_lang('BasicOverview'), array('style' => 'vertical-align: middle;'),ICON_SIZE_SMALL).' '.get_lang('BasicOverview').'</a>: '.get_lang('BasicOverviewComment').'<br />';
-    $learnpathadded .= '<a href="lp_controller.php?'.api_get_cidreq().'&amp;gradebook='.$gradebook.'&action=view&lp_id='.$_SESSION['oLP']->lp_id.'">'.Display::return_icon('view_left_right.png', get_lang('Display'),array('style' => 'vertical-align: middle;'),ICON_SIZE_SMALL).' '.get_lang('Display').'</a>: '.get_lang('DisplayComment').'<br />';
-    $learnpathadded .= '<br /></p>';
-    echo $learnpathadded;
+    echo Display::page_header(get_lang('LearnPathAddedTitle'));
+    
+    echo '<ul id="lp_overview" class="thumbnails">';
+    
+    echo show_block('lp_controller.php?'.api_get_cidreq().'&amp;gradebook='.$gradebook.'&amp;action=add_item&amp;type=step&amp;lp_id=' . $_SESSION['oLP']->lp_id, get_lang("NewStep"), get_lang('NewStepComment'), 'tools.png');
+    
+    echo show_block('lp_controller.php?'.api_get_cidreq().'&amp;gradebook='.$gradebook.'&amp;action=admin_view&amp;updateaudio=true&amp;lp_id=' . $_SESSION['oLP']->lp_id, get_lang("BasicOverview"), get_lang('BasicOverviewComment'), 'audio.png');
+    
+    echo show_block('lp_controller.php?'.api_get_cidreq().'&amp;gradebook='.$gradebook.'&amp;action=view&amp;lp_id=' . $_SESSION['oLP']->lp_id, get_lang("Display"), get_lang('DisplayComment'), 'view.png');
+    
+    echo show_block('lp_controller.php?'.api_get_cidreq().'&amp;gradebook='.$gradebook.'&amp;action=edit&amp;lp_id=' . $_SESSION['oLP']->lp_id, get_lang("Settings"), null, 'settings.png');
+    
+
+    
+    echo '</ul>';    
+}
+
+function show_block($link, $title, $subtitle, $icon) {
+    $html = '<li class="span3">';
+        $html .=  '<div class="thumbnail">';
+        $html .=  '<a href="'.$link.'" title="'.$title.'">';
+        $html .=  Display::return_icon($icon, $title, array(), ICON_SIZE_BIG);
+        $html .=  '</a>';
+        $html .=  '<div class="caption">';
+        $html .=  '<strong>'.$title.'</strong></a> '.$subtitle;
+        $html .=  '</div>';
+        $html .=  '</div>';
+    $html .=  '</li>';
+    return $html;
 }
 echo '</div>';
 echo '</div>';

+ 11 - 11
main/newscorm/lp_edit.php

@@ -29,7 +29,7 @@ if (!empty($gradebook) && $gradebook == 'view') {
         );
 }
 $interbreadcrumb[] = array('url' => 'lp_controller.php?action=list', 'name' => get_lang('LearningPaths'));
-$interbreadcrumb[] = array('url' => api_get_self()."?action=admin_view&lp_id=$learnpath_id", 'name' => $_SESSION['oLP']->get_name());
+$interbreadcrumb[] = array('url' => api_get_self()."?action=build&lp_id=".$_SESSION['oLP']->get_id(), 'name' => $_SESSION['oLP']->get_name());
 
 $htmlHeadXtra[] = '<script type="text/javascript">        
 function activate_start_date() {
@@ -54,24 +54,24 @@ function activate_end_date() {
 Display::display_header(get_lang('CourseSettings'), 'Path');
 
 // Action links
-echo '<div class="actions">';
+//echo '<div class="actions">';
 $gradebook = isset($_GET['gradebook']) ? Security::remove_XSS($_GET['gradebook']) : null;
-echo '<a href="lp_controller.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&amp;gradebook='.$gradebook.'&amp;action=build&amp;lp_id=' . Security::remove_XSS($_GET['lp_id']) . '" title="'.get_lang('Build').'">'.Display::return_icon('build_learnpath.png', get_lang('Build'),'',ICON_SIZE_MEDIUM).'</a>';
-echo '<a href="lp_controller.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&amp;gradebook='.$gradebook.'&amp;action=admin_view&amp;lp_id=' . Security::remove_XSS($_GET['lp_id']) . '" title="'.get_lang('BasicOverview').'">'.Display::return_icon('move_learnpath.png', get_lang('BasicOverview'),'',ICON_SIZE_MEDIUM).'</a>';
-echo '<a href="lp_controller.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&amp;gradebook='.$gradebook.'&amp;action=view&lp_id='.Security::remove_XSS($_GET['lp_id']).'">'.Display::return_icon('view_remove.png', get_lang('Display'),'',ICON_SIZE_MEDIUM).'</a>';
-echo ' '.Display::return_icon('i.gif');
-echo '<a href="lp_controller.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&amp;gradebook='.$gradebook.'&amp;action=add_item&amp;type=step&amp;lp_id=' . Security::remove_XSS($_GET['lp_id']) . '" title="'.get_lang('NewStep').'">
-'.Display::return_icon('add.png', get_lang('NewStep'),'',ICON_SIZE_MEDIUM).'</a>';
+//echo '<a href="lp_controller.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&amp;gradebook='.$gradebook.'&amp;action=build&amp;lp_id=' . Security::remove_XSS($_GET['lp_id']) . '" title="'.get_lang('Build').'">'.Display::return_icon('build_learnpath.png', get_lang('Build'),'',ICON_SIZE_MEDIUM).'</a>';
+//echo '<a href="lp_controller.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&amp;gradebook='.$gradebook.'&amp;action=admin_view&amp;lp_id=' . Security::remove_XSS($_GET['lp_id']) . '" title="'.get_lang('BasicOverview').'">'.Display::return_icon('move_learnpath.png', get_lang('BasicOverview'),'',ICON_SIZE_MEDIUM).'</a>';
+//echo '<a href="lp_controller.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&amp;gradebook='.$gradebook.'&amp;action=view&lp_id='.Security::remove_XSS($_GET['lp_id']).'">'.Display::return_icon('view_remove.png', get_lang('Display'),'',ICON_SIZE_MEDIUM).'</a>';
+//echo ' '.Display::return_icon('i.gif');
+/*echo '<a href="lp_controller.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&amp;gradebook='.$gradebook.'&amp;action=add_item&amp;type=step&amp;lp_id=' . Security::remove_XSS($_GET['lp_id']) . '" title="'.get_lang('NewStep').'">
+'.Display::return_icon('add.png', get_lang('NewStep'),'',ICON_SIZE_MEDIUM).'</a>';*/
 
 /*echo '<a href="lp_controller.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&amp;gradebook='.$gradebook.'&amp;action=add_item&amp;type=chapter&amp;lp_id=' . Security::remove_XSS($_GET['lp_id']) . '" title="'.get_lang('NewChapter').'">
 '.Display::return_icon('add_learnpath_section.png', get_lang('NewChapter'),'',ICON_SIZE_MEDIUM).'</a>';*/
 
-echo '<a href="lp_controller.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&amp;gradebook='.$gradebook.'&amp;action=admin_view&amp;lp_id='.Security::remove_XSS($_GET['lp_id']).'&amp;updateaudio=true">'.Display::return_icon('upload_audio.png', get_lang('UpdateAllAudioFragments'),'',ICON_SIZE_MEDIUM).'</a>';
+//echo '<a href="lp_controller.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&amp;gradebook='.$gradebook.'&amp;action=admin_view&amp;lp_id='.Security::remove_XSS($_GET['lp_id']).'&amp;updateaudio=true">'.Display::return_icon('upload_audio.png', get_lang('UpdateAllAudioFragments'),'',ICON_SIZE_MEDIUM).'</a>';
 
-echo Display::url(Display::return_icon('settings_na.png', get_lang('CourseSettings'),'',ICON_SIZE_MEDIUM), '#');
+//echo Display::url(Display::return_icon('settings_na.png', get_lang('CourseSettings'),'',ICON_SIZE_MEDIUM), '#');
 //echo '<a href="../newscorm/lp_controller.php?cidReq='.$_course['sysCode'].'">'.Display::return_icon('scorms_na.png',get_lang('ReturnToLearningPaths'),'',ICON_SIZE_MEDIUM).'</a>';
 
-echo '</div>';
+//echo '</div>';
 
 $defaults=array();
 $form = new FormValidator('form1', 'post', 'lp_controller.php');