/** * one initial call of config() is required. multiple calls won't hurt. */ public static function config(array $config = array()) { // merge given (precedence) and default config $ROOT = rtrim($_SERVER['DOCUMENT_ROOT'], '/'); // normalize trailing self::$config = (object) array_merge(self::$defaultConfig, $config); $c =& self::$config; // shorthand $c->STATICPATH = $ROOT . '/' . $c->STATICPATH; //prepend }
public function set_up($smarty) { /* * Load the forms style */ import('system/share/web/statics'); $smarty->append_tpl_var('extra_statics', Statics::load('yaml/screen/forms', 'css')); Statics::load_lte('html5/jquery.html5forms', 'js', 9); $code = <<<EOF <script type="text/javascript"> \$(function(){ \$('#login-form').html5form({ 'async': false, 'messages': 'en', 'responseDiv': '#header' }); }); </script> EOF; Statics::lte_code($code, 9); }
<div class="row"> <div class="col-md-3 item-sidebar"> <div class="sidebar-block"> <div class="items"> <?php $this->widget('Ecommerce\\categorys'); ?> </div> </div> </div> <div class="col-md-9"> <div class="detail_item content"> <div class="row"> <div class="col-sm-5"> <img src="<?php echo Statics::file($item->image ? $item->image->path : '/static/system/images/no-image.png', '350x800'); ?> " class="img-responsive"/> </div> <div class="col-sm-7"> <h1><?php echo $item->name(); ?> </h1> <ul class="item-options"> <?php foreach ($item->options as $param) { if (!$param->item_option_view || !$param->value) { continue; } if ($param->item_option_type == 'select') {
public function head() { echo "<title>{$this->title}</title>\n"; if (!empty($this->template->config['favicon']) && file_exists($this->template->path . "/{$this->template->config['favicon']}")) { echo " <link rel='shortcut icon' href='/templates/{$this->template->name}/{$this->template->config['favicon']}' />"; } elseif (!empty($this->template->config['favicon']) && file_exists($this->app->path . "/static/images/{$this->template->config['favicon']}")) { echo " <link rel='shortcut icon' href='/static/images/{$this->template->config['favicon']}' />"; } elseif (file_exists($this->app->path . '/static/images/favicon.ico')) { echo " <link rel='shortcut icon' href='/static/images/favicon.ico' />"; } foreach ($this->getMetaTags() as $meta) { echo "\n " . Html::el('meta', $meta, '', null); } if (!empty(Inji::$config['assets']['js'])) { foreach (Inji::$config['assets']['js'] as $js) { $this->customAsset('js', $js); } } $this->checkNeedLibs(); $this->parseCss(); echo "\n <script src='" . Statics::file(($this->app->type != 'app' ? '/' . $this->app->name : '') . "/static/system/js/Inji.js") . "'></script>"; }
<div class="carousel-inner" role="listbox"> <?php $i = 0; foreach ($slides as $item) { ?> <div class="item <?php echo !$i ? 'active' : ''; ?> "> <?php if ($item->link) { echo "<a href = '{$item->link}' style = 'display:inline-block;'>"; } ?> <img src="<?php echo Statics::file($item->image->path); ?> " alt="<?php echo $item->name; ?> "> <div class="carousel-caption"> <?php echo $item->description; ?> </div> <?php if ($item->link) { echo "</a>"; } ?>
<div class="text-center"> <h3><?php echo Users\User::$cur->name(); ?> </h3> <img src="<?php echo Statics::file(Users\User::$cur->info->photo ? Users\User::$cur->info->photo->path : '/static/system/images/no-image.png', '200x200'); ?> " /> <br /> <a href ="/admin" class = 'btn btn-primary'>Перейти в админ панель</a> <a href ="/admin?logout=1" class = 'btn btn-danger'>Выйти</a> </div>
<tr> <th>Способ оплаты</th> <th>Валюта</th> <th></th> </tr> <?php foreach ($merchants as $merchant) { $allowCurrencies = $merchant->allowCurrencies($pay); if (!$allowCurrencies) { continue; } ?> <tr> <td> <img src="<?php echo Statics::file($merchant->image ? $merchant->image->path : '/static/system/images/no-image.png', '150x150'); ?> " class="img-responsive" /> <h4 class="text-center"><?php echo $merchant->name(); ?> </h4> </td> <td> <?php foreach ($allowCurrencies as $allowCurrency) { $className = 'Money\\MerchantHelper\\' . $merchant->object_name; $sum = $className::getFinalSum($pay, $allowCurrency); ?> <b><?php echo $allowCurrency['currency']->name();
<?php /* example foot, making use of dirList statistical functions */ ?> <div id="foot" class='singleCol'> Folder contains <?php echo $d->totalSizeHuman(2); ?> in <?php echo $d->totalFiles(); ?> Files. It has <?php echo $d->totalDirs(); ?> subdirectories. check <a href='http://validator.w3.org/check?uri=referer'>W3C</a> </div> <!-- script foot --> <script src='http://code.jquery.com/jquery-1.11.0.min.js'></script> <script src='<?php echo Statics::get('lib/fotorama/fotorama.min.js'); ?> '></script> <script src='<?php echo Statics::get('common.js'); ?> '></script> </body> </html>
<h4 class="item-name"> <a href="/ecommerce/view/<?php echo $item->id; ?> "> <?php echo $item->name(); ?> </a> </h4> <a href="/ecommerce/view/<?php echo $item->id; ?> "> <img src="<?php echo Statics::file($item->image ? $item->image->path : '/static/system/images/no-image.png', '200x200', 'q'); ?> " class="img-responsive" style = 'margin:0 auto;'/> </a> <div class="item-actions"> <div class="btn-group btn-group-justified"> <a class="btn btn-default item-price"><?php echo number_format($item->getPrice()->price, 2, '.', ' '); ?> руб</a> <a class="btn btn-primary item-addtocart" onclick="inji.Ecommerce.Cart.addItem(<?php echo $item->getPrice()->id; ?> , 1);"><i class="glyphicon glyphicon-shopping-cart"></i></a> </div> </div>
<div class="users"> <div class="content"> <div class='row'> <div class = 'box col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1'> <h3>Вход</h3> <div class="form-group"> <?php $socials = Users\Social::getList(['where' => ['active', 1]]); if ($socials) { echo 'Войти через: '; foreach (Users\Social::getList(['where' => ['active', 1]]) as $social) { $text = $social->image ? '<img src ="' . Statics::file($social->image->path, '25x25', 'q') . '">' : $social->name(); echo "<a href = '/users/social/auth/{$social->code}'>{$text}</a> "; } } ?> </div> <form action = '' method = 'POST' > <div class ='row'> <div class="col-sm-6"> <div class ='form-group'> <label>Логин или email</label> <input type ='text' name ='user_login' class ='form-control' placeholder ='*****@*****.**' required /> </div> </div> <div class="col-sm-6"> <div class ='form-group'> <label>Пароль</label> <input type ='password' name ='user_pass' class ='form-control' placeholder ='Пароль' required /> </div> </div>