<?php
/**
 * YAWIK
 *
 * @filesource
 * @license MIT
 * @copyright  2013 - 2015 Cross Solution <http://cross-solution.de>
 */


if ($this->renderSummary):?>
<div class="row">
    <div class="col-md-3 yk-label">
        <label><?php echo $this->translate($this->element->getLabel())?></label>
    </div>
    <div class="col-md-9">
        <?php
        $options = $this->element->getValueOptions();
        $valueKey= $this->element->getValue();

        if ($valueKey):
            $value   = $options[$valueKey];

            $data    = explode('|', $value);
            if (isset($data[4])): ?><div class="row"><div class="col-md-6"><?php
            else:?>          <div class="row"><div class="col-md-12"><?php
            endif;
            $info    = array();

            if (isset($data[1])):
                $info[] = $data[1];
            endif;

            if (isset($data[2])):
                $info[] = $data[2] . ($data[3] ? ' ' . $data[3] : '');
            endif;
            ?>
        <strong><?php echo $data[0] ?></strong><br>
        <small><?php echo implode(', ', $info) ?></small>
                </div>
                <?php if (isset($data[4]) && !empty($data[4])):?>
                     <div class="col-md-6 pull-right">
                         <img src="<?php echo $this->basepath($data[4]) ?>" class="yk-logo-sm">
                     </div>
                <?php endif ?>
                    </div>

        <?php endif ?>

    </div>
</div>
<div style="padding: 10px">
    <?php if (1 == count($options)): ?>
        <?php $this->alert()->info(array('dismissable' => false)); ?>
        <p>
            <?php echo sprintf(
                $this->translate('If you want to post job openings for your customers, you have to %sadd them%s in the organizations menu.'),
                '<a href="' . $this->url('lang/organizations/edit', array(), true) . '">', '</a>'
            );
            ?>
        </p>
        <?php echo $this->alert()->end(); ?>
    <?php endif ?>

</div>

<?php else: echo $this->formRow()->render($this->element, /* ignoreViewPartial */ true);
endif; // ($this->renderSummary) ?>