From e8fdc8f2dd9eebda9d2e614ef8f5022b2f209541 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Mon, 27 Jun 2016 09:53:05 +0200 Subject: [PATCH 01/31] Fix extra field filter see #8301 --- main/admin/subscribe_user2course.php | 86 +++++++++++++--------------- main/inc/lib/usermanager.lib.php | 10 ++-- 2 files changed, 45 insertions(+), 51 deletions(-) diff --git a/main/admin/subscribe_user2course.php b/main/admin/subscribe_user2course.php index fedaf42ca0..fac2d0915b 100755 --- a/main/admin/subscribe_user2course.php +++ b/main/admin/subscribe_user2course.php @@ -11,7 +11,6 @@ * @todo use formvalidator for the form */ -/* INIT SECTION */ $cidReset = true; require_once '../inc/global.inc.php'; $this_section = SECTION_PLATFORM_ADMIN; @@ -23,28 +22,28 @@ api_protect_admin_script(); $form_sent = 0; $first_letter_user = ''; $first_letter_course = ''; -$courses = array (); +$courses = array(); $users = array(); $tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE); -$tbl_user = Database :: get_main_table(TABLE_MAIN_USER); +$tbl_user = Database :: get_main_table(TABLE_MAIN_USER); /* Header */ $tool_name = get_lang('AddUsersToACourse'); $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); -$htmlHeadXtra[] = ' -'; // displaying the header Display :: display_header($tool_name); -$link_add_group = ''.Display::return_icon('multiple.gif',get_lang('RegistrationByUsersGroups')).get_lang('RegistrationByUsersGroups').''; +$link_add_group = ''. + Display::return_icon('multiple.gif', get_lang('RegistrationByUsersGroups')).get_lang('RegistrationByUsersGroups').''; echo '
'.$link_add_group.'
'; $form = new FormValidator('subscribe_user2course'); @@ -52,13 +51,18 @@ $form->addElement('header', '', $tool_name); $form->display(); //checking for extra field with filter on -$extra_field_list= UserManager::get_extra_fields(); +$extra_field_list = UserManager::get_extra_fields(); + $new_field_list = array(); if (is_array($extra_field_list)) { foreach ($extra_field_list as $extra_field) { //if is enabled to filter and is a " - - - + + @@ -309,15 +307,11 @@ if (is_array($extra_field_list)) { diff --git a/main/inc/lib/usermanager.lib.php b/main/inc/lib/usermanager.lib.php index 53684dae15..dc51861353 100755 --- a/main/inc/lib/usermanager.lib.php +++ b/main/inc/lib/usermanager.lib.php @@ -1898,7 +1898,7 @@ class UserManager 0 => $rowf['id'], 1 => $rowf['variable'], 2 => $rowf['field_type'], - 3 => (empty($rowf['display_text']) ? '' : $rowf['display_text']), + 3 => empty($rowf['display_text']) ? '' : $rowf['display_text'], 4 => $rowf['default_value'], 5 => $rowf['field_order'], 6 => $rowf['visible'], @@ -1917,7 +1917,7 @@ class UserManager $fields[$rowf['id']][9][$rowo['id']] = array( 0 => $rowo['id'], 1 => $rowo['option_value'], - 2 => (empty($rowo['display_text']) ? '' : $rowo['display_text']), + 2 => empty($rowo['display_text']) ? '' : $rowo['display_text'], 3 => $rowo['option_order'] ); } @@ -2052,7 +2052,7 @@ class UserManager /** * Check if a field is available - * @param string th$variable + * @param string $variable * @return boolean */ public static function is_extra_field_available($variable) @@ -2060,7 +2060,7 @@ class UserManager $extraField = new ExtraField('user'); $data = $extraField->get_handler_field_info_by_field_variable($variable); - return empty($data) ? true : false; + return !empty($data) ? true : false; } /** @@ -2279,7 +2279,7 @@ class UserManager { $extraField = new ExtraFieldValue('user'); - $data = $extraField->get_values_by_handler_and_field_variable( + $data = $extraField->get_item_id_from_field_variable_and_field_value( $field_variable, $field_value, null, From fd371b0b7077cfaa78dcc4fe4f4ae53d2b8aae7a Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Mon, 27 Jun 2016 15:10:46 +0200 Subject: [PATCH 02/31] Fix date see BT#11324 --- main/inc/lib/statistics.lib.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/main/inc/lib/statistics.lib.php b/main/inc/lib/statistics.lib.php index 8ad356ed7a..a3d8cc844f 100644 --- a/main/inc/lib/statistics.lib.php +++ b/main/inc/lib/statistics.lib.php @@ -293,10 +293,10 @@ class Statistics } } - if (!empty($row['default_date']) && $row['default_date'] != '0000-00-00 00:00:00') { - $row['default_date'] = api_get_local_time($row['default_date']); + if (!empty($row[7]) && $row[7] != '0000-00-00 00:00:00') { + $row[7] = api_get_local_time($row[7]); } else { - $row['default_date'] = '-'; + $row[7] = '-'; } if (!empty($row[5])) { @@ -327,6 +327,7 @@ class Statistics $row[6] = get_lang('Unknown'); } } + $activities[] = $row; } @@ -530,7 +531,7 @@ class Statistics Statistics::printStats(get_lang('Logins'), $totalLogin, false); } } - + /** * get the number of recent logins * @param bool $distinct Whether to only give distinct users stats, or *all* logins @@ -555,15 +556,15 @@ class Statistics $field = 'DISTINCT(login_user_id)'; } $sql = "SELECT count($field) AS number, date(login_date) as login_date FROM $table $table_url WHERE DATE_ADD(login_date, INTERVAL 15 DAY) >= '$now' $where_url GROUP BY date(login_date)"; - + $res = Database::query($sql); while($row = Database::fetch_array($res,'ASSOC')){ $totalLogin[$row['login_date']] = $row['number']; } - + return $totalLogin; } - + /** * Show some stats about the accesses to the different course tools */ From 663fa2b4cb85792b093a95ce82a887f7fd17d609 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Mon, 27 Jun 2016 16:07:40 -0500 Subject: [PATCH 03/31] Fix issue with exercises live results (class name not capitalized) --- main/inc/ajax/exercise.ajax.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/inc/ajax/exercise.ajax.php b/main/inc/ajax/exercise.ajax.php index fb3531aa78..776839626e 100755 --- a/main/inc/ajax/exercise.ajax.php +++ b/main/inc/ajax/exercise.ajax.php @@ -117,7 +117,7 @@ switch ($action) { $results[] = $row; } - $oExe = new exercise(); + $oExe = new Exercise(); $oExe->read($exercise_id); $response = new stdClass(); From fe26e6b89e779815c163c5b07a3cb08a30072fd6 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Mon, 27 Jun 2016 21:14:13 -0500 Subject: [PATCH 04/31] Fix work teacher list --- main/work/work.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/main/work/work.lib.php b/main/work/work.lib.php index 69cfd103eb..0ac4900b1b 100755 --- a/main/work/work.lib.php +++ b/main/work/work.lib.php @@ -1499,7 +1499,6 @@ function getWorkListTeacher( $where_condition ORDER BY $column $direction LIMIT $start, $limit"; - echo "
$sql
"; $result = Database::query($sql); if ($getCount) { From 3e48cb9fef8aa677c6cc9b9d2e546fe8a949b533 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Tue, 28 Jun 2016 12:56:08 +0200 Subject: [PATCH 05/31] Fix extra field functions --- main/inc/lib/extra_field_value.lib.php | 10 ++++++++-- main/inc/lib/usermanager.lib.php | 10 +++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/main/inc/lib/extra_field_value.lib.php b/main/inc/lib/extra_field_value.lib.php index b7d34c3585..bff8d2183f 100755 --- a/main/inc/lib/extra_field_value.lib.php +++ b/main/inc/lib/extra_field_value.lib.php @@ -647,6 +647,7 @@ class ExtraFieldValue extends Model $sql .= " AND visible = $visibility "; } $sql .= " ORDER BY id"; + $result = Database::query($sql); if (Database::num_rows($result)) { $result = Database::fetch_array($result, 'ASSOC'); @@ -685,7 +686,8 @@ class ExtraFieldValue extends Model $field_variable, $field_value, $transform = false, - $last = false + $last = false, + $all = false ) { $field_value = Database::escape_string($field_value); $field_variable = Database::escape_string($field_variable); @@ -710,7 +712,11 @@ class ExtraFieldValue extends Model $result = Database::query($sql); if ($result !== false && Database::num_rows($result)) { - $result = Database::fetch_array($result, 'ASSOC'); + if ($all) { + $result = Database::store_result($result, 'ASSOC'); + } else { + $result = Database::fetch_array($result, 'ASSOC'); + } return $result; } else { diff --git a/main/inc/lib/usermanager.lib.php b/main/inc/lib/usermanager.lib.php index dc51861353..54e869ce12 100755 --- a/main/inc/lib/usermanager.lib.php +++ b/main/inc/lib/usermanager.lib.php @@ -2282,15 +2282,15 @@ class UserManager $data = $extraField->get_item_id_from_field_variable_and_field_value( $field_variable, $field_value, - null, - true, - intval($all_visibility) + false, + false, + true ); $result = []; if (!empty($data)) { - foreach ($data as $data) { - $result[] = $data['item_id']; + foreach ($data as $value) { + $result[] = $value['item_id']; } } From 8e42509b23a4ed6800b811c4f18c19c604af909f Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 28 Jun 2016 11:35:11 -0500 Subject: [PATCH 06/31] Minor - Remove blank line --- app/config/mail.conf.dist.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/config/mail.conf.dist.php b/app/config/mail.conf.dist.php index 92b539d194..9f2bb8ce3a 100644 --- a/app/config/mail.conf.dist.php +++ b/app/config/mail.conf.dist.php @@ -1,5 +1,4 @@ Date: Tue, 28 Jun 2016 14:51:21 -0500 Subject: [PATCH 07/31] Show only one table in works in session report - refs BT#11031 --- main/mySpace/works.php | 107 +++++++++++++---------- main/template/default/my_space/works.tpl | 33 ++++++- 2 files changed, 91 insertions(+), 49 deletions(-) diff --git a/main/mySpace/works.php b/main/mySpace/works.php index 37e7b4b545..1fdeb83ed3 100644 --- a/main/mySpace/works.php +++ b/main/mySpace/works.php @@ -7,6 +7,11 @@ require_once '../inc/global.inc.php'; +use \Chamilo\CoreBundle\Entity\Session; +use \Doctrine\Common\Collections\Criteria; + +api_block_anonymous_users(true); + if (api_is_student()) { api_not_allowed(true); exit; @@ -15,7 +20,6 @@ if (api_is_student()) { $em = Database::getManager(); $session = null; $sessionsInfo = SessionManager::getSessionsFollowedByUser(api_get_user_id(), COURSEMANAGER); -$coursesData = []; $form = new FormValidator('work_report'); $selectSession = $form->addSelect('session', get_lang('Session'), [0 => get_lang('None')]); @@ -30,60 +34,69 @@ if ($form->validate()) { $session = $em->find('ChamiloCoreBundle:Session', $sessionId); } +$coursesInfo = []; +$usersInfo = []; + if ($session) { - $userSubscriptions = $session->getUsers(); $sessionCourses = $session->getCourses(); foreach ($sessionCourses as $sessionCourse) { $course = $sessionCourse->getCourse(); - $userCourseSubscriptions = $session->getUserCourseSubscriptionsByStatus($course, 0); - $courseInfo = [ - 'title' => $course->getTitle() - ]; - - $table = new HTML_Table(['class' => 'table table-hover table-striped']); - $table->setHeaderContents(0, 0, get_lang('OfficialCode')); - $table->setHeaderContents(0, 1, get_lang('StudentName')); - $table->setHeaderContents(0, 2, get_lang('TimeSpentOnThePlatform')); - $table->setHeaderContents(0, 3, get_lang('FirstLoginInPlatform')); - $table->setHeaderContents(0, 4, get_lang('LatestLoginInPlatform')); - $table->setHeaderContents(0, 5, get_lang('Course')); - $table->setHeaderContents(0, 6, get_lang('Progress')); - $table->setHeaderContents(0, 7, get_lang('SentDate')); + $coursesInfo[$course->getId()] = $course->getCode(); + $criteria = Criteria::create()->where( + Criteria::expr()->eq("status", Session::STUDENT) + ); + $userCourseSubscriptions = $session + ->getUserCourseSubscriptions() + ->matching($criteria); foreach ($userCourseSubscriptions as $userCourseSubscription) { $user = $userCourseSubscription->getUser(); - + + if (!array_key_exists($user->getId(), $usersInfo)) { + $usersInfo[$user->getId()] = [ + 'code' => $user->getOfficialCode(), + 'complete_name' => $user->getCompleteName(), + 'time_in_platform' => api_time_to_hms( + Tracking::get_time_spent_on_the_platform($user->getId()) + ), + 'first_connection' => Tracking::get_first_connection_date($user->getId()), + 'last_connection' => Tracking::get_last_connection_date($user->getId()) + ]; + } + + $usersInfo[$user->getId()][$course->getId() . '_score'] = null; + $usersInfo[$user->getId()][$course->getId() . '_progress'] = null; + $usersInfo[$user->getId()][$course->getId() . '_last_sent_date'] = null; + + if (!$session->hasStudentInCourse($user, $course)) { + continue; + } + + $usersInfo[$user->getId()][$course->getId() . '_score'] = Tracking::get_avg_student_score( + $user->getId(), + $course->getCode(), + null, + $session->getId() + ); + $usersInfo[$user->getId()][$course->getId() . '_progress'] = Tracking::get_avg_student_progress( + $user->getId(), + $course->getCode(), + null, + $session->getId() + ); + $lastPublication = Tracking::getLastStudentPublication($user, 'work', $course, $session); - $lastPublicationFormatted = null; - if ($lastPublication) { - $lastPublicationFormatted = api_format_date( - $lastPublication->getSentDate()->getTimestamp(), - DATE_TIME_FORMAT_SHORT - ); + if (!$lastPublication) { + continue; } - $data = [ - $user->getOfficialCode(), - $user->getCompleteName(), - api_time_to_hms( - Tracking::get_time_spent_on_the_platform($user->getId()) - ), - Tracking::get_first_connection_date($user->getId()), - Tracking::get_last_connection_date($user->getId()), - Tracking::get_avg_student_score($user->getId(), $course->getCode(), null, $session->getId()), - Tracking::get_avg_student_progress($user->getId(), $course->getCode(), null, $session->getId()), - $lastPublicationFormatted - ]; - - $table->addRow($data); + $usersInfo[$user->getId()][$course->getId() . '_last_sent_date'] = api_format_date( + $lastPublication->getSentDate()->getTimestamp(), + DATE_TIME_FORMAT_SHORT + ); } - - $coursesData[] = [ - 'title' => $course->getTitle(), - 'detail_table' => $table->toHtml() - ]; } } @@ -92,16 +105,20 @@ $interbreadcrumb[] = [ 'name' => get_lang('MySpace') ]; -$view = new Template(get_lang('WorkReport')); -$view->assign('header', get_lang('WorkReport')); +$toolName = get_lang('WorkReport'); + +$view = new Template($toolName); $view->assign('form', $form->returnForm()); if ($session) { $view->assign('session', ['name' => $session->getName()]); - $view->assign('courses', $coursesData); + $view->assign('courses', $coursesInfo); + $view->assign('users', $usersInfo); } $template = $view->get_template('my_space/works.tpl'); $content = $view->fetch($template); + +$view->assign('header', $toolName); $view->assign('content', $content); $view->display_one_col_template(); diff --git a/main/template/default/my_space/works.tpl b/main/template/default/my_space/works.tpl index 26dba0ba9e..9f792fe817 100644 --- a/main/template/default/my_space/works.tpl +++ b/main/template/default/my_space/works.tpl @@ -1,8 +1,33 @@ {{ form }} + {% if session %} - {% for course in courses %} -

{{ course.title }}

- {{ course.detail_table }} - {% endfor %} +
+ + + + + + + + + + {% for course_code in courses %} + + + + {% endfor %} + + + + {% for user in users %} + + {% for data in user %} + + {% endfor %} + + {% endfor %} + +
{{ 'OfficialCode'|get_lang }}{{ 'Name'|get_lang }}{{ 'TimeSpentOnThePlatform'|get_lang }}{{ 'FirstLoginInPlatform'|get_lang }}{{ 'LatestLoginInPlatform'|get_lang }}{{ course_code }}{{ 'Progress'|get_lang }}{{ 'LastSentWorkDate'|get_lang }}
{{ data }}
+
{% endif %} From e0516796ae1451f378bafb6f88e857a6e07c2ca6 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 28 Jun 2016 15:02:20 -0500 Subject: [PATCH 08/31] Add clean cache info in upgrade guide when upgrading from 1.9 to 1.10 (just in case) - refs CT#8309 --- documentation/installation_guide.html | 1 + 1 file changed, 1 insertion(+) diff --git a/documentation/installation_guide.html b/documentation/installation_guide.html index 50e5b106cb..d9a5708cce 100755 --- a/documentation/installation_guide.html +++ b/documentation/installation_guide.html @@ -335,6 +335,7 @@ Please note that if you (unluckily) upgraded from any of the 1.9 versions to 1.1
  • make sure "AllowOverride All" is present in your Apache configuration, as interpreting the .htaccess files is very important for Chamilo to work (note that the Order-Allow directive has been replaced by "Require all granted" in Apache 2.4)
  • point your browser on your portal URL + main/install/
  • click Install, then choose Upgrade from 1.9.*
  • +
  • once your portal is upgraded, clean your app/cache/twig directory: delete all the contents *in* this directory (do NOT remove the directory itself, only its contents!). It will all be re-generated. You can also delete the contents of this directory through the "Archive directory cleanup" option in the "System" box of the Administration page.

  • From 25e36b700d06bf3f269d0937a86b83b0c2fa726d Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Tue, 28 Jun 2016 15:23:20 -0500 Subject: [PATCH 09/31] Allow export works in session report - refs BT#11031 --- main/admin/teacher_time_report_by_session.php | 5 +- main/mySpace/works.php | 61 +++++++++++++++++-- main/template/default/my_space/works.tpl | 2 +- 3 files changed, 59 insertions(+), 9 deletions(-) diff --git a/main/admin/teacher_time_report_by_session.php b/main/admin/teacher_time_report_by_session.php index c20556aeb9..b426753cd6 100644 --- a/main/admin/teacher_time_report_by_session.php +++ b/main/admin/teacher_time_report_by_session.php @@ -27,7 +27,6 @@ foreach ($sessionsInfo as $sessionInfo) { if (isset($_GET['session']) && intval($_GET['session'])) { $form->setDefaults(['session' => intval($_GET['session'])]); - $sessionId = $form->exportValue('session'); $session = $em->find('ChamiloCoreBundle:Session', intval($_GET['session'])); } @@ -154,11 +153,11 @@ if ($session) { $actions = [ Display::url( Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), [], ICON_SIZE_MEDIUM), - api_get_self() . '?' . http_build_query(['export' => 'csv', 'session' => $session ? $session->getId() : 0]) + api_get_self() . '?' . http_build_query(['export' => 'csv', 'session' => $session->getId()]) ), Display::url( Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), [], ICON_SIZE_MEDIUM), - api_get_self() . '?' . http_build_query(['export' => 'xls', 'session' => $session ? $session->getId() : 0]) + api_get_self() . '?' . http_build_query(['export' => 'xls', 'session' => $session->getId()]) ) ]; } diff --git a/main/mySpace/works.php b/main/mySpace/works.php index 1fdeb83ed3..6b9538859e 100644 --- a/main/mySpace/works.php +++ b/main/mySpace/works.php @@ -17,11 +17,13 @@ if (api_is_student()) { exit; } +$toolName = get_lang('WorksInSessionReport'); + $em = Database::getManager(); $session = null; $sessionsInfo = SessionManager::getSessionsFollowedByUser(api_get_user_id(), COURSEMANAGER); -$form = new FormValidator('work_report'); +$form = new FormValidator('work_report', 'GET'); $selectSession = $form->addSelect('session', get_lang('Session'), [0 => get_lang('None')]); $form->addButtonFilter(get_lang('Filter')); @@ -29,9 +31,10 @@ foreach ($sessionsInfo as $sessionInfo) { $selectSession->addOption($sessionInfo['name'], $sessionInfo['id']); } -if ($form->validate()) { - $sessionId = $form->exportValue('session'); - $session = $em->find('ChamiloCoreBundle:Session', $sessionId); +if (isset($_GET['session']) && intval($_GET['session'])) { + $form->setDefaults(['session' => intval($_GET['session'])]); + + $session = $em->find('ChamiloCoreBundle:Session', intval($_GET['session'])); } $coursesInfo = []; @@ -100,12 +103,59 @@ if ($session) { } } +if (isset($_GET['export']) && $session && ($coursesInfo && $usersInfo)) { + $dataToExport = [ + [$toolName] + ]; + $fileName = 'works_in_session_' . api_get_local_time(); + + $dataToExport['headers'][] = get_lang('OfficialCode'); + $dataToExport['headers'][] = get_lang('StudentName'); + $dataToExport['headers'][] = get_lang('TimeSpentOnThePlatform'); + $dataToExport['headers'][] = get_lang('FirstLoginInPlatform'); + $dataToExport['headers'][] = get_lang('LatestLoginInPlatform'); + + foreach ($coursesInfo as $courseCode) { + $dataToExport['headers'][] = $courseCode; + $dataToExport['headers'][] = get_lang('Progress'); + $dataToExport['headers'][] = get_lang('LastSentWorkDate'); + } + + foreach ($usersInfo as $user) { + $dataToExport[] = $user; + } + + switch ($_GET['export']) { + case 'xls': + Export::export_table_xls_html($dataToExport, $fileName); + break; + case 'csv': + Export::arrayToCsv($dataToExport, $fileName); + break; + } + + exit; +} + $interbreadcrumb[] = [ 'url' => api_get_path(WEB_CODE_PATH) . 'mySpace/index.php', 'name' => get_lang('MySpace') ]; -$toolName = get_lang('WorkReport'); +$actions = []; + +if ($session) { + $actions = [ + Display::url( + Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), [], ICON_SIZE_MEDIUM), + api_get_self() . '?' . http_build_query(['export' => 'csv', 'session' => $session->getId()]) + ), + Display::url( + Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), [], ICON_SIZE_MEDIUM), + api_get_self() . '?' . http_build_query(['export' => 'xls', 'session' => $session->getId()]) + ) + ]; +} $view = new Template($toolName); $view->assign('form', $form->returnForm()); @@ -121,4 +171,5 @@ $content = $view->fetch($template); $view->assign('header', $toolName); $view->assign('content', $content); +$view->assign('actions', implode(' ', $actions)); $view->display_one_col_template(); diff --git a/main/template/default/my_space/works.tpl b/main/template/default/my_space/works.tpl index 9f792fe817..b615270939 100644 --- a/main/template/default/my_space/works.tpl +++ b/main/template/default/my_space/works.tpl @@ -7,7 +7,7 @@ {{ 'OfficialCode'|get_lang }} - {{ 'Name'|get_lang }} + {{ 'StudentName'|get_lang }} {{ 'TimeSpentOnThePlatform'|get_lang }} {{ 'FirstLoginInPlatform'|get_lang }} {{ 'LatestLoginInPlatform'|get_lang }} From 864b91189807325422d3f29015c12b45d1063cf3 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Tue, 28 Jun 2016 15:26:23 -0500 Subject: [PATCH 10/31] Rename file for works in session report - refs BT#11031 --- main/inc/ajax/model.ajax.php | 2 +- main/mySpace/{works.php => works_in_session_report.php} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename main/mySpace/{works.php => works_in_session_report.php} (100%) diff --git a/main/inc/ajax/model.ajax.php b/main/inc/ajax/model.ajax.php index 8040f5b301..2968340d7f 100755 --- a/main/inc/ajax/model.ajax.php +++ b/main/inc/ajax/model.ajax.php @@ -986,7 +986,7 @@ switch ($action) { $detailButtons = []; $detailButtons[] = Display::url( Display::return_icon('works.png', get_lang('Works')), - api_get_path(WEB_CODE_PATH) . 'mySpace/works.php' + api_get_path(WEB_CODE_PATH) . 'mySpace/works_in_session_report.php' ); $detailButtons[] = Display::url( Display::return_icon('2rightarrow.png'), diff --git a/main/mySpace/works.php b/main/mySpace/works_in_session_report.php similarity index 100% rename from main/mySpace/works.php rename to main/mySpace/works_in_session_report.php From 5c127fbe66ccc513528f80ee262a8442f4c9d01e Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 28 Jun 2016 15:41:02 -0500 Subject: [PATCH 11/31] Minor - Fix Generator meta attribute name (lowercase) --- main/template/default/layout/head.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/template/default/layout/head.tpl b/main/template/default/layout/head.tpl index ff76a3f16d..d481a2be70 100755 --- a/main/template/default/layout/head.tpl +++ b/main/template/default/layout/head.tpl @@ -11,7 +11,7 @@ {{ favico }} - + {# Use the latest engine in ie8/ie9 or use google chrome engine if available #} {# Improve usability in portal devices #} From 3756e449d4362a550ebb6aab0fb19c26fdebce8e Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Tue, 28 Jun 2016 15:52:49 -0500 Subject: [PATCH 12/31] Rename file of teachers time by session report - refs BT#11032 --- ...hp => teachers_time_by_session_report.php} | 2 +- .../default/admin/teacher_time_report.tpl | 22 +++++++++---------- ...pl => teachers_time_by_session_report.tpl} | 0 3 files changed, 11 insertions(+), 13 deletions(-) rename main/admin/{teacher_time_report_by_session.php => teachers_time_by_session_report.php} (98%) rename main/template/default/admin/{teacher_time_report_by_session.tpl => teachers_time_by_session_report.tpl} (100%) diff --git a/main/admin/teacher_time_report_by_session.php b/main/admin/teachers_time_by_session_report.php similarity index 98% rename from main/admin/teacher_time_report_by_session.php rename to main/admin/teachers_time_by_session_report.php index b426753cd6..1a863429d6 100644 --- a/main/admin/teacher_time_report_by_session.php +++ b/main/admin/teachers_time_by_session_report.php @@ -170,7 +170,7 @@ if ($session) { $view->assign('data', $data); } -$template = $view->get_template('admin/teacher_time_report_by_session.tpl'); +$template = $view->get_template('admin/teachers_time_by_session_report.tpl'); $content = $view->fetch($template); $view->assign('header', $toolName); diff --git a/main/template/default/admin/teacher_time_report.tpl b/main/template/default/admin/teacher_time_report.tpl index 6c5dda04b9..0acb0154ff 100644 --- a/main/template/default/admin/teacher_time_report.tpl +++ b/main/template/default/admin/teacher_time_report.tpl @@ -28,18 +28,16 @@
    -

    {{ 'TeacherTimeReport' | get_lang }}

    diff --git a/main/template/default/admin/teacher_time_report_by_session.tpl b/main/template/default/admin/teachers_time_by_session_report.tpl similarity index 100% rename from main/template/default/admin/teacher_time_report_by_session.tpl rename to main/template/default/admin/teachers_time_by_session_report.tpl From e0a22db146aaa1adde2abe5aba128e42a42eb82e Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Tue, 28 Jun 2016 16:35:56 -0500 Subject: [PATCH 13/31] Show only one table in teachers time by session report - refs BT#11032 --- .../admin/teachers_time_by_session_report.php | 96 ++++++++++++------- .../admin/teachers_time_by_session_report.tpl | 29 ++++++ 2 files changed, 89 insertions(+), 36 deletions(-) diff --git a/main/admin/teachers_time_by_session_report.php b/main/admin/teachers_time_by_session_report.php index 1a863429d6..39860d928e 100644 --- a/main/admin/teachers_time_by_session_report.php +++ b/main/admin/teachers_time_by_session_report.php @@ -5,6 +5,10 @@ * Generate a teacher time report in platform by session only * @package chamilo.admin */ + +use \Chamilo\CoreBundle\Entity\Session; +use \Doctrine\Common\Collections\Criteria; + $cidReset = true; require_once '../inc/global.inc.php'; @@ -12,6 +16,8 @@ require_once api_get_path(SYS_CODE_PATH) . 'work/work.lib.php'; api_protect_admin_script(); +$toolName = get_lang('TeacherTimeReportBySession'); + $em = Database::getManager(); $sessionsInfo = SessionManager::get_sessions_list([], ['name']); $session = null; @@ -31,22 +37,27 @@ if (isset($_GET['session']) && intval($_GET['session'])) { } $data = []; +$coursesInfo = []; +$usersInfo = []; if ($session) { $sessionCourses = $session->getCourses(); foreach ($sessionCourses as $sessionCourse) { $course = $sessionCourse->getCourse(); - $userCourseSubscriptions = $session->getUserCourseSubscriptionsByStatus( - $course, - \Chamilo\CoreBundle\Entity\Session::COACH + $coursesInfo[$course->getId()] = $course->getCode(); + $criteria = Criteria::create()->where( + Criteria::expr()->eq("status", Session::COACH) ); + $userCourseSubscriptions = $session + ->getUserCourseSubscriptions() + ->matching($criteria); foreach ($userCourseSubscriptions as $userCourseSubscription) { $user = $userCourseSubscription->getUser(); - if (!array_key_exists($user->getId(), $data)) { - $data[$user->getId()] = [ + if (!array_key_exists($user->getId(), $usersInfo)) { + $usersInfo[$user->getId()] = [ 'code' => $user->getOfficialCode(), 'complete_name' => $user->getCompleteName(), 'time_in_platform' => api_time_to_hms( @@ -54,11 +65,15 @@ if ($session) { ), 'first_connection' => Tracking::get_first_connection_date($user->getId()), 'last_connection' => Tracking::get_last_connection_date($user->getId()), - 'courses' => [] ]; } - if (array_key_exists($course->getId(), $data[$user->getId()]['courses'])) { + $usersInfo[$user->getId()][$course->getId() . '_number_of_students'] = null; + $usersInfo[$user->getId()][$course->getId() . '_number_of_works'] = null; + $usersInfo[$user->getId()][$course->getId() . '_last_work'] = null; + $usersInfo[$user->getId()][$course->getId() . '_time_spent_of_course'] = null; + + if (!$session->hasCoachInCourseWithStatus($user, $course)) { continue; } @@ -66,43 +81,52 @@ if ($session) { ->getRepository('ChamiloCourseBundle:CStudentPublication') ->findByTeacher($user, $course, $session->getId()); $lastWork = array_pop($works); - $lastFormattedDate = null; - if ($lastWork) { - $lastFormattedDate = api_format_date($lastWork->getSentDate()->getTimestamp(), DATE_TIME_FORMAT_SHORT); + $usersInfo[$user->getId()][$course->getId() . '_number_of_students'] = $sessionCourse->getNbrUsers(); + $usersInfo[$user->getId()][$course->getId() . '_number_of_works'] = count($works); + $usersInfo[$user->getId()][$course->getId() . '_time_spent_of_course'] = api_time_to_hms( + Tracking::get_time_spent_on_the_course($user->getId(), $course->getId(), $session->getId()) + ); + + if (!$lastWork) { + continue; } - $data[$user->getId()]['courses'][$course->getId()] = [ - 'id' => $course->getId(), - 'title' => $course->getTitle(), - 'code' => $course->getCode(), - 'number_of_students' => $sessionCourse->getNbrUsers(), - 'number_of_works' => count($works), - 'last_work' => $lastFormattedDate, - 'time_spent_of_course' => api_time_to_hms( - Tracking::get_time_spent_on_the_course( - $user->getId(), - $course->getId(), - $session->getId() - ) - ) - ]; + $lastFormattedDate = api_format_date($lastWork->getSentDate()->getTimestamp(), DATE_TIME_FORMAT_SHORT); + + $usersInfo[$user->getId()][$course->getId() . '_last_work'] = api_format_date( + $lastWork->getSentDate()->getTimestamp(), + DATE_TIME_FORMAT_SHORT + ); } } } -if (isset($_GET['export']) && $session && $data) { - $dataToExport = []; +if (isset($_GET['export']) && $session && ($coursesInfo && $usersInfo)) { $fileName = get_lang('TeacherTimeReport') . ' ' . api_get_local_time(); + $dataToExport = []; + $dataToExport[] = [$toolName, $session->getName()]; + $dataToExport['headers'] = [ + get_lang('OfficialCode'), + get_lang('CoachName'), + get_lang('TimeSpentOnThePlatform'), + get_lang('FirstLoginInPlatform'), + get_lang('LatestLoginInPlatform'), + ]; + + foreach ($coursesInfo as $courseCode) { + $dataToExport['headers'][] = $courseCode; + $dataToExport['headers'][] = get_lang('NumberOfWorks'); + $dataToExport['headers'][] = get_lang('LastWork'); + $dataToExport['headers'][] = sprintf(get_lang('TimeReportForCourseX'), $courseCode); + } + + foreach ($usersInfo as $user) { + $dataToExport[] = $user; + } + foreach ($data as $row) { - $headers = [ - get_lang('OfficialCode'), - get_lang('Name'), - get_lang('TimeSpentOnThePlatform'), - get_lang('FirstLoginInPlatform'), - get_lang('LatestLoginInPlatform') - ]; $contents = [ $row['code'], $row['complete_name'], @@ -145,7 +169,6 @@ $interbreadcrumb[] = [ 'url' => api_get_path(WEB_CODE_PATH) . 'admin/teacher_time_report.php', 'name' => get_lang('TeacherTimeReport') ]; -$toolName = get_lang('TeacherTimeReportBySession'); $actions = []; @@ -167,7 +190,8 @@ $view->assign('form', $form->returnForm()); if ($session) { $view->assign('session', ['id' => $session->getId(), 'name' => $session->getName()]); - $view->assign('data', $data); + $view->assign('courses', $coursesInfo); + $view->assign('users', $usersInfo); } $template = $view->get_template('admin/teachers_time_by_session_report.tpl'); diff --git a/main/template/default/admin/teachers_time_by_session_report.tpl b/main/template/default/admin/teachers_time_by_session_report.tpl index 281fc4746a..45d967ec0f 100644 --- a/main/template/default/admin/teachers_time_by_session_report.tpl +++ b/main/template/default/admin/teachers_time_by_session_report.tpl @@ -2,6 +2,35 @@ {% if session %} +
    + + + + + + + + + + {% for course_code in courses %} + + + + + {% endfor %} + + + + {% for user in users %} + + {% for data in user %} + + {% endfor %} + + {% endfor %} + +
    {{ 'OfficialCode'|get_lang }}{{ 'CoachName'|get_lang }}{{ 'TimeSpentOnThePlatform'|get_lang }}{{ 'FirstLoginInPlatform'|get_lang }}{{ 'LatestLoginInPlatform'|get_lang }}{{ course_code }}{{ 'NumberOfWorks'|get_lang }}{{ 'LastWork'|get_lang }}{{ 'TimeReportForCourseX'|get_lang|format(course.code) }}
    {{ data }}
    +
    {% for row in data %}
    From c99331107faf5652dc1b51a75b70cfa3ddc6e310 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Tue, 28 Jun 2016 16:37:29 -0500 Subject: [PATCH 14/31] Rename template file + improve for report - refs BT#11031 --- main/mySpace/works_in_session_report.php | 7 +++---- .../my_space/{works.tpl => works_in_session_report.tpl} | 0 2 files changed, 3 insertions(+), 4 deletions(-) rename main/template/default/my_space/{works.tpl => works_in_session_report.tpl} (100%) diff --git a/main/mySpace/works_in_session_report.php b/main/mySpace/works_in_session_report.php index 6b9538859e..18b95f3191 100644 --- a/main/mySpace/works_in_session_report.php +++ b/main/mySpace/works_in_session_report.php @@ -104,11 +104,10 @@ if ($session) { } if (isset($_GET['export']) && $session && ($coursesInfo && $usersInfo)) { - $dataToExport = [ - [$toolName] - ]; $fileName = 'works_in_session_' . api_get_local_time(); + $dataToExport = []; + $dataToExport[] = [$toolName, $session->getName()]; $dataToExport['headers'][] = get_lang('OfficialCode'); $dataToExport['headers'][] = get_lang('StudentName'); $dataToExport['headers'][] = get_lang('TimeSpentOnThePlatform'); @@ -166,7 +165,7 @@ if ($session) { $view->assign('users', $usersInfo); } -$template = $view->get_template('my_space/works.tpl'); +$template = $view->get_template('my_space/works_in_session_report.tpl'); $content = $view->fetch($template); $view->assign('header', $toolName); diff --git a/main/template/default/my_space/works.tpl b/main/template/default/my_space/works_in_session_report.tpl similarity index 100% rename from main/template/default/my_space/works.tpl rename to main/template/default/my_space/works_in_session_report.tpl From 52481bb45790a06560a07fb58ede769d1dccdfcf Mon Sep 17 00:00:00 2001 From: Nicolas Ducoulombier Date: Wed, 29 Jun 2016 12:24:49 +0200 Subject: [PATCH 15/31] fix name of variable -refs BT#11032 --- main/template/default/admin/teachers_time_by_session_report.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/template/default/admin/teachers_time_by_session_report.tpl b/main/template/default/admin/teachers_time_by_session_report.tpl index 45d967ec0f..f438c40aa8 100644 --- a/main/template/default/admin/teachers_time_by_session_report.tpl +++ b/main/template/default/admin/teachers_time_by_session_report.tpl @@ -16,7 +16,7 @@ {{ course_code }} {{ 'NumberOfWorks'|get_lang }} {{ 'LastWork'|get_lang }} - {{ 'TimeReportForCourseX'|get_lang|format(course.code) }} + {{ 'TimeReportForCourseX'|get_lang|format(course_code) }} {% endfor %} From 10c3ed1d86ef5f53066b33c8af5731eba07606d6 Mon Sep 17 00:00:00 2001 From: Nicolas Ducoulombier Date: Wed, 29 Jun 2016 12:39:31 +0200 Subject: [PATCH 16/31] fix second name of variable -refs BT#11032 --- main/template/default/admin/teachers_time_by_session_report.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/template/default/admin/teachers_time_by_session_report.tpl b/main/template/default/admin/teachers_time_by_session_report.tpl index f438c40aa8..0f65c04171 100644 --- a/main/template/default/admin/teachers_time_by_session_report.tpl +++ b/main/template/default/admin/teachers_time_by_session_report.tpl @@ -47,7 +47,7 @@ {{ course.code }} {{ 'NumberOfWorks'|get_lang }} {{ 'LastWork'|get_lang }} - {{ 'TimeReportForCourseX'|get_lang|format(course.code) }} + {{ 'TimeReportForCourseX'|get_lang|format(course_code) }} {% endfor %} From d5bbae840635f5652be59087b9f79e4bc3e9d170 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Wed, 29 Jun 2016 14:28:10 +0200 Subject: [PATCH 17/31] add scayt plugin --- .../ckeditor/plugins/scayt/CHANGELOG.md | 40 +- .../assets/ckeditor/plugins/scayt/LICENSE.md | 56 +- .../assets/ckeditor/plugins/scayt/README.md | 25 + .../ckeditor/plugins/scayt/dialogs/options.js | 592 +++++- .../plugins/scayt/dialogs/toolbar.css | 142 +- .../plugins/scayt/icons/hidpi/scayt.png | Bin 0 -> 2816 bytes .../ckeditor/plugins/scayt/icons/scayt.png | Bin 0 -> 839 bytes .../assets/ckeditor/plugins/scayt/lang/af.js | 13 + .../assets/ckeditor/plugins/scayt/lang/ar.js | 13 + .../assets/ckeditor/plugins/scayt/lang/bg.js | 13 + .../assets/ckeditor/plugins/scayt/lang/bn.js | 13 + .../assets/ckeditor/plugins/scayt/lang/bs.js | 13 + .../assets/ckeditor/plugins/scayt/lang/ca.js | 13 + .../assets/ckeditor/plugins/scayt/lang/cs.js | 13 + .../assets/ckeditor/plugins/scayt/lang/cy.js | 13 + .../assets/ckeditor/plugins/scayt/lang/da.js | 13 + .../assets/ckeditor/plugins/scayt/lang/de.js | 13 + .../assets/ckeditor/plugins/scayt/lang/el.js | 13 + .../ckeditor/plugins/scayt/lang/en-au.js | 13 + .../ckeditor/plugins/scayt/lang/en-ca.js | 13 + .../ckeditor/plugins/scayt/lang/en-gb.js | 13 + .../assets/ckeditor/plugins/scayt/lang/en.js | 13 + .../assets/ckeditor/plugins/scayt/lang/eo.js | 13 + .../assets/ckeditor/plugins/scayt/lang/es.js | 13 + .../assets/ckeditor/plugins/scayt/lang/et.js | 13 + .../assets/ckeditor/plugins/scayt/lang/eu.js | 13 + .../assets/ckeditor/plugins/scayt/lang/fa.js | 13 + .../assets/ckeditor/plugins/scayt/lang/fi.js | 13 + .../assets/ckeditor/plugins/scayt/lang/fo.js | 13 + .../ckeditor/plugins/scayt/lang/fr-ca.js | 13 + .../assets/ckeditor/plugins/scayt/lang/fr.js | 13 + .../assets/ckeditor/plugins/scayt/lang/gl.js | 13 + .../assets/ckeditor/plugins/scayt/lang/gu.js | 13 + .../assets/ckeditor/plugins/scayt/lang/he.js | 13 + .../assets/ckeditor/plugins/scayt/lang/hi.js | 13 + .../assets/ckeditor/plugins/scayt/lang/hr.js | 13 + .../assets/ckeditor/plugins/scayt/lang/hu.js | 13 + .../assets/ckeditor/plugins/scayt/lang/is.js | 13 + .../assets/ckeditor/plugins/scayt/lang/it.js | 13 + .../assets/ckeditor/plugins/scayt/lang/ja.js | 13 + .../assets/ckeditor/plugins/scayt/lang/ka.js | 13 + .../assets/ckeditor/plugins/scayt/lang/km.js | 13 + .../assets/ckeditor/plugins/scayt/lang/ko.js | 13 + .../assets/ckeditor/plugins/scayt/lang/ku.js | 13 + .../assets/ckeditor/plugins/scayt/lang/lt.js | 13 + .../assets/ckeditor/plugins/scayt/lang/lv.js | 13 + .../assets/ckeditor/plugins/scayt/lang/mk.js | 13 + .../assets/ckeditor/plugins/scayt/lang/mn.js | 13 + .../assets/ckeditor/plugins/scayt/lang/ms.js | 13 + .../assets/ckeditor/plugins/scayt/lang/nb.js | 13 + .../assets/ckeditor/plugins/scayt/lang/nl.js | 13 + .../assets/ckeditor/plugins/scayt/lang/no.js | 13 + .../assets/ckeditor/plugins/scayt/lang/pl.js | 13 + .../ckeditor/plugins/scayt/lang/pt-br.js | 13 + .../assets/ckeditor/plugins/scayt/lang/pt.js | 13 + .../assets/ckeditor/plugins/scayt/lang/ro.js | 13 + .../assets/ckeditor/plugins/scayt/lang/ru.js | 13 + .../assets/ckeditor/plugins/scayt/lang/sk.js | 13 + .../assets/ckeditor/plugins/scayt/lang/sl.js | 13 + .../ckeditor/plugins/scayt/lang/sr-latn.js | 13 + .../assets/ckeditor/plugins/scayt/lang/sr.js | 13 + .../assets/ckeditor/plugins/scayt/lang/sv.js | 13 + .../assets/ckeditor/plugins/scayt/lang/th.js | 13 + .../assets/ckeditor/plugins/scayt/lang/tr.js | 13 + .../assets/ckeditor/plugins/scayt/lang/ug.js | 13 + .../assets/ckeditor/plugins/scayt/lang/uk.js | 13 + .../assets/ckeditor/plugins/scayt/lang/vi.js | 13 + .../ckeditor/plugins/scayt/lang/zh-cn.js | 13 + .../assets/ckeditor/plugins/scayt/lang/zh.js | 13 + .../assets/ckeditor/plugins/scayt/plugin.js | 1877 +++++++++++++++++ 70 files changed, 3400 insertions(+), 138 deletions(-) create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/README.md create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/icons/hidpi/scayt.png create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/icons/scayt.png create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/af.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/ar.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/bg.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/bn.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/bs.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/ca.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/cs.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/cy.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/da.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/de.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/el.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/en-au.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/en-ca.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/en-gb.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/en.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/eo.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/es.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/et.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/eu.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/fa.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/fi.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/fo.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/fr-ca.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/fr.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/gl.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/gu.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/he.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/hi.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/hr.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/hu.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/is.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/it.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/ja.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/ka.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/km.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/ko.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/ku.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/lt.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/lv.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/mk.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/mn.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/ms.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/nb.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/nl.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/no.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/pl.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/pt-br.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/pt.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/ro.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/ru.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/sk.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/sl.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/sr-latn.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/sr.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/sv.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/th.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/tr.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/ug.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/uk.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/vi.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/zh-cn.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/lang/zh.js create mode 100644 app/Resources/public/assets/ckeditor/plugins/scayt/plugin.js diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/CHANGELOG.md b/app/Resources/public/assets/ckeditor/plugins/scayt/CHANGELOG.md index d956208b3f..05cf2ddc7e 100644 --- a/app/Resources/public/assets/ckeditor/plugins/scayt/CHANGELOG.md +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/CHANGELOG.md @@ -1,20 +1,20 @@ -SCAYT plugin for CKEditor 4 Changelog -==================== -### CKEditor 4.5.6 - -New Features: -* CKEditor [language addon](http://ckeditor.com/addon/language) support -* CKEditor [placeholder addon](http://ckeditor.com/addon/placeholder) support -* Drag and Drop support -* *Experimental* GRAYT functionality http://www.webspellchecker.net/samples/scayt-ckeditor-plugin.html#25 - -Fixed issues: -* [#98](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/98) SCAYT Affects Dialog Double Click. Fixed in SCAYT Core. -* [#102](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/102) SCAYT Core performance enhancements -* [#104](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/104) SCAYT's spans leak into the clipboard and after pasting -* [#105](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/105) Javascript error fired in case of multiple instances of CKEditor in one page -* [#107](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/107) SCAYT should not check non-editable parts of content -* [#108](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/108) Latest SCAYT copies id of editor element to the iframe -* SCAYT stops working when CKEditor Undo plug-in not enabled -* Issue with pasting SCAYT markup in CKEditor -* [#32](https://github.com/WebSpellChecker/ckeditor-plugin-wsc/issues/32) SCAYT stops working after pressing Cancel button in WSC dialog +SCAYT plugin for CKEditor 4 Changelog +==================== +### CKEditor 4.5.6 + +New Features: +* CKEditor [language addon](http://ckeditor.com/addon/language) support +* CKEditor [placeholder addon](http://ckeditor.com/addon/placeholder) support +* Drag and Drop support +* *Experimental* GRAYT functionality http://www.webspellchecker.net/samples/scayt-ckeditor-plugin.html#25 + +Fixed issues: +* [#98](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/98) SCAYT Affects Dialog Double Click. Fixed in SCAYT Core. +* [#102](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/102) SCAYT Core performance enhancements +* [#104](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/104) SCAYT's spans leak into the clipboard and after pasting +* [#105](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/105) Javascript error fired in case of multiple instances of CKEditor in one page +* [#107](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/107) SCAYT should not check non-editable parts of content +* [#108](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/108) Latest SCAYT copies id of editor element to the iframe +* SCAYT stops working when CKEditor Undo plug-in not enabled +* Issue with pasting SCAYT markup in CKEditor +* [#32](https://github.com/WebSpellChecker/ckeditor-plugin-wsc/issues/32) SCAYT stops working after pressing Cancel button in WSC dialog diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/LICENSE.md b/app/Resources/public/assets/ckeditor/plugins/scayt/LICENSE.md index 844ab4de0b..610c807808 100644 --- a/app/Resources/public/assets/ckeditor/plugins/scayt/LICENSE.md +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/LICENSE.md @@ -1,28 +1,28 @@ -Software License Agreement -========================== - -**CKEditor SCAYT Plugin** -Copyright © 2012, [CKSource](http://cksource.com) - Frederico Knabben. All rights reserved. - -Licensed under the terms of any of the following licenses at your choice: - -* GNU General Public License Version 2 or later (the "GPL"): - http://www.gnu.org/licenses/gpl.html - -* GNU Lesser General Public License Version 2.1 or later (the "LGPL"): - http://www.gnu.org/licenses/lgpl.html - -* Mozilla Public License Version 1.1 or later (the "MPL"): - http://www.mozilla.org/MPL/MPL-1.1.html - -You are not required to, but if you want to explicitly declare the license you have chosen to be bound to when using, reproducing, modifying and distributing this software, just include a text file titled "legal.txt" in your version of this software, indicating your license choice. - -Sources of Intellectual Property Included in this plugin --------------------------------------------------------- - -Where not otherwise indicated, all plugin content is authored by CKSource engineers and consists of CKSource-owned intellectual property. In some specific instances, the plugin will incorporate work done by developers outside of CKSource with their express permission. - -Trademarks ----------- - -CKEditor is a trademark of CKSource - Frederico Knabben. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders. +Software License Agreement +========================== + +**CKEditor SCAYT Plugin** +Copyright © 2012, [CKSource](http://cksource.com) - Frederico Knabben. All rights reserved. + +Licensed under the terms of any of the following licenses at your choice: + +* GNU General Public License Version 2 or later (the "GPL"): + http://www.gnu.org/licenses/gpl.html + +* GNU Lesser General Public License Version 2.1 or later (the "LGPL"): + http://www.gnu.org/licenses/lgpl.html + +* Mozilla Public License Version 1.1 or later (the "MPL"): + http://www.mozilla.org/MPL/MPL-1.1.html + +You are not required to, but if you want to explicitly declare the license you have chosen to be bound to when using, reproducing, modifying and distributing this software, just include a text file titled "legal.txt" in your version of this software, indicating your license choice. + +Sources of Intellectual Property Included in this plugin +-------------------------------------------------------- + +Where not otherwise indicated, all plugin content is authored by CKSource engineers and consists of CKSource-owned intellectual property. In some specific instances, the plugin will incorporate work done by developers outside of CKSource with their express permission. + +Trademarks +---------- + +CKEditor is a trademark of CKSource - Frederico Knabben. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders. diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/README.md b/app/Resources/public/assets/ckeditor/plugins/scayt/README.md new file mode 100644 index 0000000000..ac94ab09be --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/README.md @@ -0,0 +1,25 @@ +CKEditor SCAYT Plugin +===================== + +This plugin brings Spell Check As You Type (SCAYT) into up to CKEditor 4+. + +SCAYT is a "installation-less", using the web-services of [WebSpellChecker.net](http://www.webspellchecker.net/). It's an out of the box solution. + +Installation +------------ + +1. Clone/copy this repository contents in a new "plugins/scayt" folder in your CKEditor installation. +2. Enable the "scayt" plugin in the CKEditor configuration file (config.js): + + config.extraPlugins = 'scayt'; + +That's all. SCAYT will appear on the editor toolbar and will be ready to use. + +License +------- + +Licensed under the terms of any of the following licenses at your choice: [GPL](http://www.gnu.org/licenses/gpl.html), [LGPL](http://www.gnu.org/licenses/lgpl.html) and [MPL](http://www.mozilla.org/MPL/MPL-1.1.html). + +See LICENSE.md for more information. + +Developed in cooperation with [WebSpellChecker.net](http://www.webspellchecker.net/). diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/dialogs/options.js b/app/Resources/public/assets/ckeditor/plugins/scayt/dialogs/options.js index 12dbfd132d..a82e7c3797 100644 --- a/app/Resources/public/assets/ckeditor/plugins/scayt/dialogs/options.js +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/dialogs/options.js @@ -1,19 +1,573 @@ -CKEDITOR.dialog.add("scaytDialog",function(c){var f=c.scayt,q='\x3cp\x3e\x3cimg src\x3d"'+f.getLogo()+'" /\x3e\x3c/p\x3e\x3cp\x3e'+f.getLocal("version")+f.getVersion()+"\x3c/p\x3e\x3cp\x3e"+f.getLocal("text_copyrights")+"\x3c/p\x3e",r=CKEDITOR.document,n={isChanged:function(){return null===this.newLang||this.currentLang===this.newLang?!1:!0},currentLang:f.getLang(),newLang:null,reset:function(){this.currentLang=f.getLang();this.newLang=null},id:"lang"},q=[{id:"options",label:f.getLocal("tab_options"), -onShow:function(){},elements:[{type:"vbox",id:"scaytOptions",children:function(){var a=f.getApplicationConfig(),b=[],g={"ignore-all-caps-words":"label_allCaps","ignore-domain-names":"label_ignoreDomainNames","ignore-words-with-mixed-cases":"label_mixedCase","ignore-words-with-numbers":"label_mixedWithDigits"},e;for(e in a)a={type:"checkbox"},a.id=e,a.label=f.getLocal(g[e]),b.push(a);return b}(),onShow:function(){this.getChild();for(var a=c.scayt,b=0;bb[1]?c=1:a[1]

    ' + + '

    ' + scayt_instance.getLocal('version') + scayt_instance.getVersion() + '

    ' + + '

    ' + scayt_instance.getLocal('text_copyrights') + '

    '; + + var doc = CKEDITOR.document; + + var optionGenerator = function() { + var scayt_instance_ = editor.scayt, + applicationConfig = scayt_instance.getApplicationConfig(), + optionArrayUiCheckboxes = [], + optionLocalizationList = { + "ignore-all-caps-words" : "label_allCaps", + "ignore-domain-names" : "label_ignoreDomainNames", + "ignore-words-with-mixed-cases" : "label_mixedCase", + "ignore-words-with-numbers" : "label_mixedWithDigits" + }; + + for(var option in applicationConfig) { + + var checkboxConfig = { + type: "checkbox" + }; + + checkboxConfig.id = option; + checkboxConfig.label = scayt_instance.getLocal(optionLocalizationList[option]); + + optionArrayUiCheckboxes.push(checkboxConfig); + } + + return optionArrayUiCheckboxes; + }; + + var languageModelState = { + isChanged : function() { + return (this.newLang === null || this.currentLang === this.newLang) ? false : true; + }, + currentLang: scayt_instance.getLang(), + newLang: null, + reset: function() { + this.currentLang = scayt_instance.getLang(); + this.newLang = null; + }, + id: 'lang' + }; + + var generateDialogTabs = function(tabsList, editor) { + var tabs = [], + uiTabs = editor.config.scayt_uiTabs; + + if(!uiTabs) { + return tabsList; + } else { + for(var i in uiTabs) { + (uiTabs[i] == 1) && tabs.push(tabsList[i]); + } + + tabs.push(tabsList[tabsList.length - 1]); + } + + return tabs; + }; + + var dialogTabs = [{ + id : 'options', + label : scayt_instance.getLocal('tab_options'), + onShow: function() { + // console.log("tab show"); + }, + elements : [ + { + type: 'vbox', + id: 'scaytOptions', + children: optionGenerator(), + onShow: function() { + var optionsTab = this.getChild(), + scayt_instance = editor.scayt; + for(var i = 0; i < this.getChild().length; i++) { + this.getChild()[i].setValue(scayt_instance.getApplicationConfig()[this.getChild()[i].id]); + } + + } + } + + ] + }, + { + id : 'langs', + label : scayt_instance.getLocal('tab_languages'), + elements : [ + { + id: "leftLangColumn", + type: 'vbox', + align: 'left', + widths: ['100'], + children: [ + { + type: 'html', + id: 'langBox', + style: 'overflow: hidden; white-space: normal;margin-bottom:15px;', + html: '
    ', + onShow: function() { + var scayt_instance = editor.scayt; + var lang = scayt_instance.getLang(), + prefix_id = "scaytLang_", + radio = doc.getById(prefix_id + editor.name + '_' + lang); + + radio.$.checked = true; + } + }, + { + type: 'html', + id: 'graytLanguagesHint', + html: '
    - This languages are supported by Grammar As You Type(GRAYT).
    ', + onShow: function() { + var graytLanguagesHint = doc.getById(editor.name + 'graytLanguagesHint'); + + if (!editor.config.grayt_autoStartup) { + graytLanguagesHint.$.style.display = 'none'; + } + } + } + ] + } + ] + }, + { + id : 'dictionaries', + label : scayt_instance.getLocal('tab_dictionaries'), + elements : [ + { + type: 'vbox', + id: 'rightCol_col__left', + children: [ + { + type: 'html', + id: 'dictionaryNote', + html: '' + }, + { + type: 'text', + id: 'dictionaryName', + label: scayt_instance.getLocal('label_fieldNameDic') || 'Dictionary name', + onShow: function(data) { + var dialog = data.sender, + scayt_instance = editor.scayt; + + // IE7 specific fix + setTimeout(function() { + // clear dictionaryNote field + dialog.getContentElement("dictionaries", "dictionaryNote").getElement().setText(''); + + // restore/clear dictionaryName field + if(scayt_instance.getUserDictionaryName() != null && scayt_instance.getUserDictionaryName() != '') { + dialog.getContentElement("dictionaries", "dictionaryName").setValue(scayt_instance.getUserDictionaryName()); + } + }, 0); + } + }, + { + type: 'hbox', + id: 'notExistDic', + align: 'left', + style: 'width:auto;', + widths: [ '50%', '50%' ], + children: [ + { + type: 'button', + id: 'createDic', + label: scayt_instance.getLocal('btn_createDic'), + title: scayt_instance.getLocal('btn_createDic'), + onClick: function() { + var dialog = this.getDialog(), + self = dialogDefinition, + scayt_instance = editor.scayt, + name = dialog.getContentElement("dictionaries", "dictionaryName").getValue(); + + scayt_instance.createUserDictionary(name, function(response) { + if(!response.error) { + self.toggleDictionaryButtons.call(dialog, true); + } + response.dialog = dialog; + response.command = "create"; + response.name = name; + editor.fire("scaytUserDictionaryAction", response); + }, function(error) { + error.dialog = dialog; + error.command = "create"; + error.name = name; + editor.fire("scaytUserDictionaryActionError", error); + }); + } + }, + { + type: 'button', + id: 'restoreDic', + label: scayt_instance.getLocal('btn_restoreDic'), + title: scayt_instance.getLocal('btn_restoreDic'), + onClick: function() { + var dialog = this.getDialog(), + scayt_instance = editor.scayt, + self = dialogDefinition, + name = dialog.getContentElement("dictionaries", "dictionaryName").getValue(); + + scayt_instance.restoreUserDictionary(name, function(response) { + response.dialog = dialog; + if(!response.error) { + self.toggleDictionaryButtons.call(dialog, true); + } + response.command = "restore"; + response.name = name; + editor.fire("scaytUserDictionaryAction", response); + }, function(error) { + error.dialog = dialog; + error.command = "restore"; + error.name = name; + editor.fire("scaytUserDictionaryActionError", error); + }); + } + } + ] + }, + { + type: 'hbox', + id: 'existDic', + align: 'left', + style: 'width:auto;', + widths: [ '50%', '50%' ], + children: [ + { + type: 'button', + id: 'removeDic', + label: scayt_instance.getLocal('btn_deleteDic'), + title: scayt_instance.getLocal('btn_deleteDic'), + onClick: function() { + var dialog = this.getDialog(), + scayt_instance = editor.scayt, + self = dialogDefinition, + dictionaryNameField = dialog.getContentElement("dictionaries", "dictionaryName"), + name = dictionaryNameField.getValue(); + + scayt_instance.removeUserDictionary(name, function(response) { + dictionaryNameField.setValue(""); + if(!response.error) { + self.toggleDictionaryButtons.call(dialog, false); + } + response.dialog = dialog; + response.command = "remove"; + response.name = name; + editor.fire("scaytUserDictionaryAction", response); + }, function(error) { + error.dialog = dialog; + error.command = "remove"; + error.name = name; + editor.fire("scaytUserDictionaryActionError", error); + }); + } + }, + { + type: 'button', + id: 'renameDic', + label: scayt_instance.getLocal('btn_renameDic'), + title: scayt_instance.getLocal('btn_renameDic'), + onClick: function() { + var dialog = this.getDialog(), + scayt_instance = editor.scayt, + name = dialog.getContentElement("dictionaries", "dictionaryName").getValue(); + + scayt_instance.renameUserDictionary(name, function(response) { + response.dialog = dialog; + response.command = "rename"; + response.name = name; + editor.fire("scaytUserDictionaryAction", response); + }, function(error) { + error.dialog = dialog; + error.command = "rename"; + error.name = name; + editor.fire("scaytUserDictionaryActionError", error); + }); + } + } + ] + }, + { + type: 'html', + id: 'dicInfo', + html: '
    ' + scayt_instance.getLocal('text_descriptionDic') + '
    ' + } + ] + } + ] + }, + { + id : 'about', + label : scayt_instance.getLocal('tab_about'), + elements : [ + { + type : 'html', + id : 'about', + style : 'margin: 5px 5px;', + html : '
    ' + + aboutTabDefinition + + '
    ' + } + ] + }]; + + editor.on("scaytUserDictionaryAction", function(event) { + var UILib = SCAYT.prototype.UILib, + dialog = event.data.dialog, + dictionaryNote = dialog.getContentElement("dictionaries", "dictionaryNote").getElement(), + scayt_instance = event.editor.scayt, + messageTemplate; + + if(event.data.error === undefined) { + + // success message + messageTemplate = scayt_instance.getLocal("message_success_" + event.data.command + "Dic"); + messageTemplate = messageTemplate.replace('%s', event.data.name); + dictionaryNote.setText(messageTemplate); + UILib.css(dictionaryNote.$, {color: 'blue'}); + } else { + + // error message + if(event.data.name === '') { + + // empty dictionary name + dictionaryNote.setText(scayt_instance.getLocal('message_info_emptyDic')); + } else { + messageTemplate = scayt_instance.getLocal("message_error_" + event.data.command + "Dic"); + messageTemplate = messageTemplate.replace('%s', event.data.name); + dictionaryNote.setText(messageTemplate); + } + UILib.css(dictionaryNote.$, {color: 'red'}); + + if(scayt_instance.getUserDictionaryName() != null && scayt_instance.getUserDictionaryName() != '') { + dialog.getContentElement("dictionaries", "dictionaryName").setValue(scayt_instance.getUserDictionaryName()); + } else { + dialog.getContentElement("dictionaries", "dictionaryName").setValue(""); + } + } + }); + + editor.on("scaytUserDictionaryActionError", function(event) { + var UILib = SCAYT.prototype.UILib, + dialog = event.data.dialog, + dictionaryNote = dialog.getContentElement("dictionaries", "dictionaryNote").getElement(), + scayt_instance = event.editor.scayt, + messageTemplate; + + if(event.data.name === '') { + + // empty dictionary name + dictionaryNote.setText(scayt_instance.getLocal('message_info_emptyDic')); + } else { + messageTemplate = scayt_instance.getLocal("message_error_" + event.data.command + "Dic"); + messageTemplate = messageTemplate.replace('%s', event.data.name); + dictionaryNote.setText(messageTemplate); + } + UILib.css(dictionaryNote.$, {color: 'red'}); + + + if(scayt_instance.getUserDictionaryName() != null && scayt_instance.getUserDictionaryName() != '') { + dialog.getContentElement("dictionaries", "dictionaryName").setValue(scayt_instance.getUserDictionaryName()); + } else { + dialog.getContentElement("dictionaries", "dictionaryName").setValue(""); + } + + }); + + var plugin = CKEDITOR.plugins.scayt; + + var dialogDefinition = { + title: scayt_instance.getLocal('text_title'), + resizable: CKEDITOR.DIALOG_RESIZE_BOTH, + minWidth: 340, + minHeight: 260, + onLoad: function() { + if(editor.config.scayt_uiTabs[1] == 0) { + return; + } + + var dialog = this, + self = dialogDefinition, + langBoxes = self.getLangBoxes.call(dialog); + + langBoxes.getParent().setStyle("white-space", "normal"); + + //dialog.data = editor.fire( 'scaytDialog', {} ); + self.renderLangList(langBoxes); + + var scayt_instance = editor.scayt; + + this.definition.minWidth = this.getSize().width; + this.resize(this.definition.minWidth, this.definition.minHeight); + }, + onCancel: function() { + languageModelState.reset(); + }, + onHide: function() { + editor.unlockSelection(); + }, + onShow: function() { + editor.fire("scaytDialogShown", this); + + if(editor.config.scayt_uiTabs[2] == 0) { + return; + } + + var scayt_instance = editor.scayt, + self = dialogDefinition, + dialog = this, + dictionaryNameField = dialog.getContentElement("dictionaries", "dictionaryName"), + existance = dialog.getContentElement("dictionaries", "existDic").getElement().getParent(), + notExistance = dialog.getContentElement("dictionaries", "notExistDic").getElement().getParent(); + + existance.hide(); + notExistance.hide(); + + if(scayt_instance.getUserDictionaryName() != null && scayt_instance.getUserDictionaryName() != '') { + dialog.getContentElement("dictionaries", "dictionaryName").setValue(scayt_instance.getUserDictionaryName()); + existance.show(); + } else { + dictionaryNameField.setValue(""); + notExistance.show(); + } + }, + onOk: function() { + var dialog = this, + self = dialogDefinition, + scayt_instance = editor.scayt, + scaytOptions = dialog.getContentElement("options", "scaytOptions"), + changedOptions = self.getChangedOption.call(dialog); + + scayt_instance.commitOption({ changedOptions: changedOptions }); + }, + toggleDictionaryButtons: function(exist) { + var existance = this.getContentElement("dictionaries", "existDic").getElement().getParent(), + notExistance = this.getContentElement("dictionaries", "notExistDic").getElement().getParent(); + + if(exist) { + existance.show(); + notExistance.hide(); + } else { + existance.hide(); + notExistance.show(); + } + + }, + getChangedOption: function() { + var changedOption = {}; + + if(editor.config.scayt_uiTabs[0] == 1) { + var dialog = this, + scaytOptions = dialog.getContentElement("options", "scaytOptions").getChild(); + + for(var i = 0; i < scaytOptions.length; i++) { + if(scaytOptions[i].isChanged()) { + changedOption[scaytOptions[i].id] = scaytOptions[i].getValue(); + } + } + } + + if(languageModelState.isChanged()) { + changedOption[languageModelState.id] = editor.config.scayt_sLang = languageModelState.currentLang = languageModelState.newLang; + } + + return changedOption; + }, + buildRadioInputs: function(key, value, isSupportedByGrayt) { + var divContainer = new CKEDITOR.dom.element( 'div' ), + doc = CKEDITOR.document, + id = "scaytLang_" + editor.name + '_' + value, + radio = CKEDITOR.dom.element.createFromHtml( '' ), + + radioLabel = new CKEDITOR.dom.element( 'label' ), + scayt_instance = editor.scayt; + + divContainer.setStyles({ + "white-space": "normal", + 'position': 'relative', + 'padding-bottom': '2px' + }); + + radio.on( 'click', function(data) { + languageModelState.newLang = data.sender.getValue(); + }); + + radioLabel.appendText(key); + radioLabel.setAttribute("for", id); + + if(isSupportedByGrayt && editor.config.grayt_autoStartup) { + radioLabel.setStyles({ + 'color': '#02b620' + }); + } + + divContainer.append(radio); + divContainer.append(radioLabel); + + if(value === scayt_instance.getLang()) { + radio.setAttribute("checked", true); + radio.setAttribute('defaultChecked', 'defaultChecked'); + } + + return divContainer; + }, + renderLangList: function(langBoxes) { + var dialog = this, + leftCol = langBoxes.find('#left-col-' + editor.name).getItem(0), + rightCol = langBoxes.find('#right-col-' + editor.name).getItem(0), + scaytLangList = scayt_instance.getScaytLangList(), + graytLangList = scayt_instance.getGraytLangList(), + mergedLangList = {}, + sortable = [], + counter = 0, + isSupportedByGrayt = false, + half, lang; + + for(lang in scaytLangList.ltr) { + mergedLangList[lang] = scaytLangList.ltr[lang]; + } + + for(lang in scaytLangList.rtl) { + mergedLangList[lang] = scaytLangList.rtl[lang]; + } + + // sort alphabetically lang list + for(lang in mergedLangList) { + sortable.push([lang, mergedLangList[lang]]); + } + sortable.sort(function(a, b) { + var result = 0; + if(a[1] > b[1]) { + result = 1; + } else if(a[1] < b[1]) { + result = -1; + } + return result; + }); + mergedLangList = {}; + for(var i = 0; i < sortable.length; i++) { + mergedLangList[sortable[i][0]] = sortable[i][1]; + } + + half = Math.round(sortable.length / 2); + + for(lang in mergedLangList) { + counter++; + isSupportedByGrayt = (lang in graytLangList.ltr) || (lang in graytLangList.rtl); + dialog.buildRadioInputs(mergedLangList[lang], lang, isSupportedByGrayt).appendTo(counter <= half ? leftCol : rightCol); + } + }, + getLangBoxes: function() { + var dialog = this, + langboxes = dialog.getContentElement("langs", "langBox").getElement(); + + return langboxes; + }, + contents: generateDialogTabs(dialogTabs, editor) + }; + + return dialogDefinition; +}); \ No newline at end of file diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/dialogs/toolbar.css b/app/Resources/public/assets/ckeditor/plugins/scayt/dialogs/toolbar.css index ecabdac9d2..861f43e3b4 100644 --- a/app/Resources/public/assets/ckeditor/plugins/scayt/dialogs/toolbar.css +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/dialogs/toolbar.css @@ -1,71 +1,71 @@ -a -{ - text-decoration:none; - padding: 2px 4px 4px 6px; - display : block; - border-width: 1px; - border-style: solid; - margin : 0px; -} - -a.cke_scayt_toogle:hover, -a.cke_scayt_toogle:focus, -a.cke_scayt_toogle:active -{ - border-color: #316ac5; - background-color: #dff1ff; - color : #000; - cursor: pointer; - margin : 0px; -} -a.cke_scayt_toogle { - color : #316ac5; - border-color: #fff; -} -.scayt_enabled a.cke_scayt_item { - color : #316ac5; - border-color: #fff; - margin : 0px; -} -.scayt_disabled a.cke_scayt_item { - color : gray; - border-color : #fff; -} -.scayt_enabled a.cke_scayt_item:hover, -.scayt_enabled a.cke_scayt_item:focus, -.scayt_enabled a.cke_scayt_item:active -{ - border-color: #316ac5; - background-color: #dff1ff; - color : #000; - cursor: pointer; -} -.scayt_disabled a.cke_scayt_item:hover, -.scayt_disabled a.cke_scayt_item:focus, -.scayt_disabled a.cke_scayt_item:active -{ - border-color: gray; - background-color: #dff1ff; - color : gray; - cursor: no-drop; -} -.cke_scayt_set_on, .cke_scayt_set_off -{ - display: none; -} -.scayt_enabled .cke_scayt_set_on -{ - display: none; -} -.scayt_disabled .cke_scayt_set_on -{ - display: inline; -} -.scayt_disabled .cke_scayt_set_off -{ - display: none; -} -.scayt_enabled .cke_scayt_set_off -{ - display: inline; -} +a +{ + text-decoration:none; + padding: 2px 4px 4px 6px; + display : block; + border-width: 1px; + border-style: solid; + margin : 0px; +} + +a.cke_scayt_toogle:hover, +a.cke_scayt_toogle:focus, +a.cke_scayt_toogle:active +{ + border-color: #316ac5; + background-color: #dff1ff; + color : #000; + cursor: pointer; + margin : 0px; +} +a.cke_scayt_toogle { + color : #316ac5; + border-color: #fff; +} +.scayt_enabled a.cke_scayt_item { + color : #316ac5; + border-color: #fff; + margin : 0px; +} +.scayt_disabled a.cke_scayt_item { + color : gray; + border-color : #fff; +} +.scayt_enabled a.cke_scayt_item:hover, +.scayt_enabled a.cke_scayt_item:focus, +.scayt_enabled a.cke_scayt_item:active +{ + border-color: #316ac5; + background-color: #dff1ff; + color : #000; + cursor: pointer; +} +.scayt_disabled a.cke_scayt_item:hover, +.scayt_disabled a.cke_scayt_item:focus, +.scayt_disabled a.cke_scayt_item:active +{ + border-color: gray; + background-color: #dff1ff; + color : gray; + cursor: no-drop; +} +.cke_scayt_set_on, .cke_scayt_set_off +{ + display: none; +} +.scayt_enabled .cke_scayt_set_on +{ + display: none; +} +.scayt_disabled .cke_scayt_set_on +{ + display: inline; +} +.scayt_disabled .cke_scayt_set_off +{ + display: none; +} +.scayt_enabled .cke_scayt_set_off +{ + display: inline; +} diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/icons/hidpi/scayt.png b/app/Resources/public/assets/ckeditor/plugins/scayt/icons/hidpi/scayt.png new file mode 100644 index 0000000000000000000000000000000000000000..58a9f4c1328de5c5c9d05e61878e9860cd8a6399 GIT binary patch literal 2816 zcmV+b3;*Sp*-{8m zwp9wHbvZI2Fe<+E96${yrBD^0Hwj273Hbfg1Oix6qP3=^6xSVxT(OAO8oy~0^!xFf zW|^oEWzvR$>v>$y<;dpq0A*iQRhUxV3_u7$Nhvb998RHttJDVs3@HiEn@4EPniU&2 zZ~l!^iXT7!{O6~S9{qOFbx~Rq^!xeyZ+_DY2Lc#EfDoipspQ2=myXYjjcwPbPQ90$ znnG($V{I*BU|?fYYwN$X<62V3m4vg=dHJXq)(jqkL2_;*K@ft0Z~brZCL;- z7tEVS$#qp#ef`RS&-ZOZN>B>FX%eccqSm%KcjnA*uO*X{OO`BI`iXVx9!RFsouaq5 zukhMyzf(#f1_u6N^P`XME9P>XIC0|5LOx&U>+etW$K#!1pGzKr4moc_b$$#(`e|swox==5sk2ip4(c zxh|gTa@VqDeffM|d}Qs~g}@o$Wc%HBH($PdS-6G5e4rJj$^;B4sR;xSy}e6nYidG` z4Gmr-5*gE;Cx8$6E$f4o4_KDP(UFlKa^%Q8Kuf7q$~lfhZz2(KvRPcuLrCenl}i2N=0_gcq&$yeu_)HAS)*g2(1pp$)}*2bhG}A07KYysa1m&(kVuz24^s+3 zmCuK1+q5iRywZ@8Lx&EjXP$W`RAt))YibsWo}Sv`Yp+df*F`Bsu}~oII2TTzKK+|$ zG#ZJ;VryS{9PVsw)sH{^_$L7l96ZRrefwx% zwrm}?jZs-IreW~&W5<5Jx>S0?^E^g;zRiYd?sFWcyiptnDt=AFz;9WYwhgd!>$YuY zom`GX&pmgSA;fu!)_9&rLu2DTS;wJi;le3k6R@cv7JDn7&l3rUTSaH5O(1{(48vgl z{Q1-^T12#^g`uILkWz|tDuvcsI1>}p*VpSpKF_eI~+KG>p^%CB9$y65WE ztMb14?yLUzs#Uk28y-F{l~QE0S*~8YCazq$!rN!hUQvdDwk%GZI(6a7*ck6zx&%Vl zOiVB~HpcsxFEf=&#p=W14@au2`!0=+jy?9+W9mP@@|79jLcq3JGca)c2Zs+U+pSKlAqP-MqDH7h3CO zl{r^y-Encx9_GBC)>{8mYyAtYb+$71wc<-J0o=BH#fq_AyLT(CwWqayLu-9(uHCP` z@eTfaco?a)CSNMeZC-RqDcrJ<%nwfp5$PkqU(uEy~B5T_3uKoyI)`8>*Xk)}DTT6l#5 zcwYG=G)=S+xTO+asZ>@vA+QXC(7buHG&LdCu3gkSIQY|rO-(Jz^JF%gWpZ+oyE{Ae z-l3r%09#J(*pap8&&RZFgkfL`A&@>FKGQ^3oQlfhw{3#9T^1@Sx#2k6a2#CE1FbO) zgHSL?V>F8B?OoW@-#-#-XlU_VSLSj#(&;qaJw1BQ?%fKQ0di(Ah~f7mDr#xY_H-D= z%^J+^^_oC{hPpaLBC!Q{MgRKO$%#~o>)9*-HGu%p`g%lncXQ9+;7D^cdb{#Gnakx! zrBcM>@mcVFz~@dq^^~&1;WBuopEUWsF$*3F28k|MfavaiV%_@nUr(je=S6q-8vW** zNo#5fv}S%Jf{4dsiNV2<#`^j@X2H|xG@YHDde5Fc3fK=kc5>%VWrxG%y2}rm@joCS zg&=6#L?aPIclQ&k*RA`yUrMns8f_zy7!h4vYxL-760H$!ZB6mMzL97ovcz*;nV*fk zyIX(vJKs^jbHJms;HKY?FpOKb<#RLOGfhMyA@KPI3z>|tv=)B9UoGfz-RvyINai5qLdz@Pv;{-Ap7CiW%0Qz?C z+ND;kSfP{2B-w11Qn4s&!{N5taJa2hEXqtaOEQ_HtE)@z-Md!-2Z4V&xpSxY=fH1C zKm%Gze);s%x^gHT-oJmp>gwv!vzc&RSGuk%9mipEVuG%&EtYO^?!sy540000bbVXQnWMOn=I%9HWVRU5xGB7bSEigAN zF*Z~&F*-6aIx{gVFfuwYFsRP;vj6}9C3HntbYx+4WjbwdWNBu305UK!Gc7PTEipD! zF)=zaF*-9bD=;!TFfiGZO%DJ702y>eSaefwW^{L9a%BK_cXuvnZfkR6VQ^(GZ*pgw S?mQX*0000t}QT literal 0 HcmV?d00001 diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/icons/scayt.png b/app/Resources/public/assets/ckeditor/plugins/scayt/icons/scayt.png new file mode 100644 index 0000000000000000000000000000000000000000..701ceee69ffd031218ea8100f52256d433b94db5 GIT binary patch literal 839 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zKpodXn9)gNb_D|iQ-Y_9V~EA+)XAs)ZU+do?cXRXBVV&5he=R+$-5n%8&p@V(mS!q zzj0OEy(Rq&{ue^^XL~4c<@{#Q$ja8^7UM{CNJyS6<1elfm?5q__w)REH{<{I?tT6J zA8q*We`hQ>$N1p4-Mr_4p`zz3SFMuztoHH1_u6I4mv=svXs|iYxZ#=*3*+Cq`MY;p zpW39t|DiUabV@E&A&OcPk*wv@eQ^~=23bSvUUBcTERkw z*RNmuBn1ZtpRZVT>-?rSnJq_;x;C&Kc=amFY@sW2LTaiib3|O6TrvYcKR=6-ktK<`Z`h=R^4LPI6dk2@86FeJ!(3b@IhrohXIeeQeKF{=}jjEvlv1{1ziQNMfDi6 zI5s?=qwIUx(9$=Up=*)E*4r~?&z6pU{oBsi*!ax3b3(3yF|o0RA-mSC`Wm(NS;*A1 z&6Y2n7Ot8zckbUgB@ci7lJfKS54@`6Iq73%My{b?=>lb?%H4O%Zr{FbAF|cL-u`%X zO^u9pb`N7lME3Ew%)Ek?l5G#Cm+h8~%H}sSH@9c*wK+fE#b?rz4c9K^mxHRKF1HdT>SCj#S068|x$w5Eo-ulF-1>mfri*p$i5(p!J%;mLRKzEmHykPalbe~j zGOx$-McMBCjr@D#{N3x7ByLWAZn;WpuHW+y&z?QIdh+DS@`j&3e`<6sYTmndul<4F zCsPCuO6ze&PGfxY?#&w+pd~l5w)(8TYIN<^;lF?XvQ&J}H)>GvY+4l*D%yOop|zEj z|HiEwH!2u6?A|?_A-}(`&xC`i=Dxf-^B>l#+?0;qrIUMs2~f4fHKHUXu_VKd4b7#dj_8(SHhY8x0@85n%HA#8=BAvZrIGp!Q0hQ`*_Z9ol@ARB`7 r(@M${i&7cN%ggmL^RkPR6AM!H@{7`Ezq647Dq`?-^>bP0l+XkKZ;E0; literal 0 HcmV?d00001 diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/af.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/af.js new file mode 100644 index 0000000000..38135977f0 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/af.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'af', { + btn_about: 'SCAYT info', + btn_dictionaries: 'Woordeboeke', + btn_disable: 'SCAYT af', + btn_enable: 'SCAYT aan', + btn_langs:'Tale', + btn_options: 'Opsies', + text_title: 'Speltoets terwyl u tik' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ar.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ar.js new file mode 100644 index 0000000000..d6aee64861 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ar.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'ar', { + btn_about: 'عن SCAYT', + btn_dictionaries: 'قواميس', + btn_disable: 'تعطيل SCAYT', + btn_enable: 'تفعيل SCAYT', + btn_langs:'لغات', + btn_options: 'خيارات', + text_title: 'تدقيق إملائي أثناء الكتابة' +}); \ No newline at end of file diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/bg.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/bg.js new file mode 100644 index 0000000000..38acdd1a3e --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/bg.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'bg', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Речници', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Languages', + btn_options: 'Options', + text_title: 'Spell Check As You Type' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/bn.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/bn.js new file mode 100644 index 0000000000..f1c9c58f2d --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/bn.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'bn', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Dictionaries', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Languages', + btn_options: 'Options', + text_title: 'Spell Check As You Type' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/bs.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/bs.js new file mode 100644 index 0000000000..a96b4cc924 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/bs.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'bs', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Dictionaries', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Languages', + btn_options: 'Options', + text_title: 'Spell Check As You Type' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ca.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ca.js new file mode 100644 index 0000000000..4955b65a47 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ca.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'ca', { + btn_about: 'Quant a l\'SCAYT', + btn_dictionaries: 'Diccionaris', + btn_disable: 'Deshabilita SCAYT', + btn_enable: 'Habilitat l\'SCAYT', + btn_langs:'Idiomes', + btn_options: 'Opcions', + text_title: 'Spell Check As You Type' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/cs.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/cs.js new file mode 100644 index 0000000000..1d3fb68fd8 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/cs.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'cs', { + btn_about: 'O aplikaci SCAYT', + btn_dictionaries: 'Slovníky', + btn_disable: 'Vypnout SCAYT', + btn_enable: 'Zapnout SCAYT', + btn_langs:'Jazyky', + btn_options: 'Nastavení', + text_title: 'Kontrola pravopisu během psaní (SCAYT)' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/cy.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/cy.js new file mode 100644 index 0000000000..23f16e0fa7 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/cy.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'cy', { + btn_about: 'Ynghylch SCAYT', + btn_dictionaries: 'Geiriaduron', + btn_disable: 'Analluogi SCAYT', + btn_enable: 'Galluogi SCAYT', + btn_langs:'Ieithoedd', + btn_options: 'Opsiynau', + text_title: 'Gwirio\'r Sillafu Wrth Deipio' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/da.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/da.js new file mode 100644 index 0000000000..a6eb642704 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/da.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'da', { + btn_about: 'Om SCAYT', + btn_dictionaries: 'Ordbøger', + btn_disable: 'Deaktivér SCAYT', + btn_enable: 'Aktivér SCAYT', + btn_langs:'Sprog', + btn_options: 'Indstillinger', + text_title: 'Stavekontrol mens du skriver' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/de.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/de.js new file mode 100644 index 0000000000..293326f5c3 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/de.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'de', { + btn_about: 'Über SCAYT', + btn_dictionaries: 'Wörterbücher', + btn_disable: 'SCAYT ausschalten', + btn_enable: 'SCAYT einschalten', + btn_langs:'Sprachen', + btn_options: 'Optionen', + text_title: 'Rechtschreibprüfung während der Texteingabe (SCAYT)' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/el.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/el.js new file mode 100644 index 0000000000..ad6d53c8ed --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/el.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'el', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Λεξικά', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Γλώσσες', + btn_options: 'Επιλογές', + text_title: 'Spell Check As You Type' +}); \ No newline at end of file diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/en-au.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/en-au.js new file mode 100644 index 0000000000..9be05862d4 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/en-au.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'en-au', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Dictionaries', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Languages', + btn_options: 'Options', + text_title: 'Spell Check As You Type' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/en-ca.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/en-ca.js new file mode 100644 index 0000000000..bf9e89a1ba --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/en-ca.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'en-ca', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Dictionaries', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Languages', + btn_options: 'Options', + text_title: 'Spell Check As You Type' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/en-gb.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/en-gb.js new file mode 100644 index 0000000000..f2d159d1ba --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/en-gb.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'en-gb', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Dictionaries', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Languages', + btn_options: 'Options', + text_title: 'Spell Check As You Type' +}); \ No newline at end of file diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/en.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/en.js new file mode 100644 index 0000000000..5e32b23fe4 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/en.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'en', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Dictionaries', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Languages', + btn_options: 'Options', + text_title: 'Spell Check As You Type' +}); \ No newline at end of file diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/eo.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/eo.js new file mode 100644 index 0000000000..582fabcbe1 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/eo.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'eo', { + btn_about: 'Pri OKDVT', + btn_dictionaries: 'Vortaroj', + btn_disable: 'Malebligi OKDVT', + btn_enable: 'Ebligi OKDVT', + btn_langs:'Lingvoj', + btn_options: 'Opcioj', + text_title: 'OrtografiKontrolado Dum Vi Tajpas (OKDVT)' +}); \ No newline at end of file diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/es.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/es.js new file mode 100644 index 0000000000..9ca5d8610c --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/es.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'es', { + btn_about: 'Acerca de Corrector', + btn_dictionaries: 'Diccionarios', + btn_disable: 'Desactivar Corrector', + btn_enable: 'Activar Corrector', + btn_langs:'Idiomas', + btn_options: 'Opciones', + text_title: 'Comprobar Ortografía Mientras Escribe' +}); \ No newline at end of file diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/et.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/et.js new file mode 100644 index 0000000000..1c888de531 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/et.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'et', { + btn_about: 'SCAYT-ist lähemalt', + btn_dictionaries: 'Sõnaraamatud', + btn_disable: 'SCAYT keelatud', + btn_enable: 'SCAYT lubatud', + btn_langs:'Keeled', + btn_options: 'Valikud', + text_title: 'Õigekirjakontroll kirjutamise ajal' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/eu.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/eu.js new file mode 100644 index 0000000000..217be7a83e --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/eu.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'eu', { + btn_about: 'SCAYTi buruz', + btn_dictionaries: 'Hiztegiak', + btn_disable: 'Desgaitu SCAYT', + btn_enable: 'Gaitu SCAYT', + btn_langs:'Hizkuntzak', + btn_options: 'Aukerak', + text_title: 'Ortografia Zuzenketa Idatzi Ahala (SCAYT)' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/fa.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/fa.js new file mode 100644 index 0000000000..b78e9f3801 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/fa.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'fa', { + btn_about: 'درباره SCAYT', + btn_dictionaries: 'دیکشنریها', + btn_disable: 'غیرفعالسازی SCAYT', + btn_enable: 'فعالسازی SCAYT', + btn_langs:'زبانها', + btn_options: 'گزینهها', + text_title: 'بررسی املای تایپ شما' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/fi.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/fi.js new file mode 100644 index 0000000000..a34bfd4468 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/fi.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'fi', { + btn_about: 'Tietoja oikoluvusta kirjoitetaessa', + btn_dictionaries: 'Sanakirjat', + btn_disable: 'Poista käytöstä oikoluku kirjoitetaessa', + btn_enable: 'Ota käyttöön oikoluku kirjoitettaessa', + btn_langs:'Kielet', + btn_options: 'Asetukset', + text_title: 'Oikolue kirjoitettaessa' +}); \ No newline at end of file diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/fo.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/fo.js new file mode 100644 index 0000000000..0e1fbe8561 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/fo.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'fo', { + btn_about: 'Um SCAYT', + btn_dictionaries: 'Orðabøkur', + btn_disable: 'Nokta SCAYT', + btn_enable: 'Loyv SCAYT', + btn_langs:'Tungumál', + btn_options: 'Uppseting', + text_title: 'Kanna stavseting, meðan tú skrivar' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/fr-ca.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/fr-ca.js new file mode 100644 index 0000000000..7b1ddf3b1e --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/fr-ca.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'fr-ca', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Dictionaries', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Languages', + btn_options: 'Options', + text_title: 'Spell Check As You Type' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/fr.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/fr.js new file mode 100644 index 0000000000..719312b9b9 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/fr.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'fr', { + btn_about: 'A propos de SCAYT', + btn_dictionaries: 'Dictionnaires', + btn_disable: 'Désactiver SCAYT', + btn_enable: 'Activer SCAYT', + btn_langs:'Langues', + btn_options: 'Options', + text_title: 'Vérification de l\'Orthographe en Cours de Frappe (SCAYT)' +}); \ No newline at end of file diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/gl.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/gl.js new file mode 100644 index 0000000000..5e7b30d132 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/gl.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'gl', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Dictionaries', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Languages', + btn_options: 'Options', + text_title: 'Spell Check As You Type' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/gu.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/gu.js new file mode 100644 index 0000000000..b29bf1ebee --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/gu.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'gu', { + btn_about: 'SCAYT વિષે', + btn_dictionaries: 'શબ્દકોશ', + btn_disable: 'SCAYT ડિસેબલ કરવું', + btn_enable: 'SCAYT એનેબલ કરવું', + btn_langs:'ભાષાઓ', + btn_options: 'વિકલ્પો', + text_title: 'ટાઈપ કરતા સ્પેલ તપાસો' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/he.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/he.js new file mode 100644 index 0000000000..da89f474bd --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/he.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'he', { + btn_about: 'אודות SCAYT', + btn_dictionaries: 'מילון', + btn_disable: 'בטל SCAYT', + btn_enable: 'אפשר SCAYT', + btn_langs:'שפות', + btn_options: 'אפשרויות', + text_title: 'בדיקת איות בזמן כתיבה (SCAYT)' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/hi.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/hi.js new file mode 100644 index 0000000000..6a08c00b4c --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/hi.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'hi', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Dictionaries', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Languages', + btn_options: 'Options', + text_title: 'Spell Check As You Type' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/hr.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/hr.js new file mode 100644 index 0000000000..6cc9e5a28e --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/hr.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'hr', { + btn_about: 'O SCAYT', + btn_dictionaries: 'Rječnici', + btn_disable: 'Onemogući SCAYT', + btn_enable: 'Omogući SCAYT', + btn_langs:'Jezici', + btn_options: 'Opcije', + text_title: 'Provjeri pravopis tijekom tipkanja (SCAYT)' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/hu.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/hu.js new file mode 100644 index 0000000000..b5b8ff5348 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/hu.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'hu', { + btn_about: 'SCAYT névjegy', + btn_dictionaries: 'Szótár', + btn_disable: 'SCAYT letiltása', + btn_enable: 'SCAYT engedélyezése', + btn_langs:'Nyelvek', + btn_options: 'Beállítások', + text_title: 'Helyesírás ellenőrzés gépelés közben' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/is.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/is.js new file mode 100644 index 0000000000..3b0b75942f --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/is.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'is', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Dictionaries', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Languages', + btn_options: 'Options', + text_title: 'Spell Check As You Type' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/it.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/it.js new file mode 100644 index 0000000000..15e0af8b54 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/it.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'it', { + btn_about: 'About COMS', + btn_dictionaries: 'Dizionari', + btn_disable: 'Disabilita COMS', + btn_enable: 'Abilita COMS', + btn_langs:'Lingue', + btn_options: 'Opzioni', + text_title: 'Controllo Ortografico Mentre Scrivi' +}); \ No newline at end of file diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ja.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ja.js new file mode 100644 index 0000000000..9097f9cda1 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ja.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'ja', { + btn_about: 'SCAYTバージョン', + btn_dictionaries: '辞書', + btn_disable: 'SCAYT無効', + btn_enable: 'SCAYT有効', + btn_langs:'言語', + btn_options: 'オプション', + text_title: 'スペルチェック設定(SCAYT)' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ka.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ka.js new file mode 100644 index 0000000000..6f3d3ba371 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ka.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'ka', { + btn_about: 'SCAYT-ის შესახებ', + btn_dictionaries: 'ლექსიკონები', + btn_disable: 'SCAYT-ის გამორთვა', + btn_enable: 'SCAYT-ის ჩართვა', + btn_langs:'ენები', + btn_options: 'პარამეტრები', + text_title: 'მართლწერის შემოწმება კრეფისას' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/km.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/km.js new file mode 100644 index 0000000000..5e21114582 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/km.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'km', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Dictionaries', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Languages', + btn_options: 'Options', + text_title: 'Spell Check As You Type' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ko.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ko.js new file mode 100644 index 0000000000..9bce7a42be --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ko.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'ko', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Dictionaries', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Languages', + btn_options: 'Options', + text_title: 'Spell Check As You Type' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ku.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ku.js new file mode 100644 index 0000000000..09d82b0fc0 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ku.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'ku', { + btn_about: 'دهربارهی SCAYT', + btn_dictionaries: 'فهرههنگهکان', + btn_disable: 'ناچالاککردنی SCAYT', + btn_enable: 'چالاککردنی SCAYT', + btn_langs:'زمانهکان', + btn_options: 'ههڵبژارده', + text_title: 'پشکنینی نووسه لهکاتی نووسین' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/lt.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/lt.js new file mode 100644 index 0000000000..2da3b320aa --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/lt.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'lt', { + btn_about: 'Apie SCAYT', + btn_dictionaries: 'Žodynai', + btn_disable: 'Išjungti SCAYT', + btn_enable: 'Įjungti SCAYT', + btn_langs:'Kalbos', + btn_options: 'Parametrai', + text_title: 'Tikrinti klaidas kai rašoma' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/lv.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/lv.js new file mode 100644 index 0000000000..809855af54 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/lv.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'lv', { + btn_about: 'Par SCAYT', + btn_dictionaries: 'Vārdnīcas', + btn_disable: 'Atslēgt SCAYT', + btn_enable: 'Ieslēgt SCAYT', + btn_langs:'Valodas', + btn_options: 'Uzstādījumi', + text_title: 'Pārbaudīt gramatiku rakstot' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/mk.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/mk.js new file mode 100644 index 0000000000..49ab39bfc5 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/mk.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'mk', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Dictionaries', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Languages', + btn_options: 'Options', + text_title: 'Spell Check As You Type' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/mn.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/mn.js new file mode 100644 index 0000000000..a932def9fe --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/mn.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'mn', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Толь бичгүүд', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Хэлүүд', + btn_options: 'Сонголт', + text_title: 'Spell Check As You Type' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ms.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ms.js new file mode 100644 index 0000000000..98fd51f62d --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ms.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'ms', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Dictionaries', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Languages', + btn_options: 'Options', + text_title: 'Spell Check As You Type' // MISSING +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/nb.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/nb.js new file mode 100644 index 0000000000..e82fab357b --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/nb.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'nb', { + btn_about: 'Om SCAYT', + btn_dictionaries: 'Ordbøker', + btn_disable: 'Slå av SCAYT', + btn_enable: 'Slå på SCAYT', + btn_langs:'Språk', + btn_options: 'Valg', + text_title: 'Stavekontroll mens du skriver' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/nl.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/nl.js new file mode 100644 index 0000000000..3a3078680c --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/nl.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'nl', { + btn_about: 'Over SCAYT', + btn_dictionaries: 'Woordenboeken', + btn_disable: 'SCAYT uitschakelen', + btn_enable: 'SCAYT inschakelen', + btn_langs:'Talen', + btn_options: 'Opties', + text_title: 'Controleer de spelling tijdens het typen' +}); \ No newline at end of file diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/no.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/no.js new file mode 100644 index 0000000000..a955c1f080 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/no.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'no', { + btn_about: 'Om SCAYT', + btn_dictionaries: 'Ordbøker', + btn_disable: 'Slå av SCAYT', + btn_enable: 'Slå på SCAYT', + btn_langs:'Språk', + btn_options: 'Valg', + text_title: 'Stavekontroll mens du skriver' +}); \ No newline at end of file diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/pl.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/pl.js new file mode 100644 index 0000000000..18a600512c --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/pl.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'pl', { + btn_about: 'Informacje o SCAYT', + btn_dictionaries: 'Słowniki', + btn_disable: 'Wyłącz SCAYT', + btn_enable: 'Włącz SCAYT', + btn_langs:'Języki', + btn_options: 'Opcje', + text_title: 'Sprawdź pisownię podczas pisania (SCAYT)' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/pt-br.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/pt-br.js new file mode 100644 index 0000000000..b0a81944c0 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/pt-br.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'pt-br', { + btn_about: 'Sobre a correção ortográfica durante a digitação', + btn_dictionaries: 'Dicionários', + btn_disable: 'Desabilitar correção ortográfica durante a digitação', + btn_enable: 'Habilitar correção ortográfica durante a digitação', + btn_langs:'Idiomas', + btn_options: 'Opções', + text_title: 'Correção ortográfica durante a digitação' +}); \ No newline at end of file diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/pt.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/pt.js new file mode 100644 index 0000000000..58a8e4924d --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/pt.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'pt', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Dictionaries', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Languages', + btn_options: 'Options', + text_title: 'Spell Check As You Type' // MISSING +}); \ No newline at end of file diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ro.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ro.js new file mode 100644 index 0000000000..706ea7948a --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ro.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'ro', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Dictionaries', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Languages', + btn_options: 'Options', + text_title: 'Spell Check As You Type' // MISSING +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ru.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ru.js new file mode 100644 index 0000000000..11e6a14d44 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ru.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'ru', { + btn_about: 'О SCAYT', + btn_dictionaries: 'Словари', + btn_disable: 'Отключить SCAYT', + btn_enable: 'Включить SCAYT', + btn_langs:'Языки', + btn_options: 'Настройки', + text_title: 'Проверка орфографии по мере ввода (SCAYT)' +}); \ No newline at end of file diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/sk.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/sk.js new file mode 100644 index 0000000000..0a09b53da3 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/sk.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'sk', { + btn_about: 'O KPPP (Kontrola pravopisu počas písania)', + btn_dictionaries: 'Slovníky', + btn_disable: 'Zakázať KPPP (Kontrola pravopisu počas písania)', + btn_enable: 'Povoliť KPPP (Kontrola pravopisu počas písania)', + btn_langs:'Jazyky', + btn_options: 'Možnosti', + text_title: 'Kontrola pravopisu počas písania' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/sl.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/sl.js new file mode 100644 index 0000000000..301f72a51d --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/sl.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'sl', { + btn_about: 'O storitvi SCAYT', + btn_dictionaries: 'Slovarji', + btn_disable: 'Onemogoči SCAYT', + btn_enable: 'Omogoči SCAYT', + btn_langs:'Jeziki', + btn_options: 'Možnosti', + text_title: 'Črkovanje med tipkanjem' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/sr-latn.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/sr-latn.js new file mode 100644 index 0000000000..02a6554458 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/sr-latn.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'sr-latn', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Dictionaries', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Languages', + btn_options: 'Options', + text_title: 'Spell Check As You Type' // MISSING +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/sr.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/sr.js new file mode 100644 index 0000000000..067e401c28 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/sr.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'sr', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Dictionaries', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Languages', + btn_options: 'Options', + text_title: 'Spell Check As You Type' // MISSING +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/sv.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/sv.js new file mode 100644 index 0000000000..e9da617d2a --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/sv.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'sv', { + btn_about: 'Om SCAYT', + btn_dictionaries: 'Ordlistor', + btn_disable: 'Inaktivera SCAYT', + btn_enable: 'Aktivera SCAYT', + btn_langs:'Språk', + btn_options: 'Inställningar', + text_title: 'Stavningskontroll medan du skriver' +}); \ No newline at end of file diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/th.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/th.js new file mode 100644 index 0000000000..4842cdf18d --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/th.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'th', { + btn_about: 'About SCAYT', + btn_dictionaries: 'Dictionaries', + btn_disable: 'Disable SCAYT', + btn_enable: 'Enable SCAYT', + btn_langs:'Languages', + btn_options: 'Options', + text_title: 'Spell Check As You Type' // MISSING +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/tr.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/tr.js new file mode 100644 index 0000000000..fb574c165d --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/tr.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'tr', { + btn_about: 'SCAYT\'ı hakkında', + btn_dictionaries: 'Sözlükler', + btn_disable: 'SCAYT\'ı pasifleştir', + btn_enable: 'SCAYT\'ı etkinleştir', + btn_langs:'Diller', + btn_options: 'Seçenekler', + text_title: 'Girmiş olduğunuz kelime denetimi' +}); \ No newline at end of file diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ug.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ug.js new file mode 100644 index 0000000000..a03b535e49 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/ug.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'ug', { + btn_about: 'شۇئان ئىملا تەكشۈرۈش ھەققىدە', + btn_dictionaries: 'لۇغەت', + btn_disable: 'شۇئان ئىملا تەكشۈرۈشنى چەكلە', + btn_enable: 'شۇئان ئىملا تەكشۈرۈشنى قوزغات', + btn_langs:'تىل', + btn_options: 'تاللانما', + text_title: 'شۇئان ئىملا تەكشۈر' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/uk.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/uk.js new file mode 100644 index 0000000000..18cfdc4aad --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/uk.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'uk', { + btn_about: 'Про SCAYT', + btn_dictionaries: 'Словники', + btn_disable: 'Вимкнути SCAYT', + btn_enable: 'Ввімкнути SCAYT', + btn_langs:'Мови', + btn_options: 'Опції', + text_title: 'Перефірка орфографії по мірі набору' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/vi.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/vi.js new file mode 100644 index 0000000000..efd1fda22e --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/vi.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'vi', { + btn_about: 'Thông tin về SCAYT', + btn_dictionaries: 'Từ điển', + btn_disable: 'Tắt SCAYT', + btn_enable: 'Bật SCAYT', + btn_langs:'Ngôn ngữ', + btn_options: 'Tùy chọn', + text_title: 'Kiểm tra chính tả ngay khi gõ chữ (SCAYT)' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/zh-cn.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/zh-cn.js new file mode 100644 index 0000000000..46efa2fa94 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/zh-cn.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'zh-cn', { + btn_about: '关于即时拼写检查', + btn_dictionaries: '字典', + btn_disable: '禁用即时拼写检查', + btn_enable: '启用即时拼写检查', + btn_langs:'语言', + btn_options: '选项', + text_title: '即时拼写检查' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/lang/zh.js b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/zh.js new file mode 100644 index 0000000000..05524e5285 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/lang/zh.js @@ -0,0 +1,13 @@ +/* +Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. +For licensing, see LICENSE.html or http://ckeditor.com/license +*/ +CKEDITOR.plugins.setLang( 'scayt', 'zh', { + btn_about: '關於即時拼寫檢查', + btn_dictionaries: '字典', + btn_disable: '關閉即時拼寫檢查', + btn_enable: '啟用即時拼寫檢查', + btn_langs: '語言', + btn_options: '選項', + text_title: '即時拼寫檢查' +}); diff --git a/app/Resources/public/assets/ckeditor/plugins/scayt/plugin.js b/app/Resources/public/assets/ckeditor/plugins/scayt/plugin.js new file mode 100644 index 0000000000..eba747e3d2 --- /dev/null +++ b/app/Resources/public/assets/ckeditor/plugins/scayt/plugin.js @@ -0,0 +1,1877 @@ +'use strict'; +CKEDITOR.plugins.add('scayt', { + + //requires : ['menubutton', 'dialog'], + requires: 'menubutton,dialog', + lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en-au,en-ca,en-gb,en,eo,es,et,eu,fa,fi,fo,fr-ca,fr,gl,gu,he,hi,hr,hu,is,it,ja,ka,km,ko,lt,lv,mk,mn,ms,nb,nl,no,pl,pt-br,pt,ro,ru,sk,sl,sr-latn,sr,sv,th,tr,ug,uk,vi,zh-cn,zh', // %REMOVE_LINE_CORE% + icons: 'scayt', // %REMOVE_LINE_CORE% + hidpi: true, // %REMOVE_LINE_CORE% + tabToOpen : null, + dialogName: 'scaytDialog', + init: function(editor) { + var self = this, + plugin = CKEDITOR.plugins.scayt; + + this.bindEvents(editor); + this.parseConfig(editor); + this.addRule(editor); + + // source mode + CKEDITOR.dialog.add(this.dialogName, CKEDITOR.getUrl(this.path + 'dialogs/options.js')); + // end source mode + + this.addMenuItems(editor); + var config = editor.config, + lang = editor.lang.scayt, + env = CKEDITOR.env; + + editor.ui.add('Scayt', CKEDITOR.UI_MENUBUTTON, { + label : lang.text_title, + title : ( editor.plugins.wsc ? editor.lang.wsc.title : lang.text_title ), + // SCAYT doesn't work in IE Compatibility Mode and IE (8 & 9) Quirks Mode + modes : {wysiwyg: !(env.ie && ( env.version < 8 || env.quirks ) ) }, + toolbar: 'spellchecker,20', + refresh: function() { + var buttonState = editor.ui.instances.Scayt.getState(); + + // check if scayt is created + if(editor.scayt) { + // check if scayt is enabled + if(plugin.state.scayt[editor.name]) { + buttonState = CKEDITOR.TRISTATE_ON; + } else { + buttonState = CKEDITOR.TRISTATE_OFF; + } + } + + editor.fire('scaytButtonState', buttonState); + }, + onRender: function() { + var that = this; + + editor.on('scaytButtonState', function(ev) { + if(typeof ev.data !== undefined) { + that.setState(ev.data); + } + }); + }, + onMenu : function() { + var scaytInstance = editor.scayt; + + editor.getMenuItem('scaytToggle').label = editor.lang.scayt[(scaytInstance ? plugin.state.scayt[editor.name] : false) ? 'btn_disable' : 'btn_enable']; + + // If UI tab is disabled we shouldn't show menu item + var menuDefinition = { + scaytToggle : CKEDITOR.TRISTATE_OFF, + scaytOptions : scaytInstance ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, + scaytLangs : scaytInstance ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, + scaytDict : scaytInstance ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, + scaytAbout : scaytInstance ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, + WSC : editor.plugins.wsc ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED + }; + + if(!editor.config.scayt_uiTabs[0]) { + delete menuDefinition.scaytOptions; + } + + if(!editor.config.scayt_uiTabs[1]) { + delete menuDefinition.scaytLangs; + } + + if(!editor.config.scayt_uiTabs[2]) { + delete menuDefinition.scaytDict; + } + + return menuDefinition; + } + }); + + // If the 'contextmenu' plugin is loaded, register the listeners. + if(editor.contextMenu && editor.addMenuItems) { + editor.contextMenu.addListener(function(element, selection) { + var scaytInstance = editor.scayt, + result, selectionNode; + + if(scaytInstance) { + selectionNode = scaytInstance.getSelectionNode(); + + // SCAYT shouldn't build context menu if instance isnot created or word is without misspelling or grammar problem + if(selectionNode) { + var items = self.menuGenerator(editor, selectionNode); + + scaytInstance.showBanner('.' + editor.contextMenu._.definition.panel.className.split(' ').join(' .')); + result = items; + } + } + + return result; + }); + + editor.contextMenu._.onHide = CKEDITOR.tools.override(editor.contextMenu._.onHide, function(org) { + return function() { + var scaytInstance = editor.scayt; + + if(scaytInstance) { + scaytInstance.hideBanner(); + } + + return org.apply(this); + }; + }); + } + }, + addMenuItems: function(editor) { + var self = this, + plugin = CKEDITOR.plugins.scayt, + graytGroups = ['grayt_description', 'grayt_suggest', 'grayt_control'], + menuGroup = 'scaytButton'; + + editor.addMenuGroup(menuGroup); + + var items_order = editor.config.scayt_contextMenuItemsOrder.split('|'); + + for(var pos = 0 ; pos < items_order.length ; pos++) { + items_order[pos] = 'scayt_' + items_order[pos]; + } + items_order = graytGroups.concat(items_order); + + if(items_order && items_order.length) { + for(var pos = 0 ; pos < items_order.length ; pos++) { + editor.addMenuGroup(items_order[pos], pos - 10); + } + } + + editor.addCommand( 'scaytToggle', { + exec: function(editor) { + var scaytInstance = editor.scayt; + + plugin.state.scayt[editor.name] = !plugin.state.scayt[editor.name]; + + if(plugin.state.scayt[editor.name] === true) { + if(!scaytInstance) { + plugin.createScayt(editor); + } + } else { + if(scaytInstance) { + plugin.destroy(editor); + } + } + } + } ); + + editor.addCommand( 'scaytAbout', { + exec: function(editor) { + var scaytInstance = editor.scayt; + + scaytInstance.tabToOpen = 'about'; + editor.lockSelection(); + editor.openDialog(self.dialogName); + } + } ); + + editor.addCommand( 'scaytOptions', { + exec: function(editor) { + var scaytInstance = editor.scayt; + + scaytInstance.tabToOpen = 'options'; + editor.lockSelection(); + editor.openDialog(self.dialogName); + } + } ); + + editor.addCommand( 'scaytLangs', { + exec: function(editor) { + var scaytInstance = editor.scayt; + + scaytInstance.tabToOpen = 'langs'; + editor.lockSelection(); + editor.openDialog(self.dialogName); + } + } ); + + editor.addCommand( 'scaytDict', { + exec: function(editor) { + var scaytInstance = editor.scayt; + + scaytInstance.tabToOpen = 'dictionaries'; + editor.lockSelection(); + editor.openDialog(self.dialogName); + } + } ); + + var uiMenuItems = { + scaytToggle: { + label : editor.lang.scayt.btn_enable, + group : menuGroup, + command: 'scaytToggle' + }, + scaytAbout: { + label : editor.lang.scayt.btn_about, + group : menuGroup, + command: 'scaytAbout' + }, + scaytOptions: { + label : editor.lang.scayt.btn_options, + group : menuGroup, + command: 'scaytOptions' + }, + scaytLangs: { + label : editor.lang.scayt.btn_langs, + group : menuGroup, + command: 'scaytLangs' + }, + scaytDict: { + label : editor.lang.scayt.btn_dictionaries, + group : menuGroup, + command: 'scaytDict' + } + }; + + if(editor.plugins.wsc) { + uiMenuItems.WSC = { + label : editor.lang.wsc.toolbar, + group : menuGroup, + onClick: function() { + var inlineMode = (editor.elementMode == CKEDITOR.ELEMENT_MODE_INLINE), + plugin = CKEDITOR.plugins.scayt, + scaytInstance = editor.scayt, + text = inlineMode ? editor.container.getText() : editor.document.getBody().getText(); + + text = text.replace(/\s/g, ''); + + if(text) { + if(scaytInstance && plugin.state.scayt[editor.name] && scaytInstance.setMarkupPaused) { + scaytInstance.setMarkupPaused(true); + } + + editor.lockSelection(); + editor.execCommand('checkspell'); + } else { + alert('Nothing to check!'); + } + } + } + } + + editor.addMenuItems(uiMenuItems); + }, + bindEvents: function(editor) { + var self = this, + plugin = CKEDITOR.plugins.scayt, + inline_mode = (editor.elementMode == CKEDITOR.ELEMENT_MODE_INLINE); + + var scaytDestroy = function() { + plugin.destroy(editor); + }; + + /* + * Dirty fix for placeholder drag&drop + * Should be fixed with next release + */ + /* + editor.on('drop', function(evt) { + var dropRange = evt.data.dropRange; + var b = dropRange.createBookmark(true); + editor.scayt.removeMarkupInSelectionNode({ selectionNode: evt.data.target.$, forceBookmark: false }); + dropRange.moveToBookmark(b); + + evt.data.dropRange = dropRange; + return evt; + }, this, null, 0); // We should be sure that we modify dropRange before CKEDITOR.plugins.clipboard calls + */ + + var contentDomReady = function() { + // The event is fired when editable iframe node was reinited so we should restart our service + if (plugin.state.scayt[editor.name] && !editor.readOnly && !editor.scayt) { + plugin.createScayt(editor); + } + }; + + var addMarkupStateHandlers = function() { + var editable = editor.editable(); + + editable.attachListener( editable, 'focus', function( evt ) { + if( CKEDITOR.plugins.scayt && !editor.scayt ) { + setTimeout(contentDomReady, 0); // we need small timeout in order to correctly set initial 'focused' option value in SCAYT core + } + + var pluginStatus = CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[editor.name] && editor.scayt, + selectedElement, ranges, textLength, range; + + if((inline_mode ? true : pluginStatus) && editor._.savedSelection) { + selectedElement = editor._.savedSelection.getSelectedElement(); + ranges = !selectedElement && editor._.savedSelection.getRanges(); + + for(var i = 0; i < ranges.length; i++) { + range = ranges[i]; + // we need to check type of node value in order to avoid error in IE when accessing 'nodeValue' property + if(typeof range.startContainer.$.nodeValue === 'string') { + textLength = range.startContainer.getText().length; + if(textLength < range.startOffset || textLength < range.endOffset) { + editor.unlockSelection(false); + } + } + } + } + }, this, null, -10 ); // priority "-10" is set to call SCAYT CKEDITOR.editor#unlockSelection before CKEDITOR.editor#unlockSelection call + }; + + var contentDomHandler = function() { + if(inline_mode) { + + if (!editor.config.scayt_inlineModeImmediateMarkup) { + /* + * Give an opportunity to CKEditor to perform all needed updates + * and only after that call 'scaytDestroy' method (#72725) + */ + editor.on('blur', function () { setTimeout( scaytDestroy, 0 ); } ); + editor.on('focus', contentDomReady); + + // We need to check if editor has focus(created) right now. + // If editor is active - make attempt to create scayt + if(editor.focusManager.hasFocus) { + contentDomReady(); + } + + } else { + contentDomReady(); + } + + } else { + contentDomReady(); + } + + addMarkupStateHandlers(); + + /* + * 'mousedown' handler handle widget selection (click on widget). To + * fix the issue when widget#wrapper referenced to element which can + * be broken after markup. + */ + var editable = editor.editable(); + editable.attachListener(editable, 'mousedown', function( evt ) { + var target = evt.data.getTarget(); + var widget = editor.widgets && editor.widgets.getByElement( target ); + if ( widget ) { + widget.wrapper = target.getAscendant( function( el ) { + return el.hasAttribute( 'data-cke-widget-wrapper' ) + }, true ); + } + }, this, null, -10); // '-10': we need to be shure that widget#wrapper updated before any other calls + }; + + editor.on('contentDom', contentDomHandler); + + editor.on('beforeCommandExec', function(ev) { + var scaytInstance = editor.scayt, + selectedLangElement = null, + forceBookmark = false, + removeMarkupInsideSelection = true; + + // TODO: after switching in source mode not recreate SCAYT instance, try to just rerun markuping to don't make requests to server + if(ev.data.name in plugin.options.disablingCommandExec && editor.mode == 'wysiwyg') { + if(scaytInstance) { + plugin.destroy(editor); + editor.fire('scaytButtonState', CKEDITOR.TRISTATE_DISABLED); + } + } else if( ev.data.name === 'bold' || ev.data.name === 'italic' || ev.data.name === 'underline' || + ev.data.name === 'strike' || ev.data.name === 'subscript' || ev.data.name === 'superscript' || + ev.data.name === 'enter' || ev.data.name === 'cut' || ev.data.name === 'language') { + if(scaytInstance) { + if(ev.data.name === 'cut') { + removeMarkupInsideSelection = false; + // We need to force bookmark before we remove our markup. + // Otherwise we will get issues with cutting text via context menu. + forceBookmark = true; + } + + // We need to remove all SCAYT markup from 'lang' node before it will be deleted. + // We need to remove SCAYT markup from selected text before creating 'lang' node as well. + if(ev.data.name === 'language') { + selectedLangElement = editor.plugins.language.getCurrentLangElement(editor); + selectedLangElement = selectedLangElement && selectedLangElement.$; + // We need to force bookmark before we remove our markup. + // Otherwise we will get issues with cutting text via language plugin menu. + forceBookmark = true; + } + + editor.fire('reloadMarkupScayt', { + removeOptions: { + removeInside: removeMarkupInsideSelection, + forceBookmark: forceBookmark, + selectionNode: selectedLangElement + }, + timeout: 0 + }); + } + } + }); + + editor.on('beforeSetMode', function(ev) { + var scaytInstance; + // needed when we use: + // CKEDITOR.instances.editor_ID.setMode("source") + // CKEDITOR.instances.editor_ID.setMode("wysiwyg") + // can't be implemented in editor.on('mode', function(ev) {}); + if (ev.data == 'source') { + scaytInstance = editor.scayt; + if(scaytInstance) { + plugin.destroy(editor); + editor.fire('scaytButtonState', CKEDITOR.TRISTATE_DISABLED); + } + + // remove custom data from body, to prevent waste properties showing in IE8 + if(editor.document) { //GitHub #84 : make sure that document exists(e.g. when startup mode set to 'source') + editor.document.getBody().removeAttribute('_jquid'); + } + } + }); + + editor.on('afterCommandExec', function(ev) { + if(editor.mode == 'wysiwyg' && (ev.data.name == 'undo' || ev.data.name == 'redo')) { + setTimeout(function() { + var scaytInstance = editor.scayt, + scaytLangList = scaytInstance && scaytInstance.getScaytLangList(); + + /* + * Checks SCAYT initialization of LangList. To prevent immediate + * markup which is triggered by 'startSpellCheck' event. + * E.g.: Drop into inline CKEDITOR with scayt_autoStartup = true; + */ + if (!scaytLangList || !(scaytLangList.ltr && scaytLangList.rtl)) return; + + scaytInstance.fire('startSpellCheck, startGrammarCheck'); + }, 250); + } + }); + + // handle readonly changes + editor.on('readOnly', function(ev) { + var scaytInstance; + + if(ev) { + scaytInstance = editor.scayt; + + if(ev.editor.readOnly === true) { + if(scaytInstance) { + scaytInstance.fire('removeMarkupInDocument', {}); + } + } else { + if(scaytInstance) { + scaytInstance.fire('startSpellCheck, startGrammarCheck'); + } else if(ev.editor.mode == 'wysiwyg' && plugin.state.scayt[ev.editor.name] === true) { + plugin.createScayt(editor); + ev.editor.fire('scaytButtonState', CKEDITOR.TRISTATE_ON); + } + } + } + }); + + // we need to destroy SCAYT before CK editor will be completely destroyed + editor.on('beforeDestroy', scaytDestroy); + + //#9439 after SetData method fires contentDom event and SCAYT create additional instanse + // This way we should destroy SCAYT on setData event when contenteditable Iframe was re-created + editor.on('setData', function() { + scaytDestroy(); + + // in inline mode SetData does not fire contentDom event + if(editor.elementMode == CKEDITOR.ELEMENT_MODE_INLINE || editor.plugins.divarea) { + contentDomHandler(); + } + }, this, null, 50); + + /* + * Main entry point to react on changes in document + */ + editor.on('reloadMarkupScayt', function(ev) { + var removeOptions = ev.data && ev.data.removeOptions, + timeout = ev.data && ev.data.timeout; + + /* + * Perform removeMarkupInSelectionNode and 'startSpellCheck' fire + * asynchroniosly and keep CKEDITOR flow as expected + */ + setTimeout(function() { + var scaytInstance = editor.scayt, + scaytLangList = scaytInstance && scaytInstance.getScaytLangList(); + + /* + * Checks SCAYT initialization of LangList. To prevent immediate + * markup which is triggered by 'startSpellCheck' event. + * E.g.: Drop into inline CKEDITOR with scayt_autoStartup = true; + */ + if (!scaytLangList || !(scaytLangList.ltr && scaytLangList.rtl)) return; + + /* + * CKEditor can keep \u200B character in document (with selection#selectRanges) + * we need to take care about that. For this case we fire + * 'keydown' [left arrow], what will trigger 'removeFillingChar' on Webkit + * to cleanup the document + */ + editor.document.fire( 'keydown', new CKEDITOR.dom.event( { keyCode: 37 } ) ); + + /* trigger remove markup with 'startSpellCheck' */ + scaytInstance.removeMarkupInSelectionNode(removeOptions); + scaytInstance.fire('startSpellCheck, startGrammarCheck'); + }, timeout || 0 ); + }); + + // Reload spell-checking for current word after insertion completed. + editor.on('insertElement', function() { + // IE bug: we need wait here to make sure that focus is returned to editor, and we can store the selection before we proceed with markup + editor.fire('reloadMarkupScayt', {removeOptions: {forceBookmark: true}}); + }, this, null, 50); + + editor.on('insertHtml', function() { + editor.fire('reloadMarkupScayt'); + }, this, null, 50); + + editor.on('insertText', function() { + editor.fire('reloadMarkupScayt'); + }, this, null, 50); + + // The event is listening to open necessary dialog tab + editor.on('scaytDialogShown', function(ev) { + var dialog = ev.data, + scaytInstance = editor.scayt; + + dialog.selectPage(scaytInstance.tabToOpen); + }); + }, + parseConfig: function(editor) { + var plugin = CKEDITOR.plugins.scayt; + + // preprocess config for backward compatibility + plugin.replaceOldOptionsNames(editor.config); + + // Checking editor's config after initialization + if(typeof editor.config.scayt_autoStartup !== 'boolean') { + editor.config.scayt_autoStartup = false; + } + plugin.state.scayt[editor.name] = editor.config.scayt_autoStartup; + + if(typeof editor.config.grayt_autoStartup !== 'boolean') { + editor.config.grayt_autoStartup = false; + } + if(typeof editor.config.scayt_inlineModeImmediateMarkup !== 'boolean') { + editor.config.scayt_inlineModeImmediateMarkup = false; + } + plugin.state.grayt[editor.name] = editor.config.grayt_autoStartup; + + if(!editor.config.scayt_contextCommands) { + editor.config.scayt_contextCommands = 'ignore|ignoreall|add'; + } + + if(!editor.config.scayt_contextMenuItemsOrder) { + editor.config.scayt_contextMenuItemsOrder = 'suggest|moresuggest|control'; + } + + if(!editor.config.scayt_sLang) { + editor.config.scayt_sLang = 'en_US'; + } + + if(editor.config.scayt_maxSuggestions === undefined || typeof editor.config.scayt_maxSuggestions != 'number' || editor.config.scayt_maxSuggestions < 0) { + editor.config.scayt_maxSuggestions = 5; + } + + if(editor.config.scayt_minWordLength === undefined || typeof editor.config.scayt_minWordLength != 'number' || editor.config.scayt_minWordLength < 1) { + editor.config.scayt_minWordLength = 4; + } + + if(editor.config.scayt_customDictionaryIds === undefined || typeof editor.config.scayt_customDictionaryIds !== 'string') { + editor.config.scayt_customDictionaryIds = ''; + } + + if(editor.config.scayt_userDictionaryName === undefined || typeof editor.config.scayt_userDictionaryName !== 'string') { + editor.config.scayt_userDictionaryName = null; + } + + if(typeof editor.config.scayt_uiTabs === 'string' && editor.config.scayt_uiTabs.split(',').length === 3) { + var scayt_uiTabs = [], _tempUITabs = []; + editor.config.scayt_uiTabs = editor.config.scayt_uiTabs.split(','); + + CKEDITOR.tools.search(editor.config.scayt_uiTabs, function(value) { + if (Number(value) === 1 || Number(value) === 0) { + _tempUITabs.push(true); + scayt_uiTabs.push(Number(value)); + } else { + _tempUITabs.push(false); + } + }); + + if (CKEDITOR.tools.search(_tempUITabs, false) === null) { + editor.config.scayt_uiTabs = scayt_uiTabs; + } else { + editor.config.scayt_uiTabs = [1,1,1]; + } + + } else { + editor.config.scayt_uiTabs = [1,1,1]; + } + + if(typeof editor.config.scayt_serviceProtocol != 'string') { + editor.config.scayt_serviceProtocol = null; + } + + if(typeof editor.config.scayt_serviceHost != 'string') { + editor.config.scayt_serviceHost = null; + } + + if(typeof editor.config.scayt_servicePort != 'string') { + editor.config.scayt_servicePort = null; + } + + if(typeof editor.config.scayt_servicePath != 'string') { + editor.config.scayt_servicePath = null; + } + + if(!editor.config.scayt_moreSuggestions) { + editor.config.scayt_moreSuggestions = 'on'; + } + + if(typeof editor.config.scayt_customerId !== 'string') { + editor.config.scayt_customerId = '1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2'; + } + + if(typeof editor.config.scayt_srcUrl !== 'string') { + var protocol = document.location.protocol; + protocol = protocol.search(/https?:/) != -1 ? protocol : 'http:'; + + editor.config.scayt_srcUrl = protocol + '//svc.webspellchecker.net/spellcheck31/lf/scayt3/ckscayt/ckscayt.js'; + } + + if(typeof CKEDITOR.config.scayt_handleCheckDirty !== 'boolean') { + CKEDITOR.config.scayt_handleCheckDirty = true; + } + + if(typeof CKEDITOR.config.scayt_handleUndoRedo !== 'boolean') { + /* set default as 'true' */ + CKEDITOR.config.scayt_handleUndoRedo = true; + } + /* checking 'undo' plugin, if no disable SCAYT handler */ + CKEDITOR.config.scayt_handleUndoRedo = CKEDITOR.plugins.undo ? CKEDITOR.config.scayt_handleUndoRedo : false; + + if(typeof editor.config.scayt_multiLanguageMode !== 'boolean') { + editor.config.scayt_multiLanguageMode = false; + } + + if(typeof editor.config.scayt_multiLanguageStyles !== 'object') { + editor.config.scayt_multiLanguageStyles = {}; + } + + if(editor.config.scayt_ignoreAllCapsWords && typeof editor.config.scayt_ignoreAllCapsWords !== 'boolean') { + editor.config.scayt_ignoreAllCapsWords = false; + } + + if(editor.config.scayt_ignoreDomainNames && typeof editor.config.scayt_ignoreDomainNames !== 'boolean') { + editor.config.scayt_ignoreDomainNames = false; + } + + if(editor.config.scayt_ignoreWordsWithMixedCases && typeof editor.config.scayt_ignoreWordsWithMixedCases !== 'boolean') { + editor.config.scayt_ignoreWordsWithMixedCases = false; + } + + if(editor.config.scayt_ignoreWordsWithNumbers && typeof editor.config.scayt_ignoreWordsWithNumbers !== 'boolean') { + editor.config.scayt_ignoreWordsWithNumbers = false; + } + + if( editor.config.scayt_disableOptionsStorage ) { + var userOptions = CKEDITOR.tools.isArray( editor.config.scayt_disableOptionsStorage ) ? editor.config.scayt_disableOptionsStorage : ( typeof editor.config.scayt_disableOptionsStorage === 'string' ) ? [ editor.config.scayt_disableOptionsStorage ] : undefined, + availableValue = [ 'all', 'options', 'lang', 'ignore-all-caps-words', 'ignore-domain-names', 'ignore-words-with-mixed-cases', 'ignore-words-with-numbers'], + valuesOption = ['lang', 'ignore-all-caps-words', 'ignore-domain-names', 'ignore-words-with-mixed-cases', 'ignore-words-with-numbers'], + search = CKEDITOR.tools.search, + indexOf = CKEDITOR.tools.indexOf; + + var isValidOption = function( option ) { + return !!search( availableValue, option ); + }; + + var makeOptionsToStorage = function( options ) { + var retval = []; + + for (var i = 0; i < options.length; i++) { + var value = options[i], + isGroupOptionInUserOptions = !!search( options, 'options' ); + + if( !isValidOption( value ) || isGroupOptionInUserOptions && !!search( valuesOption, function( val ) { if( val === 'lang' ) { return false; } } ) ) { + return; + } + + if( !!search( valuesOption, value ) ) { + valuesOption.splice( indexOf( valuesOption, value ), 1 ); + } + + if( value === 'all' || isGroupOptionInUserOptions && !!search( options, 'lang' )) { + return []; + } + + if( value === 'options' ) { + valuesOption = [ 'lang' ]; + } + } + + retval = retval.concat( valuesOption ); + + return retval; + }; + + editor.config.scayt_disableOptionsStorage = makeOptionsToStorage( userOptions ); + } + }, + addRule: function(editor) { + var plugin = CKEDITOR.plugins.scayt, + dataProcessor = editor.dataProcessor, + htmlFilter = dataProcessor && dataProcessor.htmlFilter, + pathFilters = editor._.elementsPath && editor._.elementsPath.filters, + dataFilter = dataProcessor && dataProcessor.dataFilter, + removeFormatFilter = editor.addRemoveFormatFilter, + pathFilter = function(element) { + var scaytInstance = editor.scayt; + + if( scaytInstance && (element.hasAttribute(plugin.options.data_attribute_name) || element.hasAttribute(plugin.options.problem_grammar_data_attribute)) ) { + return false; + } + }, + removeFormatFilterTemplate = function(element) { + var scaytInstance = editor.scayt, + result = true; + + if( scaytInstance && (element.hasAttribute(plugin.options.data_attribute_name) || element.hasAttribute(plugin.options.problem_grammar_data_attribute)) ) { + result = false; + } + + return result; + }; + + if(pathFilters) { + pathFilters.push(pathFilter); + } + + if(dataFilter) { + var dataFilterRules = { + elements: { + span: function(element) { + + var scaytState = element.hasClass(plugin.options.misspelled_word_class) && element.attributes[plugin.options.data_attribute_name], + graytState = element.hasClass(plugin.options.problem_grammar_class) && element.attributes[plugin.options.problem_grammar_data_attribute]; + + if(plugin && (scaytState || graytState)) { + delete element.name; + } + + return element; + } + } + }; + + dataFilter.addRules(dataFilterRules); + } + + if (htmlFilter) { + var htmlFilterRules = { + elements: { + span: function(element) { + + var scaytState = element.hasClass(plugin.options.misspelled_word_class) && element.attributes[plugin.options.data_attribute_name], + graytState = element.hasClass(plugin.options.problem_grammar_class) && element.attributes[plugin.options.problem_grammar_data_attribute]; + + if(plugin && (scaytState || graytState)) { + delete element.name; + } + + return element; + } + } + }; + + htmlFilter.addRules(htmlFilterRules); + } + + if(removeFormatFilter) { + removeFormatFilter.call(editor, removeFormatFilterTemplate); + } + }, + scaytMenuDefinition: function(editor) { + var self = this, + plugin = CKEDITOR.plugins.scayt, + scayt_instance = editor.scayt; + + return { + scayt: { + scayt_ignore: { + label: scayt_instance.getLocal('btn_ignore'), + group : 'scayt_control', + order : 1, + exec: function(editor) { + var scaytInstance = editor.scayt; + scaytInstance.ignoreWord(); + } + }, + scayt_ignoreall: { + label : scayt_instance.getLocal('btn_ignoreAll'), + group : 'scayt_control', + order : 2, + exec: function(editor) { + var scaytInstance = editor.scayt; + scaytInstance.ignoreAllWords(); + } + }, + scayt_add: { + label : scayt_instance.getLocal('btn_addWord'), + group : 'scayt_control', + order : 3, + exec : function(editor) { + var scaytInstance = editor.scayt; + + // @TODO: We need to add set/restore bookmark logic to 'addWordToUserDictionary' method inside dictionarymanager. + // Timeout is used as tmp fix for IE9, when after hitting 'Add word' menu item, document container was blurred. + setTimeout(function() { + scaytInstance.addWordToUserDictionary(); + }, 10); + } + }, + scayt_option: { + label : scayt_instance.getLocal('btn_options'), + group : 'scayt_control', + order : 4, + exec: function(editor) { + var scaytInstance = editor.scayt; + + scaytInstance.tabToOpen = 'options'; + editor.lockSelection(); + editor.openDialog(self.dialogName); + }, + verification: function(editor) { + return (editor.config.scayt_uiTabs[0] == 1) ? true : false; + } + }, + scayt_language: { + label : scayt_instance.getLocal('btn_langs'), + group : 'scayt_control', + order : 5, + exec: function(editor) { + var scaytInstance = editor.scayt; + + scaytInstance.tabToOpen = 'langs'; + editor.lockSelection(); + editor.openDialog(self.dialogName); + }, + verification: function(editor) { + return (editor.config.scayt_uiTabs[1] == 1) ? true : false; + } + }, + scayt_dictionary: { + label : scayt_instance.getLocal('btn_dictionaries'), + group : 'scayt_control', + order : 6, + exec: function(editor) { + var scaytInstance = editor.scayt; + + scaytInstance.tabToOpen = 'dictionaries'; + editor.lockSelection(); + editor.openDialog(self.dialogName); + }, + verification: function(editor) { + return (editor.config.scayt_uiTabs[2] == 1) ? true : false; + } + }, + scayt_about: { + label : scayt_instance.getLocal('btn_about'), + group : 'scayt_control', + order : 7, + exec: function(editor) { + var scaytInstance = editor.scayt; + + scaytInstance.tabToOpen = 'about'; + editor.lockSelection(); + editor.openDialog(self.dialogName); + } + } + }, + grayt: { + grayt_problemdescription: { + label : 'Grammar problem description', + group : 'grayt_description', // look at addMenuItems method for further info + order : 1, + state : CKEDITOR.TRISTATE_DISABLED, + exec: function(editor) {} + }, + grayt_ignore: { + label : scayt_instance.getLocal('btn_ignore'), + group : 'grayt_control', + order : 2, + exec: function(editor) { + var scaytInstance = editor.scayt; + + scaytInstance.ignorePhrase(); + } + } + } + }; + }, + buildSuggestionMenuItems: function(editor, suggestions, isScaytNode) { + var self = this, + itemList = {}, + subItemList = {}, + replaceKeyName = isScaytNode ? 'word' : 'phrase', + updateEventName = isScaytNode ? 'startGrammarCheck' : 'startSpellCheck', + plugin = CKEDITOR.plugins.scayt, + scayt_instance = editor.scayt; + + if(suggestions.length > 0 && suggestions[0] !== 'no_any_suggestions') { + + if(isScaytNode) { + // build SCAYT suggestions + for(var i = 0; i < suggestions.length; i++) { + + var commandName = 'scayt_suggest_' + CKEDITOR.plugins.scayt.suggestions[i].replace(' ', '_'); + + editor.addCommand(commandName, self.createCommand(CKEDITOR.plugins.scayt.suggestions[i], replaceKeyName, updateEventName)); + + if(i < editor.config.scayt_maxSuggestions) { + + // mainSuggestions + editor.addMenuItem(commandName, { + label: suggestions[i], + command: commandName, + group: 'scayt_suggest', + order: i + 1 + }); + + itemList[commandName] = CKEDITOR.TRISTATE_OFF; + + } else { + + // moreSuggestions + editor.addMenuItem(commandName, { + label: suggestions[i], + command: commandName, + group: 'scayt_moresuggest', + order: i + 1 + }); + + subItemList[commandName] = CKEDITOR.TRISTATE_OFF; + + if(editor.config.scayt_moreSuggestions === 'on') { + + editor.addMenuItem('scayt_moresuggest', { + label : scayt_instance.getLocal('btn_moreSuggestions'), + group : 'scayt_moresuggest', + order : 10, + getItems : function() { + return subItemList; + } + }); + + itemList['scayt_moresuggest'] = CKEDITOR.TRISTATE_OFF; + } + } + } + } else { + // build GRAYT suggestions + for(var i = 0; i < suggestions.length; i++) { + var commandName = 'grayt_suggest_' + CKEDITOR.plugins.scayt.suggestions[i].replace(' ', '_'); + + editor.addCommand(commandName, self.createCommand(CKEDITOR.plugins.scayt.suggestions[i], replaceKeyName, updateEventName)); + + // mainSuggestions + editor.addMenuItem(commandName, { + label: suggestions[i], + command: commandName, + group: 'grayt_suggest', + order: i + 1 + }); + + itemList[commandName] = CKEDITOR.TRISTATE_OFF; + } + } + } else { + var noSuggestionsCommand = 'no_scayt_suggest'; + itemList[noSuggestionsCommand] = CKEDITOR.TRISTATE_DISABLED; + + editor.addCommand(noSuggestionsCommand, { + exec: function() { + + } + }); + + editor.addMenuItem(noSuggestionsCommand, { + label : scayt_instance.getLocal('btn_noSuggestions') || noSuggestionsCommand, + command: noSuggestionsCommand, + group : 'scayt_suggest', + order : 0 + }); + } + + return itemList; + }, + menuGenerator: function(editor, selectionNode) { + var self = this, + scaytInstance = editor.scayt, + menuItems = this.scaytMenuDefinition(editor), + itemList = {}, + allowedOption = editor.config.scayt_contextCommands.split('|'), + lang = selectionNode.getAttribute(scaytInstance.getLangAttribute()) || scaytInstance.getLang(), + word, grammarPhrase, isScaytNode, isGrammarNode, problemDescriptionText; + + + isScaytNode = scaytInstance.isScaytNode(selectionNode); + isGrammarNode = scaytInstance.isGraytNode(selectionNode); + + if(isScaytNode) { + // we clicked scayt misspelling + // get suggestions + menuItems = menuItems.scayt; + + word = selectionNode.getAttribute(scaytInstance.getScaytNodeAttributeName()); + + scaytInstance.fire('getSuggestionsList', { + lang: lang, + word: word + }); + + itemList = this.buildSuggestionMenuItems(editor, CKEDITOR.plugins.scayt.suggestions, isScaytNode); + } else if(isGrammarNode) { + // we clicked grammar problem + // get suggestions + menuItems = menuItems.grayt; + grammarPhrase = selectionNode.getAttribute(scaytInstance.getGraytNodeAttributeName()); + + // setup grammar problem description + problemDescriptionText = scaytInstance.getProblemDescriptionText(grammarPhrase, lang); + if(menuItems.grayt_problemdescription && problemDescriptionText) { + menuItems.grayt_problemdescription.label = problemDescriptionText; + } + + scaytInstance.fire('getGrammarSuggestionsList', { + lang: lang, + phrase: grammarPhrase + }); + + itemList = this.buildSuggestionMenuItems(editor, CKEDITOR.plugins.scayt.suggestions, isScaytNode); + } + + if(isScaytNode && editor.config.scayt_contextCommands == 'off') { + return itemList; + } + + for(var key in menuItems) { + if(isScaytNode && CKEDITOR.tools.indexOf(allowedOption, key.replace('scayt_', '')) == -1 && editor.config.scayt_contextCommands != 'all') { + continue; + } + + if(typeof menuItems[key].state != 'undefined') { + itemList[key] = menuItems[key].state; + } else { + itemList[key] = CKEDITOR.TRISTATE_OFF; + } + + // delete item from context menu if its state isn't verified as allowed + if(typeof menuItems[key].verification === 'function' && !menuItems[key].verification(editor)) { + // itemList[key] = (menuItems[key].verification(editor)) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED; + delete itemList[key]; + } + + editor.addCommand(key, { + exec: menuItems[key].exec + }); + + editor.addMenuItem(key, { + label : editor.lang.scayt[menuItems[key].label] || menuItems[key].label, + command: key, + group : menuItems[key].group, + order : menuItems[key].order + }); + } + + return itemList; + }, + createCommand: function(suggestion, replaceKeyName, updateEventName) { + return { + exec: function(editor) { + var scaytInstance = editor.scayt, + eventObject = {}; + + eventObject[replaceKeyName] = suggestion; + scaytInstance.replaceSelectionNode(eventObject); + + // we need to remove grammar markup from selection node if we just performed replace action for misspelling + if(updateEventName === 'startGrammarCheck') { + scaytInstance.removeMarkupInSelectionNode({grammarOnly: true}); + } + // for grayt problem replacement we need to fire 'startSpellCheck' + // for scayt misspelling replacement we need to fire 'startGrammarCheck' + scaytInstance.fire(updateEventName); + } + }; + } +}); + +CKEDITOR.plugins.scayt = { + state: { + scayt: {}, + grayt: {} + }, + suggestions: [], + loadingHelper: { + loadOrder: [] + }, + isLoading: false, + options: { + disablingCommandExec: { + source: true, + newpage: true, + templates: true + }, + data_attribute_name: 'data-scayt-word', + misspelled_word_class: 'scayt-misspell-word', + problem_grammar_data_attribute: 'data-grayt-phrase', + problem_grammar_class: 'gramm-problem' + }, + backCompatibilityMap: { + 'scayt_service_protocol': 'scayt_serviceProtocol', + 'scayt_service_host' : 'scayt_serviceHost', + 'scayt_service_port' : 'scayt_servicePort', + 'scayt_service_path' : 'scayt_servicePath', + 'scayt_customerid' : 'scayt_customerId' + }, + replaceOldOptionsNames: function(config) { + for(var key in config) { + if(key in this.backCompatibilityMap) { + config[this.backCompatibilityMap[key]] = config[key]; + delete config[key]; + } + } + }, + createScayt : function(editor) { + var self = this, + plugin = CKEDITOR.plugins.scayt; + + this.loadScaytLibrary(editor, function(_editor) { + var textContainer = _editor.window && _editor.window.getFrame() || _editor.editable(); + + // Do not create SCAYT if there is no text container for usage + if(!textContainer) { + plugin.state.scayt[_editor.name] = false; + return; + } + + var scaytInstanceOptions = { + lang : _editor.config.scayt_sLang, + container : textContainer.$, + customDictionary : _editor.config.scayt_customDictionaryIds, + userDictionaryName : _editor.config.scayt_userDictionaryName, + localization : _editor.langCode, + customer_id : _editor.config.scayt_customerId, + debug : _editor.config.scayt_debug, + data_attribute_name : self.options.data_attribute_name, + misspelled_word_class: self.options.misspelled_word_class, + problem_grammar_data_attribute: self.options.problem_grammar_data_attribute, + problem_grammar_class: self.options.problem_grammar_class, + 'options-to-restore': _editor.config.scayt_disableOptionsStorage, + focused : _editor.editable().hasFocus, // #30260 we need to set focused=true if CKEditor is focused before SCAYT initialization + ignoreElementsRegex : _editor.config.scayt_elementsToIgnore, + minWordLength : _editor.config.scayt_minWordLength, + multiLanguageMode : _editor.config.scayt_multiLanguageMode, + multiLanguageStyles : _editor.config.scayt_multiLanguageStyles, + graytAutoStartup : plugin.state.grayt[_editor.name] + }; + + if(_editor.config.scayt_serviceProtocol) { + scaytInstanceOptions['service_protocol'] = _editor.config.scayt_serviceProtocol; + } + + if(_editor.config.scayt_serviceHost) { + scaytInstanceOptions['service_host'] = _editor.config.scayt_serviceHost; + } + + if(_editor.config.scayt_servicePort) { + scaytInstanceOptions['service_port'] = _editor.config.scayt_servicePort; + } + + if(_editor.config.scayt_servicePath) { + scaytInstanceOptions['service_path'] = _editor.config.scayt_servicePath; + } + + //predefined options + if(typeof _editor.config.scayt_ignoreAllCapsWords === 'boolean') { + scaytInstanceOptions['ignore-all-caps-words'] = _editor.config.scayt_ignoreAllCapsWords; + } + + if(typeof _editor.config.scayt_ignoreDomainNames === 'boolean') { + scaytInstanceOptions['ignore-domain-names'] = _editor.config.scayt_ignoreDomainNames; + } + + if(typeof _editor.config.scayt_ignoreWordsWithMixedCases === 'boolean') { + scaytInstanceOptions['ignore-words-with-mixed-cases'] = _editor.config.scayt_ignoreWordsWithMixedCases; + } + + if(typeof _editor.config.scayt_ignoreWordsWithNumbers === 'boolean') { + scaytInstanceOptions['ignore-words-with-numbers'] = _editor.config.scayt_ignoreWordsWithNumbers; + } + + var scaytInstance = new SCAYT.CKSCAYT(scaytInstanceOptions, function() { + // success callback + }, function() { + // error callback + }), + wordsPrefix = 'word_'; + + scaytInstance.subscribe('suggestionListSend', function(data) { + // TODO: 1. Maybe store suggestions for specific editor + // TODO: 2. Fix issue with suggestion duplicates on on server + //CKEDITOR.plugins.scayt.suggestions = data.suggestionList; + var _wordsCollection = {}, + _suggestionList =[]; + + for (var i = 0; i < data.suggestionList.length; i++) { + if (!_wordsCollection[wordsPrefix + data.suggestionList[i]]) { + _wordsCollection[wordsPrefix + data.suggestionList[i]] = data.suggestionList[i]; + _suggestionList.push(data.suggestionList[i]); + } + } + + CKEDITOR.plugins.scayt.suggestions = _suggestionList; + }); + + // if selection has changed programmatically by SCAYT we need to react appropriately + scaytInstance.subscribe('selectionIsChanged', function(data) { + var selection = _editor.getSelection(); + + if(selection.isLocked) { + _editor.lockSelection(); + } + }); + + scaytInstance.subscribe('graytStateChanged', function(data) { + plugin.state.grayt[_editor.name] = data.state; + }); + + _editor.scayt = scaytInstance; + + _editor.fire('scaytButtonState', _editor.readOnly ? CKEDITOR.TRISTATE_DISABLED : CKEDITOR.TRISTATE_ON); + }); + }, + destroy: function(editor) { + if(editor.scayt) { + editor.scayt.destroy(); + } + + delete editor.scayt; + editor.fire('scaytButtonState', CKEDITOR.TRISTATE_OFF); + }, + loadScaytLibrary: function(editor, callback) { + var self = this, + date, + timestamp, + scaytUrl; + + // no need to process load requests from same editor as it can cause bugs with + // loading ckscayt app due to subsequent calls of some events + // need to be before 'if' statement, because of timing issue in CKEDITOR.scriptLoader + // when callback executing is delayed for a few milliseconds, and scayt can be created twise + // on one instance + if(this.loadingHelper[editor.name]) return; + + if(typeof window.SCAYT === 'undefined' || typeof window.SCAYT.CKSCAYT !== 'function') { + + // add onLoad callbacks for editors while SCAYT is loading + this.loadingHelper[editor.name] = callback; + this.loadingHelper.loadOrder.push(editor.name); + + //creating unique timestamp for SCAYT URL + date = new Date(); + timestamp = date.getTime(); + scaytUrl = editor.config.scayt_srcUrl; + + //if there already implemented timstamp for scayr_srcURL use it, if not use our timestamp + scaytUrl = scaytUrl + (scaytUrl.indexOf('?') >= 0 ? '' : '?' + timestamp); + + if (!this.loadingHelper.ckscaytLoading) { + CKEDITOR.scriptLoader.load(scaytUrl, function(success) { + var editorName; + + if ( success ) { + CKEDITOR.fireOnce('scaytReady'); + + for(var i = 0; i < self.loadingHelper.loadOrder.length; i++) { + editorName = self.loadingHelper.loadOrder[i]; + + if(typeof self.loadingHelper[editorName] === 'function') { + self.loadingHelper[editorName](CKEDITOR.instances[editorName]); + } + + delete self.loadingHelper[editorName]; + } + self.loadingHelper.loadOrder = []; + } + }); + this.loadingHelper.ckscaytLoading = true; + } + + + } else if(window.SCAYT && typeof window.SCAYT.CKSCAYT === 'function') { + CKEDITOR.fireOnce('scaytReady'); + + if(!editor.scayt) { + if(typeof callback === 'function') { + callback(editor); + } + } + } + } +}; + +CKEDITOR.on('dialogDefinition', function(dialogDefinitionEvent) { + var dialogName = dialogDefinitionEvent.data.name, + dialogDefinition = dialogDefinitionEvent.data.definition, + dialog = dialogDefinition.dialog; + + if (dialogName === 'scaytDialog') { + dialog.on('cancel', function(cancelEvent) { + return false; + }, this, null, -1); + } + + if ( dialogName === 'checkspell' ) { + dialog.on( 'cancel', function( cancelEvent ) { + var editor = cancelEvent.sender && cancelEvent.sender.getParentEditor(), + plugin = CKEDITOR.plugins.scayt, + scaytInstance = editor.scayt; + + if ( scaytInstance && plugin.state.scayt[ editor.name ] && scaytInstance.setMarkupPaused ) { + scaytInstance.setMarkupPaused( false ); + } + + editor.unlockSelection(); + }, this, null, -2 ); // we need to call cancel callback before WSC plugin + } + + if (dialogName === 'link') { + dialog.on('ok', function(okEvent) { + var editor = okEvent.sender && okEvent.sender.getParentEditor(); + + if(editor) { + setTimeout(function() { + editor.fire('reloadMarkupScayt', { + removeOptions: { + removeInside: true, + forceBookmark: true + }, + timeout: 0 + }); + }, 0); + } + }); + } +}); + +CKEDITOR.on('scaytReady', function() { + + // Override editor.checkDirty method avoid CK checkDirty functionality to fix SCAYT issues with incorrect checkDirty behavior. + if(CKEDITOR.config.scayt_handleCheckDirty === true) { + var editorCheckDirty = CKEDITOR.editor.prototype; + + editorCheckDirty.checkDirty = CKEDITOR.tools.override(editorCheckDirty.checkDirty, function(org) { + + return function() { + var retval = null, + pluginStatus = CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[this.name] && this.scayt, + scaytInstance = this.scayt; + + if(!pluginStatus) { + retval = org.call(this); + } else { + retval = (this.status == 'ready'); + + if (retval) { + var currentData = scaytInstance.removeMarkupFromString(this.getSnapshot()), + prevData = scaytInstance.removeMarkupFromString(this._.previousValue); + + retval = (retval && (prevData !== currentData)) + } + } + + return retval; + }; + }); + + editorCheckDirty.resetDirty = CKEDITOR.tools.override(editorCheckDirty.resetDirty, function(org) { + return function() { + var pluginStatus = CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[this.name] && this.scayt, + scaytInstance = this.scayt;//CKEDITOR.plugins.scayt.getScayt(this); + + if(!pluginStatus) { + org.call(this); + } else { + this._.previousValue = scaytInstance.removeMarkupFromString(this.getSnapshot()); + } + }; + }); + } + + if (CKEDITOR.config.scayt_handleUndoRedo === true) { + var undoImagePrototype = CKEDITOR.plugins.undo.Image.prototype; + + // add backword compatibility for CKEDITOR 4.2. method equals was repleced on other method + var equalsContentMethodName = (typeof undoImagePrototype.equalsContent == "function") ? 'equalsContent' : 'equals'; + + undoImagePrototype[equalsContentMethodName] = CKEDITOR.tools.override(undoImagePrototype[equalsContentMethodName], function(org) { + return function(otherImage) { + var pluginState = CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[otherImage.editor.name] && otherImage.editor.scayt, + scaytInstance = otherImage.editor.scayt, + thisContents = this.contents, + otherContents = otherImage.contents, + retval = null; + + // Making the comparison based on content without SCAYT word markers. + if(pluginState) { + this.contents = scaytInstance.removeMarkupFromString(thisContents) || ''; + otherImage.contents = scaytInstance.removeMarkupFromString(otherContents) || ''; + } + + var retval = org.apply(this, arguments); + + this.contents = thisContents; + otherImage.contents = otherContents; + + return retval; + }; + }); + } +}); + +/** + * Automatically enables SCAYT on editor startup. When set to `true`, this option turns on SCAYT automatically + * after loading the editor. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * config.scayt_autoStartup = true; + * + * @cfg {Boolean} [scayt_autoStartup=false] + * @member CKEDITOR.config + */ + +/** + * Enables Grammar As You Type (GRAYT) on SCAYT startup. When set to `true`, this option turns on GRAYT automatically + * after SCAYT started. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * config.grayt_autoStartup = true; + * + * @since 4.5.6 + * @cfg {Boolean} [grayt_autoStartup=false] + * @member CKEDITOR.config + */ + +/** + * Enables SCAYT initialization when inline CKEditor is not focused. When set to `true`, SCAYT markup is + * displayed in both inline editor states, focused and unfocused, so the SCAYT instance is not destroyed. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * config.scayt_inlineModeImmediateMarkup = true; + * + * @since 4.5.6 + * @cfg {Boolean} [scayt_inlineModeImmediateMarkup=false] + * @member CKEDITOR.config + */ + +/** + * Defines the number of SCAYT suggestions to show in the main context menu. + * Possible values are: + * + * * `0` (zero) – No suggestions are shown in the main context menu. All + * entries will be listed in the "More Suggestions" sub-menu. + * * Positive number – The maximum number of suggestions to show in the context + * menu. Other entries will be shown in the "More Suggestions" sub-menu. + * * Negative number – Five suggestions are shown in the main context menu. All other + * entries will be listed in the "More Suggestions" sub-menu. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * Examples: + * + * // Display only three suggestions in the main context menu. + * config.scayt_maxSuggestions = 3; + * + * // Do not show the suggestions directly. + * config.scayt_maxSuggestions = 0; + * + * @cfg {Number} [scayt_maxSuggestions=5] + * @member CKEDITOR.config + */ + +/** + * Defines the minimum length of words that will be collected from the editor content for spell checking. + * Possible value is any positive number. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * Examples: + * + * // Set the minimum length of words that will be collected from editor text. + * config.scayt_minWordLength = 5; + * + * @cfg {Number} [scayt_minWordLength=4] + * @member CKEDITOR.config + */ + +/** + * Sets the customer ID for SCAYT. Used for hosted users only. Required for migration from free + * to trial or paid versions. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * // Load SCAYT using my customer ID. + * config.scayt_customerId = 'your-encrypted-customer-id'; + * + * @cfg {String} [scayt_customerId='1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2'] + * @member CKEDITOR.config + */ + +/** + * Enables and disables the "More Suggestions" sub-menu in the context menu. + * Possible values are `'on'` and `'off'`. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * // Disables the "More Suggestions" sub-menu. + * config.scayt_moreSuggestions = 'off'; + * + * @cfg {String} [scayt_moreSuggestions='on'] + * @member CKEDITOR.config + */ + +/** + * Customizes the display of SCAYT context menu commands ("Add Word", "Ignore", + * "Ignore All", "Options", "Languages", "Dictionaries" and "About"). + * This must be a string with one or more of the following + * words separated by a pipe character (`'|'`): + * + * * `off` – Disables all options. + * * `all` – Enables all options. + * * `ignore` – Enables the "Ignore" option. + * * `ignoreall` – Enables the "Ignore All" option. + * * `add` – Enables the "Add Word" option. + * * `option` – Enables the "Options" menu item. + * * `language` – Enables the "Languages" menu item. + * * `dictionary` – Enables the "Dictionaries" menu item. + * * `about` – Enables the "About" menu item. + * + * Please note that availability of the "Options", "Languages" and "Dictionaries" items + * also depends on the {@link CKEDITOR.config#scayt_uiTabs} option. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * Example: + * + * // Show only "Add Word" and "Ignore All" in the context menu. + * config.scayt_contextCommands = 'add|ignoreall'; + * + * @cfg {String} [scayt_contextCommands='ignore|ignoreall|add'] + * @member CKEDITOR.config + */ + +/** + * Sets the default spell checking language for SCAYT. Possible values are: + * `'en_US'`, `'en_GB'`, `'pt_BR'`, `'da_DK'`, + * `'nl_NL'`, `'en_CA'`, `'fi_FI'`, `'fr_FR'`, + * `'fr_CA'`, `'de_DE'`, `'el_GR'`, `'it_IT'`, + * `'nb_NO'`, `'pt_PT'`, `'es_ES'`, `'sv_SE'`. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * // Sets SCAYT to German. + * config.scayt_sLang = 'de_DE'; + * + * @cfg {String} [scayt_sLang='en_US'] + * @member CKEDITOR.config + */ + +/** + * Customizes the SCAYT dialog and SCAYT toolbar menu to show particular tabs and items. + * This setting must contain a `1` (enabled) or `0` + * (disabled) value for each of the following entries, in this precise order, + * separated by a comma (`','`): `'Options'`, `'Languages'`, and `'Dictionary'`. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * // Hides the "Languages" tab. + * config.scayt_uiTabs = '1,0,1'; + * + * @cfg {String} [scayt_uiTabs='1,1,1'] + * @member CKEDITOR.config + */ + +/** + * Sets the protocol for the WebSpellChecker service (`ssrv.cgi`) full path. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * // Defines the protocol for the WebSpellChecker service (ssrv.cgi) path. + * config.scayt_serviceProtocol = 'https'; + * + * @cfg {String} [scayt_serviceProtocol='http'] + * @member CKEDITOR.config + */ + +/** + * Sets the host for the WebSpellChecker service (`ssrv.cgi`) full path. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * // Defines the host for the WebSpellChecker service (ssrv.cgi) path. + * config.scayt_serviceHost = 'my-host'; + * + * @cfg {String} [scayt_serviceHost='svc.webspellchecker.net'] + * @member CKEDITOR.config + */ + +/** + * Sets the port for the WebSpellChecker service (`ssrv.cgi`) full path. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * // Defines the port for the WebSpellChecker service (ssrv.cgi) path. + * config.scayt_servicePort = '2330'; + * + * @cfg {String} [scayt_servicePort='80'] + * @member CKEDITOR.config + */ + +/** + * Sets the path to the WebSpellChecker service (`ssrv.cgi`). + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * // Defines the path to the WebSpellChecker service (ssrv.cgi). + * config.scayt_servicePath = 'my-path/ssrv.cgi'; + * + * @cfg {String} [scayt_servicePath='spellcheck31/script/ssrv.cgi'] + * @member CKEDITOR.config + */ + +/** + * Sets the URL to SCAYT core. Required to switch to the licensed version of SCAYT. + * + * Refer to [SCAYT documentation](http://wiki.webspellchecker.net/doku.php?id=migration:hosredfreetolicensedck) + * for more details. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * config.scayt_srcUrl = "http://my-host/spellcheck/lf/scayt/scayt.js"; + * + * @cfg {String} [scayt_srcUrl='//svc.webspellchecker.net/spellcheck31/lf/scayt3/ckscayt/ckscayt.js'] + * @member CKEDITOR.config + */ + +/** + * Links SCAYT to custom dictionaries. This is a string containing the dictionary IDs + * separated by commas (`','`). Available only for the licensed version. + * + * Refer to [SCAYT documentation](http://wiki.webspellchecker.net/doku.php?id=installationandconfiguration:customdictionaries:licensed) + * for more details. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * config.scayt_customDictionaryIds = '3021,3456,3478'; + * + * @cfg {String} [scayt_customDictionaryIds=''] + * @member CKEDITOR.config + */ + +/** + * Activates a User Dictionary in SCAYT. The user + * dictionary name must be used. Available only for the licensed version. + * + * Refer to [SCAYT documentation](http://wiki.webspellchecker.net/doku.php?id=installationandconfiguration:userdictionaries) + * for more details. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * config.scayt_userDictionaryName = 'MyDictionary'; + * + * @cfg {String} [scayt_userDictionaryName=''] + * @member CKEDITOR.config + */ + +/** + * Defines the order of SCAYT context menu items by groups. + * This must be a string with one or more of the following + * words separated by a pipe character (`'|'`): + * + * * `suggest` – The main suggestion word list. + * * `moresuggest` – The "More suggestions" word list. + * * `control` – SCAYT commands, such as "Ignore" and "Add Word". + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * Example: + * + * config.scayt_contextMenuItemsOrder = 'moresuggest|control|suggest'; + * + * @cfg {String} [scayt_contextMenuItemsOrder='suggest|moresuggest|control'] + * @member CKEDITOR.config + */ + +/** + * If set to `true`, it overrides the {@link CKEDITOR.editor#checkDirty checkDirty} functionality of CKEditor + * to fix SCAYT issues with incorrect `checkDirty` behavior. If set to `false`, + * it provides better performance on big preloaded text. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * config.scayt_handleCheckDirty = 'false'; + * + * @cfg {String} [scayt_handleCheckDirty='true'] + * @member CKEDITOR.config + */ + +/** + * Configures undo/redo behavior of SCAYT in CKEditor. + * If set to `true`, it overrides the undo/redo functionality of CKEditor + * to fix SCAYT issues with incorrect undo/redo behavior. If set to `false`, + * it provides better performance on text undo/redo. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * config.scayt_handleUndoRedo = 'false'; + * + * @cfg {String} [scayt_handleUndoRedo='true'] + * @member CKEDITOR.config + */ + +/** + * Enables the "Ignore All-Caps Words" option by default. + * You may need to {@link CKEDITOR.config#scayt_disableOptionsStorage disable option storing} for this setting to be + * effective because option storage has a higher priority. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * config.scayt_ignoreAllCapsWords = true; + * + * @since 4.5.6 + * @cfg {Boolean} [scayt_ignoreAllCapsWords=false] + * @member CKEDITOR.config + */ + +/** + * Enables the "Ignore Domain Names" option by default. + * You may need to {@link CKEDITOR.config#scayt_disableOptionsStorage disable option storing} for this setting to be + * effective because option storage has a higher priority. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * config.scayt_ignoreDomainNames = true; + * + * @since 4.5.6 + * @cfg {Boolean} [scayt_ignoreDomainNames=false] + * @member CKEDITOR.config + */ + +/** + * Enables the "Ignore Words with Mixed Case" option by default. + * You may need to {@link CKEDITOR.config#scayt_disableOptionsStorage disable option storing} for this setting to be + * effective because option storage has a higher priority. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * config.scayt_ignoreWordsWithMixedCases = true; + * + * @since 4.5.6 + * @cfg {Boolean} [scayt_ignoreWordsWithMixedCases=false] + * @member CKEDITOR.config + */ + +/** + * Enables the "Ignore Words with Numbers" option by default. + * You may need to {@link CKEDITOR.config#scayt_disableOptionsStorage disable option storing} for this setting to be + * effective because option storage has a higher priority. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * config.scayt_ignoreWordsWithNumbers = true; + * + * @since 4.5.6 + * @cfg {Boolean} [scayt_ignoreWordsWithNumbers=false] + * @member CKEDITOR.config + */ + +/** + * Disables storing of SCAYT options between sessions. Option storing will be turned off after a page refresh. + * The following settings can be used: + * + * * `'options'` – Disables storing of all SCAYT Ignore options. + * * `'ignore-all-caps-words'` – Disables storing of the "Ignore All-Caps Words" option. + * * `'ignore-domain-names'` – Disables storing of the "Ignore Domain Names" option. + * * `'ignore-words-with-mixed-cases'` – Disables storing of the "Ignore Words with Mixed Case" option. + * * `'ignore-words-with-numbers'` – Disables storing of the "Ignore Words with Numbers" option. + * * `'lang'` – Disables storing of the SCAYT spell check language. + * * `'all'` – Disables storing of all SCAYT options. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * Example: + * + * // Disabling one option. + * config.scayt_disableOptionsStorage = 'all'; + * + * // Disabling several options. + * config.scayt_disableOptionsStorage = ['lang', 'ignore-domain-names', 'ignore-words-with-numbers']; + * + * + * @cfg {String|Array} [scayt_disableOptionsStorage = ''] + * @member CKEDITOR.config + */ + +/** + * Specifies the names of tags that will be skipped while spell checking. This is a string containing tag names + * separated by commas (`','`). Please note that the `'style'` tag would be added to specified tags list. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * config.scayt_elementsToIgnore = 'del,pre'; + * + * @cfg {String} [scayt_elementsToIgnore='style'] + * @member CKEDITOR.config + */ + +/** + * Enables multi-language support in SCAYT. If set to `true`, turns on SCAYT multi-language support after loading the editor. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * config.scayt_multiLanguageMode = true; + * + * @cfg {Boolean} [scayt_multiLanguageMode=false] + * @member CKEDITOR.config + */ + +/** + * Defines additional styles for misspellings for specified languages. Styles will be applied only if + * the {@link CKEDITOR.config#scayt_multiLanguageMode} option is set to `true` and the [Language](http://ckeditor.com/addon/language) + * plugin is included and loaded in the editor. By default, all misspellings will still be underlined with the red waveline. + * + * Read more in the [documentation](#!/guide/dev_spellcheck) and see the [SDK sample](http://sdk.ckeditor.com/samples/spellchecker.html). + * + * Example: + * + * // Display misspellings in French language with green color and underlined with red waveline. + * config.scayt_multiLanguageStyles = { + * 'fr': 'color: green' + * }; + * + * // Display misspellings in Italian language with green color and underlined with red waveline + * // and German misspellings with red color only. + * config.scayt_multiLanguageStyles = { + * 'it': 'color: green', + * 'de': 'background-image: none; color: red' + * }; + * + * @cfg {Object} [scayt_multiLanguageStyles = {}] + * @member CKEDITOR.config + */ From 72efb59bd8d49b42f4f0530f0d210c420dca12d8 Mon Sep 17 00:00:00 2001 From: Julio Date: Wed, 29 Jun 2016 16:21:52 +0200 Subject: [PATCH 18/31] Hidden courses with status hidden see BT#11324 --- main/auth/courses.php | 2 +- main/inc/lib/course_category.lib.php | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/main/auth/courses.php b/main/auth/courses.php index ceff75e2e1..9b3b6495d9 100755 --- a/main/auth/courses.php +++ b/main/auth/courses.php @@ -216,7 +216,7 @@ switch ($action) { if (!$user_can_view_page) { api_not_allowed(true); } - + $courses_controller->courses_categories( $action, $categoryCode, diff --git a/main/inc/lib/course_category.lib.php b/main/inc/lib/course_category.lib.php index efd6d6c8ba..466961200a 100755 --- a/main/inc/lib/course_category.lib.php +++ b/main/inc/lib/course_category.lib.php @@ -677,6 +677,9 @@ function browseCoursesInCategory($category_code, $random_value = null, $limit = $courseVisibility = $courseInfo['visibility']; $visibilityCondition = ' AND course.visibility <> 1'; } + + $visibilityCondition .= ' AND course.visibility <> '.COURSE_VISIBILITY_HIDDEN; + if (!empty($random_value)) { $random_value = intval($random_value); @@ -936,12 +939,8 @@ function searchCategoryById($list) */ function getLimitArray() { - $pageCurrent = isset($_REQUEST['pageCurrent']) ? - intval($_GET['pageCurrent']) : - 1; - $pageLength = isset($_REQUEST['pageLength']) ? - intval($_GET['pageLength']) : - 12; + $pageCurrent = isset($_REQUEST['pageCurrent']) ? intval($_GET['pageCurrent']) : 1; + $pageLength = isset($_REQUEST['pageLength']) ? intval($_GET['pageLength']) : 12; return array( 'start' => ($pageCurrent - 1) * $pageLength, 'current' => $pageCurrent, From f332ff75180eabb8384a3a7adf15c650fdc7bc9d Mon Sep 17 00:00:00 2001 From: Julio Date: Wed, 29 Jun 2016 16:22:41 +0200 Subject: [PATCH 19/31] Remove hidden condition --- main/template/default/auth/courses_categories.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/main/template/default/auth/courses_categories.php b/main/template/default/auth/courses_categories.php index 39cad3fa7c..a775e832ca 100755 --- a/main/template/default/auth/courses_categories.php +++ b/main/template/default/auth/courses_categories.php @@ -189,12 +189,6 @@ if ($showCourses && $action != 'display_sessions') { if (!empty($browse_courses_in_category)) { foreach ($browse_courses_in_category as $course) { - $course_hidden = ($course['visibility'] == COURSE_VISIBILITY_HIDDEN); - - if ($course_hidden) { - continue; - } - $user_registerd_in_course = CourseManager::is_user_subscribed_in_course($user_id, $course['code']); $user_registerd_in_course_as_teacher = CourseManager::is_course_teacher($user_id, $course['code']); $user_registerd_in_course_as_student = ($user_registerd_in_course && !$user_registerd_in_course_as_teacher); From 1aa243f8d27076a897cfbc95f48d3f48e622b62a Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Wed, 29 Jun 2016 22:42:08 -0500 Subject: [PATCH 20/31] Update language terms --- main/lang/english/trad4all.inc.php | 37 +++++++++--- main/lang/french/trad4all.inc.php | 93 ++++++++++++++++++++++++------ main/lang/spanish/trad4all.inc.php | 30 ++++++++-- 3 files changed, 129 insertions(+), 31 deletions(-) diff --git a/main/lang/english/trad4all.inc.php b/main/lang/english/trad4all.inc.php index cac18c00a6..19be1cc618 100644 --- a/main/lang/english/trad4all.inc.php +++ b/main/lang/english/trad4all.inc.php @@ -2503,7 +2503,6 @@ $TitleManipulateStudentPublication = "Edit assignment"; $EnterDataNewChapter = "Adding a section to the course"; $EnterDataNewModule = "Enter information for section"; $CreateNewStep = "Create new rich media page"; -$NewDocument = "Rich media page / activity"; $UseAnExistingResource = "Or use an existing resource :"; $Position = "In table of contents"; $NewChapterCreated = "A new section has now been created. You may continue by adding a section or step."; @@ -2539,7 +2538,7 @@ $NoItemSelected = "Select a learning object in the table of contents"; $NewDocumentCreated = "The rich media page/activity has been added to the course"; $EditCurrentChapter = "Edit the current section"; $ditCurrentModule = "Edit the current section"; -$CreateTheDocument = "Adding a rich media page/activity to the course"; +$CreateTheDocument = "Create a new document"; $MoveTheCurrentDocument = "Move the current document"; $EditTheCurrentDocument = "Edit the current document"; $Warning = "Warning !"; @@ -6980,7 +6979,7 @@ $EventType = "Event type"; $WamiFlashDialog = "It will display a dialog box which asks for your permission to access the microphone, answer yes and close the dialog box (if you do not want to appear again, before closing check remember)"; $WamiStartRecorder = "Start recording by pressing the microphone and stop it by pressing again. Each time you do this will generate a file."; $WamiNeedFilename = "Before you activate recording it is necessary a file name."; -$InputNameHere = "Enter name here"; +$InputNameHere = "Enter filename here"; $Reload = "Reload"; $SelectGradeModel = "Select a calification model"; $AllMustWeight100 = "The sum of all values must be 100"; @@ -7215,7 +7214,7 @@ $CourseRssTitle = "Course RSS"; $CourseRssDescription = "RSS feed for all course notifications"; $AllowPublicCertificates = "Learner certificates are public"; $GlossaryTermUpdated = "Term updated"; -$DeleteAllGlossaryTerms = "Delete all terms"; +$DeleteAllGlossaryTerms = "Delete all terms before import."; $PortalHomepageEdited = "Portal homepage updated"; $UserRegistrationTitle = "User registration"; $UserRegistrationComment = "Actions to be fired when a user registers to the platform"; @@ -7720,10 +7719,10 @@ $DeleteLegal = "Delete legal agreement"; $LegalAccepted = "Legal accepted"; $LoadTermConditionsSectionTitle = "Load term conditions section"; $LoadTermConditionsSectionDescription = "The legal agreement will appear during the login or when enter to a course."; -$SendLegalSubject = "Your learner contract is ready to be signed"; -$SendLegalDescriptionToUrlX = "Hello, +$SendTermsSubject = "Your terms and conditions are ready to be signed"; +$SendTermsDescriptionToUrlX = "Hello, -Your tutor sent you your learner contract. You can go sign it following this url: %s"; +Your tutor sent you your terms and conditions. You can sign it following this url: %s"; $UserXSignedTheAgreement = "User %s signed the agreement."; $UserXSignedTheAgreementTheY = "User %s signed the agreement the %s."; $ShowTermsIfProfileCompletedTitle = "Terms and conditions only if profile complete"; @@ -7731,11 +7730,33 @@ $ShowTermsIfProfileCompletedComment = "By enabling this option, terms and condit $EnableProfileUsersAddressGeolocalizationTitle = "Enable user's geolocalization"; $EnableProfileUsersAddressGeolocalizationComment = "Enable user's address field and show it on a map using geolocalization features"; $ProfileIsNotCompleted = "You must first fill your profile to continue"; +$TermActivatedIsNeededDescription = "The terms and conditions have not yet been validated by your tutor."; $DiagnosisManagement = "Diagnosis management"; -$TermYourProfileIsNotCompleted = "You must first fill your profile to enable the contract validation."; +$TermYourProfileIsNotCompleted = "You must first fill your profile to enable the terms and conditions validation."; $Diagnostic = "Diagnostic"; $AllowShowSkypeAccountTitle = "Allow show the user Skype account"; $AllowShowSkypeAccountComment = "Add a link on the user social block allowing start a chat by Skype"; $AllowShowLinkedInUrlTitle = "Allow show the user LinkedIn URL"; $AllowShowLinkedInUrlComment = "Add a link on the user social block, allowing visit the user's LinkedIn profile"; +$LaunchVideoConferenceRoom = "Launch videoconference room"; +$VideoConference = "Videoconference"; +$TermsDuplicatedInFile = "Terms duplicated in file"; +$GlossaryTermAlreadyExists = "Term already exists"; +$LinkedInUrl = "LinkedIn profile URL"; +$SaveTheCorrectAnswersForTheNextAttempt = "Save the correct answer for the next attempt"; +$TranslateThisTerm = "Translate this term"; +$OnlyActiveSubLanguagesAreListed = "Only active sub-languages appear in this list"; +$Translation = "Translation"; +$IfThisTranslationExistsThisWillReplaceTheTerm = "If this term has already been translated, this operation will replace its translation for this sub-language."; +$LastConnection = "Last connection"; +$HisProfileIs = "His profile is"; +$UpdateExistingGlossaryTerms = "Update existing terms."; +$TermsUpdated = "Terms updated"; +$TermsAdded = "Terms added"; +$TeacherTimeReportBySession = "Teachers time report by session"; +$NumberOfWorks = "Number of works"; +$LastWork = "Last work"; +$WaitingModeration = "Waiting for moderation"; +$WorksInSessionReport = "Works in session report"; +$Files = "Files"; ?> \ No newline at end of file diff --git a/main/lang/french/trad4all.inc.php b/main/lang/french/trad4all.inc.php index 29de7a99f9..5ad59d3db4 100644 --- a/main/lang/french/trad4all.inc.php +++ b/main/lang/french/trad4all.inc.php @@ -742,7 +742,7 @@ $DocumentsWillBeAddedToo = "Les documents seront également ajoutés"; $ToExportLearnpathWithQuizYouHaveToSelectQuiz = "Si vous désirez exporter un cours contenant des tests, il est nécessaire d'inclure ces tests dans l'export en les sélectionnant dans la liste des tests."; $ArchivesDirectoryNotWriteableContactAdmin = "Le répertoire d'archives, utilisé par cet outil, ne dispose pas des accès en écriture attendus. Veuillez contacter l'administrateur de la plateforme à ce sujet."; $DestinationCourse = "Cours de destination"; -$ConvertToMultipleAnswer = "Convertir à réponses multiples"; +$ConvertToMultipleAnswer = "Convertir en question à réponses multiples (QRM)"; $CasMainActivateComment = "Activer l'authentification CAS permettra aux utilisateurs de s'identifier à l'aide de leur compte CAS
    Vous trouverez dans les Plugin un bouton 'Login CAS', paramétrable, qui s'ajoutera sur la page d'accueil de votre campus Chamilo."; $UsersRegisteredInAnyGroup = "Utilisateurs enregistrés dans n'importe quel groupe"; $Camera = "Caméra"; @@ -2496,7 +2496,6 @@ $TitleManipulateStudentPublication = "Éditer ce document"; $EnterDataNewChapter = "Saisissez les informations de ce nouveau chapitre"; $EnterDataNewModule = "Saisissez les informations de ce nouveau chapitre"; $CreateNewStep = "Créer une nouvelle étape :"; -$NewDocument = "Nouveau document"; $UseAnExistingResource = "Ou utiliser une ressource existante :"; $Position = "Position"; $NewChapterCreated = "Le nouveau chapitre a bien été créé. Vous pouvez maintenant ajouter un nouveau chapitre ou une nouvelle étape dans celui-ci."; @@ -2532,7 +2531,7 @@ $NoItemSelected = "Pour afficher un élément dans cette zone, veuillez cliquer $NewDocumentCreated = "Le nouveau document a bien été créé."; $EditCurrentChapter = "Éditer ce chapitre"; $ditCurrentModule = "Éditer le chapitre actuel"; -$CreateTheDocument = "Créer le document"; +$CreateTheDocument = "Créer un nouveau document"; $MoveTheCurrentDocument = "Déplacer le document courant"; $EditTheCurrentDocument = "Éditer le document actuel"; $Warning = "Attention !"; @@ -2681,7 +2680,7 @@ $UsedInSeveralExercises = "Attention ! Cette question et ses réponses sont util $ModifyInAllExercises = "pour l'ensemble des tests"; $ModifyInThisExercise = "uniquement pour le test courant"; $AnswerType = "Type de réponse"; -$MultipleSelect = "Réponses multiples"; +$MultipleSelect = "Question à réponses multiples (QRM)"; $FillBlanks = "Remplir les blancs"; $Matching = "Apparier"; $ReplacePicture = "Remplacer l'image"; @@ -2909,7 +2908,7 @@ $ShowResultsToStudents = "Montrer le résultat à l'apprenant"; $ProcedToQuestions = "Poursuivre avec la création de questions"; $AddQuestionToExercise = "Ajouter la question au test"; $PresentationQuestions = "Présentation des questions"; -$UniqueAnswer = "Choix multiple"; +$UniqueAnswer = "Question à réponse unique (QRU)"; $MultipleAnswer = "Réponses multiples"; $ReachedOneAttempt = "Vous ne pouvez pas passer ce test car vous avez déjà effectué une première tentative."; $QuestionsPerPage = "Questions par page"; @@ -2974,7 +2973,7 @@ $GradebookListOfStudentsReports = "Rapport de liste d'étudiants"; $CreateDir = "Créer un répertoire"; $Name = "Nom"; $Comment = "Commentaire"; -$Visible = "Visible/invisible"; +$Visible = "Visible"; $NewDir = "nom du nouveau répertoire"; $DirCr = "Répertoire créé"; $Download = "Télécharger"; @@ -2990,10 +2989,10 @@ $DelImage = "Supprimer la photo"; $Code = "Code cours"; $Up = "Monter"; $Down = "descendre"; -$TimeReportForCourseX = "Rapport de temps pour le cours %s"; +$TimeReportForCourseX = "Temps passé dans %s"; $Theme = "Thème graphique"; $TheListIsEmpty = "La liste est vide."; -$UniqueSelect = "Choix multiple"; +$UniqueSelect = "Question à réponse unique (QRU)"; $CreateCategory = "Créer une catégorie"; $SendFile = "Importer le document"; $SaveChanges = "Enregistrer les modifications"; @@ -3060,7 +3059,7 @@ $BackHome = "Retour à la page d'accueil de"; $Propositions = "Propositions d'amélioration de"; $Maj = "Mise à jour"; $Modify = "modifier"; -$Invisible = "Rendre invisible"; +$Invisible = "Invisible"; $Save = "Enregistrer"; $Move = "Déplacer"; $Help = "Aide"; @@ -4856,7 +4855,7 @@ $RemoveAnswer = "Supprimer l'option"; $AddAnswer = "Ajouter une option"; $DisplayAnswersHorVert = "Afficher"; $AnswerOptions = "Réponses possibles"; -$MultipleResponse = "Réponses multiples"; +$MultipleResponse = "Question à réponses multiples (QRM)"; $Dropdown = "Liste déroulante"; $Pagebreak = "Séparateur de page"; $QuestionNumber = "Numéro de question"; @@ -4898,7 +4897,7 @@ $CompleteReportDetail = "Dans ce rapport, vous pouvez obtenir une vue d'ensemble $DetailedReportByUserDetail = "Dans ce rapport, vous pouvez voir toutes les réponses spécifiques à un utilisateur."; $DetailedReportByQuestionDetail = "Dans ce rapport, vous pouvez voir les résultats question par question."; $ReminderResendToAllUsers = "Envoyer un rappel à tous les utilisateurs de l'enquête. Si vous ne cochez pas cette case, seuls les nouveaux utilisateurs vont recevoir un email."; -$Multiplechoice = "Choix multiple"; +$Multiplechoice = "Question à réponse unique (QRU)"; $Score = "Score"; $Invite = "Invités"; $MaximumScore = "Score maximum"; @@ -5998,7 +5997,7 @@ $Off = "Off"; $webserver = "serveur web"; $mysql = "MySQL"; $NotInserted = "Non inséré"; -$Multipleresponse = "Réponse multiple"; +$StudentBoss = "Supérieur (n+1)"; $EnableMathJaxComment = "Activer le visualiseur de formules mathématiques MathJax. Ce paramètre n'est utile que si ASCIIMathML ou ASCIISVG sont activés."; $YouCanNowLoginAtXUsingTheLoginAndThePasswordYouHaveProvided = "Vous pouvez vous connecter sur %s en utilisant l'identifiant et le mot de passe qui vous ont été fournis."; $HaveFun = "amusez-vous,"; @@ -6504,7 +6503,7 @@ $Steps = "Étapes"; $OriginalValue = "Valeur originale"; $ChooseAnAnswer = "Sélectionnez une réponse"; $ImportExercise = "Importer exercice"; -$MultipleChoiceMultipleAnswers = "Choix multiple, réponses multiples"; +$MultipleChoiceMultipleAnswers = "Question à réponses multiples (QRM)"; $MultipleChoiceUniqueAnswer = "Choix multiple, réponse unique"; $HotPotatoesFiles = "Fichiers HotPotatoes"; $OAR = "Zones à éviter"; @@ -6938,7 +6937,7 @@ $CopyOnlySessionItems = "Copier seulement les élémenents de la session"; $FirstLetterCourseTitle = "Première lettre (title)"; $NumberOfPublishedExercises = "# d'exerices publiés"; $NumberOfPublishedLps = "# de parcours publiés"; -$ChatConnected = "Messagerie instantanée (connecté)"; +$ChatConnected = "Messagerie (connecté)"; $ChatDisconnected = "Messagerie (déconnecté)"; $AddCourseDescription = "Décrire le cours"; $ThingsToDo = "Premiers pas suggérés"; @@ -6969,7 +6968,7 @@ $EventType = "Type d'événement"; $WamiFlashDialog = "Cet outil va afficher un boîte de dialogue qui vous demandera de confirmer l'accès à votre microphone. Veuillez répondre \"oui\" et fermer la boîte de dialogue (si vous ne voulez pas voir réapparaître ce message veuillez sélectionner l'option \"se souvenir de mon choix\" avant de fermer)"; $WamiStartRecorder = "Commencer l'enregistrement en appuyant sur le microphone et arrêter l'enregistrement en appuyant une nouvel fois. Un nouveau ficher sera généré à chaque fois."; $WamiNeedFilename = "Avant d'activer l'enregistrement il faut donner un nom de fichier."; -$InputNameHere = "Entrer votre nom ici"; +$InputNameHere = "Introduisez le nom de l'enregistrement ici"; $Reload = "Rafraîchir"; $SelectGradeModel = "Sélectionnez un modèle de note"; $AllMustWeight100 = "La somme de toutes les valeurs doit être égale à 100"; @@ -7077,7 +7076,7 @@ $EventTypeName = "Nom du type d'événement"; $HideCampusFromPublicPlatformsList = "Masquer le campus de la liste public des plates-formes"; $ChamiloOfficialServicesProviders = "Fournisseurs officiels de Chamilo"; $NoNegativeScore = "Pas de points négatifs"; -$GlobalMultipleAnswer = "Réponses multiples à pondération globale"; +$GlobalMultipleAnswer = "Question à réponses multiples (QRM) avec pondération globale"; $Zombies = "Zombies"; $ActiveOnly = "Actif seulement"; $AuthenticationSource = "Identification"; @@ -7490,7 +7489,7 @@ $ResetPasswordTokenLimitComment = "La quantité de secondes avant que la clef g $ViewMyCoursesListBySessionTitle = "Vue des sessions par cours"; $ViewMyCoursesListBySessionComment = "Active une nouvelle page \"Mes cours\" où les sessions apparaîssent comme partie des cours, plutôt que l'inverse."; $DownloadCertificatePdf = "Télécharger certificat en PDF"; -$EnterPassword = "Introduir mot de passe"; +$EnterPassword = "Introduire mot de passe"; $DownloadReportPdf = "Télécharger rapport en PDF"; $SkillXEnabled = "Compétence \"%s\" activée"; $SkillXDisabled = "Compétence \"%s\" désactivée"; @@ -7651,5 +7650,61 @@ $RecordAudio = "Enregistrement audio"; $StartRecordingAudio = "Lancer l'enregistrement"; $StopRecordingAudio = "Arrêter l'enregistrement"; $SaveRecordedAudio = "Sauvegarder l'audio enregistré"; -$GradeFromX = "Bulletin pour le cours: %s"; -?> +$GradeFromX = "Bulletin du cours: %s"; +$TitleMandatory = "Le titre est obligatoire"; +$NoCourseCategorySupplied = "Aucune catégorie de cours n'a été indiquée"; +$ForumStartDate = "Date de publication"; +$ForumEndDate = "Date de fermeture"; +$ForumStartDateComment = "Le forum sera publié à cette date"; +$ForumEndDateComment = "Après cette date, le forum sera automatiquement fermé"; +$ModeratedForum = "Forum modéré"; +$DiagnosisFilledSubject = "Diagnostique complété"; +$DiagnosisFilledDescription = "Le diagnostique a été complété avec succès"; +$UserXHasFilledTheDiagnosis = "L'utilisateur %s a complété son diagnostique"; +$UserXHasFilledTheDiagnosisDescription = "L'utilisateur %s a complété son diagnostique sur la plateforme et celui-ci attend votre révision."; +$SendLegal = "Envoyer l'accord légal"; +$DeleteLegal = "Supprimer l'accord légal"; +$LegalAccepted = "Accord légal accepté"; +$LoadTermConditionsSectionTitle = "Charger la section de termes et conditions"; +$LoadTermConditionsSectionDescription = "L'accord légal apparaîtra au moment du login ou lorsque l'apprenant entre dans le cours."; +$SendTermsSubject = "Votre contrat d'apprentissage est déjà signé."; +$SendTermsDescriptionToUrlX = "Bonjour, +Votre tuteur vous a envoyé votre contrat d'apprentissage. Vous pouvez le signer en suivant l'URL suivante: %s"; +$UserXSignedTheAgreement = "L'utilisateur %s a signé le contrat d'apprentissage."; +$UserXSignedTheAgreementTheY = "L'utilisateur %s a signé son contrat d'apprentissage le %s."; +$ShowTermsIfProfileCompletedTitle = "Contrat d'apprentissage bloqué par la complétude du profil"; +$ShowTermsIfProfileCompletedComment = "En activant cette option, le contrat d'apprentissage sera disponible pour l'utilisateur seulement lorsqu'il aura complété les champs de profil extra préfixés par 'terms_' et marqués comme visibles."; +$EnableProfileUsersAddressGeolocalizationTitle = "Activer la géolocalisation"; +$EnableProfileUsersAddressGeolocalizationComment = "Activer un champ d'adresse pour l'utilisateur et situer son adresse sur une carte en utilisant la géolocalisation"; +$ProfileIsNotCompleted = "Vous devez d'abord compléter votre profil pour continuer"; +$TermActivatedIsNeededDescription = "Le contrat d'apprentissage n'a pas encore été validé par votre tuteur."; +$DiagnosisManagement = "Gestion des diagnostiques"; +$TermYourProfileIsNotCompleted = "Vous devez d'abord compléter votre profil pour activer la validation du contrat d'apprentissage."; +$Diagnostic = "Diagnostique"; +$AllowShowSkypeAccountTitle = "Permettre l'affichage du compte Skype de l'utilisateur"; +$AllowShowSkypeAccountComment = "Ajouter un lien dans le block utilisateur sur le réseau social pour permettre le démarrage d'une session de chat via Skype."; +$AllowShowLinkedInUrlTitle = "Permettre l'affichage de l'URL LinkedIn"; +$AllowShowLinkedInUrlComment = "Ajouter un lien dans le bloc de l'utilisateur dans le réseay social pour permettre aux visiteurs de voir le profil LinkedIn de l'utilisateur."; +$LaunchVideoConferenceRoom = "Lancer une salle de vidéoconférence"; +$VideoConference = "Vidéoconférence"; +$TermsDuplicatedInFile = "Termes dupliqués dans le fichier"; +$GlossaryTermAlreadyExists = "Ce terme existe déjà"; +$LinkedInUrl = "URL de profil LinkedIn"; +$SaveTheCorrectAnswersForTheNextAttempt = "Garder les réponses correctes pour l'essai suivant"; +$TranslateThisTerm = "Traduire ce terme"; +$OnlyActiveSubLanguagesAreListed = "Seules les sous-langues actives sont listées ici"; +$Translation = "Traduction"; +$IfThisTranslationExistsThisWillReplaceTheTerm = "Si ce terme a déjà été traduit, cette opération remplacera la traduction existante pour ce sous-langage."; +$LastConnection = "Dernière connexion"; +$HisProfileIs = "Son profil est"; +$YouCanAssignATutorInThisLinkX = "Vous pouvez assigner un tuteur à l'adresse suivante: %s"; +$UpdateExistingGlossaryTerms = "Mettre à jour les termes existants"; +$TermsUpdated = "Termes mis à jour"; +$TermsAdded = "Termes ajoutés"; +$TeacherTimeReportBySession = "Rapport de temps des enseignants par session"; +$NumberOfWorks = "NB Travaux demandés"; +$LastWork = "Dernier travail"; +$WaitingModeration = "En attente de modération"; +$WorksInSessionReport = "Travaux dans le rapport de session"; +$Files = "Fichiers"; +?> \ No newline at end of file diff --git a/main/lang/spanish/trad4all.inc.php b/main/lang/spanish/trad4all.inc.php index 44ac704118..b5d3694a02 100644 --- a/main/lang/spanish/trad4all.inc.php +++ b/main/lang/spanish/trad4all.inc.php @@ -2503,7 +2503,6 @@ $TitleManipulateStudentPublication = "Modificar la tarea actual"; $EnterDataNewChapter = "Introduzca los datos de la sección"; $EnterDataNewModule = "Introduzca los datos de la sección"; $CreateNewStep = "Crear un documento :"; -$NewDocument = "Cree e incorpore a su lección documentos con componentes multimedia"; $UseAnExistingResource = "O usar un recurso ya existente :"; $Position = "Posición"; $NewChapterCreated = "La sección ha sido creada. Ahora puede incorporarle objetos de aprendizaje o crear otra sección"; @@ -2539,7 +2538,7 @@ $NoItemSelected = "Seleccione un objeto de aprendizaje de la tabla contenidos"; $NewDocumentCreated = "El documento ha sido creado."; $EditCurrentChapter = "Editar la sección actual"; $ditCurrentModule = "Editar la sección actual"; -$CreateTheDocument = "Cree e incorpore a su lección documentos con componentes multimedia"; +$CreateTheDocument = "Crear un nuevo documento"; $MoveTheCurrentDocument = "Mover el documento actual"; $EditTheCurrentDocument = "Editar el documento actual"; $Warning = "¡ Atención !"; @@ -7739,8 +7738,8 @@ $DeleteLegal = "Borrar acuerdo legal"; $LegalAccepted = "Acuerdo legal aceptado"; $LoadTermConditionsSectionTitle = "Cargar la sección de términos y condiciones"; $LoadTermConditionsSectionDescription = "El acuerdo legal aparecerá durante el login o cuando entre a un curso."; -$SendLegalSubject = "Su contrato de aprendizaje está listo para firmar."; -$SendLegalDescriptionToUrlX = "Hola, +$SendTermsSubject = "Su contrato de aprendizaje está listo para firmar."; +$SendTermsDescriptionToUrlX = "Hola, Su tutor le ha enviado s contrato de aprendizaje. Puede ir a firmarlo siguiendo esta URL: %s"; $UserXSignedTheAgreement = "El usuario %s ha firmado el acuerdo."; @@ -7750,6 +7749,7 @@ $ShowTermsIfProfileCompletedComment = "Activando esta opción, los términos y c $EnableProfileUsersAddressGeolocalizationTitle = "Activar geolocalización"; $EnableProfileUsersAddressGeolocalizationComment = "Activar un campo de dirección en el perfil del usuario y ubicar su dirección en un mapa usando la geolocalización"; $ProfileIsNotCompleted = "Debe llenar su perfil para seguir adelante"; +$TermActivatedIsNeededDescription = "Los términos y condiciones no han sido validados por su tutor"; $DiagnosisManagement = "Gestión de diagnóstico"; $TermYourProfileIsNotCompleted = "Debe completar su perfil para acceder a la validación del contrato."; $Diagnostic = "Diagnóstico"; @@ -7757,4 +7757,26 @@ $AllowShowSkypeAccountTitle = "Permitir mostrar la cuenta de usuario de Skype"; $AllowShowSkypeAccountComment = "Añadir un enlace en el bloque social de usuario que permite iniciar una conversación por Skype"; $AllowShowLinkedInUrlTitle = "Permitir mostrar la URL de LinkedIn del usuario"; $AllowShowLinkedInUrlComment = "Añadir un enlace en el bloque social del usuario, lo que permite visitar el perfil del usuario en LinkedIn"; +$LaunchVideoConferenceRoom = "Lanzar una sala de video conferencia"; +$VideoConference = "Video conferencia"; +$TermsDuplicatedInFile = "Términos duplicados en el archivo"; +$GlossaryTermAlreadyExists = "El término ya existe"; +$LinkedInUrl = "URL de perfil LinkedIn"; +$SaveTheCorrectAnswersForTheNextAttempt = "Guardar la respuesta correcta para el siguiente intento"; +$TranslateThisTerm = "Traducir este término"; +$OnlyActiveSubLanguagesAreListed = "Solo los sub-idiomas activos aparecen en la lista"; +$Translation = "Traducción"; +$IfThisTranslationExistsThisWillReplaceTheTerm = "Si este término ha sido traducido anteriormente, esta operación remplazará su traducción para este sub-idioma."; +$LastConnection = "Última conexión"; +$HisProfileIs = "Su perfil es"; +$YouCanAssignATutorInThisLinkX = "Puede asignar un tutor siguiendo este enlace: %s"; +$UpdateExistingGlossaryTerms = "Actualizar términos existentes"; +$TermsUpdated = "Términos actualizados"; +$TermsAdded = "Términos añadidos"; +$TeacherTimeReportBySession = "Reporte de tiempos de profesores por sesión"; +$NumberOfWorks = "Número de tareas"; +$LastWork = "Última tarea"; +$WaitingModeration = "Esperando moderación"; +$WorksInSessionReport = "Tareas en reporte de sesión"; +$Files = "Archivos"; ?> \ No newline at end of file From fabc20a486100b187586ff1af81ea2f06de6991f Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Thu, 30 Jun 2016 09:44:33 -0500 Subject: [PATCH 21/31] Fix number of works and last work date in teachers time by session report - refs BT#11032 --- main/admin/teachers_time_by_session_report.php | 3 ++- .../Entity/Repository/CStudentPublicationRepository.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/main/admin/teachers_time_by_session_report.php b/main/admin/teachers_time_by_session_report.php index 39860d928e..f8018ae3de 100644 --- a/main/admin/teachers_time_by_session_report.php +++ b/main/admin/teachers_time_by_session_report.php @@ -80,7 +80,6 @@ if ($session) { $works = $em ->getRepository('ChamiloCourseBundle:CStudentPublication') ->findByTeacher($user, $course, $session->getId()); - $lastWork = array_pop($works); $usersInfo[$user->getId()][$course->getId() . '_number_of_students'] = $sessionCourse->getNbrUsers(); $usersInfo[$user->getId()][$course->getId() . '_number_of_works'] = count($works); @@ -88,6 +87,8 @@ if ($session) { Tracking::get_time_spent_on_the_course($user->getId(), $course->getId(), $session->getId()) ); + $lastWork = array_pop($works); + if (!$lastWork) { continue; } diff --git a/src/Chamilo/CourseBundle/Entity/Repository/CStudentPublicationRepository.php b/src/Chamilo/CourseBundle/Entity/Repository/CStudentPublicationRepository.php index 1ef4fb6e78..a8d3241efc 100644 --- a/src/Chamilo/CourseBundle/Entity/Repository/CStudentPublicationRepository.php +++ b/src/Chamilo/CourseBundle/Entity/Repository/CStudentPublicationRepository.php @@ -40,7 +40,7 @@ class CStudentPublicationRepository extends EntityRepository $qb->expr()->eq('w.userId', ':user') ) ) - ->orderBy('w.sentDate', 'DESC') + ->orderBy('w.sentDate', 'ASC') ->setParameters([ 'course' => intval($course->getId()), 'session' => intval($sessionId), From c63c7060c3c7a920dede403edd561bdd9e125877 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Thu, 30 Jun 2016 10:16:34 -0500 Subject: [PATCH 22/31] Fix get_time_spent_on_the_platform - refs BT#11032 --- main/inc/lib/tracking.lib.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/main/inc/lib/tracking.lib.php b/main/inc/lib/tracking.lib.php index 335719b1c7..792571cfe2 100755 --- a/main/inc/lib/tracking.lib.php +++ b/main/inc/lib/tracking.lib.php @@ -1352,16 +1352,18 @@ class Tracking $timeFilter = 'last_week'; } - $today = date('Y-m-d H:i:s'); + $today = new DateTime('now', new DateTimeZone('UTC')); switch ($timeFilter) { case 'last_7_days': - $new_date = date('Y-m-d H:i:s', strtotime('-7 day')); - $condition_time = ' AND (login_date >= "'.$new_date.'" AND logout_date <= "'.$today.'") '; + $newDate = new DateTime('-7 day', new DateTimeZone('UTC')); + $condition_time = " AND (login_date >= '{$newDate->format('Y-m-d H:i:s')}'"; + $condition_time .= " AND logout_date <= '{$today->format('Y-m-d H:i:s')}') "; break; case 'last_30_days': $new_date = date('Y-m-d H:i:s', strtotime('-30 day')); - $condition_time = ' AND (login_date >= "'.$new_date.'" AND logout_date <= "'.$today.'") '; + $condition_time = " AND (login_date >= '{$new_date->format('Y-m-d H:i:s')}'"; + $condition_time .= "AND logout_date <= '{$today->format('Y-m-d H:i:s')}') "; break; case 'custom': if (!empty($start_date) && !empty($end_date)) { From 57ccd9a4c548bb00e2045276f5e20c6314cd8ac4 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Thu, 30 Jun 2016 10:19:02 -0500 Subject: [PATCH 23/31] Calc ALL spent teachers time in platform in teachers time by session report - refs BT#11032 --- main/admin/teachers_time_by_session_report.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/admin/teachers_time_by_session_report.php b/main/admin/teachers_time_by_session_report.php index f8018ae3de..7c6117c479 100644 --- a/main/admin/teachers_time_by_session_report.php +++ b/main/admin/teachers_time_by_session_report.php @@ -61,7 +61,7 @@ if ($session) { 'code' => $user->getOfficialCode(), 'complete_name' => $user->getCompleteName(), 'time_in_platform' => api_time_to_hms( - Tracking::get_time_spent_on_the_platform($user->getId()) + Tracking::get_time_spent_on_the_platform($user->getId(), 'ever') ), 'first_connection' => Tracking::get_first_connection_date($user->getId()), 'last_connection' => Tracking::get_last_connection_date($user->getId()), From af0b2ae615c933c9ee9c7541c6e484a40274038a Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Thu, 30 Jun 2016 11:15:23 -0500 Subject: [PATCH 24/31] Fix get_time_spent_on_the_platform - refs BT#11032 --- main/inc/lib/tracking.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/inc/lib/tracking.lib.php b/main/inc/lib/tracking.lib.php index 792571cfe2..28e7d9350a 100755 --- a/main/inc/lib/tracking.lib.php +++ b/main/inc/lib/tracking.lib.php @@ -1361,8 +1361,8 @@ class Tracking $condition_time .= " AND logout_date <= '{$today->format('Y-m-d H:i:s')}') "; break; case 'last_30_days': - $new_date = date('Y-m-d H:i:s', strtotime('-30 day')); - $condition_time = " AND (login_date >= '{$new_date->format('Y-m-d H:i:s')}'"; + $newDate = new DateTime('-30 days', new DateTimeZone('UTC')); + $condition_time = " AND (login_date >= '{$newDate->format('Y-m-d H:i:s')}'"; $condition_time .= "AND logout_date <= '{$today->format('Y-m-d H:i:s')}') "; break; case 'custom': From f316e71b089c6383ab7372fda6f50167318771b4 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Thu, 30 Jun 2016 17:18:00 -0500 Subject: [PATCH 25/31] Update installation guide to add details about previous versions tables - refs CT#8279 --- documentation/installation_guide.html | 4 +++- documentation/installation_guide_es_ES.html | 13 +++++++------ documentation/installation_guide_fr_FR.html | 6 ++++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/documentation/installation_guide.html b/documentation/installation_guide.html index d9a5708cce..2b786d4d19 100755 --- a/documentation/installation_guide.html +++ b/documentation/installation_guide.html @@ -328,6 +328,7 @@ Please note that if you (unluckily) upgraded from any of the 1.9 versions to 1.1

    3.2 Upgrading from Chamilo 1.9.x

      +
    • make sure you don't have tables from previous versions of Chamilo still hanging around. These can cause the upgrade to fail. In particular, tables from versions 1.8.* could have multiple tables for each course, resulting in many tables with the same prefix. Only tables without prefix or with a "c_" prefix exist in 1.9 and superior versions. Make sure none of these tables persist. Take a backup of your database (just in case) and delete these prefixed tables (drop table ...).
    • check that you haven't left any customised stylesheet or image (if you have, make sure you keep a copy on the side*)
    • download the Chamilo 1.10 install package from the Chamilo download page
    • unzip the new files of Chamilo 1.10 over the files of the older version (or unzip the files in one folder and then copy the files from there to the older version's directory)
    • @@ -361,7 +362,8 @@ Do not delete the previous Chamilo installation directory before installing the new one. The upgrade process should take care of all unrequired folders.

      3.2 Upgrading from Chamilo 1.8.x

      - To upgrade from version of Chamilo prior to 1.9.0, you will need to first upgrade them to 1.9.10.2, then upgrade again (separately) to 1.10.x + To upgrade from version of Chamilo prior to 1.9.0, you will need to first upgrade them to 1.9.10.x, then upgrade again (separately) to 1.10.x. + You can find the 1.9.10.x packages here: https://github.com/chamilo/chamilo-lms/releases

      3.5 In both last cases

      diff --git a/documentation/installation_guide_es_ES.html b/documentation/installation_guide_es_ES.html index 96ba9d2732..5241916fbf 100755 --- a/documentation/installation_guide_es_ES.html +++ b/documentation/installation_guide_es_ES.html @@ -295,13 +295,14 @@ Dado que se trata sólo de un cambio de versión menor previa de Chamilo 1.10.*

      3.2 Actualizar desde Chamilo 1.9.x

        +
      • Asegúrese que ninguna tabla de una versión anterior (a la 1.9) exista en su base de datos. Estas tablas pueden causar errores durante el proceso de actualización hacia versiones superiores. En particular, las tablas de versiones 1.8.* y anteriores podían repetirse una vez por curso, resultando en una gran cantidad de tablas que compartían el mismo prefijo. Solo las tablas sin prefijo o con un prefijo "c_" son legítimas en Chamilo 1.9 y siguientes. Asegúrese de que ninguna de estas antiguas tablas persista. Tóme una copia de seguridad de la base de datos (por si a caso) y luego borre estas tablas con prefijo (drop table ...).
      • Compruebe que no ha dejado ninguna hoja de estilo o imagen personalizada (si la tuviera, asegúrese de realizar una copia de respaldo*)
      • Descargue el paquete de instalación de Chamilo 1.9 desde la página de descarga de Chamilo
      • Descomprima los nuevos ficheros de Chamilo 1.9 sobre los ficheros de la antigua versión ( o descomprima en una carpeta y luego copie los archivos en el directorio de la versión antigua)
      • -
      • Asegúrese *por completo* que el archivo .htaccess de la versión 1.10 ha sido copiado en la raíz también
      • -
      • Asegúrese que "AllowOverride All" está presente en su configuración de Apache, ya que interpretar el archivo .htaccess es muy importante para que Chamilo funcione (ojo que la directiva Order-Allow ha sido remplazada por "Require all granted" en Apache 2.4)
      • -
      • Escriba en su navegador web la URL de su portal + main/install/
      • -
      • Elija su idioma y haga click sobre Actualizar desde 1.9.x
      • +
      • Asegúrese *por completo* que el archivo .htaccess de la versión 1.10 ha sido copiado en la raíz también
      • +
      • Asegúrese que "AllowOverride All" está presente en su configuración de Apache, ya que interpretar el archivo .htaccess es muy importante para que Chamilo funcione (ojo que la directiva Order-Allow ha sido remplazada por "Require all granted" en Apache 2.4)
      • +
      • Escriba en su navegador web la URL de su portal + main/install/
      • +
      • Elija su idioma y haga click sobre Actualizar desde 1.9.x

      * Los estilos e imágenes están ubicados en el directorio main/css o main/img. @@ -319,8 +320,8 @@ Dado que se trata sólo de un cambio de versión menor previa de Chamilo 1.10.*

      3.3 Actualizar desde Chamilo o Dok€os 1.8.x

      -Para actualizar desde una versión previa a la 1.9.0, deberá a partir de ahora primero actualizar a la versión 1.9.10.2, para luego actualizar de ahí a la 1.10.x. - +Para actualizar desde una versión previa a la 1.9.0, deberá a partir de ahora primero actualizar a la versión 1.9.10.x, para luego actualizar de ahí a la 1.10.x. +Podrá encontrar una versión descargable de 1.9.10.x aquí: https://github.com/chamilo/chamilo-lms/releases

      3.4 En ambos últimos casos

      diff --git a/documentation/installation_guide_fr_FR.html b/documentation/installation_guide_fr_FR.html index 7e32ea1953..911b307085 100644 --- a/documentation/installation_guide_fr_FR.html +++ b/documentation/installation_guide_fr_FR.html @@ -386,6 +386,7 @@

      3.2 Mettre à jour depuis Chamilo 1.9.x

        +
      • assurez-vous qu'aucune table ne persiste d'une version antérieure de Chamilo. Ces tables peuvent en effet causer une erreur durant la mise à jour. En particulier, les tables des versions 1.8.* et antérieures pouvaient se répéter une fois par cours, résultant en un grand nombre de tables partageant le même préfixe. Seules les tables sans préfixe ou avec un préfixe "c_" sont légitimes dans les versions 1.9 et supérieures. Assurez-vous qu'aucune de ces anciennes tables ne persiste. Prenez une copie de sauvegarde de votre base de données (au cas où) puis supprimez-les (drop table ...).
      • vérifiez que vous n'avez pas laissé de feuille de style personnalisée ou d'image (le cas échant, faites-en une sauvegarde*)
      • télécharger le paquet Chamilo 1.10 depuis la page de téléchargement de Chamilo
      • décompressez les nouveaux fichiers de Chamilo 1.10 sur les fichiers de votre ancienne installation (ou décompressez les dans un nouveau dossier et copier les fichiers extraits sur les anciens fichiers).
      • @@ -420,8 +421,9 @@

        3.3 Mettre à jour depuis Chamilo 1.8.x

        - Pour mettre à jour depuis une version antérieure à la 1.9.0, vous devrez commencer par la mettre à jour vers la version 1.9.10.2, - et seulement alors mettre à jours vers la 1.10.x + Pour mettre à jour depuis une version antérieure à la 1.9.0, vous devrez commencer par la mettre à jour vers la version 1.9.10.x, + et seulement alors mettre à jours vers la 1.10.x. + Vous pouvez trouver une version téléchargeable de 1.9.10.x ici: https://github.com/chamilo/chamilo-lms/releases

        3.4 Dans les deux derniers cas

        From 50e4f534f696795389a876990836214b962f3b9b Mon Sep 17 00:00:00 2001 From: nosolored Date: Tue, 5 Jul 2016 14:51:37 +0200 Subject: [PATCH 26/31] Fix query - replace course_code for c_id --- main/inc/lib/login.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/inc/lib/login.lib.php b/main/inc/lib/login.lib.php index 7b15c31b71..bc2792280b 100755 --- a/main/inc/lib/login.lib.php +++ b/main/inc/lib/login.lib.php @@ -580,7 +580,7 @@ class Login WHERE user_id = '" . $user_id . "' AND relation_type <> " . COURSE_RELATION_TYPE_RRHH . " AND - course_code = '$course_id'"; + c_id = '".$_real_cid."'"; $result = Database::query($sql); $cuData = null; From 07d75682fa823c4228d57f0ef7340e70903130e3 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Tue, 5 Jul 2016 09:01:06 -0500 Subject: [PATCH 27/31] Add link to Works Report in session on mySpace/session.php - refs BT#11031 --- main/inc/ajax/model.ajax.php | 4 ++-- main/mySpace/session.php | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/main/inc/ajax/model.ajax.php b/main/inc/ajax/model.ajax.php index 2968340d7f..c924684781 100755 --- a/main/inc/ajax/model.ajax.php +++ b/main/inc/ajax/model.ajax.php @@ -985,8 +985,8 @@ switch ($action) { $detailButtons = []; $detailButtons[] = Display::url( - Display::return_icon('works.png', get_lang('Works')), - api_get_path(WEB_CODE_PATH) . 'mySpace/works_in_session_report.php' + Display::return_icon('works.png', get_lang('WorksReport')), + api_get_path(WEB_CODE_PATH) . 'mySpace/works_in_session_report.php?session=' . $session['id'] ); $detailButtons[] = Display::url( Display::return_icon('2rightarrow.png'), diff --git a/main/mySpace/session.php b/main/mySpace/session.php index 416b13da0a..fb6b19146e 100755 --- a/main/mySpace/session.php +++ b/main/mySpace/session.php @@ -60,6 +60,11 @@ if (api_is_drh() || api_is_session_admin() || api_is_platform_admin()) { ); } + $menu_items[] = Display::url( + Display::return_icon('works.png', get_lang('WorksReport'), [], ICON_SIZE_MEDIUM), + api_get_path(WEB_CODE_PATH) . 'mySpace/works_in_session_report.php' + ); + $actionsLeft = ''; $nb_menu_items = count($menu_items); if ($nb_menu_items > 1) { @@ -82,7 +87,7 @@ if (api_is_drh() || api_is_session_admin() || api_is_platform_admin()) { $toolbar = Display::toolbarAction( 'toolbar-session', - $content = array(0 => $actionsLeft, 1 => $actionsRight) + array($actionsLeft, $actionsRight) ); echo $toolbar; From 814da60ba8db12ef6191cc3236a3b4b5abf3a999 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Tue, 5 Jul 2016 15:43:41 -0500 Subject: [PATCH 28/31] Fix save thematic advance - BT#11358 --- main/course_progress/index.php | 4 +- main/course_progress/thematic_advance.php | 38 +++++++++++- main/course_progress/thematic_controller.php | 61 +++----------------- 3 files changed, 45 insertions(+), 58 deletions(-) diff --git a/main/course_progress/index.php b/main/course_progress/index.php index ceeb175470..c99ab4b49b 100755 --- a/main/course_progress/index.php +++ b/main/course_progress/index.php @@ -50,8 +50,8 @@ $actions = array( ); $action = 'thematic_details'; -if (isset($_GET['action']) && in_array($_GET['action'],$actions)) { - $action = $_GET['action']; +if (isset($_REQUEST['action']) && in_array($_REQUEST['action'], $actions)) { + $action = $_REQUEST['action']; } if (isset($_POST['action']) && $_POST['action'] == 'thematic_delete_select') { diff --git a/main/course_progress/thematic_advance.php b/main/course_progress/thematic_advance.php index 30ea5d3a9c..95d58d3f0a 100755 --- a/main/course_progress/thematic_advance.php +++ b/main/course_progress/thematic_advance.php @@ -22,8 +22,7 @@ if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') { $form = new FormValidator( 'thematic_advance', 'POST', - 'index.php?action=thematic_advance_list&thematic_id='.$thematic_id.'&'.api_get_cidreq( - ) + api_get_self() . '?' . api_get_cidreq() ); $form->addElement('header', $header_form); //$form->addElement('hidden', 'thematic_advance_token',$token); @@ -170,6 +169,41 @@ if ($action == 'thematic_advance_add' || $action == 'thematic_advance_edit') { } } $form->setDefaults($default); + + if ($form->validate()) { + $values = $form->exportValues(); + + $thematic = new Thematic(); + $thematic->set_thematic_advance_attributes( + isset($values['thematic_advance_id']) ? $values['thematic_advance_id']: null, + $values['thematic_id'], + $values['start_date_type'] == 1 && isset($values['attendance_select']) ? $values['attendance_select'] : 0, + $values['content'], + $values['start_date_type'] == 2 ? $values['custom_start_date'] : $values['start_date_by_attendance'], + $values['duration_in_hours'] + ); + + $affected_rows = $thematic->thematic_advance_save(); + + if ($affected_rows) { + // get last done thematic advance before move thematic list + $last_done_thematic_advance = $thematic->get_last_done_thematic_advance(); + // update done advances with de current thematic list + if (!empty($last_done_thematic_advance)) { + $thematic->update_done_thematic_advances($last_done_thematic_advance); + } + } + + $redirectUrlParams = 'course_progress/index.php?' . api_get_cidreq() . '&' . + http_build_query([ + 'action' => 'thematic_advance_list', + 'thematic_id' => $values['thematic_id'] + ]); + + header('Location: ' . api_get_path(WEB_CODE_PATH) . $redirectUrlParams); + exit; + } + $form->display(); } else if ($action == 'thematic_advance_list') { diff --git a/main/course_progress/thematic_controller.php b/main/course_progress/thematic_controller.php index 43525bed29..15462f611f 100755 --- a/main/course_progress/thematic_controller.php +++ b/main/course_progress/thematic_controller.php @@ -425,60 +425,13 @@ class ThematicController exit; } - if ((isset($_REQUEST['start_date_type']) && $_REQUEST['start_date_type'] == 1 && empty($_REQUEST['start_date_by_attendance'])) || - (!empty($_REQUEST['duration_in_hours']) && !is_numeric($_REQUEST['duration_in_hours'])) - ) { - if ($_REQUEST['start_date_type'] == 1 && empty($_REQUEST['start_date_by_attendance'])) { - $start_date_error = true; - $data['start_date_error'] = $start_date_error; - } - - if (!empty($_REQUEST['duration_in_hours']) && !is_numeric($_REQUEST['duration_in_hours'])) { - $duration_error = true; - $data['duration_error'] = $duration_error; - } - - $data['action'] = $_REQUEST['action']; - $data['thematic_id'] = $_REQUEST['thematic_id']; - $data['attendance_select'] = $attendance_select; - if (isset($_REQUEST['thematic_advance_id'])) { - $data['thematic_advance_id'] = $_REQUEST['thematic_advance_id']; - $thematic_advance_data = $thematic->get_thematic_advance_list($_REQUEST['thematic_advance_id']); - $data['thematic_advance_data'] = $thematic_advance_data; - } - } else { - if (api_is_allowed_to_edit(null, true)) { - $thematic_advance_id = isset($_REQUEST['thematic_advance_id']) ? $_REQUEST['thematic_advance_id'] : null; - $thematic_id = $_REQUEST['thematic_id']; - $content = isset($_REQUEST['content']) ? $_REQUEST['content'] : null; - $duration = isset($_REQUEST['duration_in_hours']) ? $_REQUEST['duration_in_hours'] : null; - if (isset($_REQUEST['start_date_type']) && $_REQUEST['start_date_type'] == 2) { - $start_date = $_REQUEST['custom_start_date']; - $attendance_id = 0; - } else { - $start_date = isset($_REQUEST['start_date_by_attendance']) ? $_REQUEST['start_date_by_attendance'] : null; - $attendance_id = isset($_REQUEST['attendance_select']) ? $_REQUEST['attendance_select'] : null; - } - $thematic->set_thematic_advance_attributes( - $thematic_advance_id, - $thematic_id, - $attendance_id, - $content, - $start_date, - $duration - ); - - $affected_rows = $thematic->thematic_advance_save(); - - if ($affected_rows) { - // get last done thematic advance before move thematic list - $last_done_thematic_advance = $thematic->get_last_done_thematic_advance(); - // update done advances with de current thematic list - if (!empty($last_done_thematic_advance)) { - $thematic->update_done_thematic_advances($last_done_thematic_advance); - } - } - } + $data['action'] = $_REQUEST['action']; + $data['thematic_id'] = $_REQUEST['thematic_id']; + $data['attendance_select'] = $attendance_select; + if (isset($_REQUEST['thematic_advance_id'])) { + $data['thematic_advance_id'] = $_REQUEST['thematic_advance_id']; + $thematic_advance_data = $thematic->get_thematic_advance_list($_REQUEST['thematic_advance_id']); + $data['thematic_advance_data'] = $thematic_advance_data; } break; default: From 997719b4e3cf56cd45876436a72ecceca552d3c0 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Tue, 5 Jul 2016 17:11:53 -0500 Subject: [PATCH 29/31] Minor - Remove E_NOTICE when display_teacher_in_courselist is true - refs BT#11356 --- main/inc/lib/course.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main/inc/lib/course.lib.php b/main/inc/lib/course.lib.php index dab2139a04..9484ecbf19 100755 --- a/main/inc/lib/course.lib.php +++ b/main/inc/lib/course.lib.php @@ -3696,6 +3696,8 @@ class CourseManager $course_title .= ' (' . $course_info['visual_code'] . ') '; } + $teachers = ''; + if (api_get_setting('display_teacher_in_courselist') == 'true') { $teachers = CourseManager::get_teacher_list_from_course_code_to_string( $course['code'], From 2c14b74acd7fc0cf4f7104d6f6f8420e2405de95 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Tue, 5 Jul 2016 17:53:00 -0500 Subject: [PATCH 30/31] Fix update legal terms - refs BT#11360 --- main/inc/lib/legal.lib.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/main/inc/lib/legal.lib.php b/main/inc/lib/legal.lib.php index c00a515fe6..716172d7c1 100755 --- a/main/inc/lib/legal.lib.php +++ b/main/inc/lib/legal.lib.php @@ -31,6 +31,14 @@ class LegalManager $time = time(); if ($last['content'] != $content) { + $maxLegalId = Database::getManager() + ->createQuery(' + SELECT MAX(l.legalId) FROM ChamiloCoreBundle:Legal l + ') + ->getSingleScalarResult(); + + $legalId = $maxLegalId + 1; + $version = intval(LegalManager::get_last_condition_version($language)); $version++; $params = [ @@ -39,7 +47,8 @@ class LegalManager 'changes' => $changes, 'type' => $type, 'version' => intval($version), - 'date' => $time + 'date' => $time, + 'legal_id' => $legalId ]; Database::insert($legal_table, $params); From 740b5dda526968ab46b9a8c9016426cca9b3f2c2 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Tue, 5 Jul 2016 18:17:49 -0500 Subject: [PATCH 31/31] Allow to platform admin edit a agenda course event - refs BT#11359 --- main/inc/lib/agenda.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/inc/lib/agenda.lib.php b/main/inc/lib/agenda.lib.php index 38d26161a8..b7ce218e76 100644 --- a/main/inc/lib/agenda.lib.php +++ b/main/inc/lib/agenda.lib.php @@ -1594,7 +1594,7 @@ class Agenda $coachCanEdit = false; if (!empty($session_id)) { - $coachCanEdit = api_is_coach($session_id, $course_id); + $coachCanEdit = api_is_coach($session_id, $course_id) || api_is_platform_admin(); } if (Database::num_rows($result)) {