setup
2 years ago
alias.php
2 years ago
conf.php
1 month ago
inc-po-links.php
1 month ago
inc-po-table.php
1 year ago
locale.php
2 years ago
setup.php
1 month ago
view.php
2 years ago
conf.php
165 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Bundle configuration form |
| 4 | */ |
| 5 | $this->extend('../layout'); |
| 6 | ?> |
| 7 | |
| 8 | <form action="" method="post" enctype="application/x-www-form-urlencoded" id="loco-conf"><?php |
| 9 | |
| 10 | /* @var $p Loco_mvc_ViewParams */ |
| 11 | foreach( $conf as $i => $p ): $id = sprintf('loco-conf-%u',$i)?> |
| 12 | <div id="<?php echo $id?>"> |
| 13 | |
| 14 | <a href="#" tabindex="-1" class="has-icon icon-del"><span class="screen-reader-text">remove</span></a> |
| 15 | <input type="hidden" name="<?php echo $p->prefix?>[removed]" value="" /> |
| 16 | |
| 17 | <?php |
| 18 | // display package name, and slug if it differs. |
| 19 | if( $p->name === $p->short ):?> |
| 20 | <h2><?php $p->e('name')?></h2><?php |
| 21 | else:?> |
| 22 | <h2><?php $p->e('name')?> <span>(<?php $p->e('short')?>)</span></h2><?php |
| 23 | endif;?> |
| 24 | |
| 25 | <table class="form-table"> |
| 26 | <tbody> |
| 27 | <tr valign="top"> |
| 28 | <th scope="row"> |
| 29 | <label for="<?php echo $id?>-name"><?php esc_html_e('Project name','loco-translate')?></label> |
| 30 | </th> |
| 31 | <td> |
| 32 | <input type="text" name="<?php echo $p->prefix?>[name]" value="<?php $p->e('name')?>" id="<?php echo $id?>-name" class="regular-text" /> |
| 33 | <p class="description"> |
| 34 | <?php // Translators: Help tip for "Project name" field in advanced bundle config |
| 35 | esc_html_e('Descriptive name for this set of translatable strings','loco-translate')?> |
| 36 | </p> |
| 37 | </td> |
| 38 | </tr> |
| 39 | <tr valign="top"> |
| 40 | <th scope="row"> |
| 41 | <label for="<?php echo $id?>-domain"><?php esc_html_e('Text domain','loco-translate')?></label> |
| 42 | </th> |
| 43 | <td> |
| 44 | <input type="text" name="<?php echo $p->prefix?>[domain]" value="<?php $p->e('domain')?>" id="<?php echo $id?>-domain" class="regular-text" /> |
| 45 | <p class="description"> |
| 46 | <?php // Translators: Help tip for "Text domain" field in advanced bundle config |
| 47 | esc_html_e('The namespace into which WordPress will load translated strings','loco-translate')?> |
| 48 | </p> |
| 49 | </td> |
| 50 | </tr> |
| 51 | <tr valign="top"> |
| 52 | <th scope="row"> |
| 53 | <label for="<?php echo $id?>-slug"><?php esc_html_e('File prefix','loco-translate')?></label> |
| 54 | </th> |
| 55 | <td> |
| 56 | <input type="text" name="<?php echo $p->prefix?>[slug]" value="<?php $p->e('slug')?>" id="<?php echo $id?>-slug" class="regular-text" /> |
| 57 | <p class="description"> |
| 58 | <?php // Translators: Help tip for "File prefix" field in advanced bundle config |
| 59 | esc_html_e("Usually the same as the text domain, but don't leave blank unless you mean to",'loco-translate')?> |
| 60 | </p> |
| 61 | </td> |
| 62 | </tr> |
| 63 | <tr valign="top"> |
| 64 | <th scope="row"> |
| 65 | <label for="<?php echo $id?>-template"><?php esc_html_e('Template file','loco-translate')?></label> |
| 66 | </th> |
| 67 | <td> |
| 68 | <input type="text" name="<?php echo $p->prefix?>[template][path]" id="<?php echo $id?>-template" class="regular-text" value="<?php echo $p->escape( $p->template['path'] )?>" /> |
| 69 | <label> |
| 70 | <input type="checkbox" value="1" name="<?php echo $p->prefix?>[template][locked]" <?php empty($p->template['locked']) || print('checked');?> /> |
| 71 | <?php esc_html_e('Locked','loco-translate')?> |
| 72 | </label> |
| 73 | <p class="description"> |
| 74 | <?php // Translators: Help tip for "Template file" field in advanced bundle config |
| 75 | esc_html_e('Relative path from bundle root to the official POT file','loco-translate')?> |
| 76 | </p> |
| 77 | </td> |
| 78 | </tr> |
| 79 | <tr valign="top"> |
| 80 | <th scope="row"> |
| 81 | <label for="<?php echo $id?>-target"><?php esc_html_e('Domain path','loco-translate')?></label> |
| 82 | </th> |
| 83 | <td class="twin"> |
| 84 | <div> |
| 85 | <span class="description"><?php esc_html_e('Include','loco-translate')?>:</span> |
| 86 | <textarea name="<?php echo $p->prefix?>[target][path]" id="<?php echo $id?>-target" rows="2" cols="30" class="large-text"><?php echo $p->escape( $p->target['path'] )?></textarea> |
| 87 | </div> |
| 88 | <div> |
| 89 | <span class="description"><?php esc_html_e('Exclude','loco-translate')?>:</span> |
| 90 | <textarea name="<?php echo $p->prefix?>[target][exclude][path]" id="<?php echo $id?>-xtarget" rows="2" cols="30" class="large-text"><?php echo $p->escape( $p->target['exclude']['path'] )?></textarea> |
| 91 | </div> |
| 92 | <p class="description"> |
| 93 | <?php // Translators: Help tip for "Domain path" field in advanced bundle config |
| 94 | esc_html_e('Folders within the bundle that contain author-supplied translations','loco-translate')?>. (<?php esc_html_e('no wildcards','loco-translate')?>) |
| 95 | </p> |
| 96 | </td> |
| 97 | </tr> |
| 98 | <tr valign="top"> |
| 99 | <th scope="row"> |
| 100 | <label for="<?php echo $id?>-source"><?php esc_html_e('Source file paths','loco-translate')?></label> |
| 101 | </th> |
| 102 | <td class="twin"> |
| 103 | <div> |
| 104 | <span class="description"><?php esc_html_e('Include','loco-translate')?>:</span> |
| 105 | <textarea name="<?php echo $p->prefix?>[source][path]" id="<?php echo $id?>-source" rows="2" cols="30" class="large-text"><?php echo $p->escape( $p->source['path'] )?></textarea> |
| 106 | </div> |
| 107 | <div> |
| 108 | <span class="description"><?php esc_html_e('Exclude','loco-translate')?>:</span> |
| 109 | <textarea name="<?php echo $p->prefix?>[source][exclude][path]" id="<?php echo $id?>-xsource" rows="2" cols="30" class="large-text"><?php echo $p->escape( $p->source['exclude']['path'] )?></textarea> |
| 110 | </div> |
| 111 | <p class="description"> |
| 112 | <?php // Translators: Help tip for "Source file paths" field in advanced bundle config |
| 113 | esc_html_e('Files and folders within the bundle that contain localized PHP code','loco-translate')?>. (<?php esc_html_e('no wildcards','loco-translate')?>) |
| 114 | </p> |
| 115 | </td> |
| 116 | </tr> |
| 117 | </tbody> |
| 118 | </table> |
| 119 | </div><?php |
| 120 | endforeach;?> |
| 121 | |
| 122 | |
| 123 | <footer id="loco-form-foot"> |
| 124 | <table class="form-table"> |
| 125 | <tbody> |
| 126 | <tr valign="top"> |
| 127 | <th scope="row"> |
| 128 | <label for="all-excl"><?php esc_html_e('Blocked paths','loco-translate')?>:</label> |
| 129 | </th> |
| 130 | <td> |
| 131 | <textarea name="exclude[path]" id="all-excl" rows="3" cols="30" class="large-text"><?php echo $params->escape($excl['path'])?></textarea> |
| 132 | <p class="description"> |
| 133 | <?php // Translators: Help tip for "Blocked paths" field in advanced bundle config |
| 134 | esc_html_e('Folders within the bundle that will never be searched for files','loco-translate')?>. (<?php esc_html_e('no wildcards','loco-translate')?>) |
| 135 | </p> |
| 136 | </td> |
| 137 | </tr> |
| 138 | </tbody> |
| 139 | </table> |
| 140 | <p class="submit" > |
| 141 | <input type="submit" class="button-primary" value="<?php esc_html_e('Save config','loco-translate')?>" /> |
| 142 | <button type="button" class="button" disabled id="loco-add-butt"><?php esc_html_e('Add set','loco-translate')?></button><?php |
| 143 | if( $params->parent ):?> |
| 144 | <a class="button button-link has-icon icon-cog" href="<?php $parent->e('href')?>"><?php esc_html_e('Parent theme','loco-translate')?></a><?php |
| 145 | endif?> |
| 146 | <a class="button button-link has-icon icon-download" href="<?php $params->e('xmlUrl')?>"><?php esc_html_e('XML','loco-translate')?></a> |
| 147 | <a class="button button-link has-icon icon-help" href="<?php $params->e('manUrl')?>" target="_blank"><?php esc_html_e('Help','loco-translate')?></a> |
| 148 | </p> |
| 149 | </footer> |
| 150 | |
| 151 | <input type="hidden" name="<?php $nonce->e('name')?>" value="<?php $nonce->e('value')?>" /> |
| 152 | <input type="hidden" name="name" value="<?php $params->e('name')?>" /> |
| 153 | |
| 154 | </form> |
| 155 | |
| 156 | |
| 157 | <?php if( 'db' === $saved ):?> |
| 158 | <form action="" method="post" id="loco-reset"> |
| 159 | <p class="submit"> |
| 160 | <input type="submit" name="unconf" class="button button-danger" value="<?php esc_html_e('Reset config','loco-translate')?>" /> |
| 161 | <input type="hidden" name="<?php $nonce->e('name')?>" value="<?php $nonce->e('value')?>" /> |
| 162 | </p> |
| 163 | </form><?php |
| 164 | endif; |
| 165 |