2 // Note: This file is included from the library/Vanilla/Vanilla.Control.CategoryForm.php control.
4 echo '<div id="Form" class="Account CategoryList">';
5 $Action = ForceIncomingString("Action", "");
6 if ($Action == 'Removed') {
7 echo '<div id="Success">'.$this->Context
->GetDefinition('CategoryRemoved').'</div>';
8 } else if ($Action == 'Saved') {
9 echo '<div id="Success">'.$this->Context
->GetDefinition('CategorySaved').'</div>';
10 } else if ($Action == 'SavedNew') {
11 echo '<div id="Success">'.$this->Context
->GetDefinition('NewCategorySaved').'</div>';
14 <legend>'.$this->Context
->GetDefinition('CategoryManagement').'</legend>'
15 .$this->Get_Warnings()
16 .'<form method="get" action="'.GetUrl($this->Context
->Configuration
, $this->Context
->SelfUrl
).'">
17 <input type="hidden" name="PostBackAction" value="Category" />
18 <p>'.$this->Context
->GetDefinition('CategoryReorderNotes').'</p>
19 <div class="SortList" id="SortCategories">
21 if ($this->CategoryData
) {
22 $c = $this->Context
->ObjectFactory
->NewObject($this->Context
, 'Category');
23 while ($Row = $this->Context
->Database
->GetRow($this->CategoryData
)) {
25 $c->GetPropertiesFromDataSet($Row);
26 $c->FormatPropertiesForDisplay();
27 echo '<div class="SortListItem'.($c->RoleBlocked?
' RoleBlocked':'').($this->Context
->Session
->User
->Permission('PERMISSION_SORT_CATEGORIES') ?
' MovableSortListItem':'').'" id="item_'.$c->CategoryID
.'">
28 <div class="SortListOptions">';
29 if ($this->Context
->Session
->User
->Permission('PERMISSION_EDIT_CATEGORIES')) echo '<a class="SortEdit" href="'.GetUrl($this->Context
->Configuration
, $this->Context
->SelfUrl
, '', '', '', '', 'PostBackAction=Category&CategoryID='.$c->CategoryID
).'">'.$this->Context
->GetDefinition('Edit').'</a>';
30 if ($this->Context
->Session
->User
->Permission('PERMISSION_REMOVE_CATEGORIES')) echo '<a class="SortRemove" href="'.GetUrl($this->Context
->Configuration
, $this->Context
->SelfUrl
, '', '', '', '', 'PostBackAction=CategoryRemove&CategoryID='.$c->CategoryID
).'"> </a>';
38 <div id="SortResult" style="display: none;"></div>';
40 if ($this->Context
->Session
->User
->Permission('PERMISSION_SORT_CATEGORIES')) {
42 <script type=\"text/javascript\" language=\"javascript\">
44 Sortable.create('SortCategories', {dropOnEmpty:true, tag:'div', constraint: 'vertical', ghosting: false, onUpdate: function() {new Ajax.Updater('SortResult', '"
45 . $this->Context
->Configuration
['WEB_ROOT'] . "ajax/sortcategories.php', "
46 . "{onComplete: function(request) { new Effect.Highlight('SortCategories',{startcolor:'#ffff99'});}, "
47 . "parameters:Sortable.serialize('SortCategories', {tag:'div', name:'CategoryID'})"
48 ." + '&PostBackKey=" . $this->SessionPostBackKey
. "', "
49 . "evalScripts:true, asynchronous:true})}});
53 echo '<div class="Submit">
54 <input type="submit" name="btnSave" value="'.$this->Context
->GetDefinition('CreateNewCategory').'" class="Button SubmitButton NewCategoryButton" />
55 <a href="'.GetUrl($this->Context
->Configuration
, $this->Context
->SelfUrl
).'" class="CancelButton">'.$this->Context
->GetDefinition('Cancel').'</a>