<?php
defined('_JEXEC') or die('Restricted access');
?>
<!-- Attached Layout Modal -->
<div class="modal fade" id="attached-layout-modal" tabindex="-1" role="dialog" aria-labelledby="attached-layout-modal-Label" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
        <h4 class="modal-title" id="attached-layout-modal-Label"><?php echo cck_lang_text("COM_OS_CCK_ATTACHED_LAYOUT_MODAL_TITLE")?></h4>
      </div>
      <div class="modal-body">
        <div class="row">
          <span class="col-lg-6 col-lg-6 col-md-6 col-sm-6 col-xs-6"><label>Title</label></span>
          <span class="col-lg-3 col-lg-3 col-md-3 col-sm-3 col-xs-3"><label>Type</label></span>
          <span class="col-lg-2 col-lg-2 col-md-2 col-sm-2 col-xs-2"><label>Language</label></span>
          <span class="col-lg-1 col-lg-1 col-md-1 col-sm-1 col-xs-1"><label>ID</label></span>
        </div>
        <?php 
        
        foreach ($layout->layout_list as $key => $value) { 
          $value->type = getLayoutType($value->type);?>
          <div id="attached-layout-row-<?php echo $value->lid; ?>" class="row"
               onclick="addAttachedLayout('<?php echo $value->lid; ?>',<?php echo $db->quote($value->title); ?>, '<?php echo property_exists($value, 'entity_type') ? $value->entity_type : '';?>', '<?php echo property_exists($value, 'fk_eid') ? $value->fk_eid : '';?>');">
            <span class="col-lg-6 col-lg-6 col-md-6 col-sm-6 col-xs-6"><?php echo $value->title; ?></span>
            <span class="col-lg-3 col-lg-3 col-md-3 col-sm-3 col-xs-3"><?php echo $value->type; ?></span>
            <span class="col-lg-2 col-lg-2 col-md-2 col-sm-2 col-xs-2"><?php echo $value->language; ?></span>
            <span class="col-lg-1 col-lg-1 col-md-1 col-sm-1 col-xs-1"><?php echo $value->lid; ?></span>
          </div>
          <?php
        } ?>
      </div>
    </div>
  </div>
</div>
<!-- Attached Layout Modal -->