2 // Note: This file is included from the library/Vanilla/Vanilla.Control.RoleForm.php control.
4 echo '<div id="Form" class="Account Roles">';
5 $Action = ForceIncomingString("Action", "");
6 if ($Action == 'Removed') {
7 echo '<div id="Success">'.$this->Context
->GetDefinition('RoleRemoved').'</div>';
8 } else if ($Action == 'Saved') {
9 echo '<div id="Success">'.$this->Context
->GetDefinition('RoleSaved').'</div>';
10 } else if ($Action == 'SavedNew') {
11 echo '<div id="Success">'.$this->Context
->GetDefinition('NewRoleSaved').'</div>';
15 <legend>'.$this->Context
->GetDefinition('RoleManagement').'</legend>'
16 .$this->Get_Warnings().
17 '<form method="get" action="'.GetUrl($this->Context
->Configuration
, $this->Context
->SelfUrl
).'">
18 <input type="hidden" name="PostBackAction" value="Role" />
19 <p>'.$this->Context
->GetDefinition('RoleReorderNotes').'</p>
21 <div class="SortList" id="SortRoles">';
22 if ($this->RoleData
) {
23 $r = $this->Context
->ObjectFactory
->NewContextObject($this->Context
, 'Role');
25 while ($Row = $this->Context
->Database
->GetRow($this->RoleData
)) {
27 $r->GetPropertiesFromDataSet($Row);
28 $r->FormatPropertiesForDisplay();
29 echo '<div class="SortListItem'.($this->Context
->Session
->User
->Permission('PERMISSION_SORT_ROLES') ?
' MovableSortListItem' : '').'" id="item_'.$r->RoleID
.'">
30 <div class="SortListOptions">';
31 if ($this->Context
->Session
->User
->Permission('PERMISSION_EDIT_ROLES')) echo '<a class="SortEdit" href="'.GetUrl($this->Context
->Configuration
, $this->Context
->SelfUrl
, '', '', '', '', 'PostBackAction=Role&RoleID='.$r->RoleID
).'">'.$this->Context
->GetDefinition('Edit').'</a>';
32 if ($this->Context
->Session
->User
->Permission('PERMISSION_REMOVE_ROLES')) {
33 if (!$r->Unauthenticated
) {
34 echo '<a class="SortRemove" href="'.GetUrl($this->Context
->Configuration
, $this->Context
->SelfUrl
, '', '', '', '', 'PostBackAction=RoleRemove&RoleID='.$r->RoleID
).'"> </a>';
36 echo '<span class="SortNoRemove"> </span>';
45 if ($this->Context
->Session
->User
->Permission('PERMISSION_SORT_ROLES')) {
46 echo "<script type=\"text/javascript\" language=\"javascript\">
48 Sortable.create('SortRoles', {dropOnEmpty:true, tag:'div', constraint: 'vertical', ghosting: false, onUpdate: function() {new Ajax.Updater('SortResult', '"
49 . $this->Context
->Configuration
['WEB_ROOT'] . "ajax/sortroles.php', "
50 . "{onComplete: function(request) { new Effect.Highlight('SortRoles',{startcolor:'#ffff99'});}, "
51 . "parameters:Sortable.serialize('SortRoles', {tag:'div', name:'RoleID'})"
52 ." + '&PostBackKey=" . $this->SessionPostBackKey
. "', "
53 ."evalScripts:true, asynchronous:true})}});
57 echo '<div id="SortResult" style="display: none;"></div>';
59 if ($this->Context
->Session
->User
->Permission('PERMISSION_ADD_ROLES')) {
60 echo '<div class="Submit">
61 <input type="submit" name="btnSave" value="'.$this->Context
->GetDefinition('CreateANewRole').'" class="Button SubmitButton NewRoleButton" />
62 <a href="'.GetUrl($this->Context
->Configuration
, $this->Context
->SelfUrl
).'" class="CancelButton">'.$this->Context
->GetDefinition('Cancel').'</a>