PluginProbe
wpForo Forum / 1.4.13
wpForo Forum v1.4.13
3.1.5 3.1.4 3.1.2 3.1.1 3.1.0 3.0.9 3.0.8 3.0.7 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.2 All 137 releases
wpforo / wpf-admin / forum.php

forum.php in wpForo Forum 1.4.13, at wpf-admin/forum.php

277 lines 15.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // Exit if accessed directly
3 if( !defined( 'ABSPATH' ) ) exit;
4 if( !current_user_can('administrator') ) exit;
5 ?>
6
7 <!-- Screen Options -->
8 <?php if( isset($_GET['action']) && $_GET['action'] == 'add' || isset($_GET['action']) && $_GET['action'] == 'edit') : ?>
9
10 <div id="screen-meta" class="metabox-prefs" style="display: none; ">
11 <div id="screen-options-wrap" class="hidden" tabindex="-1" aria-label="Screen Options Tab" style="display: none; ">
12 <form id="adv-settings" action="" method="post">
13 <h5><?php _e('Show on screen', 'wpforo'); ?></h5>
14 <div class="metabox-prefs">
15 <label for="forum_cat-hide"><input class="hide-postbox-tog" name="forum_cat-hide" type="checkbox" id="forum_cat-hide" value="forum_cat" checked="checked"><?php _e('Forum Options', 'wpforo'); ?></label>
16 <label for="forum_permissions-hide"><input class="hide-postbox-tog" name="forum_permissions-hide" type="checkbox" id="forum_permissions-hide" value="forum_permissions" checked="checked"><?php _e('Permissions', 'wpforo'); ?></label>
17 <label for="forum_slug-hide"><input class="hide-postbox-tog" name="forum_slug-hide" type="checkbox" id="forum_slug-hide" value="forum_slug" checked="checked"><?php _e('Slug', 'wpforo'); ?></label>
18 <label for="forum_meta-hide"><input class="hide-postbox-tog" name="forum_meta-hide" type="checkbox" id="forum_meta-hide" value="forum_meta" checked="checked"><?php _e('Forum Meta', 'wpforo'); ?></label>
19 <br class="clear">
20 </div>
21 <h5 class="screen-layout"><?php _e('Screen Layout', 'wpforo'); ?></h5>
22 <div class="columns-prefs"><?php _e('Number of Columns', 'wpforo'); ?>:
23 <label class="columns-prefs-1"><input type="radio" name="screen_columns" value="1">1</label>
24 <label class="columns-prefs-2"><input type="radio" name="screen_columns" value="2" checked="checked">2</label>
25 </div>
26 </form>
27 </div>
28 </div>
29
30 <div id="screen-meta-links">
31 <div id="screen-options-link-wrap" class="hide-if-no-js screen-meta-toggle" style="">
32 <button aria-expanded="true" aria-controls="screen-options-wrap" class="button show-settings screen-meta-active" id="show-settings-link" type="button"><?php _e('Screen Options', 'wpforo'); ?></button>
33 </div>
34 </div>
35
36 <?php endif; ?>
37 <!-- end Screen Options -->
38
39 <div id="icon-edit" class="icon32 icon32-posts-post"></div>
40 <div id="wpf-admin-wrap" class="wrap">
41
42 <h2 style="padding:30px 0px 10px 0px; line-height: 20px;">
43 <?php _e('Categories and Forums', 'wpforo'); ?> &nbsp;
44 <a href="<?php echo admin_url( 'admin.php?page=wpforo-forums&action=add' ) ?>" class="add-new-h2"><?php _e('Add New', 'wpforo'); ?></a>
45 </h2>
46
47 <?php WPF()->notice->show(FALSE) ?>
48
49 <!-- Forum Hierarchy -->
50 <?php if( !isset($_GET['action'])) : ?>
51 <?php if(WPF()->perm->usergroup_can('ef')): ?>
52
53 <div class="wpf-info-bar" style="line-height: 1em; clear:both; padding: 5px 30px; font-size:15px; display:block; box-shadow:none; margin: 20px 0 10px 0; font-style: italic; background: #FFFFC6; width:90%;">
54 <ul style="list-style-type: disc; line-height:18px;">
55 <li style="list-style:none; margin-left:-17px; font-style:normal; font-weight:bold;"><i class="fas fa-info-circle" aria-hidden="true"></i>&nbsp; <?php _e('Important Tips', 'wpforo'); ?></li>
56 <li><?php _e('Please drag and drop forum panels to set parent-child hierarchy.', 'wpforo'); ?></li>
57 <li><?php _e('If a category (blue panels) does not have forums (grey panels) it will not be displayed on front-end. Each category should contain at least one forum.', 'wpforo'); ?></li>
58 <li><?php _e('Forums can be displayed with different layouts (Extended, Simplified, Q&A), just edit the top (blue panels) category and set the layout you want. Child forums\' layout depends on the top category (blue panels) layout. They cannot have a different layout.', 'wpforo'); ?></li>
59 </ul>
60 </div>
61 <br style="clear: both;" />
62
63 <form id="forum-hierarchy" encType="multipart/form-data" method="post" action="">
64 <?php wp_nonce_field( 'wpforo-forums-hierarchy' ); ?>
65 <input type="hidden" name="forums_hierarchy_submit"/>
66 <div id="post-body">
67 <ul id="menu-to-edit" class="menu">
68
69 <?php WPF()->forum->tree('drag_menu'); ?>
70
71 </ul>
72 </div><br />
73 <div class="major-publishing-actions">
74 <div class="publishing-action"><input id="save_menu_footer" class="button button-primary menu-save" name="save_menu" value="<?php _e('Save forums order and hierarchy', 'wpforo'); ?>" onclick="get_forums_hierarchy()" type="button"></div>
75 </div>
76 </form>
77 <script>
78 var menus = false;
79 navMenuL10n.saveAlert = null;
80 window.onbeforeunload=function(){if(a.menusChanged){return navMenuL10n.saveAlert}}
81 </script>
82 <?php endif; ?><!--checking edit forum permission-->
83 <?php endif; ?>
84 <!-- end Forum Hierarchy -->
85 <br style="clear: both;"/>
86 <!-- Forum Add || Edit -->
87 <?php if( ( isset($_GET['action']) && $_GET['action'] == 'add' ) || ( isset($_GET['action']) && $_GET['action'] == 'edit' ) ) : ?>
88 <?php if(WPF()->perm->usergroup_can('cf')): ?>
89 <?php
90 $disabled_forumid = 0;
91 $selected_forumid = 0;
92 if(!empty($_GET['id'])){
93 $disabled_forumid = array( $_GET['id'] );
94 if( $data = WPF()->forum->get_forum( array('forumid' => $_GET['id']) ) ) $selected_forumid = $data['parentid'];
95 }
96 if (!empty($_GET['parentid'])){
97 $selected_forumid = $_GET['parentid'];
98 }
99 ?>
100 <div id="poststuff">
101 <form name="forum" action="" method="post">
102 <?php wp_nonce_field( 'wpforo-forum-addedit' ); ?>
103 <div id="post-body" class="metabox-holder columns-2">
104 <div id="post-body-content">
105 <input type="hidden" name="wpforo_submit" value="1"/>
106 <input type="hidden" name="forum[order]" value="<?php echo esc_attr(isset($data['order']) ? $data['order'] : '') ?>"/>
107 <div class="form-wrap">
108 <div class="form-field form-required" style="margin-bottom:0px; padding-bottom:0px;">
109 <div id="titlediv">
110 <div id="titlewrap">
111 <input id="title" name="forum[title]" type="text" value="<?php echo esc_attr(isset($data['title']) ? $data['title'] : '') ?>" size="40" autocomplete="off" required="TRUE" placeholder="<?php _e('Enter forum title here', 'wpforo'); ?>" />
112 </div>
113 </div>
114 <p>&nbsp;</p>
115 <div class="form-field">
116 <textarea placeholder="<?php _e('Enter description here . . .', 'wpforo'); ?>" name="forum[description]" rows="5" cols="40" style="padding:10px;"><?php echo esc_textarea(isset($data['description']) ? $data['description'] : '') ?></textarea>
117 <p><?php _e('This is a forum description. This content will be displayed under forum title on the forum list.', 'wpforo'); ?></p>
118 </div>
119 </div>
120 </div>
121 </div>
122
123 <div id="postbox-container-1" class="postbox-container">
124 <div id="side-sortables" class="meta-box-sortables ui-sortable">
125
126
127 <div id="forum_cat" class="postbox">
128 <div class="handlediv" title="Click to toggle"><br></div>
129 <h3 class="hndle"><span><?php _e('Forum Options', 'wpforo'); ?></span></h3>
130 <div class="inside">
131 <div class="form-field">
132 <p><strong><?php _e('Parent Forum', 'wpforo'); ?></strong></p>
133 <p>
134 <select id="parent" name="forum[parentid]" class="postform" <?php echo (isset($data['is_cat']) && $data['is_cat'] == 1 ? 'disabled' : '') ?>>
135 <option value="0"><?php _e('No parent', 'wpforo'); ?></option>
136 <?php WPF()->forum->tree('select_box', true, $selected_forumid, false, $disabled_forumid); ?>
137 </select>
138 </p>
139 <p class="form-field">
140 <label for="use_us_cat"><?php _e('Use as Category', 'wpforo'); ?> &nbsp;<input id="use_us_cat" onclick="document.getElementById('parent').disabled = this.checked; document.getElementById('cat_layout').disabled = !this.checked;" type="checkbox" name="forum[is_cat]" value="1" <?php echo (isset($data['is_cat']) && $data['is_cat'] == 1 ? 'checked' : '') ?>/> </label>
141 </p>
142 <p><strong><?php _e('Category Layout', 'wpforo'); ?></strong></p>
143 <p>
144 <?php $layouts = WPF()->tpl->find_layouts( WPFORO_THEME ); ?>
145 <?php if(!empty($layouts)): ?>
146 <select id="cat_layout" name="forum[cat_layout]" class="postform" <?php $data['cat_layout'] = ( isset($data['cat_layout']) ? $data['cat_layout'] : 1 ); echo ( isset($data['is_cat']) && $data['is_cat'] == 1 ? '' : 'disabled="TRUE"' ); ?> >
147 <?php WPF()->tpl->show_layout_selectbox($data['cat_layout']); ?>
148 </select>
149 <?php else: ?>
150 <p><?php _e('No layout found.', 'wpforo'); ?></p>
151 <?php endif; ?>
152 </p>
153 </div>
154 </div>
155 </div>
156
157 <div id="submitdiv" class="postbox">
158 <div class="handlediv" title="Click to toggle"><br></div>
159 <h3 class="hndle"><span><?php _e('Publish', 'wpforo'); ?></span></h3>
160 <div class="inside">
161 <div id="major-publishing-actions" style="text-align:right;">
162 <?php if( $_GET['action'] == 'edit' ) : ?>
163 <a class="wpf-delete button" href="?page=wpforo-forums&id=<?php echo intval($data['forumid']) ?>&action=del" onclick="if (!confirm('<?php _e('Are you sure you want to delete this forum?', 'wpforo'); ?>')) { return false; }"><?php _e('Delete', 'wpforo'); ?></a> &nbsp;
164 <a class="preview button" href="<?php echo wpforo_home_url( (isset($data['slug']) ? $data['slug'] : '') ) ?>" target="wp-preview" id="post-preview" style="display:inline-block;float:none;"><?php _e('View', 'wpforo'); ?></a> &nbsp;
165 <?php endif; ?>
166 <input type="submit" name="forum[save_edit]" class="button button-primary forum_submit" style="display:inline-block;float:none;" value="<?php _e('Publish', 'wpforo'); ?>">
167 <div class="clear"></div>
168 </div>
169 </div>
170 </div>
171
172
173 <div id="forum_permissions" class="postbox">
174 <div class="handlediv" title="Click to toggle"><br></div>
175 <h3 class="hndle"><span>Forum Permissions</span></h3>
176 <div class="inside">
177 <table>
178 <?php WPF()->forum->permissions(); ?>
179 </table>
180 </div>
181 </div>
182
183 </div>
184 </div>
185
186 <div id="postbox-container-2" class="postbox-container">
187 <div id="normal-sortables" class="meta-box-sortables ui-sortable">
188
189 <div id="forum_slug" class="postbox">
190 <div class="handlediv" title="Click to toggle"><br></div>
191 <h3 class="hndle"><span><?php _e('Forum Slug', 'wpforo'); ?></span></h3>
192 <div class="inside">
193 <input name="forum[slug]" type="text" value="<?php echo esc_attr(isset($data['slug']) ? $data['slug'] : '') ?>" size="40" />
194 <p><?php _e('The "slug" is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.', 'wpforo'); ?> </p><br />
195 </div>
196 </div>
197
198 <div id="forum_icon" class="postbox">
199 <div class="handlediv" title="Click to toggle"><br></div>
200 <h3 class="hndle"><span><?php _e('Forum Icon', 'wpforo'); ?></span></h3>
201 <div class="inside" style="padding-top:10px;">
202 <div class="form-field">
203 <label for="tag-icon" style="display:block; padding-bottom:5px;"><?php _e('Font-awesome Icon', 'wpforo'); ?>:</label>
204 <input name="forum[icon]" value="<?php echo (isset($data['icon']) && $data['icon']) ? esc_attr($data['icon']) : 'fas fa-comments'; ?>" type="text"/>
205 <p style="margin-bottom:0px; margin-top:5px;"><?php _e('You can find all icons', 'wpforo'); ?> <a href="http://fontawesome.io/icons/" target="_blank"><?php _e('here', 'wpforo'); ?>.</a> <?php _e('Make sure you insert a class of font-awesome icon, it should start with fa- prefix like &quot;fas fa-comments&quot;.', '') ?></p>
206 </div>
207 </div>
208 </div>
209
210 <div id="forum_meta" class="postbox">
211 <div class="handlediv" title="Click to toggle"><br></div>
212 <h3 class="hndle"><span><?php _e('Forum SEO', 'wpforo'); ?></span></h3>
213 <div class="inside" style="padding-top:10px;">
214 <div class="form-field">
215 <label for="tag-description" style="display:block; padding-bottom:5px;"><?php _e('Meta Description', 'wpforo'); ?>:</label>
216 <textarea name="forum[meta_desc]" rows="3" cols="40"><?php echo esc_html(isset($data['meta_desc']) ? $data['meta_desc'] : '') ?></textarea>
217 </div>
218 </div>
219 </div>
220
221 </div>
222 <div id="advanced-sortables" class="meta-box-sortables ui-sortable"></div>
223 </div>
224
225 </div>
226 </form>
227 </div>
228 <?php endif; ?><!-- chekcing creat forum permission-->
229 <?php endif; ?>
230 <!-- end Forum Add || Edit -->
231
232 <!-- Forum Delete -->
233 <?php if( isset($_GET['action']) && $_GET['action'] == 'del') : ?>
234
235 <form action="" method="post">
236 <?php wp_nonce_field( 'wpforo-forum-delete' ); ?>
237 <input type="hidden" name="wpforo_delete" value="1"/>
238 <div class="form-wrap">
239 <div class="form-field form-required">
240 <div class="form-field wpf-info-bar" style="padding:25px 20px 15px 20px; margin-top:20px;">
241 <table class="wpforo_settings_table">
242 <tr>
243 <td style="width:50%;">
244 <label for="delete_forum" class="menu_delete" style="color: red; font-size:13px; line-height:18px;"><?php _e('This action will also delete all sub-forums, topics and replies.', 'wpforo'); ?></label>
245 </td>
246 <td width="20px">
247 <input id="delete_forum" type="radio" name="forum[delete]" value="1" checked="" onchange="mode_changer('false');"/>
248 </td>
249 </tr>
250 <tr>
251 <td>
252 <label for="marge" style="font-size:13px; line-height:18px;"><?php _e('If you want to delete this forum and keep its sub-forums, topics and replies, please select a new target forum in dropdown below', 'wpforo'); ?></label>
253 </td>
254 <td><input id="marge" type="radio" name="forum[delete]" value="0" onchange="mode_changer('true');"/> </td>
255 </tr>
256 <tr>
257 <td colspan="2">
258 <select id="forum_select" name="forum[mergeid]" class="postform" disabled="" >
259 <?php WPF()->forum->tree('select_box', false); ?>
260 </select>
261 <p><?php _e('All sub-forums, topics and replies will be attached to selected forum. Layout will be inherited from this forum.', 'wpforo'); ?></p>
262 </td>
263 </tr>
264 <tr>
265 <td colspan="2">
266 <input id="forum_submit" type="submit" name="forum[submit]" class="button button-primary" value="Delete" />
267 </td>
268 </tr>
269 </table>
270 </div>
271 </div>
272 </div>
273 </form>
274 <?php endif; ?>
275 <!-- end Forum Delete -->
276
277 </div><!-- wpwrap -->