| @@ -88,20 +88,23 @@ | ||
| 88 | 88 | 'default' => '0', |
| 89 | 89 | 'options' => $list |
| 90 | 90 | ] |
| 91 | 91 | ]; |
| 92 | - foreach( $documents as $document ) { | |
| 92 | + if ( current_user_can( 'access_depicter' ) ) { | |
| 93 | + foreach( $documents as $document ) { | |
| 93 | 94 | |
| 94 | - $args = [ | |
| 95 | - 'isPublishedBefore' => \Depicter::documentRepository()->isPublishedBefore( $document['id'] ), | |
| 96 | - 'documentStatus' => $document['status'] | |
| 97 | - ]; | |
| 98 | - | |
| 99 | - $markup = \Depicter::view('admin/notices/builders-draft-notice')->with('view_args', $args)->toString(); | |
| 100 | - $fields[ 'slider_control_buttons_' . $document['id'] ] = [ | |
| 101 | - 'type' => 'raw', | |
| 102 | - 'content' => $markup, | |
| 103 | - ]; | |
| 95 | + $args = [ | |
| 96 | + 'isPublishedBefore' => \Depicter::documentRepository()->isPublishedBefore( $document['id'] ), | |
| 97 | + 'documentStatus' => $document['status'], | |
| 98 | + 'documentID' => $document['id'] | |
| 99 | + ]; | |
| 100 | + | |
| 101 | + $markup = \Depicter::view('admin/notices/builders-draft-notice')->with('view_args', $args)->toString(); | |
| 102 | + $fields[ 'slider_control_buttons_' . $document['id'] ] = [ | |
| 103 | + 'type' => 'raw', | |
| 104 | + 'content' => $markup, | |
| 105 | + ]; | |
| 106 | + } | |
| 104 | 107 | } |
| 105 | 108 | |
| 106 | 109 | return $fields; |
| 107 | 110 | } |