mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Only show accessibleSubdefs when permalink is available
This commit is contained in:
@@ -40,18 +40,25 @@ class ToolsController extends Controller
|
||||
$recordAccessibleSubdefs = array();
|
||||
|
||||
if (count($records) == 1) {
|
||||
/** @var \record_adapter $record */
|
||||
$record = $records->first();
|
||||
|
||||
// fetch subdef list:
|
||||
$subdefs = $record->get_subdefs();
|
||||
|
||||
$acl = $this->getAclForUser();
|
||||
|
||||
if ($acl->is_admin()) {
|
||||
foreach ($subdefs as $subdef) {
|
||||
$permalink = $subdef->get_permalink();
|
||||
if (null === $permalink = $subdef->get_permalink()) {
|
||||
continue;
|
||||
}
|
||||
$recordAccessibleSubdefs[] = array(
|
||||
'name' => $subdef->get_name(),
|
||||
'state' => $permalink->get_is_activated()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$record->isStory()) {
|
||||
try {
|
||||
|
Reference in New Issue
Block a user