Skip to content

Commit

Permalink
namespace WorldlandDict #12
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Dec 3, 2019
1 parent 6f75798 commit 5754d45
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 49 deletions.
2 changes: 1 addition & 1 deletion controllers/ToolController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace GlobasaDictionary;
namespace WorldlangDict;

class ToolController {

Expand Down
2 changes: 1 addition & 1 deletion controllers/WordListController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace GlobasaDictionary;
namespace WorldlangDict;

class WordListController
{
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
namespace GlobasaDictionary;
namespace WorldlangDict;
include_once 'src/config.php';
processRequest($app);
2 changes: 1 addition & 1 deletion models/Request.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace GlobasaDictionary;
namespace WorldlangDict;

/**
* Calls the appropriate function based on the url.
Expand Down
2 changes: 1 addition & 1 deletion models/Word.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace GlobasaDictionary;
namespace WorldlangDict;

// A Globasa Word
class Word
Expand Down
4 changes: 2 additions & 2 deletions models/WordList.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace GlobasaDictionary;
namespace WorldlangDict;

class WordList {
private $app, $listLang, $list;
Expand Down Expand Up @@ -36,7 +36,7 @@ public function get($word = null) {

foreach($this->list as $wordIndex=>$entry) {
// var_dump($entry->get());
if (is_a($entry, 'GlobasaDictionary\Word')) {
if (is_a($entry, 'WorldlangDict\Word')) {
if ($this->listLang != "glb") {
$result .='<h1>'.sprintf($this->app->getTrans('Entry for'),$wordIndex,$this->listLang).'</h1>';
}
Expand Down
21 changes: 17 additions & 4 deletions src/App.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
<?php
namespace GlobasaDictionary;
namespace WorldlangDict;

class GlobasaApp {
class WorldlangDictConfig {
public $siteUri, $siteName, $template, $lang, $langCap, $defaultLang, $defaultLangCap, $auxLang, $auxLangCap, $templateFolder, $templatePath, $templateUri, $dictionaryFile, $languagesFile, $internationalizationFile, $dictionary, $languages, $trans, $startTime;

function __construct() {
$this->startTime = microtime(true);
}

public function setLang($lang) {
$this->lang = $lang;
public function setLang($lang, $aux=null) {
$this->lang = strtolower($lang);
$this->langCap = ucfirst($lang);
if (!is_null($aux)) {
$this->defaultLang = strtolower($aux);
$this->defaultLangCap = ucfirst($aux);
}
}

public function setTemplate($name, $folder=null) {
$this->template = $name;
if (!is_null($folder)) {
$this->templatesFolder = $folder;
}

$this->templatePath = "./".$this->templatesFolder.'/'.$this->template.'/';
$this->templateUri = $this->siteUri.$this->templatesFolder.'/'.$this->template.'/';
}
public function setPageTitle($title) {
$this->page->title = $title . ' - ' . $this->siteName;
}
Expand Down
34 changes: 0 additions & 34 deletions src/config.php

This file was deleted.

6 changes: 2 additions & 4 deletions src/request.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace GlobasaDictionary;
namespace WorldlangDict;

/**
* Calls the appropriate function based on the url.
Expand Down Expand Up @@ -78,9 +78,7 @@ function processOptions($app)
foreach ($app->page->options as $option=>$value) {
switch ($option) {
case 'template':
$app->template = $value;
$app->templatePath = "./".$app->templatesFolder.'/'.$app->template.'/';
$app->templateUri = $app->siteUri.$app->templatesFolder.'/'.$app->template.'/';
$app->setTemplate($value);
case 'full':

}
Expand Down

0 comments on commit 5754d45

Please sign in to comment.