aragonc 9 years ago
parent
commit
d8236778fd

+ 1 - 0
main/auth/sso/sso.Drupal.class.php

@@ -145,6 +145,7 @@ class ssoDrupal
                                         // the user has permission to enter at this site
                                         $_user['user_id'] = $uData['id'];
                                         $_user = api_get_user_info($_user['user_id']);
+                                        $_user['uidReset'] = true;
                                         Session::write('_user', $_user);
                                         Event::event_login($_user['user_id']);
                                         // Redirect to homepage

+ 1 - 0
main/auth/sso/sso.class.php

@@ -157,6 +157,7 @@ class sso {
                                         // the user has permission to enter at this site
                                         $_user['user_id'] = $uData['user_id'];
                                         $_user = api_get_user_info($_user['user_id']);
+                                        $_user['uidReset'] = true;
                                         Session::write('_user', $_user);
                                         Event::event_login($_user['user_id']);
                                         // Redirect to homepage

+ 3 - 3
main/inc/lib/formvalidator/Element/HtmlEditor.php

@@ -72,7 +72,7 @@ class HtmlEditor extends HTML_QuickForm_textarea
         } else {
             $styleCss = $this->editor->getConfigAttribute('style');
             
-            if ($styleCss){
+            if ($styleCss) {
                $style = true;
             } else {
                $style = false;
@@ -93,13 +93,13 @@ class HtmlEditor extends HTML_QuickForm_textarea
     /**
      * @return string
      */
-    public function buildEditor($style=false)
+    public function buildEditor($style = false)
     {
         $result = '';
         if ($this->editor) {
             $this->editor->value = $this->getValue();
             $this->editor->setName($this->getName());
-            if($style==true){
+            if ($style == true) {
                 $result = $this->editor->createHtmlStyle();
             }  else {
                 $result = $this->editor->createHtml();

+ 1 - 1
main/inc/lib/formvalidator/FormValidator.class.php

@@ -761,7 +761,7 @@ EOT;
 
         /** @var HtmlEditor $element */
         $element = $this->getElement($name);
-        if ($style){
+        if ($style) {
             $config['style'] = true;
         }
         if ($fullPage) {

+ 21 - 20
main/inc/lib/userportal.lib.php

@@ -681,29 +681,29 @@ class IndexManager
      * @todo use the template system
      */
     function show_right_block($title, $content, $id = null, $params = null, $idAccordion = null, $idCollpase = null) {
-        if (!empty($idAccordion)){
+        if (!empty($idAccordion)) {
             $html = null;
-            $html .= '<div class="panel-group" id="'.$idAccordion.'" role="tablist" aria-multiselectable="true">';
-            $html .= '<div class="panel panel-default" id="'.$id.'">';
-            $html .= '<div class="panel-heading" role="tab"><h4 class="panel-title">';
-            $html .= '<a role="button" data-toggle="collapse" data-parent="#'.$idAccordion.'" href="#'.$idCollpase.'" aria-expanded="true" aria-controls="'.$idCollpase.'">';
-            $html .= $title.'</a></h4></div>';
-            $html .= '<div id="'.$idCollpase.'" class="panel-collapse collapse in" role="tabpanel">';
-            $html .= '<div class="panel-body">'.$content.'</div>';
-            $html .= '</div></div></div>';
+            $html .= '<div class="panel-group" id="'.$idAccordion.'" role="tablist" aria-multiselectable="true">' . PHP_EOL;
+            $html .= '<div class="panel panel-default" id="'.$id.'">' . PHP_EOL;
+            $html .= '<div class="panel-heading" role="tab"><h4 class="panel-title">' . PHP_EOL;
+            $html .= '<a role="button" data-toggle="collapse" data-parent="#'.$idAccordion.'" href="#'.$idCollpase.'" aria-expanded="true" aria-controls="'.$idCollpase.'">'.$title.'</a>' . PHP_EOL;
+            $html .= '</h4></div>' . PHP_EOL;
+            $html .= '<div id="'.$idCollpase.'" class="panel-collapse collapse in" role="tabpanel">' . PHP_EOL;
+            $html .= '<div class="panel-body">'.$content.'</div>' . PHP_EOL;
+            $html .= '</div></div></div>' . PHP_EOL;
             
-        }else{
+        } else {
             if (!empty($id)) {
                 $params['id'] = $id;
             }
             $params['class'] = 'panel panel-default';
             $html = null;
             if (!empty($title)) {
-                $html.= '<div class="panel-heading">'.$title.'</div>';
+                $html .= '<div class="panel-heading">'.$title.'</div>' . PHP_EOL;
             }
-            $html.= '<div class="panel-body">'.$content.'</div>';
+            $html.= '<div class="panel-body">'.$content.'</div>' . PHP_EOL;
             $html = Display::div($html, $params);
-            }
+        }
         return $html;
     }
 
@@ -851,13 +851,14 @@ class IndexManager
 
         $profile_content .= '<li class="profile-social"><a href="' . $editProfileUrl . '">'.Display::return_icon('edit-profile.png',get_lang('EditProfile'),null,ICON_SIZE_SMALL).get_lang('EditProfile').'</a></li>';
         $profile_content .= '</ul>';
-        $html = self::show_right_block(get_lang('Profile'),
-                $profile_content,
-                'profile_block',
-                null,
-                'profile',
-                'profileCollapse'
-                );
+        $html = self::show_right_block(
+            get_lang('Profile'),
+            $profile_content,
+            'profile_block',
+            null,
+            'profile',
+            'profileCollapse'
+        );
         return $html;
     }
 

+ 42 - 42
main/install/install.lib.php

@@ -1451,12 +1451,12 @@ function display_database_settings_form(
 
     <?php
 }
-function panel($content=null, $title=null, $id=null, $style=null){
+function panel($content = null, $title = null, $id = null, $style = null) {
     $html = '';
-    if(empty($style)){
+    if (empty($style)) {
         $style = 'default';
     }
-    if (!empty($title)){
+    if (!empty($title)) {
         $panelTitle = Display::div($title, array('class' => 'panel-heading'));
         $panelBody = Display::div($content, array('class' => 'panel-body'));
         $panelParent = Display::div($panelTitle . $panelBody, array('id' => $id, 'class' => 'panel panel-'.$style));
@@ -1484,13 +1484,13 @@ function display_configuration_parameter(
     $displayWhenUpdate = 'true'
 ) {
     $html = '<div class="form-group">';
-    $html.= '<label class="col-sm-6 control-label">' . $parameterName . '</label>';
+    $html .= '<label class="col-sm-6 control-label">' . $parameterName . '</label>';
     if ($installType == INSTALL_TYPE_UPDATE && $displayWhenUpdate) {
-        $html.= '<input type="hidden" name="' . $formFieldName . '" value="'. api_htmlentities($parameterValue, ENT_QUOTES). '" />' . $parameterValue;
+        $html .= '<input type="hidden" name="' . $formFieldName . '" value="'. api_htmlentities($parameterValue, ENT_QUOTES). '" />' . $parameterValue;
     } else {
-        $html.= '<div class="col-sm-6"><input class="form-control" type="text" size="'.FORM_FIELD_DISPLAY_LENGTH.'" maxlength="'.MAX_FORM_FIELD_LENGTH.'" name="'.$formFieldName.'" value="'.api_htmlentities($parameterValue, ENT_QUOTES).'" />'."</div>";
+        $html .= '<div class="col-sm-6"><input class="form-control" type="text" size="'.FORM_FIELD_DISPLAY_LENGTH.'" maxlength="'.MAX_FORM_FIELD_LENGTH.'" name="'.$formFieldName.'" value="'.api_htmlentities($parameterValue, ENT_QUOTES).'" />'."</div>";
     }
-    $html.= "</div>";
+    $html .= "</div>";
     return $html;
 }
 
@@ -1606,72 +1606,72 @@ function display_configuration_settings_form(
     
     
     $html .= '<div class="form-group">
-            <label class="col-sm-6 control-label">'. get_lang("EncryptMethodUserPass").'</label>
-            <div class="col-sm-6">';
-            if ($installType == 'update') { 
-                $html .= '<input type="hidden" name="encryptPassForm" value="'. $encryptPassForm .'" />'. $encryptPassForm;
-            } else {
+            <label class="col-sm-6 control-label">' . get_lang("EncryptMethodUserPass") . '</label>
+        <div class="col-sm-6">';
+    if ($installType == 'update') { 
+        $html .= '<input type="hidden" name="encryptPassForm" value="'. $encryptPassForm .'" />'. $encryptPassForm;
+    } else {
             
-            $html .= '<div class="checkbox">
+        $html .= '<div class="checkbox">
                     <label>
                         <input  type="radio" name="encryptPassForm" value="bcrypt" id="encryptPass1" '. ($encryptPassForm == 'bcrypt' ? 'checked="checked" ':'') .'/> bcrypt
                     </label>';       
             
-            $html .= '<label>
+        $html .= '<label>
                         <input  type="radio" name="encryptPassForm" value="sha1" id="encryptPass1" '. ($encryptPassForm == 'sha1' ? 'checked="checked" ':'') .'/> sha1
                     </label>';
 
-            $html .= '<label>
+        $html .= '<label>
                         <input type="radio" name="encryptPassForm" value="md5" id="encryptPass0" '. ($encryptPassForm == 'md5' ? 'checked="checked" ':'') .'/> md5
                     </label>';
 
-            $html .= '<label>
+        $html .= '<label>
                         <input type="radio" name="encryptPassForm" value="none" id="encryptPass2" '. ($encryptPassForm == 'none' ? 'checked="checked" ':'') .'/>'. get_lang('None').'
                     </label>'; 
-            $html .= '</div>';
-             }
- $html .= '</div></div>';
+        $html .= '</div>';
+    }
+    $html .= '</div></div>';
   
    
     $html .= '<div class="form-group">
-            <label class="col-sm-6 control-label">'. get_lang('AllowSelfReg') .'</label>
+            <label class="col-sm-6 control-label">' . get_lang('AllowSelfReg') . '</label>
             <div class="col-sm-6">';
-            if ($installType == 'update'){ 
-                $html .= '<input type="hidden" name="allowSelfReg" value="'. $allowSelfReg .'" />'. $allowSelfReg ? get_lang('Yes') : get_lang('No');
-            } else {
-            $html .= '<div class="control-group">';
-            $html .= '<label class="checkbox-inline">
-                    <input type="radio" name="allowSelfReg" value="1" id="allowSelfReg1" '. ($allowSelfReg ? 'checked="checked" ' : '') . ' /> '. get_lang('Yes') .'
-                </label>';
-            $html .= '<label class="checkbox-inline">
-                    <input type="radio" name="allowSelfReg" value="0" id="allowSelfReg0" '. ($allowSelfReg ? '' : 'checked="checked" ') .' /> '. get_lang('No') .'
-                </label>';
-            $html .= '</div>';
-            }
+    if ($installType == 'update') { 
+        $html .= '<input type="hidden" name="allowSelfReg" value="'. $allowSelfReg .'" />'. $allowSelfReg ? get_lang('Yes') : get_lang('No');
+    } else {
+        $html .= '<div class="control-group">';
+        $html .= '<label class="checkbox-inline">
+                        <input type="radio" name="allowSelfReg" value="1" id="allowSelfReg1" '. ($allowSelfReg ? 'checked="checked" ' : '') . ' /> '. get_lang('Yes') .'
+                    </label>';
+        $html .= '<label class="checkbox-inline">
+                        <input type="radio" name="allowSelfReg" value="0" id="allowSelfReg0" '. ($allowSelfReg ? '' : 'checked="checked" ') .' /> '. get_lang('No') .'
+                    </label>';
         $html .= '</div>';
-   $html .= '</div>';    
+    }
+    $html .= '</div>';
+    $html .= '</div>';    
     
     $html .= '<div class="form-group">';
     $html .= '<label class="col-sm-6 control-label">'. get_lang('AllowSelfRegProf') .'</label>
         <div class="col-sm-6">';
-        if ($installType == 'update'){
-               $html .= '<input type="hidden" name="allowSelfRegProf" value="'. $allowSelfRegProf.'" />'. $allowSelfRegProf? get_lang('Yes') : get_lang('No');
-        } else { 
-            $html .= '<div class="control-group">
+    if ($installType == 'update'){
+        $html .= '<input type="hidden" name="allowSelfRegProf" value="'. $allowSelfRegProf.'" />'. $allowSelfRegProf? get_lang('Yes') : get_lang('No');
+    } else { 
+        $html .= '<div class="control-group">
                 <label class="checkbox-inline">
                     <input type="radio" name="allowSelfRegProf" value="1" id="allowSelfRegProf1" '. ($allowSelfRegProf ? 'checked="checked" ' : '') .'/>
                 ' . get_lang('Yes') .'
                 </label>';
-            $html .= '<label class="checkbox-inline">
+        $html .= '<label class="checkbox-inline">
                     <input type="radio" name="allowSelfRegProf" value="0" id="allowSelfRegProf0" '. ($allowSelfRegProf ? '' : 'checked="checked" ') .' />
                    '. get_lang('No') .'
                 </label>';
-            $html .= '</div>';
-        }    
-$html .= '</div>
+        $html .= '</div>';
+    }    
+    $html .= '</div>
     </div>';    
       
- echo panel($html, get_lang('Platform'), 'platform'); 
+    echo panel($html, get_lang('Platform'), 'platform'); 
  ?> 
     <div class='form-group'>
         <div class="col-sm-6">

+ 1 - 2
main/newscorm/learnpath.class.php

@@ -7601,8 +7601,7 @@ class learnpath
                         $renderer = $form->defaultRenderer();
                         $renderer->setElementTemplate('&nbsp;{label}{element}', 'content_lp');
                         $form->addElement('html', '<div class="editor-lp">');
-                        $form->addHtmlEditor('content_lp', null, null, true, $editor_config, $style=true);
-                        //$form->addElement('html_editor', 'content_lp', '', null, $editor_config);
+                        $form->addHtmlEditor('content_lp', null, null, true, $editor_config, true);
                         $form->addElement('html', '</div>');
                         $defaults['content_lp'] = $content;
                     }

+ 1 - 1
main/template/default/auth/courses_categories.php

@@ -393,4 +393,4 @@ function return_unregister_button($course, $stok, $search_term, $code)
     $html = ' <a class="btn btn-primary" href="'. api_get_self().'?action=unsubscribe&amp;sec_token='.$stok.'&amp;unsubscribe='.$course['code'].'&amp;search_term='.$search_term.'&amp;category_code='.$code.'">'.get_lang('Unsubscribe').'</a>';
     return $html;
     
-}
+}