Learning calendar plugin changed dir name to "learning_calendar"

BT#14608
pull/2588/merge
Julio Montoya 8 years ago
parent 9171910c5c
commit 89ac2f824f
  1. 6
      main/admin/usergroup_users.php
  2. 6
      main/inc/ajax/model.ajax.php
  3. 4
      main/inc/lib/tracking.lib.php
  4. 6
      main/inc/lib/usergroup.lib.php
  5. 6
      main/lp/learnpath.class.php
  6. 10
      main/mySpace/index.php
  7. 4
      main/mySpace/myStudents.php
  8. 11
      plugin/learning_calendar/LearningCalendarPlugin.php
  9. 0
      plugin/learning_calendar/README.md
  10. 2
      plugin/learning_calendar/ajax.php
  11. 8
      plugin/learning_calendar/calendar.php
  12. 4
      plugin/learning_calendar/calendar_users.php
  13. 2
      plugin/learning_calendar/install.php
  14. 2
      plugin/learning_calendar/lang/english.php
  15. 2
      plugin/learning_calendar/lang/french.php
  16. 2
      plugin/learning_calendar/lang/spanish.php
  17. 4
      plugin/learning_calendar/plugin.php
  18. 6
      plugin/learning_calendar/start.php
  19. 2
      plugin/learning_calendar/uninstall.php
  20. 0
      plugin/learning_calendar/view/calendar.tpl
  21. 0
      plugin/learning_calendar/view/start.tpl
  22. 4
      plugin/lp_calendar/plugin.php

@ -21,8 +21,8 @@ if (empty($userGroupInfo)) {
$usergroup->protectScript($userGroupInfo);
$calendarPlugin = null;
if (api_get_plugin_setting('lp_calendar', 'enabled') === 'true') {
$calendarPlugin = LpCalendarPlugin::create();
if (api_get_plugin_setting('learning_calendar', 'enabled') === 'true') {
$calendarPlugin = LearningCalendarPlugin::create();
}
// Add the JS needed to use the jqgrid
@ -132,7 +132,7 @@ $column_model = [
],
];
if (api_get_plugin_setting('lp_calendar', 'enabled') === 'true') {
if (api_get_plugin_setting('learning_calendar', 'enabled') === 'true') {
$columns = [
get_lang('Name'),
get_lang('Calendar'),

@ -233,7 +233,7 @@ if (!$sidx) {
switch ($action) {
case 'get_calendar_users':
$calendarPlugin = LpCalendarPlugin::create();
$calendarPlugin = LearningCalendarPlugin::create();
$id = isset($_REQUEST['id']) ? $_REQUEST['id'] : 0;
$count = $calendarPlugin->getUsersPerCalendarCount($id);
break;
@ -244,7 +244,7 @@ switch ($action) {
$count = $usergroup->getUserGroupUsers($id, true);
break;
case 'get_learning_path_calendars':
$calendarPlugin = LpCalendarPlugin::create();
$calendarPlugin = LearningCalendarPlugin::create();
$count = $calendarPlugin->getCalendarCount();
break;
case 'course_log_events':
@ -804,7 +804,7 @@ switch ($action) {
break;
case 'get_usergroups_users':
$columns = ['name', 'actions'];
if (api_get_plugin_setting('lp_calendar', 'enabled') === 'true') {
if (api_get_plugin_setting('learning_calendar', 'enabled') === 'true') {
$columns = [
'name',
'calendar',

@ -5408,10 +5408,10 @@ class Tracking
}
}
$pluginCalendar = api_get_plugin_setting('lp_calendar', 'enabled') === 'true';
$pluginCalendar = api_get_plugin_setting('learning_calendar', 'enabled') === 'true';
if ($pluginCalendar) {
$course_in_session[0] = $courseIdList;
$plugin = LpCalendarPlugin::create();
$plugin = LearningCalendarPlugin::create();
$html .= $plugin->getUserStatsPanel($user_id, $course_in_session);
}

@ -105,12 +105,12 @@ class UserGroup extends Model
return 0;
} else {
$list = [];
$showCalendar = api_get_plugin_setting('lp_calendar', 'enabled') === 'true';
$showCalendar = api_get_plugin_setting('learning_calendar', 'enabled') === 'true';
$calendarPlugin = null;
if ($showCalendar) {
$calendarPlugin = LpCalendarPlugin::create();
$calendarPlugin = LearningCalendarPlugin::create();
}
$url = api_get_path(WEB_PLUGIN_PATH).'lp_calendar/calendar_users.php?';
$url = api_get_path(WEB_PLUGIN_PATH).'learning_calendar/calendar_users.php?';
while ($data = Database::fetch_array($result)) {
$userId = $data['user_id'];
$userInfo = api_get_user_info($userId);

@ -6326,13 +6326,13 @@ class learnpath
$previewIcon = '';
$pluginCalendarIcon = '';
$pluginCalendar = api_get_plugin_setting('lp_calendar', 'enabled') === 'true';
$pluginCalendar = api_get_plugin_setting('learning_calendar', 'enabled') === 'true';
$plugin = null;
if ($pluginCalendar) {
$plugin = LpCalendarPlugin::create();
$plugin = LearningCalendarPlugin::create();
}
$pluginUrl = api_get_path(WEB_PLUGIN_PATH).'lp_calendar/start.php?';
$pluginUrl = api_get_path(WEB_PLUGIN_PATH).'learning_calendar/start.php?';
if ($is_allowed_to_edit) {
if (!$update_audio || $update_audio != 'true') {

@ -56,7 +56,7 @@ if (isset($_GET['view']) && in_array($_GET['view'], $views)) {
}
$menu_items = [];
$pluginCalendar = api_get_plugin_setting('lp_calendar', 'enabled') === 'true';
$pluginCalendar = api_get_plugin_setting('learning_calendar', 'enabled') === 'true';
$calendarMenuAdded = false;
if ($is_platform_admin) {
@ -103,10 +103,10 @@ if ($is_platform_admin) {
);
if ($pluginCalendar) {
$lpCalendar = LpCalendarPlugin::create();
$lpCalendar = LearningCalendarPlugin::create();
$menu_items[] = Display::url(
Display::return_icon('agenda.png', $lpCalendar->get_lang('LearningCalendar'), [], ICON_SIZE_MEDIUM),
api_get_path(WEB_PLUGIN_PATH).'lp_calendar/start.php'
api_get_path(WEB_PLUGIN_PATH).'learning_calendar/start.php'
);
$calendarMenuAdded = true;
}
@ -218,10 +218,10 @@ if (!empty($session_id) &&
);
if ($pluginCalendar && api_is_teacher() && $calendarMenuAdded === false) {
$lpCalendar = LpCalendarPlugin::create();
$lpCalendar = LearningCalendarPlugin::create();
$actionsLeft .= Display::url(
Display::return_icon('agenda.png', $lpCalendar->get_lang('LearningCalendar'), [], ICON_SIZE_MEDIUM),
api_get_path(WEB_PLUGIN_PATH).'lp_calendar/start.php'
api_get_path(WEB_PLUGIN_PATH).'learning_calendar/start.php'
);
}

@ -1840,9 +1840,9 @@ if ($allow && (api_is_drh() || api_is_platform_admin())) {
$table->display();
}
$pluginCalendar = api_get_plugin_setting('lp_calendar', 'enabled') === 'true';
$pluginCalendar = api_get_plugin_setting('learning_calendar', 'enabled') === 'true';
if ($pluginCalendar) {
$plugin = LpCalendarPlugin::create();
$plugin = LearningCalendarPlugin::create();
echo $plugin->getUserStatsPanel($student_id, $courses_in_session);
}

@ -2,9 +2,9 @@
/* For license terms, see /license.txt */
/**
* Class LpCalendarPlugin.
* Class LearningCalendarPlugin.
*/
class LpCalendarPlugin extends Plugin
class LearningCalendarPlugin extends Plugin
{
const EVENT_TYPE_TAKEN = 1;
const EVENT_TYPE_EXAM = 2;
@ -66,7 +66,7 @@ class LpCalendarPlugin extends Plugin
*/
public function get_name()
{
return 'lp_calendar';
return 'learning_calendar';
}
/**
@ -200,12 +200,12 @@ class LpCalendarPlugin extends Plugin
$result = Database::query($sql);
$list = [];
$link = api_get_path(WEB_PLUGIN_PATH).'lp_calendar/start.php';
$link = api_get_path(WEB_PLUGIN_PATH).'learning_calendar/start.php';
while ($row = Database::fetch_array($result)) {
$id = $row['id'];
$row['title'] = Display::url(
$row['title'],
api_get_path(WEB_PLUGIN_PATH).'lp_calendar/calendar.php?id='.$id
api_get_path(WEB_PLUGIN_PATH).'learning_calendar/calendar.php?id='.$id
);
$actions = Display::url(
Display::return_icon('edit.png', get_lang('Edit')),
@ -281,7 +281,6 @@ class LpCalendarPlugin extends Plugin
}
$list = [];
//$link = api_get_path(WEB_PLUGIN_PATH).'lp_calendar/start.php';
while ($row = Database::fetch_array($result, 'ASSOC')) {
$list[] = $row;
}

@ -6,7 +6,7 @@ require_once __DIR__.'/../../main/inc/global.inc.php';
$action = isset($_REQUEST['a']) ? $_REQUEST['a'] : '';
$calendarId = isset($_REQUEST['id']) ? $_REQUEST['id'] : 0;
$plugin = LpCalendarPlugin::create();
$plugin = LearningCalendarPlugin::create();
$item = $plugin->getCalendar($calendarId);
$plugin->protectCalendar($item);

@ -4,7 +4,7 @@
require_once __DIR__.'/../../main/inc/global.inc.php';
$calendarId = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
$plugin = LpCalendarPlugin::create();
$plugin = LearningCalendarPlugin::create();
$item = $plugin->getCalendar($calendarId);
$plugin->protectCalendar($item);
@ -33,7 +33,7 @@ $actionLeft = Display::url(
null,
ICON_SIZE_MEDIUM
),
api_get_path(WEB_PLUGIN_PATH).'lp_calendar/start.php'
api_get_path(WEB_PLUGIN_PATH).'learning_calendar/start.php'
);
$actions = Display::toolbarAction('toolbar-forum', [$actionLeft]);
@ -41,9 +41,9 @@ $actions = Display::toolbarAction('toolbar-forum', [$actionLeft]);
$eventList = $plugin->getEventTypeList();
$template->assign('events', $eventList);
$template->assign('calendar_language', $calendarLanguage);
$template->assign('ajax_url', api_get_path(WEB_PLUGIN_PATH).'lp_calendar/ajax.php?id='.$calendarId);
$template->assign('ajax_url', api_get_path(WEB_PLUGIN_PATH).'learning_calendar/ajax.php?id='.$calendarId);
$template->assign('header', $item['title']);
$content = $template->fetch('lp_calendar/view/calendar.tpl');
$content = $template->fetch('learning_calendar/view/calendar.tpl');
$template->assign('actions', $actions);
$template->assign('content', $content);

@ -4,7 +4,7 @@
require_once __DIR__.'/../../main/inc/global.inc.php';
$calendarId = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
$plugin = LpCalendarPlugin::create();
$plugin = LearningCalendarPlugin::create();
$plugin->protectCalendar($calendarId);
$item = $plugin->getCalendar($calendarId);
@ -22,7 +22,7 @@ $actionLeft = Display::url(
null,
ICON_SIZE_MEDIUM
),
api_get_path(WEB_PLUGIN_PATH).'lp_calendar/start.php'
api_get_path(WEB_PLUGIN_PATH).'learning_calendar/start.php'
);
$actions = Display::toolbarAction('toolbar-forum', [$actionLeft]);

@ -5,4 +5,4 @@ if (!api_is_platform_admin()) {
die('You must have admin permissions to install plugins');
}
LpCalendarPlugin::create()->install();
LearningCalendarPlugin::create()->install();

@ -1,7 +1,7 @@
<?php
/* For license terms, see /license.txt */
$strings['plugin_title'] = 'Learning path calendar';
$strings['plugin_title'] = 'Learning calendar';
$strings['plugin_comment'] = '';
$strings['enabled'] = 'Enabled';
$strings['LearningCalendar'] = 'Learning calendar';

@ -1,7 +1,7 @@
<?php
/* For license terms, see /license.txt */
$strings['plugin_title'] = 'Learning path calendar';
$strings['plugin_title'] = 'Learning calendar';
$strings['plugin_comment'] = '';
$strings['enabled'] = 'Enabled';
$strings['LearningCalendar'] = 'Learning calendar';

@ -1,7 +1,7 @@
<?php
/* For license terms, see /license.txt */
$strings['plugin_title'] = 'Learning path calendar';
$strings['plugin_title'] = 'Learning calendar';
$strings['plugin_comment'] = '';
$strings['enabled'] = 'Activado';
$strings['LearningCalendar'] = 'Learning calendar';

@ -0,0 +1,4 @@
<?php
/* For license terms, see /license.txt */
$plugin_info = LearningCalendarPlugin::create()->get_info();

@ -9,7 +9,7 @@ if (!$allow) {
api_not_allowed(true);
}
$plugin = LpCalendarPlugin::create();
$plugin = LearningCalendarPlugin::create();
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
$calendarId = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
$formToString = '';
@ -184,10 +184,8 @@ if (in_array($action, ['add', 'edit'])) {
$template->assign('form', $formToString);
$actions = Display::toolbarAction('toolbar-calendar', [$actionLeft]);
$content = $template->fetch('lp_calendar/view/start.tpl');
$content = $template->fetch('learning_calendar/view/start.tpl');
$template->assign('content', $content);
$template->assign('actions', $actions);
$template->display_one_col_template();

@ -1,4 +1,4 @@
<?php
/* For license terms, see /license.txt */
LpCalendarPlugin::create()->uninstall();
LearningCalendarPlugin::create()->uninstall();

@ -1,4 +0,0 @@
<?php
/* For license terms, see /license.txt */
$plugin_info = LpCalendarPlugin::create()->get_info();
Loading…
Cancel
Save