Правила теперь в 4 новых файлах

Макс у тебя очень крутая MVC система!!!!!!!!!!!!
This commit is contained in:
GeorgNation 2024-07-21 21:57:34 +06:00
parent 87c7fa537b
commit 2c5f42d4d3
5 changed files with 137 additions and 11 deletions

View file

@ -24,21 +24,15 @@ class MainController
} }
public static function rules() public static function rules()
{ {
$_GLOBAL['rules'] = '/config/rules.html';
$_GLOBAL['title'] = 'Правила сайта';
Page::set('Rules'); Page::set('Rules');
} }
public static function publicationRules() public static function publicationRules()
{ {
$_GLOBAL['rules'] = '/config/publicationRules.html'; Page::set('PublicationRules');
$_GLOBAL['title'] = 'Правила отбора фотографий';
Page::set('Rules');
} }
public static function photoRules() public static function photoRules()
{ {
$_GLOBAL['rules'] = '/config/photoRules.html'; Page::set('PhotoRules');
$_GLOBAL['title'] = 'Правила подписи фотографий';
Page::set('Rules');
} }
public static function videoRules() public static function videoRules()
{ {

View file

@ -0,0 +1,44 @@
<?php
use \App\Services\{Auth, DB, Date};
use \App\Models\User;
?>
<!DOCTYPE html>
<html lang="ru">
<head>
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/LoadHead.php'); ?>
</head>
<body>
<div id="backgr"></div>
<table class="tmain">
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Navbar.php'); ?>
<td class="main">
<h1>Правила подписи фотографий</h1>
<div class="p20" style="padding:20px">
<?php
$myfile = fopen($_SERVER['DOCUMENT_ROOT'].'/config/photoRules.html', "r") or die("Unable to open file!");
echo fread($myfile,filesize($_SERVER['DOCUMENT_ROOT'].'/config/photoRules.html'));
fclose($myfile);
?>
</div>
</td>
</tr>
<tr>
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Footer.php'); ?>
</tr>
</table>
</body>
</html>

View file

@ -0,0 +1,44 @@
<?php
use \App\Services\{Auth, DB, Date};
use \App\Models\User;
?>
<!DOCTYPE html>
<html lang="ru">
<head>
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/LoadHead.php'); ?>
</head>
<body>
<div id="backgr"></div>
<table class="tmain">
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Navbar.php'); ?>
<td class="main">
<h1>Правила отбора фотографий</h1>
<div class="p20" style="padding:20px">
<?php
$myfile = fopen($_SERVER['DOCUMENT_ROOT'].'/config/publicationRules.html', "r") or die("Unable to open file!");
echo fread($myfile,filesize($_SERVER['DOCUMENT_ROOT'].'/config/publicationRules.html'));
fclose($myfile);
?>
</div>
</td>
</tr>
<tr>
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Footer.php'); ?>
</tr>
</table>
</body>
</html>

View file

@ -19,12 +19,12 @@ use \App\Models\User;
<table class="tmain"> <table class="tmain">
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Navbar.php'); ?> <?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Navbar.php'); ?>
<td class="main"> <td class="main">
<h1><?= $_GLOBAL['title'] ?></h1> <h1>Правила сайта</h1>
<div class="p20" style="padding:20px"> <div class="p20" style="padding:20px">
<?php <?php
$myfile = fopen($_SERVER['DOCUMENT_ROOT'].$_GLOBAL['rules'], "r") or die("Unable to open file!"); $myfile = fopen($_SERVER['DOCUMENT_ROOT'].'/config/rules.html', "r") or die("Unable to open file!");
echo fread($myfile,filesize($_SERVER['DOCUMENT_ROOT'].$_GLOBAL['rules'])); echo fread($myfile,filesize($_SERVER['DOCUMENT_ROOT'].'/config/rules.html'));
fclose($myfile); fclose($myfile);
?> ?>
</div> </div>

View file

@ -0,0 +1,44 @@
<?php
use \App\Services\{Auth, DB, Date};
use \App\Models\User;
?>
<!DOCTYPE html>
<html lang="ru">
<head>
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/LoadHead.php'); ?>
</head>
<body>
<div id="backgr"></div>
<table class="tmain">
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Navbar.php'); ?>
<td class="main">
<h1>Правила видеотеки</h1>
<div class="p20" style="padding:20px">
<?php
$myfile = fopen($_SERVER['DOCUMENT_ROOT'].'/config/videoRules.html', "r") or die("Unable to open file!");
echo fread($myfile,filesize($_SERVER['DOCUMENT_ROOT'].'/config/videoRules.html'));
fclose($myfile);
?>
</div>
</td>
</tr>
<tr>
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Footer.php'); ?>
</tr>
</table>
</body>
</html>