/**
 * Smarty size_format modifier plugin.
 *
 * Type:     modifier<br>
 * Name:     size_format<br>
 * Purpose:  format sizes directly from DB.
 *
 * @param integer $size Size of a file.
 * @param integer $decimals Number of decimals.
 * @return string
 */
function smarty_modifier_time_since($diff_time)
{
    if (!is_numeric($diff_time)) {
        $diff_time = strtotime(date("Y-m-d H:i:s")) - strtotime($diff_time);
    }
    if (floor($diff_time / (60 * 60 * 24)) >= 365) {
        $value[0] = floor($diff_time / (60 * 60 * 24 * 365));
        if (1 == $value[0]) {
            $value[1] = \Sifo\I18N::getTranslation("year");
        } else {
            $value[1] = \Sifo\I18N::getTranslation("years");
        }
    } elseif (floor($diff_time / (60 * 60 * 24)) >= 30) {
        $value[0] = floor($diff_time / (60 * 60 * 24 * 30));
        if (1 == $value[0]) {
            $value[1] = \Sifo\I18N::getTranslation("month");
        } else {
            $value[1] = \Sifo\I18N::getTranslation("months");
        }
    } elseif (floor($diff_time / (60 * 60 * 24)) >= 7) {
        $value[0] = floor($diff_time / (60 * 60 * 24 * 7));
        if (1 == $value[0]) {
            $value[1] = \Sifo\I18N::getTranslation("week");
        } else {
            $value[1] = \Sifo\I18N::getTranslation("weeks");
        }
    } elseif (floor($diff_time / (60 * 60)) >= 24) {
        $value[0] = floor($diff_time / (60 * 60 * 24));
        if (1 == $value[0]) {
            $value[1] = \Sifo\I18N::getTranslation("day");
        } else {
            $value[1] = \Sifo\I18N::getTranslation("days");
        }
    } elseif (floor($diff_time / 60) >= 60) {
        $value[0] = floor($diff_time / (60 * 60));
        if (1 == $value[0]) {
            $value[1] = \Sifo\I18N::getTranslation("hour");
        } else {
            $value[1] = \Sifo\I18N::getTranslation("hours");
        }
    } elseif (floor($diff_time / 60) >= 1) {
        $value[0] = floor($diff_time / 60);
        if (1 == $value[0]) {
            $value[1] = \Sifo\I18N::getTranslation("minute");
        } else {
            $value[1] = \Sifo\I18N::getTranslation("minutes");
        }
    } else {
        $value[0] = false;
        $value[1] = \Sifo\I18N::getTranslation("just some seconds");
    }
    $value[1] = smarty_block_t(array('count' => $value[0]), $value[1], $this, null);
    if ($value[0] > 0) {
        $params[1] = $value[0] . ' ' . $value[1];
    } else {
        $params[1] = $value[1];
    }
    return smarty_block_t($params, \Sifo\I18N::getTranslation('%1 ago'), $this, null);
}
/**
 * Smarty email obfuscator plugin
 *
 * Type:     function.
 * Name:     email_obfuscator.
 * Purpose:  email obfuscation for protecting emails.
 * 
 * @author   Nino Dafonte <*****@*****.**>.
 * @param	string 	Email to obfuscate (received automatically).
 * @param 	string 	Text to show instead of the email.
 * @return 	string 	JavaScript to show the obfuscated email.
*/
function smarty_function_email_obfuscator($params, &$smarty)
{
    // email address to obfuscate.
    $email = isset($params['email']) ? $params['email'] : '';
    // optional text to show instead the email
    $linktext = isset($params['text']) ? $params['text'] : '';
    // style information via class.
    $style_class = isset($params['class']) ? ' class=\\"' . $params['class'] . '\\" ' : '';
    // style information via id.
    $style_id = isset($params['id']) ? ' id=\\"' . $params['id'] . '\\" ' : '';
    // Getting the extra params for the case of %1, %2, etc in the linktext. Using ; like separator.
    $extra_params = array();
    if (isset($params['extra'])) {
        $extra_params = explode(';', $params['extra']);
    }
    // Translating linktext
    $textbefore = '';
    $textafter = '';
    if (!empty($linktext)) {
        $temp = smarty_block_t($extra_params, $linktext, $this, null);
        // If the email is inside the text string
        $email_position = strpos($temp, $email);
        if ($email_position) {
            // If the email is inside the string we make the link only in the email address
            $textbefore = substr($temp, 0, $email_position);
            $textafter = substr($temp, strpos($temp, $email) + strlen($email));
            $linktext = '';
        } else {
            // Else the link is all the string
            $linktext = $temp;
        }
    }
    $character_set = '+-.0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz';
    $key = str_shuffle($character_set);
    $cipher_text = '';
    $id = 'e' . rand(1, 999999999);
    for ($i = 0; $i < strlen($email); $i += 1) {
        $cipher_text .= $key[strpos($character_set, $email[$i])];
    }
    $script = 'var namex="' . $linktext . '";var a="' . $key . '";var b=a.split("").sort().join("");var c="' . $cipher_text . '";var d="";';
    $script .= 'for(var e=0;e<c.length;e++)d+=b.charAt(a.indexOf(c.charAt(e)));var linktext=(namex.length == 0)?linktext=d:linktext=namex;var textbefore="' . $textbefore . '";var textafter="' . $textafter . '";';
    $script .= 'document.getElementById("' . $id . '").innerHTML=textbefore+"<a ' . $style_id . $style_class . ' href=\\"mailto:"+d+"\\">"+linktext+"<\\/a>"+textafter';
    $script = "eval(\"" . str_replace(array("\\", '"'), array("\\\\", '\\"'), $script) . "\")";
    $script = '<script type="text/javascript">/*<![CDATA[*/' . $script . '/*]]>*/</script>';
    return '<span id="' . $id . '">[javascript protected email address]</span>' . $script;
}
Exemple #3
0
            } else {
                ?>
			<li><?php 
                if (!isset($_tag_stack)) {
                    $_tag_stack = array();
                }
                $_tag_stack[] = array();
                $_block_repeat = true;
                smarty_block_t($_tag_stack[count($_tag_stack) - 1], null, $this, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    ?>
No visible boards<?php 
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_t($_tag_stack[count($_tag_stack) - 1], $_block_content, $this, $_block_repeat);
                }
                array_pop($_tag_stack);
                ?>
</li>
		<?php 
            }
            ?>

		</ul>
		<?php 
            if ((defined("KU_MENUTYPE") ? KU_MENUTYPE : null) == 'normal') {
                ?>
			</div>
		<?php 
            }
/ajax_loader.gif" style="float:left; margin-top:8px;" />
				<p style="float:left;margin-left:10px; padding-top:5px;" >
				<img src="<?php 
echo $this->_tpl_vars['image_url'];
?>
/loading.gif" />
				<br/><span style="padding-left:3px;color:#aaaaaa "><?php 
$this->_tag_stack[] = array('t', array());
smarty_block_t($this->_tag_stack[count($this->_tag_stack) - 1][1], null, $this, $_block_repeat = true);
while ($_block_repeat) {
    ob_start();
    ?>
Please wait a while ...<?php 
    $_block_content = ob_get_contents();
    ob_end_clean();
    echo smarty_block_t($this->_tag_stack[count($this->_tag_stack) - 1][1], $_block_content, $this, $_block_repeat = false);
}
array_pop($this->_tag_stack);
?>
</span></p>
			</div>
			</div>			
	</div>
</div>

<?php 
echo '
<!--[if gte IE 6]>
<style type="text/css">
#main_loader .loader_box
{
    function content_56768d000667d9_02431979($_smarty_tpl)
    {
        if (!is_callable('smarty_function_locale')) {
            require_once '/var/www/wordpress/lamps.lightmaster.cz/www3/smarty/plugins/function.locale.php';
        }
        if (!is_callable('smarty_block_t')) {
            require_once '/var/www/wordpress/lamps.lightmaster.cz/www3/smarty/plugins/block.t.php';
        }
        ?>
<div class="row">
    <div class="col-sm-12">
        <div class="widget-box">
            <div class="widget-header">
                <?php 
        echo smarty_function_locale(array('path' => "locale", 'domain' => "lightmaster_en_US"), $_smarty_tpl);
        ?>

                <h4><?php 
        $_smarty_tpl->smarty->_cache['tag_stack'][] = array('t', array());
        $_block_repeat = true;
        echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
COMPANIESTITLE<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_cache['tag_stack']);
        ?>
</h4>
            </div>
<?php 
        echo '<script';
        ?>
>
    var lamps = <?php 
        echo json_encode($_smarty_tpl->tpl_vars['companiesList']->value);
        ?>
;
<?php 
        echo '</script';
        ?>
>
            <div class="widget-body">
                <div class="widget-main no-padding">
                    <table class="table table-hover table-bordered table-striped table-condensed">
                        <thead>
                        <tr>
                            
                            <th><?php 
        $_smarty_tpl->smarty->_cache['tag_stack'][] = array('t', array());
        $_block_repeat = true;
        echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
COMPANYNAME<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_cache['tag_stack']);
        ?>
</th>
                            <th><?php 
        $_smarty_tpl->smarty->_cache['tag_stack'][] = array('t', array());
        $_block_repeat = true;
        echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
COMPANYEDIT<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_cache['tag_stack']);
        ?>
</th>
                        </tr>
                        </thead>
                        <?php 
        $_from = $_smarty_tpl->tpl_vars['companiesList']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        $__foreach_it_0_saved_item = isset($_smarty_tpl->tpl_vars['it']) ? $_smarty_tpl->tpl_vars['it'] : false;
        $_smarty_tpl->tpl_vars['it'] = new Smarty_Variable();
        $__foreach_it_0_total = $_smarty_tpl->smarty->ext->_foreach->count($_from);
        if ($__foreach_it_0_total) {
            foreach ($_from as $_smarty_tpl->tpl_vars['it']->value) {
                $__foreach_it_0_saved_local_item = $_smarty_tpl->tpl_vars['it'];
                ?>
                            <tr id="item<?php 
                echo $_smarty_tpl->tpl_vars['it']->value['id'];
                ?>
">

                                
                                <td><?php 
                echo $_smarty_tpl->tpl_vars['it']->value['Company_name'];
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['it']->value['is_admin'] == 1) {
                    ?>
<button class="btn disabled btn-minier btn-yellow"><?php 
                    $_smarty_tpl->smarty->_cache['tag_stack'][] = array('t', array());
                    $_block_repeat = true;
                    echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);
                    while ($_block_repeat) {
                        ob_start();
                        ?>
ADMIN<?php 
                        $_block_content = ob_get_clean();
                        $_block_repeat = false;
                        echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);
                    }
                    array_pop($_smarty_tpl->smarty->_cache['tag_stack']);
                    ?>
</button><?php 
                }
                if ($_smarty_tpl->tpl_vars['it']->value['is_admin'] == 1) {
                    ?>
<button class="btn disabled btn-minier btn-success"><?php 
                    $_smarty_tpl->smarty->_cache['tag_stack'][] = array('t', array());
                    $_block_repeat = true;
                    echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);
                    while ($_block_repeat) {
                        ob_start();
                        ?>
MEMBER<?php 
                        $_block_content = ob_get_clean();
                        $_block_repeat = false;
                        echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);
                    }
                    array_pop($_smarty_tpl->smarty->_cache['tag_stack']);
                    ?>
</button><?php 
                }
                ?>
</td>
                                <td>
                                    <?php 
                if ($_smarty_tpl->tpl_vars['it']->value['is_admin'] == 1) {
                    ?>
                                    <div class="action-buttons">
                                        <a class="blue" href="<?php 
                    echo $_smarty_tpl->tpl_vars['setup']->value['adm']['www'];
                    ?>
companies/edit.html?id=<?php 
                    echo $_smarty_tpl->tpl_vars['it']->value['ID_company'];
                    ?>
" title="<?php 
                    $_smarty_tpl->smarty->_cache['tag_stack'][] = array('t', array());
                    $_block_repeat = true;
                    echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);
                    while ($_block_repeat) {
                        ob_start();
                        ?>
EDIT<?php 
                        $_block_content = ob_get_clean();
                        $_block_repeat = false;
                        echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);
                    }
                    array_pop($_smarty_tpl->smarty->_cache['tag_stack']);
                    ?>
">
                                            <i class="icon-edit bigger-130"></i>
                                        </a>
                                    </div>
                                    <?php 
                }
                ?>
                                </td>
                            </tr>
                            <?php 
                $_smarty_tpl->tpl_vars['it'] = $__foreach_it_0_saved_local_item;
            }
        } else {
            ?>
                            <tr>
                                <td class="center" colspan="5"><?php 
            $_smarty_tpl->smarty->_cache['tag_stack'][] = array('t', array());
            $_block_repeat = true;
            echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>
NOCOMPANIESINDB<?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_cache['tag_stack']);
            ?>
</td>
                            </tr>
                        <?php 
        }
        if ($__foreach_it_0_saved_item) {
            $_smarty_tpl->tpl_vars['it'] = $__foreach_it_0_saved_item;
        }
        ?>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div><?php 
    }
    function content_567690f88d6f43_17768414($_smarty_tpl)
    {
        if (!is_callable('smarty_function_locale')) {
            require_once '/var/www/wordpress/lamps.lightmaster.cz/www3/smarty/plugins/function.locale.php';
        }
        if (!is_callable('smarty_block_t')) {
            require_once '/var/www/wordpress/lamps.lightmaster.cz/www3/smarty/plugins/block.t.php';
        }
        ?>
<div class="row">
    <div class="col-sm-12">
        <div class="widget-box">
            <div class="widget-header">
                <?php 
        echo smarty_function_locale(array('path' => "./locale", 'domain' => "lightmaster_en_US"), $_smarty_tpl);
        ?>

                <h4><?php 
        $_smarty_tpl->smarty->_cache['tag_stack'][] = array('t', array());
        $_block_repeat = true;
        echo smarty_block_t(array(), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>
LAMPSTITLE<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_t(array(), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_cache['tag_stack']);
        ?>
</h4>
            </div>
<?php 
        echo '<script';
        ?>
>
    var lamps = <?php 
        echo json_encode($_smarty_tpl->tpl_vars['lampList']->value);
        ?>
;
<?php 
        echo '</script';
        ?>
>
            <div class="widget-body">
                <div class="widget-main no-padding">
                    <table class="table table-hover table-bordered table-striped table-condensed">
                        <thead>
                        <tr>
                            <th>Id lampy</th>
                            <th>Value 1</th>
                            <th>Value 2</th>
                            <th>Value 3</th>
                            <th>Value 4</th>
                            <th>Value 5</th>
                            <th>Value 6</th>
                        </tr>
                        </thead>
                        <?php 
        $_from = $_smarty_tpl->tpl_vars['lampList']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        $__foreach_it_0_saved_item = isset($_smarty_tpl->tpl_vars['it']) ? $_smarty_tpl->tpl_vars['it'] : false;
        $_smarty_tpl->tpl_vars['it'] = new Smarty_Variable();
        $__foreach_it_0_total = $_smarty_tpl->smarty->ext->_foreach->count($_from);
        if ($__foreach_it_0_total) {
            foreach ($_from as $_smarty_tpl->tpl_vars['it']->value) {
                $__foreach_it_0_saved_local_item = $_smarty_tpl->tpl_vars['it'];
                ?>
                            <tr id="item<?php 
                echo $_smarty_tpl->tpl_vars['it']->value['id'];
                ?>
">

                                <td><?php 
                echo $_smarty_tpl->tpl_vars['it']->value['id'];
                ?>
</td>
                                <td><?php 
                echo $_smarty_tpl->tpl_vars['it']->value['lat'];
                ?>
</td>
                                <td><?php 
                echo $_smarty_tpl->tpl_vars['it']->value['long'];
                ?>
</td>
                                <td><?php 
                echo $_smarty_tpl->tpl_vars['it']->value['isenabled'];
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['it']->value['dealer_company']) {
                    ?>
( <?php 
                    echo $_smarty_tpl->tpl_vars['it']->value['dealer_company'];
                    ?>
 )<?php 
                }
                ?>
</td>
                                <td><?php 
                echo $_smarty_tpl->tpl_vars['variable']->value['booleanBadgeInverse'][$_smarty_tpl->tpl_vars['it']->value['blokace']];
                if ($_smarty_tpl->tpl_vars['it']->value['duvodBlokace']) {
                    ?>
 - <?php 
                    echo $_smarty_tpl->tpl_vars['it']->value['duvodBlokace'];
                }
                ?>
</td>
                                <td>
                                    <div class="action-buttons">
                                        <a class="blue" href="<?php 
                echo $_smarty_tpl->tpl_vars['setup']->value['adm']['www'];
                ?>
uzivatele/edit.html?id=<?php 
                echo $_smarty_tpl->tpl_vars['it']->value['id'];
                ?>
" title="Editovat">
                                            <i class="icon-edit bigger-130"></i>
                                        </a>
                                    </div>
                                </td>
                            </tr>
                            <?php 
                $_smarty_tpl->tpl_vars['it'] = $__foreach_it_0_saved_local_item;
            }
        } else {
            ?>
                            <tr>
                                <td class="center" colspan="5">Není žádný záznam</td>
                            </tr>
                        <?php 
        }
        if ($__foreach_it_0_saved_item) {
            $_smarty_tpl->tpl_vars['it'] = $__foreach_it_0_saved_item;
        }
        ?>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div><?php 
    }