| 1 |
<?php |
| 2 |
// Exit if accessed directly |
| 3 |
if( !defined( 'ABSPATH' ) ) exit; |
| 4 |
if( !current_user_can('administrator') ) exit; |
| 5 |
?> |
| 6 |
|
| 7 |
<div id="wpf-admin-wrap" class="wrap" style="margin-top: 0px"> |
| 8 |
<?php wpforo_screen_option() ?> |
| 9 |
<div id="icon-users" class="icon32"><br></div> |
| 10 |
<h2 style="padding:30px 0px 0px 0px;line-height: 20px; margin-bottom:15px;"><?php _e('Front-end Phrases', 'wpforo'); ?> <a href="<?php echo admin_url( 'admin.php?page=wpforo-phrases&action=add' ) ?>" class="add-new-h2"><?php wpforo_phrase('add_new') ?></a></h2> |
| 11 |
<?php WPF()->notice->show(FALSE) ?> |
| 12 |
<?php |
| 13 |
if( !((isset($_GET['action']) && $_GET['action'] != '-1') || (isset($_GET['action2']) && $_GET['action2'] != '-1')) ){ |
| 14 |
$fields = array( 'phrase_key', 'phrase_value', 'package' ); |
| 15 |
$search_fields = array( 'phrase_key', 'phrase_value' ); |
| 16 |
$filter_fields = array( 'langid', 'package' ); |
| 17 |
wpforo_create_form_table( 'phrase', 'phraseid', $fields, $search_fields, $filter_fields, array('edit'), array('edit')); |
| 18 |
} |
| 19 |
?> |
| 20 |
<?php if( (isset($_GET['action']) && $_GET['action'] == 'edit') || (isset($_GET['action2']) && $_GET['action2'] == 'edit') ) : ?> |
| 21 |
<?php if(isset($_GET['id'])){$phrase_ids = array($_GET['id']);}else{ $phrase_ids = explode(',', $_GET['ids']);} ?> |
| 22 |
<form action="" method="POST" id="phrases" class="validate"> |
| 23 |
<?php wp_nonce_field( 'wpforo-phrases-edit' ); ?> |
| 24 |
<table class="form-table"> |
| 25 |
<tbody> |
| 26 |
<?php foreach($phrase_ids as $phraseid) : ?> |
| 27 |
<tr class="form-field form-required"> |
| 28 |
<th scope="row"> |
| 29 |
<?php $data = WPF()->phrase->get_wpforo_phrase($phraseid); ?> |
| 30 |
<label for="phrase"> <?php wpforo_phrase('phrase_key'); ?> |
| 31 |
<span class="description">(<?php echo esc_html($data['phrase_key']); ?>)</span></label> |
| 32 |
</th> |
| 33 |
<td> |
| 34 |
<textarea name="phrase[data][<?php echo intval($phraseid) ?>][title]" id="phrase" required style="width:80%; height:29px;"><?php wpfo($data['phrase_value'], true, 'esc_textarea'); ?></textarea> |
| 35 |
</td> |
| 36 |
</tr> |
| 37 |
<?php endforeach; ?> |
| 38 |
</tbody> |
| 39 |
</table> |
| 40 |
<p class="submit"> |
| 41 |
<input type="submit" name="phrase[save]" id="createusersub" class="button button-primary" value="<?php wpforo_phrase('update') ?>"> |
| 42 |
</p> |
| 43 |
</form> |
| 44 |
<?php endif; ?> |
| 45 |
<?php if( (isset($_GET['action']) && $_GET['action'] == 'add')) : ?> |
| 46 |
<form action="" method="POST" id="phrases" class="validate"> |
| 47 |
<?php wp_nonce_field( 'wpforo-phrase-add' ); ?> |
| 48 |
<table class="form-table"> |
| 49 |
<tbody> |
| 50 |
<tr class="form-field form-required"> |
| 51 |
<th scope="row"> |
| 52 |
<label for="phrase_key"> <?php wpforo_phrase('phrase_key') ?></label> |
| 53 |
</th> |
| 54 |
<td><input name="phrase[key]" type="text" id="phrase_key" value="" required="" required></td> |
| 55 |
|
| 56 |
<th scope="row"> |
| 57 |
<label for="phrase_value"> <?php wpforo_phrase('phrase_value') ?></label> |
| 58 |
</th> |
| 59 |
<td><input name="phrase[value]" type="text" id="phrase_value" required="" value="" required></td> |
| 60 |
</tr> |
| 61 |
</tbody> |
| 62 |
</table> |
| 63 |
<p class="submit"> |
| 64 |
<input type="submit" name="phrase[add]" id="createusersub" class="button button-primary" value="<?php wpforo_phrase('add') ?>"> |
| 65 |
</p> |
| 66 |
</form> |
| 67 |
<?php endif; ?> |
| 68 |
</div> |