Add setting 'show_full_lp_item_title_in_edition' see BT#15259

pull/2999/head
Julio Montoya 6 years ago
parent aeb2230bc7
commit 75f1644d2a
  1. 3
      main/install/configuration.dist.php
  2. 28
      main/lp/learnpath.class.php
  3. 2
      main/lp/lp_admin_view.php
  4. 9
      main/lp/lp_controller.php

@ -1309,6 +1309,9 @@ requires extension "php-soap" sudo apt-get install php-soap
// Show hidden exercises that were added to a LP in the exercise list
// $_configuration['show_hidden_exercise_added_to_lp'] = true;
// Show full lp item title
// $_configuration['show_full_lp_item_title_in_edition'] = false;
// KEEP THIS AT THE END
// -------- Custom DB changes
// Add user activation by confirmation email

@ -5870,6 +5870,7 @@ class learnpath
'ref' => $ref,
'item_type' => $array[$i]['item_type'],
'title' => $array[$i]['title'],
'title_raw' => $array[$i]['title_raw'],
'path' => $path,
'description' => $array[$i]['description'],
'parent_item_id' => $array[$i]['parent_item_id'],
@ -6021,10 +6022,22 @@ class learnpath
[],
ICON_SIZE_TINY
);
$show = api_get_configuration_value('show_full_lp_item_title_in_edition');
$pluginCalendar = api_get_plugin_setting('learning_calendar', 'enabled') === 'true';
$plugin = null;
if ($pluginCalendar) {
$plugin = LearningCalendarPlugin::create();
}
for ($i = 0; $i < $countItems; $i++) {
$parent_id = $arrLP[$i]['parent_item_id'];
$title = $arrLP[$i]['title'];
$title_cut = cut($arrLP[$i]['title'], self::MAX_LP_ITEM_TITLE_LENGTH);
$title_cut = $arrLP[$i]['title_raw'];
if ($show === false) {
$title_cut = cut($arrLP[$i]['title'], self::MAX_LP_ITEM_TITLE_LENGTH);
}
// Link for the documents
if ($arrLP[$i]['item_type'] === 'document' || $arrLP[$i]['item_type'] == TOOL_READOUT_TEXT) {
$url = $mainUrl.'&action=view_item&mode=preview_document&id='.$arrLP[$i]['id'].'&lp_id='.$this->lp_id;
@ -6100,13 +6113,6 @@ class learnpath
$previewIcon = '';
$pluginCalendarIcon = '';
$orderIcons = '';
$pluginCalendar = api_get_plugin_setting('learning_calendar', 'enabled') === 'true';
$plugin = null;
if ($pluginCalendar) {
$plugin = LearningCalendarPlugin::create();
}
$pluginUrl = api_get_path(WEB_PLUGIN_PATH).'learning_calendar/start.php?';
if ($is_allowed_to_edit) {
@ -6367,7 +6373,7 @@ class learnpath
} else {
$parent_arrays = [];
if ($arrLP[$i]['depth'] > 1) {
//Getting list of parents
// Getting list of parents
for ($j = 0; $j < $arrLP[$i]['depth']; $j++) {
foreach ($arrLP as $item) {
if ($item['id'] == $parent_id) {
@ -8193,6 +8199,7 @@ class learnpath
'id' => $row['iid'],
'item_type' => $row['item_type'],
'title' => $this->cleanItemTitle($row['title']),
'title_raw' => $row['title'],
'path' => $row['path'],
'description' => $row['description'],
'parent_item_id' => $row['parent_item_id'],
@ -10174,7 +10181,7 @@ class learnpath
ORDER BY title ASC";
$sql_hot = "SELECT * FROM $tbl_doc
WHERE
WHERE
c_id = $course_id AND
path LIKE '".$uploadPath."/%/%htm%'
$condition_session
@ -13604,6 +13611,7 @@ EOD;
'id' => $row['iid'],
'item_type' => $row['item_type'],
'title' => $this->cleanItemTitle($row['title']),
'title_raw' => $row['title'],
'path' => $row['path'],
'description' => Security::remove_XSS($row['description']),
'parent_item_id' => $row['parent_item_id'],

@ -84,7 +84,7 @@ if (isset($_POST['save_audio'])) {
if (count($lp_items_to_remove_audio) > 0) {
$sql = "UPDATE $tbl_lp_item SET audio = ''
WHERE iid IN (".$in.")";
$result = Database::query($sql);
Database::query($sql);
}
// Uploading the audio files.

@ -496,6 +496,9 @@ if (isset($_POST['title'])) {
!empty($_POST['title'])
) {
$post_title = Exercise::format_title_variable($_POST['title']);
if (api_get_configuration_value('save_titles_as_html')) {
$post_title = $_POST['title'];
}
}
}
@ -603,7 +606,7 @@ switch ($action) {
}
}
$new_item_id = $_SESSION['oLP']->add_item(
$_SESSION['oLP']->add_item(
$parent,
$previous,
$type,
@ -624,7 +627,7 @@ switch ($action) {
);
}
$new_item_id = $_SESSION['oLP']->add_item(
$_SESSION['oLP']->add_item(
$parent,
$previous,
TOOL_READOUT_TEXT,
@ -636,7 +639,7 @@ switch ($action) {
} else {
// For all other item types than documents,
// load the item using the item type and path rather than its ID.
$new_item_id = $_SESSION['oLP']->add_item(
$_SESSION['oLP']->add_item(
$parent,
$previous,
$type,

Loading…
Cancel
Save