PluginProbe
wpForo Forum / beta-4
wpForo Forum vbeta-4
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 beta-4, at wpf-admin/forum.php

293 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"><?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 $wpforo->notice->show(FALSE) ?>
48
49 <!-- Forum Hierarchy -->
50 <?php if( !isset($_GET['action'])) : ?>
51 <?php if($wpforo->perm->usergroup_can( $wpforo->current_user_groupid, 'ef')): ?>
52
53
54 <div class="wpf-info-bar" style="box-shadow:none; margin:20px 0px;">
55 <p style="font-size:15px; padding:0px; margin:10px 0px;"><?php _e('Please drag and drop forum panels to set parent-child hierarchy.', 'wpforo'); ?></p>
56 </div>
57
58 <form id="forum-hierarchy" encType="multipart/form-data" method="post" action="">
59 <?php wp_nonce_field( 'wpforo-forums-hierarchy' ); ?>
60 <input type="hidden" name="forums_hierarchy_submit"/>
61 <div id="post-body">
62 <ul id="menu-to-edit" class="menu">
63
64 <?php $wpforo->forum->tree('drag_menu'); ?>
65
66 </ul>
67 </div><br />
68 <div class="major-publishing-actions">
69 <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>
70 </div>
71 </form>
72 <script>
73 var menus = false;
74 navMenuL10n.saveAlert = null;
75 window.onbeforeunload=function(){if(a.menusChanged){return navMenuL10n.saveAlert}}
76 </script>
77 <?php endif; ?><!--checking edit forum permission-->
78 <?php endif; ?>
79 <!-- end Forum Hierarchy -->
80
81 <!-- Forum Add || Edit -->
82 <?php if( ( isset($_GET['action']) && $_GET['action'] == 'add' ) || ( isset($_GET['action']) && $_GET['action'] == 'edit' ) ) : ?>
83 <?php if($wpforo->perm->usergroup_can( $wpforo->current_user_groupid, 'cf')): ?>
84 <?php if(isset($_GET['id'])) $data = $wpforo->forum->get_forum( array('forumid' => $_GET['id']) );?>
85 <div id="poststuff">
86 <form name="forum" action="" method="post">
87 <?php wp_nonce_field( 'wpforo-forum-addedit' ); ?>
88 <div id="post-body" class="metabox-holder columns-2">
89 <div id="post-body-content">
90 <input type="hidden" name="wpforo_submit" value="1"/>
91 <input type="hidden" name="forum[order]" value="<?php echo esc_attr(isset($data['order']) ? $data['order'] : '') ?>"/>
92 <div class="form-wrap">
93 <div class="form-field form-required" style="margin-bottom:0px; padding-bottom:0px;">
94 <div id="titlediv">
95 <div id="titlewrap">
96 <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'); ?>" />
97 </div>
98 </div>
99 <p>&nbsp;</p>
100 <div class="form-field">
101 <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>
102 <p><?php _e('This is a forum description. This content will be displayed under forum title on the forum list.', 'wpforo'); ?></p>
103 </div>
104 </div>
105 </div>
106 </div>
107
108 <div id="postbox-container-1" class="postbox-container">
109 <div id="side-sortables" class="meta-box-sortables ui-sortable">
110
111
112 <div id="forum_cat" class="postbox" style="display: block; ">
113 <div class="handlediv" title="Click to toggle"><br></div>
114 <h3 class="hndle"><span><?php _e('Forum Options', 'wpforo'); ?></span></h3>
115 <div class="inside">
116 <div class="form-field">
117 <p><strong><?php _e('Parent Forum', 'wpforo'); ?></strong></p>
118 <p>
119 <select id="parent" name="forum[parentid]" class="postform" <?php echo (isset($data['is_cat']) && $data['is_cat'] == 1 ? 'disabled' : '') ?>>
120 <option value="0"><?php _e('No parent', 'wpforo'); ?></option>
121 <?php $wpforo->forum->tree('select_box'); ?>
122 </select>
123 </p>
124 <p class="form-field">
125 <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>
126 </p>
127 <p><strong><?php _e('Category Layout', 'wpforo'); ?></strong></p>
128 <p>
129 <?php $layouts = $wpforo->tpl->find_layouts( WPFORO_THEME ); ?>
130 <?php if(!empty($layouts)): ?>
131 <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"' ); ?> >
132 <?php $wpforo->tpl->show_layout_selectbox($data['cat_layout']); ?>
133 </select>
134 <?php else: ?>
135 <p><?php _e('No layout found.', 'wpforo'); ?></p>
136 <?php endif; ?>
137 </p>
138 </div>
139 </div>
140 </div>
141
142 <div id="submitdiv" class="postbox" style="display: block; ">
143 <div class="handlediv" title="Click to toggle"><br></div>
144 <h3 class="hndle"><span><?php _e('Publish', 'wpforo'); ?></span></h3>
145 <div class="inside">
146 <div id="major-publishing-actions" style="text-align:right;">
147 <?php if( $_GET['action'] == 'edit' ) : ?>
148 <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;
149 <a class="preview button" href="<?php echo WPFORO_BASE_URL . (isset($data['slug']) ? $data['slug'] : '') ?>" target="wp-preview" id="post-preview" style="display:inline-block;float:none;"><?php _e('View', 'wpforo'); ?></a> &nbsp;
150 <?php endif; ?>
151 <input type="submit" name="forum[save_edit]" class="button button-primary forum_submit" style="display:inline-block;float:none;" value="<?php _e('Publish', 'wpforo'); ?>">
152 <div class="clear"></div>
153 </div>
154 </div>
155 </div>
156
157
158 <div id="forum_permissions" class="postbox" style="display: block; ">
159 <div class="handlediv" title="Click to toggle"><br></div>
160 <h3 class="hndle"><span>Forum Permissions</span></h3>
161 <div class="inside">
162 <table>
163 <?php $wpforo->forum->permissions(); ?>
164 </table>
165 </div>
166 </div>
167
168 <?php if( get_option('wpforo_integrate_s2member') == 1 && false ) : ?>
169
170 <?php
171
172 if(isset( $_GET['id'] )){
173 $srlz = get_option( 'wpforo_s2member_items_levels' );
174 $s2member_items_levels = unserialize( $srlz );
175
176 for( $i = 0; $i < 5; $i++ ){
177 $f_ids = explode(',', $s2member_items_levels['level'.$i.'_forums']);
178 if(in_array( $_GET['id'], $f_ids)){
179 $lvl = $i;
180 break;
181 }
182 unset($f_ids);
183 }
184 }else{
185 $lvl = -1;
186 }
187
188 ?>
189
190 <div id="ws-plugin--s2member-security" class="postbox " style="display: block; ">
191 <div class="handlediv" title="Click to toggle"><br></div>
192 <h3 class="hndle"><span>s2Member®</span></h3>
193 <div class="inside">
194
195 <p style="margin-left:2px;"><strong>Forum Level Restriction?</strong></p>
196 <label class="screen-reader-text" for="ws-plugin--s2member-security-meta-box-level">Add Level Restriction?</label>
197 <select name="forum[s2member_level]" id="ws-plugin--s2member-security-meta-box-level" style="width:99%;">
198 <option value=""></option>
199 <option value="0" <?php echo ( $lvl != null && $lvl == 0 ? 'selected' : '' ); ?> >Require Level #0 (or higher)</option>
200 <option value="1" <?php echo ( $lvl != null && $lvl == 1 ? 'selected' : '' ); ?> >Require Level #1 (or higher)</option>
201 <option value="2" <?php echo ( $lvl != null && $lvl == 2 ? 'selected' : '' ); ?> >Require Level #2 (or higher)</option>
202 <option value="3" <?php echo ( $lvl != null && $lvl == 3 ? 'selected' : '' ); ?> >Require Level #3 (or higher)</option>
203 <option value="4" <?php echo ( $lvl != null && $lvl == 4 ? 'selected' : '' ); ?> >Require Highest Level #4</option>
204 </select><br>
205
206 </div>
207 </div>
208
209 <?php endif; ?>
210
211 </div>
212 </div>
213
214 <div id="postbox-container-2" class="postbox-container">
215 <div id="normal-sortables" class="meta-box-sortables ui-sortable">
216
217 <div id="forum_slug" class="postbox hide-if-js" style="display: none; ">
218 <div class="handlediv" title="Click to toggle"><br></div>
219 <h3 class="hndle"><span><?php _e('Forum Slug', 'wpforo'); ?></span></h3>
220 <div class="inside">
221 <input name="forum[slug]" type="text" value="<?php echo esc_attr(isset($data['slug']) ? $data['slug'] : '') ?>" size="40" />
222 <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 />
223 </div>
224 </div>
225
226 <div id="forum_meta" class="postbox hide-if-js" style="display: block; ">
227 <div class="handlediv" title="Click to toggle"><br></div>
228 <h3 class="hndle"><span><?php _e('Forum SEO', 'wpforo'); ?></span></h3>
229 <div class="inside" style="padding-top:10px;">
230 <div class="form-field">
231 <label for="tag-description" style="display:block; padding-bottom:5px;"><?php _e('Meta Description', 'wpforo'); ?>:</label>
232 <textarea name="forum[meta_desc]" rows="3" cols="40"><?php echo esc_html(isset($data['meta_desc']) ? $data['meta_desc'] : '') ?></textarea>
233 </div>
234 </div>
235 </div>
236
237 </div>
238 <div id="advanced-sortables" class="meta-box-sortables ui-sortable"></div>
239 </div>
240
241 </div>
242 </form>
243 </div>
244 <?php endif; ?><!-- chekcing creat forum permission-->
245 <?php endif; ?>
246 <!-- end Forum Add || Edit -->
247
248 <!-- Forum Delete -->
249 <?php if( isset($_GET['action']) && $_GET['action'] == 'del') : ?>
250
251 <form action="" method="post">
252 <?php wp_nonce_field( 'wpforo-forum-delete' ); ?>
253 <input type="hidden" name="wpforo_delete" value="1"/>
254 <div class="form-wrap">
255 <div class="form-field form-required">
256 <div class="form-field wpf-info-bar" style="padding:25px 20px 15px 20px; margin-top:20px;">
257 <table class="wpforo_settings_table">
258 <tr>
259 <td style="width:50%;">
260 <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>
261 </td>
262 <td width="20px">
263 <input id="delete_forum" type="radio" name="forum[delete]" value="1" checked="" onchange="mode_changer('false');"/>
264 </td>
265 </tr>
266 <tr>
267 <td>
268 <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>
269 </td>
270 <td><input id="marge" type="radio" name="forum[delete]" value="0" onchange="mode_changer('true');"/> </td>
271 </tr>
272 <tr>
273 <td colspan="2">
274 <select id="forum_select" name="forum[mergeid]" class="postform" disabled="" >
275 <?php $wpforo->forum->tree('select_box'); ?>
276 </select>
277 <p><?php _e('All sub-forums, topics and replies will be attached to selected forum. Layout will be inherited from this forum.', 'wpforo'); ?></p>
278 </td>
279 </tr>
280 <tr>
281 <td colspan="2">
282 <input id="forum_submit" type="submit" name="forum[submit]" class="button button-primary" value="Delete" />
283 </td>
284 </tr>
285 </table>
286 </div>
287 </div>
288 </div>
289 </form>
290 <?php endif; ?>
291 <!-- end Forum Delete -->
292
293 </div><!-- wpwrap -->