Initial import

This commit is contained in:
Admin Nasledstvo
2026-05-01 20:52:04 +03:00
commit ac168868ee
10028 changed files with 2337954 additions and 0 deletions
@@ -0,0 +1,31 @@
<?php
namespace app\models;
/**
* Class CmsRights
* @package app\models
* @property int $id
* @property string $name
*/
class CmsRights extends _Base
{
/**
* @param CmsRoles $model
* @return string
*/
public static function getHtmlList(CmsRoles $model)
{
list($checkedList, $checkList) = ["", ""];
foreach (self::find()->where(['is_active' => 1])->all() as $item) {
if (in_array($item->id, $model->getRightsIds()))
$checkedList .= '<label data-name="'.$item->name.'"><input checked name="rights[]" type="checkbox" value="' . $item->id . '">' . $item->name . '</label>';
}
foreach (self::find()->where(['is_active' => 1])->all() as $item) {
if (!in_array($item->id, $model->getRightsIds()))
$checkList .= '<label data-name="'.$item->name.'"><input name="rights[]" type="checkbox" value="' . $item->id . '">' . $item->name . '</label>';
}
return '<div style="width: 100%; background: #f8f8f8; margin: 3px 0; padding: 3px 0; border: 1px solid var(--base-background-ultra-bright )">' .$checkedList.'</div>' . $checkList;
}
}