* @copyright Copyright (C) 2002-2005 Markus Westphal, * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, * 2010-2012 Uwe Steinmann * @version Release: @package_version@ */ /** * Include parent class */ require_once("class.Bootstrap.php"); /** * Class which outputs the html page for FolderAccess view * * @category DMS * @package SeedDMS * @author Markus Westphal, Malcolm Cowe, Uwe Steinmann * @copyright Copyright (C) 2002-2005 Markus Westphal, * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, * 2010-2012 Uwe Steinmann * @version Release: @package_version@ */ class SeedDMS_View_FolderAccess extends SeedDMS_Bootstrap_Style { function printAccessModeSelection($defMode) { /* {{{ */ echo self::getAccessModeSelection($defMode); } /* }}} */ function getAccessModeSelection($defMode) { /* {{{ */ $content = "\n"; return $content; } /* }}} */ function js() { /* {{{ */ header('Content-Type: application/javascript; charset=UTF-8'); ?> function checkForm() { msg = new Array() if ((document.form1.userid.options[document.form1.userid.selectedIndex].value == -1) && (document.form1.groupid.options[document.form1.groupid.selectedIndex].value == -1)) msg.push(""); if (msg != "") { noty({ text: msg.join('
'), type: 'error', dismissQueue: true, layout: 'topRight', theme: 'defaultTheme', _timeout: 1500, }); return false; } else return true; } $(document).ready(function() { $('body').on('submit', '#form1', function(ev){ if(checkForm()) return; ev.preventDefault(); }); }); params['dms']; $user = $this->params['user']; $folder = $this->params['folder']; $allUsers = $this->params['allusers']; $allGroups = $this->params['allgroups']; $rootfolderid = $this->params['rootfolderid']; $this->htmlStartPage(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName())))); $this->globalNavigation($folder); $this->contentStart(); $this->pageNavigation($this->getFolderPathHTML($folder, true), "view_folder", $folder); $this->contentHeading(getMLText("edit_folder_access")); echo "
\n"; echo "
\n"; $this->contentContainerStart(); if ($user->isAdmin()) { ?>
getOwner(); $options = array(); foreach ($allUsers as $currUser) { if (!$currUser->isGuest()) $options[] = array($currUser->getID(), htmlspecialchars($currUser->getLogin()), ($currUser->getID()==$owner->getID()), array(array('data-subtitle', htmlspecialchars($currUser->getFullName())))); } $this->formField( getMLText("set_owner"), array( 'element'=>'select', 'name'=>'ownerid', 'class'=>'chzn-select', 'options'=>$options ) ); $this->formSubmit(" ".getMLText('save')); ?>
getID() != $rootfolderid && $folder->getParent()){ $this->contentSubHeading(getMLText("access_inheritance")); if ($folder->inheritsAccess()) { printMLText("inherits_access_msg"); ?>

">
">

contentContainerEnd(); echo "
"; echo "
"; $this->contentEnd(); $this->htmlEndPage(); return; } ?>
">
contentContainerEnd(); echo ""; echo "
"; $this->contentContainerStart(); $accessList = $folder->getAccessList(); ?>
formField( getMLText("default_access"), $this->getAccessModeSelection($folder->getDefaultAccess()) ); $this->formSubmit(" ".getMLText('save')); ?>
isGuest()) $options[] = array($currUser->getID(), htmlspecialchars($currUser->getLogin()), false, array(array('data-subtitle', htmlspecialchars($currUser->getFullName())))); } $this->formField( getMLText("user"), array( 'element'=>'select', 'name'=>'userid', 'id'=>'userid', 'class'=>'chzn-select', 'attributes'=>array(array('data-allow-clear', 'true'), array('data-placeholder',getMLText('select_user'))), 'options'=>$options ) ); $options = array(); $options[] = array(-1, getMLText('select_one')); foreach ($allGroups as $groupObj) { $options[] = array($groupObj->getID(), htmlspecialchars($groupObj->getName())); } $this->formField( getMLText("group"), array( 'element'=>'select', 'name'=>'groupid', 'class'=>'chzn-select', 'attributes'=>array(array('data-allow-clear', 'true'), array('data-placeholder', getMLText('select_group'))), 'options'=>$options ) ); $this->formField( getMLText("access_mode"), $this->getAccessModeSelection(M_READ) ); $this->formSubmit(" ".getMLText('add')); ?>
contentContainerEnd(); ?>
"; foreach ($accessList["users"] as $userAccess) { $userObj = $userAccess->getUser(); print "\n"; print "\n"; print "". htmlspecialchars($userObj->getFullName()) . "\n"; print "
\n"; echo createHiddenFieldWithKey('folderaccess')."\n"; print "getID()."\">\n"; print "\n"; print "getID()."\">\n"; print "\n"; $this->printAccessModeSelection($userAccess->getMode()); print "\n"; print "\n"; print ""; print "\n"; print "
\n"; print "
\n"; echo createHiddenFieldWithKey('folderaccess')."\n"; print "getID()."\">\n"; print "\n"; print "getID()."\">\n"; print "\n"; print ""; print "\n"; print "
\n"; print "\n"; } foreach ($accessList["groups"] as $groupAccess) { $groupObj = $groupAccess->getGroup(); $mode = $groupAccess->getMode(); print ""; print ""; print "". htmlspecialchars($groupObj->getName()) . ""; print "
"; echo createHiddenFieldWithKey('folderaccess')."\n"; print "getID()."\">"; print ""; print "getID()."\">"; print ""; $this->printAccessModeSelection($groupAccess->getMode()); print "\n"; print "\n"; print ""; print "\n"; print "
"; print "
\n"; echo createHiddenFieldWithKey('folderaccess')."\n"; print "getID()."\">\n"; print "\n"; print "getID()."\">\n"; print ""; print ""; print "\n"; print "
"; print "\n"; } print "
"; } ?>
contentEnd(); $this->htmlEndPage(); } /* }}} */ } ?>