xowiki::includelet::personal-notification-messages proc modal_message_dialog (public)

 xowiki::includelet::personal-notification-messages[i] modal_message_dialog \
    -to_user_id to_user_id  [ -title title ] [ -adpicon adpicon ]

Defined in /var/www/openacs.org/packages/xowiki/tcl/personal-notification-procs.tcl

Create a bootstrap3/5-compatible modal dialog

Switches:
-to_user_id (required, integer)
-title (optional, defaults to "#xowiki.Send_message_to#")
-adpicon (optional, defaults to "pencil")

Testcases:
No testcase defined.
Source code:
if {[::template::CSS toolkit] eq "bootstrap5"} {
  set data_attribute "data-bs"
  set close_button_label ""
  set before_close  "<h4 class='modal-title' id='configurationModalTitle'>$title</h4>"
  set after_close  ""

} else {
  set data_attribute "data"
  set close_button_label {<span aria-hidden="true">&#215;</span>}
  set before_close  ""
  set after_close  "<h4 class='modal-title' id='configurationModalTitle'>$title</h4>"
}
if {[llength $to_user_id] == 1} {
  set id dialog-msg-$to_user_id
  set to_user_name [::xo::get_user_name $to_user_id]
} else {
  set id dialog-msg-all
  set to_user_name " [llength $to_user_id] #xowiki.Participants#"
}
append title " " $to_user_name

foreach to_user_id $to_user_id {
  append input_fields [subst {<input type="hidden" name="to_user_id" value="$to_user_id">}]
}
set btnDefault [::template::CSS class btn-default]
return [list link [subst {
  <a href="#$id" title="$title" role="button" $data_attribute-toggle="modal" $data_attribute-keyboard="false">
  <adp:icon name="$adpicon" aria-hidden="true"></span>
}] dialog [subst {
  <div class="modal fade" id='$id' tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document">
<form role="form" class="form-vertical" method="post" action="">
  <div class="modal-content">
<div class="modal-header">
  $before_close<adp:button type="button" class="close" data-dismiss="modal" aria-label="Close">$close_button_label
  </adp:button>$after_close
</div><!-- modal-header -->

<div class="modal-body">
  <div class="form-group">
  <label for="msg"><adp:icon name="$adpicon"#xowiki.Message#</label>
    <input class="form-control" id="msg" name="msg" placeholder="#xowiki.Enter_message#" required autofocus>
  </div>
  <div class="form-group">
  #xowiki.Urgency#
    <label class="radio-inline" for="option1">#xowiki.urgency_low#</label>
    <input id="option1" name="urgency" value="info" type="radio">
    <label class="radio-inline" for="option2">#xowiki.urgency_normal#</label>
    <input id="option2" name="urgency" value="warning" type="radio" checked>
    <label class="radio-inline" for="option3">#xowiki.urgency_high#</label>
    <input id="option3" name="urgency" value="danger" type="radio">
  </div> <!--form-group-->

  $input_fields
</div><!--modal-body-->
<div class="modal-footer">
<adp:button type="button" class="btn btn-default" data-dismiss="modal">#acs-kernel.common_Close#</adp:button>
<adp:button type="submit" class="btn btn-default submit" data-id="$id" data-dismiss="modal">#xowiki.Send#</adp:button>
</div>
  </div>
</form>
  </div><!--modal-dialog-->
  </div><!--modal-->
}]]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: