Skip to content

Commit

Permalink
Merge pull request #12 from angry-meow/inited-spelling
Browse files Browse the repository at this point in the history
Fixed `inited` spelling
  • Loading branch information
n0nag0n authored Dec 19, 2022
2 parents a36828b + 616ceaf commit d60c328
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions controllers/Base_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ abstract class Base_Controller {

public function __construct(\Base $fw) {
$this->fw = $fw;
$has_been_initted = $this->hasBeenInitted();
if($this->hasBeenInitted() === false && strpos($this->fw->URI, '/init-environment') === false) {
$has_been_inited = $this->hasBeenInited();
if($this->hasBeenInited() === false && strpos($this->fw->URI, '/init-environment') === false) {
$this->fw->reroute('/init-environment', false);
}

$this->fw->set('has_been_initted', $has_been_initted);
if($has_been_initted) {
$this->fw->set('has_been_inited', $has_been_inited);
if($has_been_inited) {
$project_config = new Project_Config($fw->DB);
$project_config->load();
$this->fw->set('project_config', $project_config);
Expand All @@ -28,8 +28,8 @@ public function renderHtml(string $file_path, array $hive = []): void {
echo \Template::instance()->render('layout.htm');
}

public function hasBeenInitted(): bool {
public function hasBeenInited(): bool {
return file_exists($this->fw->PROJECT_CONFIG);
}
}

}
8 changes: 4 additions & 4 deletions controllers/Index_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
class Index_Controller extends Base_Controller {

public function index(\Base $fw): void {

// if the main config file is missing, start initing this bad boy
if(!$fw->has_been_initted) {
$fw->reroute('/init-environment', false);
if(!$fw->has_been_inited) {
$fw->reroute('/init-environment');
}

$this->renderHtml('index/index.htm');
}

}
}
2 changes: 1 addition & 1 deletion ui/layout.htm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</button>

<div class="collapse navbar-collapse" id="navbarsExampleDefault">
<check if="{{ @has_been_initted }}">
<check if="{{ @has_been_inited }}">
<ul class="navbar-nav mr-auto">
<li class="nav-item {{ strpos(@URI, 'controllers') !== false ? 'active' : '' }}">
<a class="nav-link" href="/controllers">Controllers</a>
Expand Down

0 comments on commit d60c328

Please sign in to comment.