<?php

/**
 * @extension       Marlev Template
 * @author          Lev Milicenco<support@marlev.it>
 * @link            http://www.marlev.it
 * @copyright       Copyright 2017 marlev.it All Rights Reserved
 * @license         http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 */
defined('_JEXEC') or die;
//JHtml::_('behavior.formvalidation');
//JHtml::_('behavior.keepalive');
//JHtml::_('formbehavior.chosen', 'select');
//JHtml::_('jquery.framework');
//JHtml::_('bootstrap.framework');

$input = JFactory::getApplication()->input;
$post_class = $input->getString("loadclass");
$post_position = $input->getString("position");
$positionclass = $input->getString("blockclass");
$post_parentid = $input->getString("parentid");
include JPATH_COMPONENT_ADMINISTRATOR . "/functions/layout.php";
$render = new ml_layout($this->layout,$this->load->template);
$ifdata = $render->elabora_posdata($post_position);

$selected = new stdClass;
if ($ifdata != false) {
    $selected->tablet = $ifdata->tabcollayout[0];
    $selected->mobile = $ifdata->mobcollayout[0];
    $selected->pc = $ifdata->defcollayout[0];
    $posdata = $ifdata;
} else {
    $selected->tablet = 12;
    $selected->mobile = 12;
    $selected->pc = 3;
    $posdata = $render->elabora_posdata($post_parentid);
}


echo '<div id="load_' . $post_position . '" class="pos_' . $post_position . ' ' . $positionclass . ' col-md-' . $selected->pc . ' col-lg-' . $selected->pc . ' col-xs-12 col-sm-12" data-mobile="' . $selected->mobile . '" data-tablet="' . $selected->tablet . '" data-pc="' . $selected->pc . '" data-position="' . $post_position . '"> ';


echo '<div style="padding: 2px"> <div class="show-position">';

echo '<div>'.$post_position.'</div>';
echo $render->in_popup($post_parentid, $post_position, $selected, $posdata,$post_position);
echo'<div class="colcancel"><span class="hasTooltip icon-cancel" data-original-title="' . JText::_('COM_TMARLEV_DELETE_THIS_COL') . '"></span></div>';
echo '</div></div></div>';
?>
