}
}
+
+function addToModal(url) {
+ var url = url + '?mode=modal';
+ var modal = $('#modal').modal();
+
+ modal
+ .find('#modal-body')
+ .load(url, function (responseText, textStatus) {
+ if ( textStatus === 'success' ||
+ textStatus === 'notmodified')
+ {
+ modal.show();
+
+ //Get first h3 element and use it as title
+ loadModalTitle();
+ }
+ });
+};
+
function editpost(url) {
var modal = $('#jot-modal').modal();
var url = url + " #profile-jot-form";
<script>
// Note this is the same script like in wall_thread.tpl
$(document).ready(function() {
- // replace data target for poke & private Message to make Modal Dialog possible
- $('li a[href^="poke/?f"]').attr('rel','modal');
- $('li a[href^="message/new"]').attr('rel','modal');
-
// put shared content in an own wrapper div
$('#wall-item-content-{{$item.id}} > #wall-item-body-{{$item.id}} > .shared_content').after('<div class="shared-content-wrapper content-card"></div>');
$("#wall-item-content-{{$item.id}} > #wall-item-body-{{$item.id}} > .shared_header, #wall-item-content-{{$item.id}} > #wall-item-body-{{$item.id}} > .shared_content").appendTo("#wall-item-content-{{$item.id}} .shared-content-wrapper");
</div><!--./comment-container-->
{{/if}}
-{{* The Modals - They have to be in this file to call remote content
-@todo: Move them somerhere else - we don't want this in every new message
-*}}
-<div class="modal" id="MailModal" tabindex="-1" role="dialog" aria-labelledby="MailModal" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- </div> <!-- /.modal-content -->
- </div> <!-- /.modal-dialog -->
-</div> <!-- /.modal -->
-
-<div class="modal" id="PokeModal" tabindex="-1" role="dialog" aria-labelledby="PokeModal" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- </div> <!-- /.modal-content -->
- </div> <!-- /.modal-dialog -->
-</div> <!-- /.modal -->
<script>
// Note: this is the same script like in search_item.tpl
$(document).ready(function() {
- // replace data target for poke & private Message to make Modal Dialog possible
- $('li a[href^="poke/?f"]').attr('rel','modal');
- $('li a[href^="message/new"]').attr('rel','modal');
-
// put shared content in an own wrapper div
$('#wall-item-content-{{$item.id}} > #wall-item-body-{{$item.id}} > .shared_content').after('<div class="shared-content-wrapper content-card"></div>');
$("#wall-item-content-{{$item.id}} > #wall-item-body-{{$item.id}} > .shared_header, #wall-item-content-{{$item.id}} > #wall-item-body-{{$item.id}} > .shared_content").appendTo("#wall-item-content-{{$item.id}} .shared-content-wrapper");
function frio_install() {
register_hook('prepare_body_final', 'view/theme/frio/theme.php', 'frio_item_photo_links');
+ register_hook('item_photo_menu', 'view/theme/frio/theme.php', 'frio_item_photo_menu');
logger("installed theme frio");
}
function frio_uninstall() {
unregister_hook('prepare_body_final', 'view/theme/frio/theme.php', 'frio_item_photo_links');
+ unregister_hook('item_photo_menu', 'view/theme/frio/theme.php', 'frio_item_photo_menu');
logger("uninstalled theme frio");
}
$p = bb_find_open_close($body_info['html'], "<a", ">", $occurence);
}
}
+
+/**
+ * @brief Replace links of the item_photo_menu
+ *
+ * This function replaces the original poke and the message links
+ * to call the addToModal javascript function so this pages can
+ * be loaded in a bootstrap modal
+ *
+ * @param app $a The app data
+ * @param array $arr Contains item data and the original photo_menu
+ */
+function frio_item_photo_menu($a, &$arr){
+
+ foreach($arr["menu"] as $k =>$v) {
+ if(strpos($v,'poke/?f=&c=') === 0 || strpos($v,'message/new/') === 0) {
+ $v = "javascript:addToModal('" . $v . "'); return false;";
+ $arr["menu"][$k] = $v;
+ $testvariable = $testvariable+1;
+ }
+ }
+ $args = array('item' => $item, 'menu' => $menu);
+}