Display the session description in session preview - refs BT#9049

1.10.x
Angel Fernando Quiroz Campos 11 years ago
parent 2e2719e0e8
commit 51b80ced89
  1. 12
      main/admin/resume_session.php
  2. 8
      plugin/advancedsessions/src/AdvancedSessionsPlugin.class.php

@ -10,6 +10,12 @@ $language_file = 'admin';
$cidReset = true;
require_once '../inc/global.inc.php';
$advancedSessionsPluginFilePath = api_get_path(PLUGIN_PATH) . 'advancedsessions/src/AdvancedSessionsPlugin.class.php';
if (file_exists($advancedSessionsPluginFilePath)) {
require_once api_get_path(PLUGIN_PATH) . 'advancedsessions/src/AdvancedSessionsPlugin.class.php';
}
// setting the section (for the tabs)
$this_section = SECTION_PLATFORM_ADMIN;
@ -243,6 +249,12 @@ if (SessionManager::durationPerUserIsEnabled()) {
}
?>
<?php if (class_exists('AdvancedSessionsPlugin') && AdvancedSessionsPlugin::hasDescriptionField()) { ?>
<tr>
<td><?php echo get_lang('Description'); ?></td>
<td><?php echo AdvancedSessionsPlugin::getSessionDescription($sessionId) ?></td>
</tr>
<?php } ?>
</table>
<br />

@ -101,4 +101,12 @@ class AdvancedSessionsPlugin extends Plugin
Database::insert($fieldValuesTable, $attributes);
}
public static function getSessionDescription($sessionId) {
$sessionId = intval($sessionId);
$fieldValue = new ExtraFieldValue('session');
$description = $fieldValue->get_values_by_handler_and_field_variable($sessionId, self::FIELD_NAME, false);
return $description !== false ? $description['field_value'] : get_lang('None');
}
}

Loading…
Cancel
Save