Minor - Replace div actions with Display::toolbarAction

pull/3890/head
Julio Montoya 4 years ago
parent c312e4c9df
commit badc7c37b0
  1. 11
      public/main/admin/extra_fields.php
  2. 8
      public/main/admin/system_announcements.php
  3. 2
      public/main/admin/user_list.php
  4. 12
      public/main/admin/usergroups.php
  5. 4
      public/main/calendar/agenda_js.php
  6. 17
      public/main/inc/lib/extra_field.lib.php
  7. 21
      public/main/inc/lib/message.lib.php
  8. 14
      public/main/inc/lib/usergroup.lib.php
  9. 5
      public/main/session/session_export.php
  10. 7
      public/main/session/session_import_drh.php
  11. 6
      public/main/session/session_list.php

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
$cidReset = true;
@ -122,10 +123,9 @@ switch ($action) {
}
$obj->display();
} else {
echo '<div class="actions">';
echo '<a href="'.api_get_self().'?type='.$obj->type.'">'.
$actions = '<a href="'.api_get_self().'?type='.$obj->type.'">'.
Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
echo Display::toolbarAction('toolbar', [$actions]);
$form->addElement('hidden', 'sec_token');
$form->setConstants(['sec_token' => $token]);
$form->display();
@ -147,10 +147,9 @@ switch ($action) {
);
$obj->display();
} else {
echo '<div class="actions">';
echo '<a href="'.api_get_self().'?type='.$obj->type.'">'.
$actions = '<a href="'.api_get_self().'?type='.$obj->type.'">'.
Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
echo Display::toolbarAction('toolbar', [$actions]);
$form->addElement('hidden', 'sec_token');
$form->setConstants(['sec_token' => $token]);
$form->display();

@ -85,20 +85,18 @@ function showCareer() {
// Displaying the header.
Display::display_header($tool_name);
if ('add' !== $action && 'edit' !== $action) {
echo '<div class="actions">';
echo '<a href="?action=add">'.Display::return_icon('add.png', get_lang('Add an announcement'), [], 32).'</a>';
echo '</div>';
$actions = '<a href="?action=add">'.Display::return_icon('add.png', get_lang('Add an announcement'), [], 32).'</a>';
echo Display::toolbarAction('toolbar', [$actions]);
}
$show_announcement_list = true;
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
$action = $_REQUEST['action'] ?? null;
// Form was posted?
if (isset($_POST['action'])) {
$action_todo = true;
}
// Actions
switch ($action) {
case 'make_visible':
case 'make_invisible':

@ -1248,7 +1248,7 @@ if (0 == $table->get_total_number_of_items()) {
}
$toolbarActions = Display::toolbarAction(
'toolbarUser',
[$actionsLeft, $actionsCenter, $actionsRight],
[$actionsLeft, $actionsCenter.$actionsRight],
[4, 4, 4]
);

@ -1,4 +1,5 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Framework\Container;
@ -104,10 +105,9 @@ switch ($action) {
header('Location: '.api_get_self());
exit;
} else {
$content .= '<div class="actions">';
$content .= '<a href="'.api_get_self().'">'.
$actions = '<a href="'.api_get_self().'">'.
Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
$content .= '</div>';
$content .= Display::toolbarAction('toolbar', [$actions]);
$token = Security::get_token();
$form->addElement('hidden', 'sec_token');
$form->setConstants(['sec_token' => $token]);
@ -152,14 +152,13 @@ switch ($action) {
header('Location: '.api_get_self());
exit;
} else {
$content .= '<div class="actions">';
$content .= '<a href="'.api_get_self().'">'.Display::return_icon(
$actions = '<a href="'.api_get_self().'">'.Display::return_icon(
'back.png',
get_lang('Back'),
'',
ICON_SIZE_MEDIUM
).'</a>';
$content .= '</div>';
$content .= Display::toolbarAction('toolbar', [$actions]);
$content .= $form->returnForm();
}
break;
@ -179,7 +178,6 @@ switch ($action) {
break;
}
// The header.
Display::display_header();
?>

@ -7,7 +7,7 @@ $use_anonymous = true;
$typeList = ['personal', 'course', 'admin', 'platform'];
// Calendar type
$type = isset($_REQUEST['type']) && in_array($_REQUEST['type'], $typeList) ? $_REQUEST['type'] : 'personal';
$userId = isset($_REQUEST['user_id']) ? $_REQUEST['user_id'] : null;
$userId = $_REQUEST['user_id'] ?? null;
if ('personal' === $type || 'admin' === $type) {
$cidReset = true; // fixes #5162
@ -18,8 +18,8 @@ api_block_inactive_user();
$current_course_tool = TOOL_CALENDAR_EVENT;
$this_section = SECTION_MYAGENDA;
$htmlHeadXtra[] = api_get_asset('fullcalendar/main.js');
$htmlHeadXtra[] = api_get_css_asset('fullcalendar/main.css');
$htmlHeadXtra[] = api_get_asset('fullcalendar/main.js');
if (api_is_platform_admin() && ('admin' === $type || 'platform' === $type)) {
$type = 'admin';

@ -2055,25 +2055,24 @@ class ExtraField extends Model
*/
public function display()
{
// action links
echo '<div class="actions">';
echo '<a href="../admin/index.php">';
echo Display::return_icon(
$actions = '<a href="../admin/index.php">';
$actions .= Display::return_icon(
'back.png',
get_lang('Back to').' '.get_lang('Administration'),
'',
ICON_SIZE_MEDIUM
);
echo '</a>';
echo '<a href="'.api_get_self().'?action=add&type='.$this->type.'">';
echo Display::return_icon(
$actions .= '</a>';
$actions .= '<a href="'.api_get_self().'?action=add&type='.$this->type.'">';
$actions .= Display::return_icon(
'add_user_fields.png',
get_lang('Add'),
'',
ICON_SIZE_MEDIUM
);
echo '</a>';
echo '</div>';
$actions .= '</a>';
echo Display::toolbarAction('toolbar', [$actions]);
echo Display::grid_html($this->type.'_fields');
}

@ -1375,7 +1375,6 @@ class MessageManager
$messageContent .= '<div class="row">';
$messageContent .= '<div class="col-md-12">';
$messageContent .= '<ul class="list-message">';
if (null !== $message->getUserSender()) {
$messageContent .= '<li>'.$userImage.'</li>';
$messageContent .= '<li>';
@ -1427,34 +1426,35 @@ class MessageManager
</tr>
</table>
<div id="message-attach">'.(!empty($filesAttachments) ? implode('<br />', $filesAttachments) : '').'</div>
<div style="padding: 15px 0px 5px 0px">';
';
$social_link = '';
if (isset($_GET['f']) && 'social' === $_GET['f']) {
$social_link = 'f=social';
}
$actions = '';
switch ($type) {
case self::MESSAGE_TYPE_OUTBOX:
$messageContent .= '<a href="outbox.php?'.$social_link.'">'.
$actions .= '<a href="outbox.php?'.$social_link.'">'.
Display::return_icon('back.png', get_lang('Return to outbox')).'</a> &nbsp';
$messageContent .= '<a href="outbox.php?action=deleteone&id='.$messageId.'&'.$social_link.'" >'.
$actions .= '<a href="outbox.php?action=deleteone&id='.$messageId.'&'.$social_link.'" >'.
Display::return_icon('delete.png', get_lang('Delete message')).'</a>&nbsp';
break;
case self::MESSAGE_TYPE_INBOX:
$messageContent .= '<a href="inbox.php?'.$social_link.'">'.
$actions .= '<a href="inbox.php?'.$social_link.'">'.
Display::return_icon('back.png', get_lang('Return to inbox')).'</a> &nbsp';
$messageContent .= '<a href="new_message.php?re_id='.$messageId.'&'.$social_link.'">'.
$actions .= '<a href="new_message.php?re_id='.$messageId.'&'.$social_link.'">'.
Display::return_icon('message_reply.png', get_lang('Reply to this message')).'</a> &nbsp';
$messageContent .= '<a href="inbox.php?action=deleteone&id='.$messageId.'&'.$social_link.'" >'.
$actions .= '<a href="inbox.php?action=deleteone&id='.$messageId.'&'.$social_link.'" >'.
Display::return_icon('delete.png', get_lang('DeleteMessage')).'</a>&nbsp;';
if (0 != $idPrevMessage) {
$messageContent .= '<a
$actions .= '<a
title="'.get_lang('PrevMessage').'"
href="view_message.php?type='.$type.'&id='.$idPrevMessage.'" ">'.
Display::return_icon('icons/22/back.png', get_lang('ScormPrevious')).'</a> &nbsp';
}
if (0 != $idNextMessage) {
$messageContent .= '<a
$actions .= '<a
title="'.get_lang('NextMessage').'"
href="view_message.php?type='.$type.'&id='.$idNextMessage.'">'.
Display::return_icon('icons/22/move.png', get_lang('ScormNext')).'</a> &nbsp';
@ -1462,7 +1462,8 @@ class MessageManager
break;
}
$messageContent .= '</div></td>
$messageContent .= Display::toolbarAction('toolbar-bottom', [$actions]);
$messageContent .= '</td>
<td width="10"></td>
</tr>
</table>';

@ -327,10 +327,10 @@ class UserGroup extends Model
*/
public function returnGrid()
{
// action links
$html = '<div class="actions">';
$html = '';
$actions = '';
if (api_is_platform_admin()) {
$html .= '<a href="../admin/index.php">'.
$actions .= '<a href="../admin/index.php">'.
Display::return_icon(
'back.png',
get_lang('Back to').' '.get_lang('Administration'),
@ -340,18 +340,18 @@ class UserGroup extends Model
'</a>';
}
$html .= '<a href="'.api_get_self().'?action=add">'.
$actions .= '<a href="'.api_get_self().'?action=add">'.
Display::return_icon('new_class.png', get_lang('Add classes'), '', ICON_SIZE_MEDIUM).
'</a>';
$html .= Display::url(
$actions .= Display::url(
Display::return_icon('import_csv.png', get_lang('Import'), [], ICON_SIZE_MEDIUM),
'usergroup_import.php'
);
$html .= Display::url(
$actions .= Display::url(
Display::return_icon('export_csv.png', get_lang('Export'), [], ICON_SIZE_MEDIUM),
'usergroup_export.php'
);
$html .= '</div>';
$html .= Display::toolbarAction('toolbar', [$actions]);
$html .= Display::grid_html('usergroups');
return $html;

@ -286,10 +286,9 @@ if (api_is_multiple_url_enabled()) {
$result = Database::query($sql);
$Sessions = Database::store_result($result);
echo '<div class="actions">';
echo '<a href="../session/session_list.php">'.
$actions = '<a href="../session/session_list.php">'.
Display::return_icon('back.png', get_lang('Back to').' '.get_lang('Session list'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
echo Display::toolbarAction('toolbar', [$actions]);
if (!empty($errorMsg)) {
echo Display::return_message($errorMsg, 'normal', false); //main API

@ -19,13 +19,12 @@ set_time_limit(0);
$inserted_in_course = [];
// Display the header.
Display::display_header($tool_name);
echo '<div class="actions">';
echo '<a href="../session/session_list.php">'.
$actions = '<a href="../session/session_list.php">'.
Display::return_icon('back.png', get_lang('Back to').' '.get_lang('Administration'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
echo Display::toolbarAction('toolbar', [$actions]);
if (!empty($error_message)) {
echo Display::return_message($error_message, 'normal', false);

@ -386,11 +386,7 @@ if (api_is_platform_admin()) {
$actionsRight .= $form->returnForm().'</div>';
}
echo Display::toolbarAction(
'toolbar',
[$actionsLeft, $actionsRight]
);
echo Display::toolbarAction('toolbar', [$actionsLeft, $actionsRight]);
echo SessionManager::getSessionListTabs($listType);
echo '<div id="session-table" class="table-responsive">';
echo Display::grid_html('sessions');

Loading…
Cancel
Save