Initial commit
This commit is contained in:
19
playarea/datatypes/datatype.appeals.php
Normal file
19
playarea/datatypes/datatype.appeals.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
class Appeals extends Item {
|
||||
public string $title = "Обращения";
|
||||
public string $description = "Управление обращениями на сайте.";
|
||||
public string $icon = "question_answer";
|
||||
public bool $visible_content = false;
|
||||
public function __construct($item_id)
|
||||
{
|
||||
parent::__construct($item_id);
|
||||
$this->props = array(
|
||||
"name" => new Prop($this, "name", "", "Имя", true, "plain_text"),
|
||||
"phone" => new Prop($this, "phone", "", "Телефон для связи", true, "plain_text"),
|
||||
"email" => new Prop($this, "email", "", "Email для связи", false, "plain_text"),
|
||||
"message" => new Prop($this, "message", "", "Сообщение", false, "plain_text"),
|
||||
"url" => new Prop($this, "url", "", "Страница, на которой находился пользователь", false, "plain_text"),
|
||||
);
|
||||
}
|
||||
}
|
||||
17
playarea/datatypes/datatype.attribute.php
Normal file
17
playarea/datatypes/datatype.attribute.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
class Attribute extends Item {
|
||||
public string $title = "Атрибуты товара";
|
||||
public string $description = "Управление атрибутами товаров на сайте.";
|
||||
public string $icon = "bookmark";
|
||||
public bool $visible_content = false;
|
||||
public function __construct($item_id)
|
||||
{
|
||||
parent::__construct($item_id);
|
||||
$this->props = array(
|
||||
"visible" => new Prop($this, "visible", "1", "Видимость", true, "plain_text"),
|
||||
"open" => new Prop($this, "open", "0", "Открыт по умолчанию", true, "plain_text"),
|
||||
"weight" => new Prop($this, "weight", "1000", "Вес", true, "plain_text"),
|
||||
);
|
||||
}
|
||||
}
|
||||
13
playarea/datatypes/datatype.attribute_item.php
Normal file
13
playarea/datatypes/datatype.attribute_item.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
class Attribute_Item extends Item {
|
||||
public string $title = "Атрибуты товара";
|
||||
public string $description = "Управление атрибутами товаров на сайте.";
|
||||
public bool $admin_menu = false;
|
||||
public string $parent_class = "Attribute";
|
||||
public function __construct($item_id)
|
||||
{
|
||||
parent::__construct($item_id);
|
||||
$this->props = array();
|
||||
}
|
||||
}
|
||||
18
playarea/datatypes/datatype.category.php
Normal file
18
playarea/datatypes/datatype.category.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
class Category extends Item {
|
||||
public string $title = "Категории";
|
||||
public string $description = "Управление категориями на сайте.";
|
||||
public string $parent_class = "Category";
|
||||
public string $icon = "source";
|
||||
public bool $visible_content = true;
|
||||
public function __construct($item_id)
|
||||
{
|
||||
parent::__construct($item_id);
|
||||
$this->props = array(
|
||||
"seo_title" => new Prop($this, "seo_title", '', "СЕО-заголовок", false, "plain_text"),
|
||||
"seo_description" => new Prop($this, "seo_description", '', "СЕО-описание", false, "plain_text"),
|
||||
"seo_keywords" => new Prop($this, "seo_keywords", '', "СЕО-keywords", false, "plain_text"),
|
||||
);
|
||||
}
|
||||
}
|
||||
16
playarea/datatypes/datatype.coupon.php
Normal file
16
playarea/datatypes/datatype.coupon.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
class Coupon extends Item {
|
||||
public string $title = "Купоны";
|
||||
public string $description = "Управление купонами на сайте.";
|
||||
public string $icon = "sell";
|
||||
public bool $visible_content = false;
|
||||
public function __construct($item_id)
|
||||
{
|
||||
parent::__construct($item_id);
|
||||
$this->props = array(
|
||||
"sum" => new Prop($this, "sum", "0", "Размер скидки в рублях", true, "plain_text"),
|
||||
"percent" => new Prop($this, "percent", "0", "Размер скидки в процентах", true, "plain_text"),
|
||||
);
|
||||
}
|
||||
}
|
||||
17
playarea/datatypes/datatype.favorite.php
Normal file
17
playarea/datatypes/datatype.favorite.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
class Favorite extends Item {
|
||||
public string $title = "Избранное - админ панель";
|
||||
public string $description = "Управление купонами на сайте.";
|
||||
public string $icon = "star";
|
||||
public bool $visible_content = false;
|
||||
public bool $admin_menu = false;
|
||||
public function __construct($item_id)
|
||||
{
|
||||
parent::__construct($item_id);
|
||||
$this->props = array(
|
||||
"user_id" => new Prop($this, "user_id", "0", "ID пользователя", true, "plain_text"),
|
||||
"link" => new Prop($this, "link", "0", "Ссылка", true, "plain_text"),
|
||||
);
|
||||
}
|
||||
}
|
||||
31
playarea/datatypes/datatype.order.php
Normal file
31
playarea/datatypes/datatype.order.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
class Order extends Item {
|
||||
public string $title = "Заказы";
|
||||
public string $description = "Управление заказами на сайте.";
|
||||
public string $icon = "shopping_basket";
|
||||
public bool $visible_content = false;
|
||||
public function __construct($item_id)
|
||||
{
|
||||
parent::__construct($item_id);
|
||||
$this->props = array(
|
||||
"status" => new Prop($this, "status", "Не оплачено", "Статус заказа", true, "plain_text"),
|
||||
"legal" => new Prop($this, "legal", "1", "Юридический статус", true, "plain_text_readonly"),
|
||||
"legal_name" => new Prop($this, "legal_name", "", "Имя компании", false, "plain_text"),
|
||||
"legal_inn" => new Prop($this, "legal_inn", "", "ИНН", false, "plain_text"),
|
||||
"name" => new Prop($this, "name", "", "ФИО", false, "plain_text"),
|
||||
"phone" => new Prop($this, "phone", "", "Телефон", true, "plain_text"),
|
||||
"email" => new Prop($this, "email", "", "Email", false, "plain_text"),
|
||||
"legal_address" => new Prop($this, "legal_address", "", "Юридический адрес", false, "plain_text"),
|
||||
"legal_kpp" => new Prop($this, "legal_kpp", "", "КПП", false, "plain_text"),
|
||||
"address_region" => new Prop($this, "address_region", "", "Область/регион", false, "plain_text"),
|
||||
"address_street" => new Prop($this, "address_street", "", "Адрес доставки", false, "plain_text"),
|
||||
"shipping_method" => new Prop($this, "shipping_method", "", "Способ доставки", false, "plain_text"),
|
||||
"payment_method" => new Prop($this, "payment_method", "", "Способ оплаты", false, "plain_text"),
|
||||
"comment" => new Prop($this, "comment", "", "Комментарий к заказу", false, "plain_text"),
|
||||
"order_cart" => new Prop($this, "order_cart", "", "Товары", false, "order_cart"),
|
||||
"promocode" => new Prop($this, "promocode", "", "Промокод", false, "plain_text"),
|
||||
"sum" => new Prop($this, "sum", "0", "Сумма заказа", true, "plain_text"),
|
||||
);
|
||||
}
|
||||
}
|
||||
17
playarea/datatypes/datatype.page.php
Normal file
17
playarea/datatypes/datatype.page.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
class Page extends Item {
|
||||
public string $title = "Страницы";
|
||||
public string $description = "Управление страницами на сайте.";
|
||||
public string $icon = "explore";
|
||||
public function __construct($item_id)
|
||||
{
|
||||
parent::__construct($item_id);
|
||||
$this->props = array(
|
||||
"seo_title" => new Prop($this, "seo_title", '', "СЕО-заголовок", false, "plain_text"),
|
||||
"seo_description" => new Prop($this, "seo_description", '', "СЕО-описание", false, "plain_text"),
|
||||
"seo_keywords" => new Prop($this, "seo_keywords", '', "СЕО-keywords", false, "plain_text"),
|
||||
"template_script" => new Prop($this, "template_script", "pages/default.php", "Скрипт страницы", false, "plain_text"),
|
||||
);
|
||||
}
|
||||
}
|
||||
24
playarea/datatypes/datatype.post.php
Normal file
24
playarea/datatypes/datatype.post.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
class Post extends Item {
|
||||
public string $title = "Посты";
|
||||
public string $description = "Управление постами на сайте.";
|
||||
public string $parent_class = "Category";
|
||||
public string $icon = "edit_note";
|
||||
public function __construct($item_id)
|
||||
{
|
||||
parent::__construct($item_id);
|
||||
$this->props = array(
|
||||
"seo_title" => new Prop($this, "seo_title", '', "СЕО-заголовок", false, "plain_text"),
|
||||
"seo_description" => new Prop($this, "seo_description", '', "СЕО-описание", false, "plain_text"),
|
||||
"seo_keywords" => new Prop($this, "seo_keywords", '', "СЕО-keywords", false, "plain_text"),
|
||||
"quick" => new Prop($this, "quick", "", "Сокращенный текст", false, "plain_text"),
|
||||
"author" => new Prop($this, "author", "Артём Опарин", "Автор", true, "author"),
|
||||
"create_date" => new Prop($this, "create_date", date("d.m.y"), "Дата создания", true, "plain_text"),
|
||||
"post_photo" => new Prop($this, "post_photo", "", "Изображение записи", false, "post_photo"),
|
||||
"views" => new Prop($this, "views", "0", "Количество просмотров", true, "plain_text"),
|
||||
"battery" => new Prop($this, "battery", "0", "Рейтинг", false, "plain_text"),
|
||||
"more" => new Prop($this, "more", '', "Смотрите также", false, "plain_links"),
|
||||
);
|
||||
}
|
||||
}
|
||||
38
playarea/datatypes/datatype.product.php
Normal file
38
playarea/datatypes/datatype.product.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
class Product extends Item {
|
||||
public string $title = "Товары";
|
||||
public string $description = "Управление товарами на сайте.";
|
||||
public string $parent_class = "ProductCategory";
|
||||
public string $icon = "shopping_basket";
|
||||
public function __construct($item_id)
|
||||
{
|
||||
parent::__construct($item_id);
|
||||
$this->props = array(
|
||||
"article" => new Prop($this, "article", "0", "Артикул", true, "plain_text"),
|
||||
"price" => new Prop($this, "price", "0", "Цена", true, "plain_text", true),
|
||||
"sale_percent" => new Prop($this, "sale_percent", "0", "Скидка (%)", false, "plain_text"),
|
||||
"product_in_stock" => new Prop($this, "product_in_stock", "0", "На складе", false, "plain_text"),
|
||||
"product_photo" => new Prop($this, "product_photo", "0", "Фотография товара", false, "plain_image"),
|
||||
"product_photo_album" => new Prop($this, "product_photo_album", "0", "Фотографии товара", false, "product_images"),
|
||||
"score" => new Prop($this, "score", "5", "Оценка товара от 1 до 5", false, "plain_text"),
|
||||
"reviews" => new Prop($this, "reviews", "", "Отзывы", false, "review_list"),
|
||||
"faq" => new Prop($this, "faq", "", "Часто задаваемые вопросы", false, "product_termins_field"),
|
||||
);
|
||||
}
|
||||
|
||||
// Получить итоговую цену со скидкой
|
||||
public function get_price()
|
||||
{
|
||||
$sale_percent = $this->get_prop("sale_percent");
|
||||
$regular_price = $this->get_prop("price");
|
||||
if($sale_percent > 0) return $regular_price * (1 - ($sale_percent / 100));
|
||||
else return $regular_price;
|
||||
}
|
||||
|
||||
// Получить цену без скидки
|
||||
public function get_regular_price()
|
||||
{
|
||||
return $this->get_prop("price");
|
||||
}
|
||||
}
|
||||
27
playarea/datatypes/datatype.productCategory.php
Normal file
27
playarea/datatypes/datatype.productCategory.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
class ProductCategory extends Item {
|
||||
public string $title = "Категории товара";
|
||||
public string $description = "Управление категориями товара на сайте.";
|
||||
public string $parent_class = "ProductCategory";
|
||||
public string $icon = "dashboard_customize";
|
||||
public function __construct($item_id)
|
||||
{
|
||||
parent::__construct($item_id);
|
||||
$this->props = array(
|
||||
"seo_title" => new Prop($this, "seo_title", '', "СЕО-заголовок", false, "plain_text"),
|
||||
"seo_description" => new Prop($this, "seo_description", '', "СЕО-описание", false, "plain_text"),
|
||||
"seo_keywords" => new Prop($this, "seo_keywords", '', "СЕО-keywords", false, "plain_text"),
|
||||
"tags_title" => new Prop($this, "tags_title", '', "Заголовок тегов", false, "plain_text"),
|
||||
"tags" => new Prop($this, "tags", '', "Теги", false, "plain_links"),
|
||||
"product_news_field" => new Prop($this, "product_news_field", '', "Новости", false, "product_news_field"),
|
||||
"product_termins_field" => new Prop($this, "product_termins_field", '', "Термины", false, "product_termins_field"),
|
||||
"tags_fast_select" => new Prop($this, "tags_fast_select", '', "Быстрый подбор по типу", false, "plain_links"),
|
||||
"tags_brands" => new Prop($this, "tags_brands", '', "Бренды", false, "plain_links"),
|
||||
"product_category_faq" => new Prop($this, "product_category_faq", '', "Часто задаваемые вопросы", false, "product_termins_field"),
|
||||
"about_title" => new Prop($this, "about_title", '', "Заголовок описания", false, "plain_text"),
|
||||
"about_block_left" => new Prop($this, "about_block_left", '', "Описание левый блок", false, "plain_bigtext"),
|
||||
"about_block_right" => new Prop($this, "about_block_right", '', "описание правый блок", false, "plain_bigtext"),
|
||||
);
|
||||
}
|
||||
}
|
||||
20
playarea/datatypes/datatype.reviews.php
Normal file
20
playarea/datatypes/datatype.reviews.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
class Reviews extends Item {
|
||||
public string $title = "Отзывы";
|
||||
public string $description = "Управление отзывами на сайте.";
|
||||
public string $icon = "reviews";
|
||||
public bool $visible_content = true;
|
||||
public function __construct($item_id)
|
||||
{
|
||||
parent::__construct($item_id);
|
||||
$this->props = array(
|
||||
"view" => new Prop($this, "view", "1", "Видимость", true, "plain_text"),
|
||||
"name" => new Prop($this, "name", "", "Автор", true, "plain_text"),
|
||||
"date" => new Prop($this, "date", "", "Дата написания", true, "plain_text"),
|
||||
"photo" => new Prop($this, "photo", "", "Фото автора", false, "plain_image"),
|
||||
"score" => new Prop($this, "score", "5", "Оценка", true, "plain_text"),
|
||||
"email" => new Prop($this, "email", "", "Email", true, "plain_text"),
|
||||
);
|
||||
}
|
||||
}
|
||||
31
playarea/datatypes/datatype.user.php
Normal file
31
playarea/datatypes/datatype.user.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
class User extends Item {
|
||||
public string $title = "Пользователи";
|
||||
public string $description = "Управление пользователями сайта.";
|
||||
public string $icon = "people";
|
||||
public bool $visible_content = false;
|
||||
public function __construct($item_id)
|
||||
{
|
||||
parent::__construct($item_id);
|
||||
$this->props = array(
|
||||
"username" => new Prop($this, "username", "", "Логин", true, "username"),
|
||||
"reg_time" => new Prop($this, "reg_time", time(), "Дата регистрации", true, "reg_time"),
|
||||
"password" => new Prop($this, "password", "", "Пароль", false, "password"),
|
||||
);
|
||||
}
|
||||
|
||||
public function check_password($password): bool
|
||||
{
|
||||
$hash = $this->get_prop("password");
|
||||
if(password_verify($password, $hash)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public function set_password($password)
|
||||
{
|
||||
$hash = password_hash($password, PASSWORD_DEFAULT);
|
||||
$this->set_prop("password", $hash);
|
||||
return $hash;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user