Skip to content

Commit

Permalink
removing unnecessary lines
Browse files Browse the repository at this point in the history
  • Loading branch information
wasu-code committed Mar 26, 2022
1 parent 60f5f36 commit d8095d8
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 17 deletions.
4 changes: 2 additions & 2 deletions app/about/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
$about = new Smarty();

$about->assign('cfg',$cfg);
$about->assign('app_url',$cfg->app_url);//++
$about->assign('root_path',$cfg->root_path);//++
//$about->assign('app_url',$cfg->app_url);//++
//$about->assign('root_path',$cfg->root_path);//++

$about->assign('page_title','O nas');
$about->assign('page_desc','liczysz na cud? Użyj naszego kalkulatora.');
Expand Down
4 changes: 2 additions & 2 deletions app/about/about.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

{block name="content"}
<div style="width:90%; margin: 2em auto;">
<a href="{$app_url}/app/calc.php" class="pure-button">Powrót do kalkulatora</a>
<a href="{$app_url}/app/security/logout.php" class="pure-button pure-button-active">Wyloguj</a>
<a href="{$cfg->app_url}/app/calc.php" class="pure-button">Powrót do kalkulatora</a>
<a href="{$cfg->app_url}/app/security/logout.php" class="pure-button pure-button-active">Wyloguj</a>
</div>

<div style="width:90%; margin: 2em auto;">
Expand Down
4 changes: 2 additions & 2 deletions app/calc/CalcCtrl.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ public function generateView() {
$smarty = new Smarty();

$smarty->assign('cfg',$cfg);
$smarty->assign('app_url',$cfg->app_url); //++
$smarty->assign('root_path',$cfg->root_path); //++
//$smarty->assign('app_url',$cfg->app_url); //++
//$smarty->assign('root_path',$cfg->root_path); //++

$smarty->assign('page_title','Kalkulator Kredytowy');
$smarty->assign('page_desc','liczysz na cud? Użyj naszego kalkulatora.');
Expand Down
5 changes: 3 additions & 2 deletions app/security/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ function validateLogin(&$form,&$messages){
}

$smarty = new Smarty();
$smarty->assign('app_url',$cfg->app_url);
$smarty->assign('root_path',$cfg->root_path);
$smarty->assign('cfg',$cfg);
//$smarty->assign('app_url',$cfg->app_url);
//$smarty->assign('root_path',$cfg->root_path);

$smarty->assign('page_title','Logowanie');
$smarty->assign('page_desc','zaloguj się');
Expand Down
4 changes: 2 additions & 2 deletions app/security/login.tpl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{extends file="../../templates/default.tpl"}
{extends file=$cfg->root_path|cat:'/templates/default.tpl'}

{block name="content"}


<div style="width:90%; margin: 2em auto;">

<form action="{$app_url}/app/security/login.php" method="post" class="pure-form pure-form-stacked">
<form action="{$cfg->app_url}/app/security/login.php" method="post" class="pure-form pure-form-stacked">
<legend>Logowanie</legend>
<fieldset>
<label for="id_login">login: </label>
Expand Down
4 changes: 4 additions & 0 deletions lib/Messages.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ public function isError() {
public function isInfo() {
return count ( $this->infos ) > 0;
}

public function isMessage() {
return count ( $this->infos ) > 0 || count ( $this->errors ) > 0;
}

public function getErrors() {
return $this->errors;
Expand Down
14 changes: 7 additions & 7 deletions templates/default.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<title>{$page_title|default:"Z powodu kryzysu nie ma napisu"}</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="stylesheet" href="{$app_url}/templates/assets/css/main.css" />
<link rel="stylesheet" href="{$app_url}/main.css" />
<link rel="stylesheet" href="{$cfg->app_url}/templates/assets/css/main.css" />
<link rel="stylesheet" href="{$cfg->app_url}/main.css" />
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/pure-min.css">
</head>

Expand All @@ -16,18 +16,18 @@
<div id="header">

<!-- Logo -->
<h1><a href="{$app_url}/index.php" id="logo">{$page_header|default:"AAAaaaa"}</a></h1>
<h1><a href="{$cfg->app_url}/index.php" id="logo">{$page_header|default:"AAAaaaa"}</a></h1>

<div><em>Zalogowano jako:
<div><em>Poziom dostępu:
{$smarty.session['role']|default: "gość"}
</em></div>

<!-- Nav -->
<nav id="nav">
<ul>
<li class="{$current1|default:''}"><a href="{$app_url}/app/ctrl.php">Kalkulator</a></li>
<li class="{$current2|default:''}"><a href="{$app_url}/app/about/about.php">O nas</a></li>
<li class="{$current3|default:''}"><a href="{$app_url}/app/security/logout.php">Wyloguj</a></li>
<li class="{$current1|default:''}"><a href="{$cfg->app_url}/app/ctrl.php">Kalkulator</a></li>
<li class="{$current2|default:''}"><a href="{$cfg->app_url}/app/about/about.php">O nas</a></li>
<li class="{$current3|default:''}"><a href="{$cfg->app_url}/app/security/logout.php">Wyloguj</a></li>
</ul>
</nav>

Expand Down

0 comments on commit d8095d8

Please sign in to comment.