|
@@ 204-221 (lines=18) @@
|
| 201 |
|
$id = null; |
| 202 |
|
$model = null; |
| 203 |
|
} |
| 204 |
|
if (!empty($_GET['params'])) { |
| 205 |
|
$params = $_GET['params']; |
| 206 |
|
if (!empty($params['relation'])) { |
| 207 |
|
$relations = $modelName::relations(); |
| 208 |
|
|
| 209 |
|
$type = !empty($relations[$_GET['params']['relation']]['type']) ? $relations[$_GET['params']['relation']]['type'] : 'to'; |
| 210 |
|
|
| 211 |
|
switch ($type) { |
| 212 |
|
case 'relModel': |
| 213 |
|
$modelName = $relations[$_GET['params']['relation']]['relModel']; |
| 214 |
|
break; |
| 215 |
|
default: |
| 216 |
|
$modelName = $relations[$_GET['params']['relation']]['model']; |
| 217 |
|
} |
| 218 |
|
} |
| 219 |
|
} else { |
| 220 |
|
$params = []; |
| 221 |
|
} |
| 222 |
|
$dataManager = new Ui\DataManager($modelName, $_GET['managerName']); |
| 223 |
|
if ($dataManager->checkAccess()) { |
| 224 |
|
$model = $modelName::get($_GET['key'], $modelName::index(), !empty($_GET['params']) ? $_GET['params'] : []); |
|
@@ 248-262 (lines=15) @@
|
| 245 |
|
$model = null; |
| 246 |
|
} |
| 247 |
|
$params = []; |
| 248 |
|
if (!empty($_GET['params'])) { |
| 249 |
|
$params = $_GET['params']; |
| 250 |
|
if (!empty($_GET['params']['relation'])) { |
| 251 |
|
$relations = $modelName::relations(); |
| 252 |
|
$type = !empty($relations[$_GET['params']['relation']]['type']) ? $relations[$_GET['params']['relation']]['type'] : 'to'; |
| 253 |
|
|
| 254 |
|
switch ($type) { |
| 255 |
|
case 'relModel': |
| 256 |
|
$modelName = $relations[$_GET['params']['relation']]['relModel']; |
| 257 |
|
break; |
| 258 |
|
default: |
| 259 |
|
$modelName = $relations[$_GET['params']['relation']]['model']; |
| 260 |
|
} |
| 261 |
|
} |
| 262 |
|
} |
| 263 |
|
$dataManager = new Ui\DataManager($modelName, $_GET['managerName']); |
| 264 |
|
if ($dataManager->checkAccess()) { |
| 265 |
|
$model = $modelName::get($_GET['key'], $modelName::index(), !empty($_GET['params']) ? $_GET['params'] : []); |
|
@@ 290-307 (lines=18) @@
|
| 287 |
|
$id = null; |
| 288 |
|
$model = null; |
| 289 |
|
} |
| 290 |
|
if (!empty($_GET['params'])) { |
| 291 |
|
$params = $_GET['params']; |
| 292 |
|
if (!empty($params['relation'])) { |
| 293 |
|
$relations = $modelName::relations(); |
| 294 |
|
|
| 295 |
|
$type = !empty($relations[$_GET['params']['relation']]['type']) ? $relations[$_GET['params']['relation']]['type'] : 'to'; |
| 296 |
|
|
| 297 |
|
switch ($type) { |
| 298 |
|
case 'relModel': |
| 299 |
|
$modelName = $relations[$_GET['params']['relation']]['relModel']; |
| 300 |
|
break; |
| 301 |
|
default: |
| 302 |
|
$modelName = $relations[$_GET['params']['relation']]['model']; |
| 303 |
|
} |
| 304 |
|
} |
| 305 |
|
} else { |
| 306 |
|
$params = []; |
| 307 |
|
} |
| 308 |
|
$dataManager = new Ui\DataManager($modelName, $_GET['managerName']); |
| 309 |
|
if ($dataManager->checkAccess()) { |
| 310 |
|
if (!empty($_GET['action']) && !empty($dataManager->managerOptions['groupActions'][$_GET['action']]) && !empty($_GET['ids'])) { |