-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move misc pages to Community namespace
- Loading branch information
1 parent
003fc59
commit 9c881cc
Showing
46 changed files
with
444 additions
and
398 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace BNETDocs\Controllers\Community; | ||
|
||
use \BNETDocs\Libraries\Community\Credits as CreditsLib; | ||
|
||
class Credits extends \BNETDocs\Controllers\Base | ||
{ | ||
/** | ||
* Constructs a Controller, typically to initialize properties. | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->model = new \BNETDocs\Models\Community\Credits(); | ||
} | ||
|
||
/** | ||
* Invoked by the Router class to handle the request. | ||
* | ||
* @param array|null $args The optional route arguments and any captured URI arguments. | ||
* @return boolean Whether the Router should invoke the configured View. | ||
*/ | ||
public function invoke(?array $args): bool | ||
{ | ||
$this->model->_responseCode = \BNETDocs\Libraries\Core\HttpCode::HTTP_OK; | ||
$this->model->top_contributors_by_comments = CreditsLib::getTopContributorsByComments(); | ||
$this->model->top_contributors_by_documents = CreditsLib::getTopContributorsByDocuments(); | ||
$this->model->top_contributors_by_news_posts = CreditsLib::getTopContributorsByNewsPosts(); | ||
$this->model->top_contributors_by_packets = CreditsLib::getTopContributorsByPackets(); | ||
$this->model->top_contributors_by_servers = CreditsLib::getTopContributorsByServers(); | ||
$this->model->total_users = CreditsLib::getTotalUsers(); | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace BNETDocs\Controllers\Community; | ||
|
||
use \BNETDocs\Libraries\Core\HttpCode; | ||
|
||
class Discord extends \BNETDocs\Controllers\Base | ||
{ | ||
/** | ||
* Constructs a Controller, typically to initialize properties. | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->model = new \BNETDocs\Models\Community\Discord(); | ||
} | ||
|
||
/** | ||
* Invoked by the Router class to handle the request. | ||
* | ||
* @param array|null $args The optional route arguments and any captured URI arguments. | ||
* @return boolean Whether the Router should invoke the configured View. | ||
*/ | ||
public function invoke(?array $args): bool | ||
{ | ||
$config = &\CarlBennett\MVC\Libraries\Common::$config->discord; | ||
|
||
$this->model->discord_server_id = $config->server_id; | ||
$this->model->discord_url = \sprintf('https://discord.gg/%s', $config->invite_code); | ||
$this->model->enabled = $config->enabled; | ||
|
||
$this->model->_responseCode = ($this->model->enabled ? HttpCode::HTTP_OK : HttpCode::HTTP_SERVICE_UNAVAILABLE); | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace BNETDocs\Controllers\Community; | ||
|
||
class Donate extends \BNETDocs\Controllers\Base | ||
{ | ||
/** | ||
* Constructs a Controller, typically to initialize properties. | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->model = new \BNETDocs\Models\Community\Donate(); | ||
} | ||
|
||
/** | ||
* Invoked by the Router class to handle the request. | ||
* | ||
* @param array|null $args The optional route arguments and any captured URI arguments. | ||
* @return boolean Whether the Router should invoke the configured View. | ||
*/ | ||
public function invoke(?array $args): bool | ||
{ | ||
$this->model->donations = \CarlBennett\MVC\Libraries\Common::$config->bnetdocs->donations; | ||
$this->model->_responseCode = \BNETDocs\Libraries\Core\HttpCode::HTTP_OK; | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
namespace BNETDocs\Controllers\Community; | ||
|
||
use \BNETDocs\Libraries\Core\DateTimeImmutable; | ||
use \DateTimeZone; | ||
|
||
class Legal extends \BNETDocs\Controllers\Base | ||
{ | ||
public const LICENSE_FILE = '../LICENSE.txt'; | ||
|
||
/** | ||
* Constructs a Controller, typically to initialize properties. | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->model = new \BNETDocs\Models\Community\Legal(); | ||
} | ||
|
||
/** | ||
* Invoked by the Router class to handle the request. | ||
* | ||
* @param array|null $args The optional route arguments and any captured URI arguments. | ||
* @return boolean Whether the Router should invoke the configured View. | ||
*/ | ||
public function invoke(?array $args): bool | ||
{ | ||
$privacy_contact = &\CarlBennett\MVC\Libraries\Common::$config->bnetdocs->privacy->contact; | ||
$this->model->email_domain = $privacy_contact->email_domain; | ||
$this->model->email_mailbox = $privacy_contact->email_mailbox; | ||
|
||
$this->model->license = \file_get_contents(self::LICENSE_FILE); | ||
$this->model->license_version = \BNETDocs\Libraries\Core\VersionInfo::$version['bnetdocs'][3] ?? null; | ||
|
||
if (!\is_null($this->model->license_version)) | ||
{ | ||
$this->model->license_version = \explode(' ', $this->model->license_version); | ||
$this->model->license_version[1] = new DateTimeImmutable( | ||
$this->model->license_version[1], new DateTimeZone('Etc/UTC') | ||
); | ||
} | ||
else | ||
{ | ||
$this->model->license_version = []; | ||
$this->model->license_version[0] = null; | ||
$this->model->license_version[1] = new DateTimeImmutable( | ||
'@' . \filemtime(self::LICENSE_FILE), new DateTimeZone('Etc/UTC') | ||
); | ||
} | ||
|
||
$this->model->_responseCode = \BNETDocs\Libraries\Core\HttpCode::HTTP_OK; | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace BNETDocs\Controllers\Community; | ||
|
||
class PrivacyPolicy extends \BNETDocs\Controllers\Base | ||
{ | ||
/** | ||
* Constructs a Controller, typically to initialize properties. | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->model = new \BNETDocs\Models\Community\PrivacyPolicy(); | ||
} | ||
|
||
/** | ||
* Invoked by the Router class to handle the request. | ||
* | ||
* @param array|null $args The optional route arguments and any captured URI arguments. | ||
* @return boolean Whether the Router should invoke the configured View. | ||
*/ | ||
public function invoke(?array $args): bool | ||
{ | ||
$privacy = &\CarlBennett\MVC\Libraries\Common::$config->bnetdocs->privacy; | ||
$this->model->data_location = $privacy->data_location; | ||
$this->model->email_domain = $privacy->contact->email_domain; | ||
$this->model->email_mailbox = $privacy->contact->email_mailbox; | ||
$this->model->organization = $privacy->organization; | ||
$this->model->_responseCode = \BNETDocs\Libraries\Core\HttpCode::HTTP_OK; | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace BNETDocs\Controllers\Community; | ||
|
||
class Welcome extends \BNETDocs\Controllers\Base | ||
{ | ||
/** | ||
* Constructs a Controller, typically to initialize properties. | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->model = new \BNETDocs\Models\Community\Welcome(); | ||
} | ||
|
||
/** | ||
* Invoked by the Router class to handle the request. | ||
* | ||
* @param array|null $args The optional route arguments and any captured URI arguments. | ||
* @return boolean Whether the Router should invoke the configured View. | ||
*/ | ||
public function invoke(?array $args): bool | ||
{ | ||
$this->model->_responseCode = \BNETDocs\Libraries\Core\HttpCode::HTTP_OK; | ||
return true; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.