Browse Source

Merge branch '1.10.x' of ssh://github.com/chamilo/chamilo-lms into 1.10.x

Julio Montoya 9 years ago
parent
commit
7f579b4632

+ 5 - 11
app/Resources/public/css/base.css

@@ -1528,7 +1528,7 @@ div.image-social-content center.friend {
 }
 
 /*  SOCIAL MENU VERTICAL */
-.social-menu  {
+.social-network-menu  {
     width:100%;
     height:auto;
 }
@@ -4397,12 +4397,6 @@ i.size-32.icon-new-work{
 #filepaths input{
     margin-bottom:5px;
 }
-.section-social #main_content .span3 {
-  float: left;
-}
-.section-social #main_content .span9 {
-  float: right;
-}
 
 .xdebug-error {
     margin-top: 20px;
@@ -4477,10 +4471,10 @@ i.size-32.icon-new-work{
     height: 52px;
 }
 
-#settings .span6 .well_border .edit-block {
+#settings .panel .admin-edit-block {
     display: none;
 }
-#settings .span6 .well_border:hover .edit-block {
+#settings .panel:hover .admin-edit-block {
     display: block;
 }
 
@@ -4961,11 +4955,11 @@ i.size-32.icon-new-work{
   vertical-align: bottom;
   margin-right: 5px;
 }
-.social-menu .nav li a{
+.social-network-menu .nav li a{
   padding: 8px;
   font-size: 12px;
 }
-.social-menu .nav li a img{
+.social-network-menu .nav li a img{
   vertical-align: bottom;
   margin-right: 5px;
 }

+ 2 - 14
app/Resources/public/css/responsive.css

@@ -637,9 +637,6 @@ The more frequent ones have been marked with *
                 border-radius: 4px 4px 0 0;
     }
 
-    #section-social .row > [class*="span"], #section-social .row-fluid > [class*="span"] {
-        float: left;
-    }
     /* Some fixes for w~720px */
     .section-mycampus #top_main_content .content-column {
         float: left;
@@ -689,7 +686,7 @@ The more frequent ones have been marked with *
     footer .container .row {
         padding-top: 15px;
     }
-    .social-menu .social-background-content .thumbnail{
+    .social-network-menu .social-background-content .thumbnail{
         border:none;
         box-shadow: none;
     }
@@ -822,9 +819,6 @@ The more frequent ones have been marked with *
     #topbar_push {
         height: 0px;
     }
-    .section-social .span9 {
-        width: 530px;
-    }
 }
 
 @media (min-width: 980px) and (max-width: 1200px) {
@@ -841,15 +835,9 @@ The more frequent ones have been marked with *
     .course-tool {
         width: 280px;
     }
-    .section-social .span9, .section-mycourses .span9{
-        width: 680px;
-    }
-    .section-social .social-menu {
+    .section-social-network .social-network-menu {
         width: 200px;
     }
-    .section-social .span5 {
-        width: 350px;
-    }
     
 }
 @media (min-width: 980px) and (max-width: 1024px) {

+ 3 - 2
main/admin/index.php

@@ -19,7 +19,7 @@ api_protect_admin_script(true);
 $nameTools = get_lang('PlatformAdmin');
 
 $accessUrlId = 0;
-$adminExtraContentDir = api_get_path(SYS_PATH) . "home/admin/";
+$adminExtraContentDir = api_get_path(SYS_APP_PATH) . "home/admin/";
 
 if (api_is_multiple_url_enabled()) {
     $accessUrlId = api_get_current_access_url_id();
@@ -28,7 +28,7 @@ if (api_is_multiple_url_enabled()) {
         $urlInfo = api_get_access_url($accessUrlId);
         $url = api_remove_trailing_slash(preg_replace('/https?:\/\//i', '', $urlInfo['url']));
         $cleanUrl = str_replace('/', '-', $url);
-        $adminExtraContentDir = api_get_path(SYS_PATH) . "home/$cleanUrl/admin/";
+        $adminExtraContentDir = api_get_path(SYS_APP_PATH) . "home/$cleanUrl/admin/";
     }
 }
 
@@ -481,6 +481,7 @@ if (api_is_platform_admin()) {
 
         if (!empty($extraData['block'])) {
             if (!is_dir($adminExtraContentDir)) {
+                var_dump($adminExtraContentDir);
                 mkdir(
                     $adminExtraContentDir,
                     api_get_permissions_for_new_directories(),

+ 2 - 2
main/inc/ajax/admin.ajax.php

@@ -50,9 +50,9 @@ switch ($action) {
             $url = api_remove_trailing_slash(preg_replace('/https?:\/\//i', '', $urlInfo['url']));
             $cleanUrl = str_replace('/', '-', $url);
 
-            $newUrlDir = api_get_path(SYS_PATH) . "home/$cleanUrl/admin/";
+            $newUrlDir = api_get_path(SYS_APP_PATH) . "home/$cleanUrl/admin/";
         } else {
-            $newUrlDir = api_get_path(SYS_PATH) . "home/admin/";
+            $newUrlDir = api_get_path(SYS_APP_PATH) . "home/admin/";
         }
 
         if (!file_exists($newUrlDir)) {

+ 1 - 1
main/inc/lib/api.lib.php

@@ -154,7 +154,7 @@ define('SECTION_COURSE_ADMIN', 'course_admin');
 define('SECTION_PLATFORM_ADMIN', 'platform_admin');
 define('SECTION_MYGRADEBOOK', 'mygradebook');
 define('SECTION_TRACKING', 'session_my_space');
-define('SECTION_SOCIAL', 'social');
+define('SECTION_SOCIAL', 'social-network');
 define('SECTION_DASHBOARD', 'dashboard');
 define('SECTION_REPORTS', 'reports');
 define('SECTION_GLOBAL', 'global');

+ 170 - 150
main/inc/lib/extra_field_value.lib.php

@@ -79,11 +79,14 @@ class ExtraFieldValue extends Model
     {
         foreach ($params as $key => $value) {
             $found = strpos($key, '__persist__');
-            if ($found) {
-                $tempKey = str_replace('__persist__', '', $key);
-                if (!isset($params[$tempKey])) {
-                    $params[$tempKey] = array();
-                }
+
+            if ($found === FALSE) {
+                continue;
+            }
+
+            $tempKey = str_replace('__persist__', '', $key);
+            if (!isset($params[$tempKey])) {
+                $params[$tempKey] = array();
             }
         }
 
@@ -94,169 +97,186 @@ class ExtraFieldValue extends Model
         $type = $this->getExtraField()->getExtraFieldType();
         // Parse params.
         foreach ($params as $key => $value) {
-            if (substr($key, 0, 6) == 'extra_' ||
-                substr($key, 0, 7) == '_extra_'
+            if (
+                substr($key, 0, 6) != 'extra_' &&
+                substr($key, 0, 7) != '_extra_'
             ) {
-                // An extra field.
-                $field_variable = substr($key, 6);
-                $extraFieldInfo = $this->getExtraField()->get_handler_field_info_by_field_variable($field_variable);
-
-                if ($extraFieldInfo) {
-                    $commentVariable = 'extra_'.$field_variable.'_comment';
-                    $comment = isset($params[$commentVariable]) ? $params[$commentVariable] : null;
-
-                    switch ($extraFieldInfo['field_type']) {
-
-                        case ExtraField::FIELD_TYPE_TAG:
-                            if ($type == EntityExtraField::USER_FIELD_TYPE) {
-
-                                UserManager::delete_user_tags(
-                                    $params['item_id'],
-                                    $extraFieldInfo['id']
-                                );
-
-                                UserManager::process_tags(
-                                    $value,
-                                    $params['item_id'],
-                                    $extraFieldInfo['id']
-                                );
-                            } else {
-                                $em = Database::getManager();
-                                
-                                $currentTags = $em
-                                    ->getRepository('ChamiloCoreBundle:ExtraFieldRelTag')
-                                    ->findBy([
-                                        'fieldId' => $extraFieldInfo['id'],
-                                        'itemId' => $params['item_id']
-                                    ]);
-
-                                foreach ($currentTags as $extraFieldtag) {
-                                    $em->remove($extraFieldtag);
-                                }
+                continue;
+            }
 
-                                $tagValues = is_array($value) ? $value : [$value];
-                                $tags = [];
-
-                                foreach ($tagValues as $tagValue) {
-                                    $tagsResult = $em->getRepository('ChamiloCoreBundle:Tag')->findBy([
-                                        'tag' => $tagValue,
-                                        'fieldId' => $extraFieldInfo['id']
-                                    ]);
-
-                                    if (empty($tagsResult)) {
-                                        $tag = new \Chamilo\CoreBundle\Entity\Tag();
-                                        $tag->setCount(0);
-                                        $tag->setFieldId($extraFieldInfo['id']);
-                                        $tag->setTag($tagValue);
-
-                                        $tags[] = $tag;
-                                    } else {
-                                        $tags = array_merge($tags, $tagsResult);
-                                    }
-                                }
+            // An extra field.
+            $field_variable = substr($key, 6);
+            $extraFieldInfo = $this->getExtraField()->get_handler_field_info_by_field_variable($field_variable);
 
-                                foreach ($tags as $tag) {
-                                    $tag->setCount($tag->getCount() + 1);
-                                    $em->persist($tag);
+            if (!$extraFieldInfo) {
+                continue;
+            }
 
-                                    $fieldRelTag = new Chamilo\CoreBundle\Entity\ExtraFieldRelTag();
-                                    $fieldRelTag->setFieldId($extraFieldInfo['id']);
-                                    $fieldRelTag->setItemId($params['item_id']);
-                                    $fieldRelTag->setTagId($tag->getId());
+            $commentVariable = 'extra_'.$field_variable.'_comment';
+            $comment = isset($params[$commentVariable]) ? $params[$commentVariable] : null;
 
-                                    $em->persist($fieldRelTag);
-                                }
+            switch ($extraFieldInfo['field_type']) {
+                case ExtraField::FIELD_TYPE_TAG:
+                    if ($type == EntityExtraField::USER_FIELD_TYPE) {
+                        UserManager::delete_user_tags(
+                            $params['item_id'],
+                            $extraFieldInfo['id']
+                        );
+
+                        UserManager::process_tags(
+                            $value,
+                            $params['item_id'],
+                            $extraFieldInfo['id']
+                        );
+                        break;
+                    }
 
-                                $em->flush();
-                            }
-                            break;
-                        case ExtraField::FIELD_TYPE_FILE_IMAGE:
-                            $dirPermissions = api_get_permissions_for_new_directories();
-                            switch ($this->type) {
-                                case 'course':
-                                    $fileDir = api_get_path(SYS_UPLOAD_PATH)."courses/";
-                                    $fileDirStored = "courses/";
-                                    break;
-                                case 'session':
-                                    $fileDir = api_get_path(SYS_UPLOAD_PATH)."sessions/";
-                                    $fileDirStored = "sessions/";
-                                    break;
-                                case 'user':
-                                    $fileDir = UserManager::getUserPathById($params['item_id'], 'system');
-                                    $fileDirStored = UserManager::getUserPathById($params['item_id'], 'last');
-                                    break;
-                            }
+                    $em = Database::getManager();
 
-                            $fileName = ExtraField::FIELD_TYPE_FILE_IMAGE . "_{$params['item_id']}.png";
+                    $currentTags = $em
+                        ->getRepository('ChamiloCoreBundle:ExtraFieldRelTag')
+                        ->findBy([
+                            'fieldId' => $extraFieldInfo['id'],
+                            'itemId' => $params['item_id']
+                        ]);
 
-                            if (!file_exists($fileDir)) {
-                                mkdir($fileDir, $dirPermissions, true);
-                            }
+                    foreach ($currentTags as $extraFieldtag) {
+                        $em->remove($extraFieldtag);
+                    }
 
-                            if ($value['error'] == 0) {
-                                $imageExtraField = new Image($value['tmp_name']);
-                                $imageExtraField->send_image($fileDir . $fileName, -1, 'png');
-                                $newParams = array(
-                                    'item_id' => $params['item_id'],
-                                    'field_id' => $extraFieldInfo['id'],
-                                    'value' => $fileDirStored . $fileName,
-                                    'comment' => $comment
-                                );
-
-                                self::save($newParams);
-                            }
-                            break;
-                        case ExtraField::FIELD_TYPE_FILE:
-                            $dirPermissions = api_get_permissions_for_new_directories();
+                    $em->flush();
 
-                            switch ($this->type) {
-                                case 'course':
-                                    $fileDir = api_get_path(SYS_UPLOAD_PATH)."courses/";
-                                    $fileDirStored = "courses/";
-                                    break;
-                                case 'session':
-                                    $fileDir = api_get_path(SYS_UPLOAD_PATH)."sessions/";
-                                    $fileDirStored = "sessions/";
-                                    break;
-                                case 'user':
-                                    $fileDir = UserManager::getUserPathById($params['item_id'], 'system');
-                                    $fileDirStored = UserManager::getUserPathById($params['item_id'], 'last');
-                                    break;
-                            }
+                    $tagValues = is_array($value) ? $value : [$value];
+                    $tags = [];
 
-                            $cleanedName = api_replace_dangerous_char($value['name']);
-                            $fileName = ExtraField::FIELD_TYPE_FILE . "_{$params['item_id']}_$cleanedName";
-                            if (!file_exists($fileDir)) {
-                                mkdir($fileDir, $dirPermissions, true);
-                            }
+                    foreach ($tagValues as $tagValue) {
+                        $tagsResult = $em
+                            ->getRepository('ChamiloCoreBundle:Tag')
+                            ->findBy([
+                                'tag' => $tagValue,
+                                'fieldId' => $extraFieldInfo['id']
+                            ]);
 
-                            if ($value['error'] == 0) {
-                                moveUploadedFile($value, $fileDir . $fileName);
+                        if (empty($tagsResult)) {
+                            $tag = new \Chamilo\CoreBundle\Entity\Tag();
+                            $tag->setFieldId($extraFieldInfo['id']);
+                            $tag->setTag($tagValue);
 
-                                $new_params = array(
-                                    'item_id' => $params['item_id'],
-                                    'field_id' => $extraFieldInfo['id'],
-                                    'value' => $fileDirStored . $fileName
-                                );
+                            $tags[] = $tag;
+                        } else {
+                            $tags = array_merge($tags, $tagsResult);
+                        }
+                    }
 
-                                if ($this->type !== 'session' && $this->type !== 'course') {
-                                    $new_params['comment'] = $comment;
-                                }
+                    foreach ($tags as $tag) {
+                        $tagUses = $em
+                            ->getRepository('ChamiloCoreBundle:ExtraFieldRelTag')
+                            ->findBy([
+                                'tagId' => $tag->getId()
+                            ]);
 
-                                self::save($new_params);
-                            }
+                        $tag->setCount(count($tagUses) + 1);
+                        $em->persist($tag);    
+                    }
+
+                    $em->flush();
+
+                    foreach ($tags as $tag) {
+                        $fieldRelTag = new Chamilo\CoreBundle\Entity\ExtraFieldRelTag();
+                        $fieldRelTag->setFieldId($extraFieldInfo['id']);
+                        $fieldRelTag->setItemId($params['item_id']);
+                        $fieldRelTag->setTagId($tag->getId());
+
+                        $em->persist($fieldRelTag);
+                    }
+
+                    $em->flush();
+                    break;
+                case ExtraField::FIELD_TYPE_FILE_IMAGE:
+                    $dirPermissions = api_get_permissions_for_new_directories();
+                    switch ($this->type) {
+                        case 'course':
+                            $fileDir = api_get_path(SYS_UPLOAD_PATH)."courses/";
+                            $fileDirStored = "courses/";
                             break;
-                        default:
-                            $newParams = array(
-                                'item_id' => $params['item_id'],
-                                'field_id' => $extraFieldInfo['id'],
-                                'value' => $value,
-                                'comment' => $comment
-                            );
+                        case 'session':
+                            $fileDir = api_get_path(SYS_UPLOAD_PATH)."sessions/";
+                            $fileDirStored = "sessions/";
+                            break;
+                        case 'user':
+                            $fileDir = UserManager::getUserPathById($params['item_id'], 'system');
+                            $fileDirStored = UserManager::getUserPathById($params['item_id'], 'last');
+                            break;
+                    }
 
-                            self::save($newParams);
+                    $fileName = ExtraField::FIELD_TYPE_FILE_IMAGE . "_{$params['item_id']}.png";
+
+                    if (!file_exists($fileDir)) {
+                        mkdir($fileDir, $dirPermissions, true);
                     }
-                }
+
+                    if ($value['error'] == 0) {
+                        $imageExtraField = new Image($value['tmp_name']);
+                        $imageExtraField->send_image($fileDir . $fileName, -1, 'png');
+                        $newParams = array(
+                            'item_id' => $params['item_id'],
+                            'field_id' => $extraFieldInfo['id'],
+                            'value' => $fileDirStored . $fileName,
+                            'comment' => $comment
+                        );
+
+                        self::save($newParams);
+                    }
+                    break;
+                case ExtraField::FIELD_TYPE_FILE:
+                    $dirPermissions = api_get_permissions_for_new_directories();
+
+                    switch ($this->type) {
+                        case 'course':
+                            $fileDir = api_get_path(SYS_UPLOAD_PATH)."courses/";
+                            $fileDirStored = "courses/";
+                            break;
+                        case 'session':
+                            $fileDir = api_get_path(SYS_UPLOAD_PATH)."sessions/";
+                            $fileDirStored = "sessions/";
+                            break;
+                        case 'user':
+                            $fileDir = UserManager::getUserPathById($params['item_id'], 'system');
+                            $fileDirStored = UserManager::getUserPathById($params['item_id'], 'last');
+                            break;
+                    }
+
+                    $cleanedName = api_replace_dangerous_char($value['name']);
+                    $fileName = ExtraField::FIELD_TYPE_FILE . "_{$params['item_id']}_$cleanedName";
+                    if (!file_exists($fileDir)) {
+                        mkdir($fileDir, $dirPermissions, true);
+                    }
+
+                    if ($value['error'] == 0) {
+                        moveUploadedFile($value, $fileDir . $fileName);
+
+                        $new_params = array(
+                            'item_id' => $params['item_id'],
+                            'field_id' => $extraFieldInfo['id'],
+                            'value' => $fileDirStored . $fileName
+                        );
+
+                        if ($this->type !== 'session' && $this->type !== 'course') {
+                            $new_params['comment'] = $comment;
+                        }
+
+                        self::save($new_params);
+                    }
+                    break;
+                default:
+                    $newParams = array(
+                        'item_id' => $params['item_id'],
+                        'field_id' => $extraFieldInfo['id'],
+                        'value' => $value,
+                        'comment' => $comment
+                    );
+
+                    self::save($newParams);
             }
         }
     }

+ 3 - 3
main/template/default/admin/settings_index.tpl

@@ -13,7 +13,7 @@ $(document).ready(function() {
 
         var extraContentEditor = CKEDITOR.instances.extra_content;
 
-        $('a.edit-block').on('click', function(e) {
+        $('a.admin-edit-block').on('click', function(e) {
             e.preventDefault();
 
             var $self = $(this);
@@ -50,8 +50,8 @@ $(document).ready(function() {
                 <div class="panel-heading">
                     {{ block_item.icon }} {{ block_item.label }}
                     {% if block_item.editable and _u.is_admin %}
-                        <a class="edit-block pull-right" href="#" data-label="{{ block_item.label }}" data-id="{{ block_item.class }}">
-                            <img src="{{ _p.web_img }}icons/22/edit.png" alt="{{ 'Edit' | get_lang }}" title="{{ 'Edit' | get_lang }}">
+                        <a class="admin-edit-block pull-right" href="#" data-label="{{ block_item.label }}" title="{{ 'Edit' | get_lang }}" data-id="{{ block_item.class }}">
+                            <img src="{{ _p.web_img }}icons/22/edit.png" alt="{{ 'Edit' | get_lang }}">
                         </a>
                     {% endif %}
                 </div>

+ 1 - 1
main/template/default/social/add_groups.tpl

@@ -3,7 +3,7 @@
 {% block content %}
 <div class="row">
     <div class="col-md-3">
-        <div class="social-menu">
+        <div class="social-network-menu">
             {{ social_avatar_block }}
             {{ social_menu_block }}
         </div>

+ 1 - 1
main/template/default/social/edit_profile.tpl

@@ -3,7 +3,7 @@
 {% block content %}
 <div class="row">
     <div class="col-md-3">
-        <div class="social-menu">
+        <div class="social-network-menu">
             {{ social_avatar_block }}
             {{ social_menu_block }}
         </div>

+ 1 - 1
main/template/default/social/friends.tpl

@@ -3,7 +3,7 @@
 {% block content %}
 <div class="row">
     <div class="col-md-3">
-        <div class="social-menu">
+        <div class="social-network-menu">
             {{ social_avatar_block }}
             {{ social_menu_block }}
         </div>

+ 1 - 1
main/template/default/social/group_waiting_list.tpl

@@ -3,7 +3,7 @@
 {% block content %}
 <div class="row">
     <div class="col-md-3">
-        <div class="social-menu">
+        <div class="social-network-menu">
             {{ social_avatar_block }}
             {{ social_menu_block }}
         </div>

+ 1 - 1
main/template/default/social/groups.tpl

@@ -3,7 +3,7 @@
 {% block content %}
 <div class="row">
     <div class="col-md-3">
-        <div class="social-menu">
+        <div class="social-network-menu">
             {{ social_avatar_block }}
             {{ social_menu_block }}
         </div>

+ 1 - 1
main/template/default/social/home.tpl

@@ -5,7 +5,7 @@
         <div class="col-md-3">
             {{ social_avatar_block }}
 
-            <div class="social-menu">
+            <div class="social-network-menu">
             {{ social_menu_block }}
             </div>
         </div>

+ 1 - 1
main/template/default/social/inbox.tpl

@@ -3,7 +3,7 @@
 {% block content %}
 <div class="row">
     <div class="col-md-3">
-        <div class="social-menu">
+        <div class="social-network-menu">
             {{ social_avatar_block }}
             {{ social_menu_block }}
         </div>

+ 1 - 1
main/template/default/social/invitations.tpl

@@ -3,7 +3,7 @@
 {% block content %}
 <div class="row">
     <div class="col-md-3">
-        <div class="social-menu">
+        <div class="social-network-menu">
             {{ social_avatar_block }}
             {{ social_menu_block }}
         </div>

+ 1 - 1
main/template/default/social/myfiles.tpl

@@ -3,7 +3,7 @@
 {% block content %}
 <div class="row">
     <div class="col-md-3">
-        <div class="social-menu">
+        <div class="social-network-menu">
             {{ social_avatar_block }}
             {{ social_menu_block }}
         </div>

+ 1 - 1
main/template/default/social/profile.tpl

@@ -5,7 +5,7 @@
     <div class="col-md-3">
         {{ social_avatar_block }}
         {{ social_extra_info_block }}        
-        <div class="social-menu">
+        <div class="social-network-menu">
             {{ social_menu_block }}
         </div>
     </div>

+ 1 - 1
main/template/default/social/search.tpl

@@ -3,7 +3,7 @@
 {% block content %}
 <div class="row">
     <div class="col-md-3">
-        <div class="social-menu">
+        <div class="social-network-menu">
             {{ social_avatar_block }}
             {{ social_menu_block }}
         </div>

+ 2 - 2
plugin/tour/config/tour.json

@@ -72,14 +72,14 @@
         ]
     },
     {
-        "pageClass": ".section-social",
+        "pageClass": ".section-social-network",
         "steps": [
             {
                 "elementSelector": ".breadcrumb",
                 "message": "SocialAllowsYouToGetInTouchWithOtherUsersOfThePlatform"
             },
             {
-                "elementSelector": ".social-menu",
+                "elementSelector": ".social-network-menu",
                 "message": "SocialMenuGivesAccessToDifferentToolsToGetInTouchOrPublishStuff"
             }
         ]

+ 1 - 1
plugin/tour/lang/english.php

@@ -49,7 +49,7 @@ $strings['AgendaButtonsAllowYouToChangePeriod'] = 'You can switch the view to da
 $strings['MySpaceAllowsYouToKeepTrackOfProgress'] = 'This area allows you to check your progress if you\'re a student, or the progress of your students if you are a teacher';
 $strings['MySpaceSectionsGiveYouImportantInsight'] = 'The reports provided on this screen are extensible and can provide you very valuable insight on your learning or teaching';
 
-// if body class = section-social
+// if body class = section-social-network
 $strings['SocialAllowsYouToGetInTouchWithOtherUsersOfThePlatform'] = 'The social area allows you to get in touch with other users on the platform';
 $strings['SocialMenuGivesAccessToDifferentToolsToGetInTouchOrPublishStuff'] = 'The menu gives you access to a series of screens allowing you to participate in private messaging, chat, interest groups, etc';
 

+ 1 - 1
plugin/tour/lang/french.php

@@ -49,7 +49,7 @@ $strings['AgendaButtonsAllowYouToChangePeriod'] = 'You can switch the view to da
 $strings['MySpaceAllowsYouToKeepTrackOfProgress'] = 'This area allows you to check your progress if you\'re a student, or the progress of your students if you are a teacher';
 $strings['MySpaceSectionsGiveYouImportantInsight'] = 'The reports provided on this screen are extensible and can provide you very valuable insight on your learning or teaching';
 
-// if body class = section-social
+// if body class = section-social-network
 $strings['SocialAllowsYouToGetInTouchWithOtherUsersOfThePlatform'] = 'The social area allows you to get in touch with other users on the platform';
 $strings['SocialMenuGivesAccessToDifferentToolsToGetInTouchOrPublishStuff'] = 'The menu gives you access to a series of screens allowing you to participate in private messaging, chat, interest groups, etc';
 

+ 1 - 1
plugin/tour/lang/spanish.php

@@ -49,7 +49,7 @@ $strings['AgendaButtonsAllowYouToChangePeriod'] = 'You can switch the view to da
 $strings['MySpaceAllowsYouToKeepTrackOfProgress'] = 'This area allows you to check your progress if you\'re a student, or the progress of your students if you are a teacher';
 $strings['MySpaceSectionsGiveYouImportantInsight'] = 'The reports provided on this screen are extensible and can provide you very valuable insight on your learning or teaching';
 
-// if body class = section-social
+// if body class = section-social-network
 $strings['SocialAllowsYouToGetInTouchWithOtherUsersOfThePlatform'] = 'The social area allows you to get in touch with other users on the platform';
 $strings['SocialMenuGivesAccessToDifferentToolsToGetInTouchOrPublishStuff'] = 'The menu gives you access to a series of screens allowing you to participate in private messaging, chat, interest groups, etc';
 

+ 64 - 0
tests/video/index.php

@@ -0,0 +1,64 @@
+<?php
+/**
+ * Script to convert videos to several formats
+ * Put a comment before the exit(); line to enable.
+ * Load in your browser with http(s)://[yourcampus]/tests/video/index.php
+ * @todo Add security filtering for filenames
+ * @author Yannick Warnier <yannick.warnier@beeznest.com>
+ */
+exit();
+ini_set('memory_limit',0);
+ini_set('max_execution_time',0);
+ini_set('upload_max_filesize',0);
+ini_set('post_max_size',0);
+?>
+<html>
+<body>
+<p>
+<form method="post" action="" enctype="multipart/form-data">
+<table>
+<tr><td>Video to convert:</td><td><input type="file" name="video"/></td></tr>
+<tr><td>Desired Codec:</td>
+  <td>
+    <select name="codec">
+      <option value="webm" selected>WebM</option>
+      <option value="ogv">OGV</option>
+    </select>
+  </td>
+</tr>
+<tr><td colspan="2"><input type="submit" name="Convert" value="Convert"></tr>
+</table>
+</form>
+</p>
+<p>
+<?php
+if (!empty($_FILES['video'])) {
+  error_log($_FILES['video']['name']);
+  $orig = dirname(__FILE__).'/upload/'.md5(uniqid(rand(),true)).'-'.$_FILES['video']['name'];
+  $dest = dirname(__FILE__).'/upload/'.md5(uniqid(rand(),true)).'-'.substr($_FILES['video']['name'],0,-3).(($_POST['codec']!='ogv')?'webm':'ogv');
+  error_log($dest);
+  $res = @move_uploaded_file($_FILES['video']['tmp_name'],$orig);
+  if ($res === false) { error_log("Error moving video file: ".$php_error_msg); }
+  error_log('Calling '.'ffmpeg -i '.$orig.' -acodec libvorbis -ac 2 -ab 96k -ar 44100 -b 345k -v quiet -s 1080x720 '.$dest);
+  $ffmpeg = @exec('ffmpeg -i '.$orig.' -acodec libvorbis -ac 2 -ab 96k -ar 44100 -b 345k -v quiet -s 1080x720 '.$dest);
+  if ($ffmpeg === false) { error_log('no'); }
+}
+?>
+</p>
+<p>
+<?php
+echo "Files on server:<br />";
+$list = scandir(dirname(__FILE__).'/upload');
+if (is_array($list)) {
+  foreach ($list as $file) {
+    if (substr($file,0,1) == '.') {
+      continue;
+    } else {
+      echo '<a href="upload/'.$file.'">'.$file.'</a><br />'."\n";
+    }
+  }
+}
+?>
+</p>
+</body>
+</html>