Fixed minor things and added missing file
[vanilla-miry.git] / extensions / CategoryRoles / ReadMe.txt
blob8657aa09740310cbdfd13e89b707b9f896c6ad35
1 ===========================================
2 GENERAL EXTENSION INSTALLATION INSTRUCTIONS
3 ===========================================
5 In order for Vanilla to recognize an extension, it must be contained within it's
6 own directory within the extensions directory. So, once you have downloaded and
7 unzipped the extension files, you can then place the folder containing the
8 default.php file into your installation of Vanilla. The path to your extension's
9 default.php file should look like this:
11 /path/to/vanilla/extensions/this_extension_name/default.php
13 Once this is complete, you can enable the extension through the "Manage
14 Extensions" form on the settings tab in Vanilla.
16 ======================
17 CategoryRoles SPECIFIC
18 ======================
20 Usage
21 *****
22 This extension adds two drop-down menu in the Categories setting pane.
23 The roles are given increasing priority level from top to bottom. This is a core feature
24 This extension uses this priority to set the required threshold.
25 Adding a new role will probably imply revision of the categories settings.
26 Most troubles reported in the forum thread are from misunderstanding this priority order.
28 Theme
29 *****
30 This extension needs a few added lines in two theme files.
31 There is a pseudo theme comming with the CategoryRoles extension.
33 Move the folder containing this theme to the <Vanilla>/forum/theme folder
34 Copy the "styles" folder from the Vanilla theme to this one (not included to save extension files size).
36 Q. How do I apply this theme?
37 A. Go to the settings tab and clicking on the “Themes and Styles” link.
38         Select this theme from the first dropdown. Check the “Apply to all users” box and click save.
40 If you want to use the extension with another theme, you can copy the two php files of this folder to you theme folder.
41 If this other theme also has modification to these files, you should merge the few lines necessary to the extension.
42 They are clearly marked by //CategoryRole comments.
44 ********
45 Obsolete. From version 1.1.4, the delegate was added to the core.
46 Instruction kept there in case someone use this extension on a lower release.
47 Required delegate
48 *****************
50 This extension REQUIRES a specific delegate.
51 At the time of this writing (first release of the extension), you should add it yourself in the file <Vanilla>/forum/library/Vanilla/Vanilla.Control.CategoryForm.php
52 There is only one line to add. In the excerpt below it's marked with the "//CategoryRoles added delegate" comment.
53 Presumably Mark will add it to future releases and this part of the readme be obsolete.
55 line 40
56                         if ($this->PostBackAction == 'ProcessCategory') {
57                                 $this->Category = $this->Context->ObjectFactory->NewObject($this->Context, 'Category');
58                                 $this->Category->GetPropertiesFromForm($this->Context);
59                                 $Action = ($this->Category->CategoryID == 0) ? "SavedNew" : "Saved";
60                                 if (($this->Category->CategoryID > 0 && $this->Context->Session->User->Permission('PERMISSION_EDIT_CATEGORIES'))
61                                         || ($this->Category->CategoryID == 0 && $this->Context->Session->User->Permission('PERMISSION_ADD_CATEGORIES'))) {
62                                         if ($this->CategoryManager->SaveCategory($this->Category)) {
63                                                 $this->CallDelegate('PostSaveCategory'); //CategoryRoles added delegate
64                                                 header('location: '.GetUrl($this->Context->Configuration, $this->Context->SelfUrl, '', '', '', '', 'PostBackAction=Categories&Action='.$Action));
65                                         }
66                                 } else {
67                                         $this->IsPostBack = 0;
68                                 }