Made quite a few changes so that the code works in the server
[vanilla-miry.git] / themes / settings_globals_form.php
blob3bcb441379ff3c75675321c484198ff15a132474
1 <?php
2 // Note: This file is included from the library/Vanilla/Vanilla.Control.GlobalsForm.php control.
3 echo '<div id="Form" class="Account GlobalsForm">';
4 if (ForceIncomingBool('Success',0)) echo '<div id="Success">'.$this->Context->GetDefinition('GlobalApplicationChangesSaved').'</div>';
5 echo '<fieldset>
6 <legend>'.$this->Context->GetDefinition('GlobalApplicationSettings').'</legend>
7 '.$this->Get_Warnings().'
8 '.$this->Get_PostBackForm('frmApplicationGlobals').'
9 <h2>'.$this->Context->GetDefinition('Warning').'</h2>
10 <p>
11 '.$this->Context->GetDefinition('GlobalApplicationSettingsNotes').'
12 </p>
14 <h2>'.$this->Context->GetDefinition('ApplicationTitles').'</h2>
15 <ul>
16 <li>
17 <label for="txtApplicationTitle">'.$this->Context->GetDefinition('ApplicationTitle').'</label>
18 <input type="text" name="APPLICATION_TITLE" value="'.$this->ConfigurationManager->GetSetting('APPLICATION_TITLE').'" maxlength="50" class="SmallInput" id="txtApplicationTitle" />
19 </li>
20 <li>
21 <label for="txtBannerTitle">'.$this->Context->GetDefinition('BannerTitle').'</label>
22 <input type="text" name="BANNER_TITLE" value="'.$this->ConfigurationManager->GetSetting('BANNER_TITLE').'" class="SmallInput" id="txtBannerTitle" />
23 <p class="Description">'.$this->Context->GetDefinition('ApplicationTitlesNotes').'</p>
24 </li>
25 </ul>
27 <h2>'.$this->Context->GetDefinition('ForumOptions').'</h2>
28 <ul>
29 <li id="ForumOptions">
30 <p><span>'.GetDynamicCheckBox('ENABLE_WHISPERS', 1, $this->ConfigurationManager->GetSetting('ENABLE_WHISPERS'), '', $this->Context->GetDefinition('EnableWhispers')).'</span></p>
31 <p><span>'.GetDynamicCheckBox('ALLOW_NAME_CHANGE', 1, $this->ConfigurationManager->GetSetting('ALLOW_NAME_CHANGE'), '', $this->Context->GetDefinition('AllowNameChange')).'</span></p>
32 <p><span>'.GetDynamicCheckBox('PUBLIC_BROWSING', 1, $this->ConfigurationManager->GetSetting('PUBLIC_BROWSING'), '', $this->Context->GetDefinition('AllowPublicBrowsing')).'</span></p>
33 <p><span>'.GetDynamicCheckBox('USE_CATEGORIES', 1, $this->ConfigurationManager->GetSetting('USE_CATEGORIES'), '', $this->Context->GetDefinition('UseCategories')).'</span></p>
34 <p><span>'.GetDynamicCheckBox('LOG_ALL_IPS', 1, $this->ConfigurationManager->GetSetting('LOG_ALL_IPS'), '', $this->Context->GetDefinition('LogAllIps')).'</span></p>
35 </li>
36 </ul>
38 <h2>'.$this->Context->GetDefinition('CountsTitle').'</h2>
39 <ul>
40 <li>
41 <label for="ddDiscussionsPerPage">'.$this->Context->GetDefinition('DiscussionsPerPage').'</label>
43 $Selector = $this->Context->ObjectFactory->NewObject($this->Context, 'Select');
44 $Selector->CssClass = 'SmallSelect';
45 $Selector->Name = 'DISCUSSIONS_PER_PAGE';
46 $Selector->Attributes = ' id="ddDiscussionsPerPage"';
47 $i = 10;
48 while ($i < 101) {
49 $Selector->AddOption($i, $i);
50 $i += 10;
52 $Selector->SelectedValue = $this->ConfigurationManager->GetSetting('DISCUSSIONS_PER_PAGE');
53 echo $Selector->Get().'
54 </li>
55 <li>
56 <label for="ddCommentsPerPage">'.$this->Context->GetDefinition('CommentsPerPage').'</label>
58 $Selector->Name = 'COMMENTS_PER_PAGE';
59 $Selector->Attributes = ' id="ddCommentsPerPage"';
60 $Selector->SelectedValue = $this->ConfigurationManager->GetSetting('COMMENTS_PER_PAGE');
61 echo $Selector->Get().'
62 </li>
63 <li>
64 <label for="ddSearchResultsPerPage">'.$this->Context->GetDefinition('SearchResultsPerPage').'</label>
66 $Selector->Name = 'SEARCH_RESULTS_PER_PAGE';
67 $Selector->Attributes = ' id="ddSearchResultsPerPage"';
68 $Selector->SelectedValue = $this->ConfigurationManager->GetSetting('SEARCH_RESULTS_PER_PAGE');
69 echo $Selector->Get().'
70 </li>';
72 $this->CallDelegate('PostCounts');
74 echo '</ul>
76 <h2>'.$this->Context->GetDefinition('SpamProtectionTitle').'</h2>
77 <ul>
78 <li>
79 <label for="txtMaxCommentLength">'.$this->Context->GetDefinition('MaxCommentLength').'</label>
80 <input type="text" name="MAX_COMMENT_LENGTH" value="'.$this->ConfigurationManager->GetSetting('MAX_COMMENT_LENGTH').'" maxlength="255" class="SmallInput" id="txtMaxCommentLength" />
81 <p class="Description">
82 '.$this->Context->GetDefinition('MaxCommentLengthNotes');
83 $Selector->Clear();
84 $Selector->CssClass = 'SmallSelect';
85 for ($i = 1; $i < 31; $i++) {
86 $Selector->AddOption($i, $i);
88 $Selector->Name = 'DISCUSSION_POST_THRESHOLD';
89 $Selector->SelectedValue = $this->Context->Configuration['DISCUSSION_POST_THRESHOLD'];
91 $SecondsSelector = $this->Context->ObjectFactory->NewObject($this->Context, 'Select');
92 $SecondsSelector2 = $this->Context->ObjectFactory->NewObject($this->Context, 'Select');
93 $SecondsSelector->CssClass = 'SmallSelect';
94 $SecondsSelector2->CssClass = 'SmallSelect';
95 for ($i = 10; $i < 601; $i++) {
96 $SecondsSelector->AddOption($i, $i);
97 $SecondsSelector2->AddOption($i, $i);
98 $i += 9;
100 $SecondsSelector->Name = 'DISCUSSION_TIME_THRESHOLD';
101 $SecondsSelector->SelectedValue = $this->Context->Configuration['DISCUSSION_TIME_THRESHOLD'];
102 $SecondsSelector2->Name = 'DISCUSSION_THRESHOLD_PUNISHMENT';
103 $SecondsSelector2->SelectedValue = $this->Context->Configuration['DISCUSSION_THRESHOLD_PUNISHMENT'];
105 echo '<br /><br />'.str_replace(array('//1', '//2', '//3'),
106 array($Selector->Get(), $SecondsSelector->Get(), $SecondsSelector2->Get()),
107 $this->Context->GetDefinition('XDiscussionsYSecondsZFreeze'));
109 $Selector->Name = 'COMMENT_POST_THRESHOLD';
110 $Selector->SelectedValue = $this->Context->Configuration['COMMENT_POST_THRESHOLD'];
112 $SecondsSelector->Name = 'COMMENT_TIME_THRESHOLD';
113 $SecondsSelector->SelectedValue = $this->Context->Configuration['COMMENT_TIME_THRESHOLD'];
115 $SecondsSelector2->Name = 'COMMENT_THRESHOLD_PUNISHMENT';
116 $SecondsSelector2->SelectedValue = $this->Context->Configuration['COMMENT_THRESHOLD_PUNISHMENT'];
118 echo '<br /><br />'
119 .str_replace(array('//1', '//2', '//3'),
120 array($Selector->Get(), $SecondsSelector->Get(), $SecondsSelector2->Get()),
121 $this->Context->GetDefinition('XCommentsYSecondsZFreeze'))
122 .'</p>
123 </li>
124 </ul>
125 <h2>'.$this->Context->GetDefinition('EmailSettings').'</h2>
126 <ul>
127 <li>
128 <label for="txtSupportName">'.$this->Context->GetDefinition('SupportName').'</label>
129 <input type="text" name="SUPPORT_NAME" value="'.$this->ConfigurationManager->GetSetting('SUPPORT_NAME').'" maxlength="255" class="SmallInput" id="txtSupportName" />
130 </li>
131 <li>
132 <label for="txtSupportEmail">'.$this->Context->GetDefinition('SupportEmail').'</label>
133 <input type="text" name="SUPPORT_EMAIL" value="'.$this->ConfigurationManager->GetSetting('SUPPORT_EMAIL').'" maxlength="255" class="SmallInput" id="txtSupportEmail" />
134 <p class="Description">'.$this->Context->GetDefinition('SupportContactNotes').'</p>
135 </li>
136 <li>
137 <label for="txtSMTPHost">'.$this->Context->GetDefinition('SMTPHost').'</label>
138 <input type="text" name="SMTP_HOST" value="'.$this->ConfigurationManager->GetSetting('SMTP_HOST').'" maxlength="255" class="SmallInput" id="txtSMTPHost" />
139 </li>
140 <li>
141 <label for="txtSMTPUser">'.$this->Context->GetDefinition('SMTPUser').'</label>
142 <input type="text" name="SMTP_USER" value="'.$this->ConfigurationManager->GetSetting('SMTP_USER').'" maxlength="255" class="SmallInput" id="txtSMTPUser" />
143 </li>
144 <li>
145 <label for="txtSMTPPassword">'.$this->Context->GetDefinition('SMTPPassword').'</label>
146 <input type="password" name="SMTP_PASSWORD" value="'.$this->ConfigurationManager->GetSetting('SMTP_PASSWORD').'" maxlength="255" class="SmallInput" id="txtSMTPPassword" />
147 <p class="Description">'.$this->Context->GetDefinition('SMTPSettingsNotes').'</p>
148 </li>
149 </ul>
151 <h2>'.$this->Context->GetDefinition('ApplicationSettings').'</h2>
152 <ul>
153 <li>
154 <label for="txtWebPathtoVanilla">'.$this->Context->GetDefinition('WebPathToVanilla').'</label>
155 <input type="text" name="BASE_URL" value="'.$this->ConfigurationManager->GetSetting('BASE_URL').'" maxlength="255" class="SmallInput" id="txtWebPathToVanilla" />
156 <p class="Description">'.$this->Context->GetDefinition('WebPathNotes').'</p>
157 </li>
158 <li>
159 <label for="txtCookieDomain">'.$this->Context->GetDefinition('CookieDomain').'</label>
160 <input type="text" name="COOKIE_DOMAIN" value="'.$this->ConfigurationManager->GetSetting('COOKIE_DOMAIN').'" maxlength="255" class="SmallInput" />
161 </li>
162 <li>
163 <label for="txtCookiePath">'.$this->Context->GetDefinition('CookiePath').'</label>
164 <input type="text" name="COOKIE_PATH" value="'.$this->ConfigurationManager->GetSetting('COOKIE_PATH').'" maxlength="255" class="SmallInput" id="txtCookiePath" />
165 <p class="Description">'.$this->Context->GetDefinition('CookieSettingsNotes').'</p>
166 </li>
167 </ul>
169 <div class="Submit">
170 <input type="submit" name="btnSave" value="'.$this->Context->GetDefinition('Save').'" class="Button SubmitButton" />
171 <a href="'.GetUrl($this->Context->Configuration, $this->Context->SelfUrl).'" class="CancelButton">'.$this->Context->GetDefinition('Cancel').'</a>
172 </div>
173 </form>
174 </fieldset>
175 </div>';