|
@@ 407-410 (lines=4) @@
|
| 404 |
|
if (!empty($modelName::$cols[$colName]['relation'])) { |
| 405 |
|
$type = !empty($relations[$modelName::$cols[$colName]['relation']]['type']) ? $relations[$modelName::$cols[$colName]['relation']]['type'] : 'to'; |
| 406 |
|
switch ($type) { |
| 407 |
|
case 'relModel': |
| 408 |
|
$managerParams = ['relation' => $modelName::$cols[$colName]['relation']]; |
| 409 |
|
$count = $item->{$modelName::$cols[$colName]['relation']}(array_merge($params, ['count' => 1])); |
| 410 |
|
return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"" . str_replace('\\', '\\\\', $modelName) . ":" . $item->pk() . "\"," . json_encode(array_merge($params, $managerParams)) . ")'>{$count} " . \Tools::getNumEnding($count, ['Элемент', 'Элемента', 'Элементов']) . "</a>"; |
| 411 |
|
case 'many': |
| 412 |
|
$managerParams = ['relation' => $modelName::$cols[$colName]['relation']]; |
| 413 |
|
$count = $item->{$modelName::$cols[$colName]['relation']}(array_merge($params, ['count' => 1])); |
|
@@ 411-414 (lines=4) @@
|
| 408 |
|
$managerParams = ['relation' => $modelName::$cols[$colName]['relation']]; |
| 409 |
|
$count = $item->{$modelName::$cols[$colName]['relation']}(array_merge($params, ['count' => 1])); |
| 410 |
|
return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"" . str_replace('\\', '\\\\', $modelName) . ":" . $item->pk() . "\"," . json_encode(array_merge($params, $managerParams)) . ")'>{$count} " . \Tools::getNumEnding($count, ['Элемент', 'Элемента', 'Элементов']) . "</a>"; |
| 411 |
|
case 'many': |
| 412 |
|
$managerParams = ['relation' => $modelName::$cols[$colName]['relation']]; |
| 413 |
|
$count = $item->{$modelName::$cols[$colName]['relation']}(array_merge($params, ['count' => 1])); |
| 414 |
|
return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"" . str_replace('\\', '\\\\', $modelName) . ":" . $item->pk() . "\"," . json_encode(array_merge($params, $managerParams)) . ")'>{$count} " . \Tools::getNumEnding($count, ['Элемент', 'Элемента', 'Элементов']) . "</a>"; |
| 415 |
|
default : |
| 416 |
|
if ($item->{$modelName::$cols[$colName]['relation']}) { |
| 417 |
|
if (\App::$cur->name == 'admin') { |
|
@@ 445-448 (lines=4) @@
|
| 442 |
|
return $content; |
| 443 |
|
case 'moduleMethod': |
| 444 |
|
return \App::$cur->{$modelName::$cols[$colName]['view']['module']}->{$modelName::$cols[$colName]['view']['method']}($item, $colName, $modelName::$cols[$colName]); |
| 445 |
|
case'many': |
| 446 |
|
$managerParams = ['relation' => $modelName::$cols[$colName]['relation']]; |
| 447 |
|
$count = $item->{$modelName::$cols[$colName]['relation']}(array_merge($params, ['count' => 1])); |
| 448 |
|
return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"" . str_replace('\\', '\\\\', $modelName) . ":" . $item->pk() . "\"," . json_encode(array_merge($params, $managerParams)) . ")'>{$count} " . \Tools::getNumEnding($count, ['Элемент', 'Элемента', 'Элементов']) . "</a>"; |
| 449 |
|
default: |
| 450 |
|
return $item->$colName; |
| 451 |
|
} |