Skip to content

Commit

Permalink
Refactored source code
Browse files Browse the repository at this point in the history
  • Loading branch information
Kero76 committed Dec 22, 2016
1 parent a460c82 commit 6286ae4
Show file tree
Hide file tree
Showing 35 changed files with 147 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
namespace SciMS\Controller\BuildDomain\Administration;

use \SciMS\Controller\BuildDomain\AbstractBuildDomain;
use \SciMS\Domain\Theme;
use \SciMS\Domain\Website;
use \SciMS\Form\Input;

/**
Expand Down Expand Up @@ -40,8 +42,8 @@ public function __construct($template) {
* @version 1.0
*/
public function buildDomain(array $services) {
$website = $services['dao.website']->findSettings('../app/settings.yml');
$themes = $services['dao.theme']->findSettings('../app/themes.yml');
$website = $services['dao.website']->findSettings(Website::WEBSITE_SETTING_PATH);
$themes = $services['dao.theme']->findSettings(Theme::THEMES_SETTING_PATH);
$theme = "";

foreach($themes as $t) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php
namespace SciMS\Controller\BuildDomain\Administration;

use SciMS\Controller\BuildDomain\AbstractBuildDomain;
use \SciMS\Controller\BuildDomain\AbstractBuildDomain;
use \SciMS\Domain\Theme;
use \SciMS\Domain\Website;

/**
* Class BuildAdministrationHome
Expand Down Expand Up @@ -37,8 +39,8 @@ public function __construct($template) {
* @version 1.0
*/
public function buildDomain(array $services) {
$website = $services['dao.website']->findSettings('../app/settings.yml');
$themes = $services['dao.theme']->findSettings('../app/themes.yml');
$website = $services['dao.website']->findSettings(Website::WEBSITE_SETTING_PATH);
$themes = $services['dao.theme']->findSettings(Theme::THEMES_SETTING_PATH);
$theme = "";

foreach ($themes as $t) {
Expand Down
10 changes: 6 additions & 4 deletions src/Controller/BuildDomain/Administration/BuildArticles.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php
namespace SciMS\Controller\BuildDomain\Administration;

use SciMS\Controller\BuildDomain\AbstractBuildDomain;
use SciMS\Domain\User;
use \SciMS\Controller\BuildDomain\AbstractBuildDomain;
use \SciMS\Domain\Theme;
use \SciMS\Domain\User;
use \SciMS\Domain\Website;

/**
* Class BuildDomainArticles.
Expand Down Expand Up @@ -38,8 +40,8 @@ public function __construct($template) {
* @version 1.0
*/
public function buildDomain(array $services) {
$website = $services['dao.website']->findSettings('../app/settings.yml');
$themes = $services['dao.theme']->findSettings('../app/themes.yml');
$website = $services['dao.website']->findSettings(Website::WEBSITE_SETTING_PATH);
$themes = $services['dao.theme']->findSettings(Theme::THEMES_SETTING_PATH);
$theme = "";

foreach ($themes as $t) {
Expand Down
8 changes: 5 additions & 3 deletions src/Controller/BuildDomain/Administration/BuildCategories.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php
namespace SciMS\Controller\BuildDomain\Administration;

use SciMS\Controller\BuildDomain\AbstractBuildDomain;
use \SciMS\Controller\BuildDomain\AbstractBuildDomain;
use \SciMS\Domain\Theme;
use \SciMS\Domain\Website;

class BuildCategories extends AbstractBuildDomain {

Expand Down Expand Up @@ -29,8 +31,8 @@ public function __construct($template) {
* @version 1.0
*/
public function buildDomain(array $services) {
$website = $services['dao.website']->findSettings('../app/settings.yml');
$themes = $services['dao.theme']->findSettings('../app/themes.yml');
$website = $services['dao.website']->findSettings(Website::WEBSITE_SETTING_PATH);
$themes = $services['dao.theme']->findSettings(Theme::THEMES_SETTING_PATH);
$theme = "";

foreach ($themes as $t) {
Expand Down
13 changes: 7 additions & 6 deletions src/Controller/BuildDomain/Administration/BuildEditArticle.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

use \SciMS\Controller\BuildDomain\AbstractBuildDomain;
use \SciMS\Domain\Article;
use \SciMS\Domain\Theme;
use \SciMS\Domain\Website;
use \SciMS\Form\Input;
use \SciMS\Form\Option;
use \SciMS\Form\Select;
Expand Down Expand Up @@ -44,16 +46,15 @@ public function __construct($template) {
* @version 1.0
*/
public function buildDomain(array $services) {
$services['get.handler']->setRequest($_GET); // Retrieve $_GET.
$user = $services['dao.user']->findById($services['session.handler']->getRequestField('user_id'));
$article = $services['dao.article']->findById($services['get.handler']->getRequestField('article'));

$services['post.handler']->setRequest($_POST); // Retrieve $_POST.
$services['get.handler']->setRequest($_GET); // Retrieve $_GET.
$services['file.handler']->setRequest($_FILES); // Retrieve $_SESSION.

$website = $services['dao.website']->findSettings('../app/settings.yml');
$themes = $services['dao.theme']->findSettings('../app/themes.yml');
$user = $services['dao.user']->findById($services['session.handler']->getRequestField('user_id'));
$article = $services['dao.article']->findById($services['get.handler']->getRequestField('article'));

$website = $services['dao.website']->findSettings(Website::WEBSITE_SETTING_PATH);
$themes = $services['dao.theme']->findSettings(Theme::THEMES_SETTING_PATH);
$theme = "";

foreach($themes as $t) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php
namespace SciMS\Controller\BuildDomain\Administration;

use SciMS\Controller\BuildDomain\AbstractBuildDomain;
use \SciMS\Controller\BuildDomain\AbstractBuildDomain;
use \SciMS\Domain\Theme;
use \SciMS\Domain\Website;
use \SciMS\Form\Input;

/**
Expand Down Expand Up @@ -39,8 +41,8 @@ public function __construct($template) {
*/
public function buildDomain(array $services) {
$services['get.handler']->setRequest($_GET); // Retrieve $_GET.
$website = $services['dao.website']->findSettings('../app/settings.yml');
$themes = $services['dao.theme']->findSettings('../app/themes.yml');
$website = $services['dao.website']->findSettings(Website::WEBSITE_SETTING_PATH);
$themes = $services['dao.theme']->findSettings(Theme::THEMES_SETTING_PATH);
$theme = "";

foreach($themes as $t) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
namespace SciMS\Controller\BuildDomain\Administration;

use \SciMS\Controller\BuildDomain\AbstractBuildDomain;
use \SciMS\Domain\Theme;
use \SciMS\Domain\Website;
use \SciMS\Form\Input;
use \SciMS\Form\TextArea;

Expand Down Expand Up @@ -42,8 +44,8 @@ public function __construct($template) {
*/
public function buildDomain(array $services) {
$services['get.handler']->setRequest($_GET); // Retrieve $_GET.
$website = $services['dao.website']->findSettings('../app/settings.yml');
$themes = $services['dao.theme']->findSettings('../app/themes.yml');
$website = $services['dao.website']->findSettings(Website::WEBSITE_SETTING_PATH);
$themes = $services['dao.theme']->findSettings(Theme::THEMES_SETTING_PATH);
$theme = "";

foreach($themes as $t) {
Expand Down
10 changes: 6 additions & 4 deletions src/Controller/BuildDomain/Administration/BuildInstallation.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php
namespace SciMS\Controller\BuildDomain\Administration;

use SciMS\Controller\BuildDomain\AbstractBuildDomain;
use SciMS\Form\Input;
use \SciMS\Controller\BuildDomain\AbstractBuildDomain;
use \SciMS\Domain\Theme;
use \SciMS\Domain\Website;
use \SciMS\Form\Input;

/**
* Class BuildInstallation.
Expand Down Expand Up @@ -39,8 +41,8 @@ public function __construct($template) {
* @version 1.0
*/
public function buildDomain(array $services) {
$website = $services['dao.website']->findSettings('../app/settings.yml');
$themes = $services['dao.theme']->findSettings('../app/themes.yml');
$website = $services['dao.website']->findSettings(Website::WEBSITE_SETTING_PATH);
$themes = $services['dao.theme']->findSettings(Theme::THEMES_SETTING_PATH);
$theme = "";

foreach ($themes as $t) {
Expand Down
8 changes: 5 additions & 3 deletions src/Controller/BuildDomain/Administration/BuildUsers.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php
namespace SciMS\Controller\BuildDomain\Administration;

use SciMS\Controller\BuildDomain\AbstractBuildDomain;
use \SciMS\Controller\BuildDomain\AbstractBuildDomain;
use \SciMS\Domain\Theme;
use \SciMS\Domain\Website;

/**
* Class BuildDomainUsers.
Expand Down Expand Up @@ -37,8 +39,8 @@ public function __construct($template) {
* @version 1.0
*/
public function buildDomain(array $services) {
$website = $services['dao.website']->findSettings('../app/settings.yml');
$themes = $services['dao.theme']->findSettings('../app/themes.yml');
$website = $services['dao.website']->findSettings(Website::WEBSITE_SETTING_PATH);
$themes = $services['dao.theme']->findSettings(Theme::THEMES_SETTING_PATH);
$theme = "";

foreach ($themes as $t) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

use \SciMS\Controller\BuildDomain\AbstractBuildDomain;
use \SciMS\Domain\Article;
use \SciMS\Domain\Theme;
use \SciMS\Domain\Website;
use \SciMS\Form\Input;
use \SciMS\Form\Option;
use \SciMS\Form\Select;
Expand Down Expand Up @@ -44,8 +46,8 @@ public function __construct($template) {
* @version 1.0
*/
public function buildDomain(array $services) {
$website = $services['dao.website']->findSettings('../app/settings.yml');
$themes = $services['dao.theme']->findSettings('../app/themes.yml');
$website = $services['dao.website']->findSettings(Website::WEBSITE_SETTING_PATH);
$themes = $services['dao.theme']->findSettings(Theme::THEMES_SETTING_PATH);
$theme = "";

foreach($themes as $t) {
Expand Down
7 changes: 5 additions & 2 deletions src/Controller/BuildDomain/Build404.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php
namespace SciMS\Controller\BuildDomain;

use \SciMS\Domain\Theme;
use \SciMS\Domain\Website;

/**
* Class Build404.
Expand Down Expand Up @@ -37,8 +40,8 @@ public function __construct($template) {
* @version 1.0
*/
public function buildDomain(array $services) {
$website = $services['dao.website']->findSettings('../app/settings.yml');
$themes = $services['dao.theme']->findSettings('../app/themes.yml');
$website = $services['dao.website']->findSettings(Website::WEBSITE_SETTING_PATH);
$themes = $services['dao.theme']->findSettings(Theme::THEMES_SETTING_PATH);
$theme = "";

foreach($themes as $t) {
Expand Down
6 changes: 4 additions & 2 deletions src/Controller/BuildDomain/BuildConnection.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
namespace SciMS\Controller\BuildDomain;

use \SciMS\Domain\Theme;
use \SciMS\Domain\Website;
use \SciMS\Form\Input;

/**
Expand Down Expand Up @@ -39,8 +41,8 @@ public function __construct($template) {
* @version 1.0
*/
public function buildDomain(array $services) {
$website = $services['dao.website']->findSettings('../app/settings.yml');
$themes = $services['dao.theme']->findSettings('../app/themes.yml');
$website = $services['dao.website']->findSettings(Website::WEBSITE_SETTING_PATH);
$themes = $services['dao.theme']->findSettings(Theme::THEMES_SETTING_PATH);
$theme = "";

foreach($themes as $t) {
Expand Down
7 changes: 5 additions & 2 deletions src/Controller/BuildDomain/BuildConsultArticle.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php
namespace SciMS\Controller\BuildDomain;

use \SciMS\Domain\Theme;
use \SciMS\Domain\Website;

/**
* Class BuildConsultArticle.
Expand Down Expand Up @@ -38,8 +41,8 @@ public function __construct($template) {
*/
public function buildDomain(array $services) {
$services['get.handler']->setRequest($_GET); // Retrieve $_GET.
$website = $services['dao.website']->findSettings('../app/settings.yml');
$themes = $services['dao.theme']->findSettings('../app/themes.yml');
$website = $services['dao.website']->findSettings(Website::WEBSITE_SETTING_PATH);
$themes = $services['dao.theme']->findSettings(Theme::THEMES_SETTING_PATH);
$theme = "";

foreach($themes as $t) {
Expand Down
7 changes: 5 additions & 2 deletions src/Controller/BuildDomain/BuildConsultArticleCategory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php
namespace SciMS\Controller\BuildDomain;

use \SciMS\Domain\Theme;
use \SciMS\Domain\Website;

/**
* Class BuildConsultArticleCategory.
Expand Down Expand Up @@ -38,8 +41,8 @@ public function __construct($template) {
*/
public function buildDomain(array $services) {
$services['get.handler']->setRequest($_GET); // Retrieve $_GET.
$website = $services['dao.website']->findSettings('../app/settings.yml');
$themes = $services['dao.theme']->findSettings('../app/themes.yml');
$website = $services['dao.website']->findSettings(Website::WEBSITE_SETTING_PATH);
$themes = $services['dao.theme']->findSettings(Theme::THEMES_SETTING_PATH);
$theme = "";

foreach($themes as $t) {
Expand Down
7 changes: 5 additions & 2 deletions src/Controller/BuildDomain/BuildConsultProfile.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php
namespace SciMS\Controller\BuildDomain;

use \SciMS\Domain\Theme;
use \SciMS\Domain\Website;

/**
* Class BuildConsultProfile.
Expand Down Expand Up @@ -37,8 +40,8 @@ public function __construct($template) {
*/
public function buildDomain(array $services) {
$services['get.handler']->setRequest($_GET); // Retrieve $_GET.
$website = $services['dao.website']->findSettings('../app/settings.yml');
$themes = $services['dao.theme']->findSettings('../app/themes.yml');
$website = $services['dao.website']->findSettings(Website::WEBSITE_SETTING_PATH);
$themes = $services['dao.theme']->findSettings(Theme::THEMES_SETTING_PATH);
$theme = "";

foreach($themes as $t) {
Expand Down
10 changes: 7 additions & 3 deletions src/Controller/BuildDomain/BuildHome.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?php
namespace SciMS\Controller\BuildDomain;

use \SciMS\Database\DatabaseSetting;
use \SciMS\Domain\Theme;
use \SciMS\Domain\Website;

/**
* Class BuildHome
*
Expand Down Expand Up @@ -46,13 +50,13 @@ public function __construct($template) {
*/
public function buildDomain(array $services) {
// Check if the database file not exist on server, and if not exist redirect the user on the installation page.
if (!$services['file.checker']->fileExist('../app/db.yml')) {
if (!$services['file.checker']->fileExist(DatabaseSetting::DB_SETTING_PATH)) {
$url = '/web/index.php?action=installation';
$services['redirect.handler']->redirect($url);
}

$website = $services['dao.website']->findSettings('../app/settings.yml');
$themes = $services['dao.theme']->findSettings('../app/themes.yml');
$website = $services['dao.website']->findSettings(Website::WEBSITE_SETTING_PATH);
$themes = $services['dao.theme']->findSettings(Theme::THEMES_SETTING_PATH);
$theme = "";

foreach($themes as $t) {
Expand Down
6 changes: 4 additions & 2 deletions src/Controller/BuildDomain/BuildInscription.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
namespace SciMS\Controller\BuildDomain;

use \SciMS\Domain\Theme;
use \SciMS\Domain\Website;
use \SciMS\Form\Input;

/**
Expand Down Expand Up @@ -39,8 +41,8 @@ public function __construct($template) {
* @version 1.0
*/
public function buildDomain(array $services) {
$website = $services['dao.website']->findSettings('../app/settings.yml');
$themes = $services['dao.theme']->findSettings('../app/themes.yml');
$website = $services['dao.website']->findSettings(Website::WEBSITE_SETTING_PATH);
$themes = $services['dao.theme']->findSettings(Theme::THEMES_SETTING_PATH);
$theme = "";

foreach($themes as $t) {
Expand Down
9 changes: 6 additions & 3 deletions src/Controller/BuildDomain/BuildSearchResultDomain.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace SciMS\Controller\BuildDomain;

use \SciMS\Domain\Theme;
use \SciMS\Domain\Website;

/**
* Class BuildSearchResultDomain.
*
Expand Down Expand Up @@ -38,9 +41,9 @@ public function buildDomain(array $services) {
$services['post.handler']->setRequest($_POST); // Retrieve $_POST.
$services['get.handler']->setRequest($_GET); // Retrieve $_GET.
$services['file.handler']->setRequest($_FILES); // Retrieve $_SESSION.
$website = $services['dao.website']->findSettings('../app/settings.yml');
$themes = $services['dao.theme']->findSettings('../app/themes.yml');

$website = $services['dao.website']->findSettings(Website::WEBSITE_SETTING_PATH);
$themes = $services['dao.theme']->findSettings(Theme::THEMES_SETTING_PATH);
$theme = "";

foreach($themes as $t) {
Expand Down
Loading

0 comments on commit 6286ae4

Please sign in to comment.