<?php defined('C5_EXECUTE') or die("Access Denied."); ?> <form method="post" data-dialog-form="save-file-set" action="<?php echo $controller->action('submit'); ?> "> <div class="ccm-ui"> <?php Loader::element('files/add_to_sets', array('displayFileSet' => function ($fileset) use($f) { $fp = new \Permissions($fileset); if (!$fp->canAddFiles() || !$fp->canAddFileType(strtolower($f->getExtension()))) { return false; } else { return true; } }, 'getCheckbox' => function ($fileset) use($f) { $checkbox = id(new HtmlObject\Input('checkbox', 'fsID[]'))->value($fileset->getFileSetID()); if ($f->inFileSet($fileset)) { $checkbox->checked(true); } return $checkbox; })); ?> </div> <div class="dialog-buttons"> <button class="btn btn-default pull-left" data-dialog-action="cancel"><?php
echo $form->text('fsAddToSearchName', $searchRequest['fsSearchName'], array('autocomplete' => 'off')); ?> </div> <? $s1 = FileSet::getMySets(); ?> <? if (count($s1) > 0) { ?> <div class="clearfix"> <ul class="inputs-list"> <? foreach($sets as $s) { $displaySet = true; $pf = new Permissions($s); if (!$pf->canAddFiles()) { $displaySet = false; } else { foreach($extensions as $ext) { if (!$pf->canAddFileType($ext)) { $displaySet = false; } } } if ($displaySet) { ?> <li class="ccm-file-set-add-cb"> <label> <?php
<?php defined('C5_EXECUTE') or die("Access Denied."); Loader::element('files/add_to_sets', array('displayFileSet' => function ($fileset) use($files) { $fp = new \Permissions($fileset); if (!$fp->canAddFiles()) { return false; } else { foreach ($files as $f) { if (!$fp->canAddFileType(strtolower($f->getExtension()))) { return false; } } } return true; }, 'getCheckbox' => function ($fileset) use($files) { $checkbox = new HtmlObject\Input('checkbox'); $checkbox->setAttribute('data-set', $fileset->getFileSetID()); $input = new HtmlObject\Input('hidden', 'fsID:' . $fileset->getFileSetID(), 0); $input->setAttribute('data-set-input', $fileset->getFileSetID()); $found = 0; foreach ($files as $f) { if ($f->inFileSet($fileset)) { $found++; } } if ($found == 0) { // nothing } else { if ($found == count($files)) { $checkbox->checked('checked');