tiki-admin_integrator_rules.tpl 9.8 KB
Newer Older
1 2
{* $Id$ *}

3
{title help="Integrator"}{tr}Edit Rules for Repository:{/tr} {$name}{/title}
4

5
<div class="t_navbar margin-bottom-md">
6
	{button href="tiki-admin_integrator.php" class="btn btn-default" _icon_name="cog" _text="{tr}Configure Repositories{/tr}"}
7
	{button href="tiki-list_integrator_repositories.php" class="btn btn-default" _icon_name="list" _text="{tr}List Repositories{/tr}"}
8
	{assign var=thisrepID value=$repID|escape}
9 10 11
	{button href="tiki-admin_integrator.php?action=edit&amp;repID=$thisrepID" class="btn btn-default" _icon_name="wrench" _text="{tr}Configure this Repository{/tr}"}
	{button href="tiki-integrator.php?repID=$thisrepID" _text="{tr}View this Repository{/tr}" _icon_name="view" class="btn btn-default"}
	{button href="tiki-admin_integrator_rules.php?repID=$thisrepID" _text="{tr}New Rule{/tr}" _icon_name="create" class="btn btn-default"}
12
	{if count($reps) gt 0}
13
		{button _onclick="javascript:flip('rules-copy-panel');" _text="{tr}Copy Rules{/tr}" _icon_name="copy" _title="{tr}view/hide copy rules dialog{/tr}"}
14
	{/if}
15 16
</div>

zaufi's avatar
zaufi committed
17
{if count($reps) gt 0}
18
	<div id="rules-copy-panel">
19 20 21 22 23 24 25 26 27 28
		<form action="tiki-admin_integrator_rules.php?repID={$repID|escape}" method="post" class="form-horizontal">
			<div class="form-group">
				<label class="col-sm-3 control-label">{tr}Source repository{/tr}</label>
				<div class="col-sm-6 col-sm-offset-1">
			      	<select name="srcrep" class="form-control">{html_options options=$reps}</select>
			    </div>
			    <div class="col-sm-1">
			    	<input type="submit" class="btn btn-default btn-sm" name="copy" value="{tr}Copy{/tr}">
			    </div>
		    </div>
29 30 31
		</form>
		<br><br>
	</div>
zaufi's avatar
zaufi committed
32
{/if}
zaufi's avatar
zaufi committed
33

34
{* Add form *}
35
<form action="tiki-admin_integrator_rules.php?repID={$repID|escape}" method="post" class="form-horizontal">
36 37
	<input type="hidden" name="ruleID" value="{$ruleID|escape}">
	<input type="hidden" name="repID" value="{$repID|escape}">
38

39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
	<div class="form-group">
		<label class="col-sm-3 control-label" title="{tr}Rules will be applied in this order ('0' or empty = auto){/tr}">{tr}Rule order{/tr}</label>
		<div class="col-sm-7 col-sm-offset-1">
			<input type="text" maxlength="2" size="2" class="form-control" name="ord" value="{$ord|escape}" title="{tr}Rules will be applied in this order ('0' or empty = auto){/tr}">
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label" title="{tr}Text to search for{/tr}">{tr}Search{/tr}</label>
		<div class="col-sm-7 col-sm-offset-1">
			<input type="text" name="srch" value="{$srch|escape}" title="{tr}Text to search for{/tr}" class="form-control">
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label" title="{tr}Text to replace{/tr}">{tr}Replace{/tr}</label>
		<div class="col-sm-7 col-sm-offset-1">
			<input type="text" name="repl" value="{$repl|escape}" title="{tr}Text to replace{/tr}" class="form-control">
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label" title="{tr}Is this regular expression or simple search/replacer{/tr}">{tr}Regex{/tr}</label>
		<div class="col-sm-7 col-sm-offset-1">
			<input type="checkbox" name="type" {if $type eq 'y'}checked="checked"{/if} title="{tr}Is this regular expression or simple search/replacer{/tr}">
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label" title="{tr}Is case sensitive (for simple replacer){/tr}">{tr}Case sensitive{/tr}</label>
		<div class="col-sm-7 col-sm-offset-1">
			<input type="checkbox" name="casesense" {if $casesense eq 'y'}checked="checked"{/if} title="{tr}Is case sensitive (for simple replacer){/tr}">
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label" title="{tr}subset of chars: imsxeADSXUu, which are regex modifiers{/tr}">{tr}Regex modifiers{/tr}</label>
		<div class="col-sm-7 col-sm-offset-1">
			<input type="text" maxlength="20" size="20" class="form-control" name="rxmod" value="{$rxmod|escape}" title="{tr}subset of chars: imsxeADSXUu, which are regex modifiers{/tr}">
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label" title="{tr}Human-readable text description of rule{/tr}">{tr}Description{/tr}</label>
		<div class="col-sm-7 col-sm-offset-1">
			<textarea name="description" class="form-control" rows="4" title="{tr}Human-readable text description of rule{/tr}">{$description|escape}</textarea>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label">{tr}Enabled{/tr}</label>
		<div class="col-sm-7 col-sm-offset-1">
			<input type="checkbox" name="enabled" {if $enabled eq 'y'}checked="checked"{/if} title="{tr}Check to enable this rule{/tr}">&nbsp;
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label"></label>
		<div class="col-sm-7 col-sm-offset-1">
			<input type="submit" class="btn btn-primary btn-sm" name="save" value="{tr}Save{/tr}">
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label">{tr}Preview options{/tr}</label>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label" title="{tr}Apply all rules or just this to generate preview{/tr}">{tr}Apply all rules{/tr}</label>
		<div class="col-sm-7 col-sm-offset-1">
			<input type="checkbox" name="all" {if $all eq 'y'}checked="checked"{/if} title="{tr}Apply all rules or just this to generate preview{/tr}">
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label" title="{tr}View source code after rules applied{/tr}">{tr}Code preview{/tr}</label>
		<div class="col-sm-7 col-sm-offset-1">
			<input type="checkbox" name="code" {if $code eq 'y'}checked="checked"{/if} title="{tr}View source code after rules applied{/tr}">
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label" title="{tr}Generate HTML preview{/tr}">{tr}HTML preview{/tr}</label>
		<div class="col-sm-7 col-sm-offset-1">
			<input type="checkbox" name="html" {if $html eq 'y'}checked="checked"{/if} title="{tr}Generate HTML preview{/tr}">
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label" title="{tr}Test file from repository to generate preview for (empty = configured start page){/tr}">{tr}File{/tr}</label>
		<div class="col-sm-7 col-sm-offset-1">
			<input type="text" name="file" value="{$file|escape}" class="form-control" title="{tr}Test file from repository to generate preview for (empty = configured start page){/tr}">
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label" title="{tr}View source code after rules applied{/tr}">{tr}Code preview{/tr}</label>
		<div class="col-sm-7 col-sm-offset-1">
			<input type="checkbox" name="code" {if $code eq 'y'}checked="checked"{/if} title="{tr}View source code after rules applied{/tr}">
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label"></label>
		<div class="col-sm-7 col-sm-offset-1">
			<input type="submit" class="btn btn-default btn-sm" name="preview" value="{tr}Preview{/tr}">
		</div>
	</div>
zaufi's avatar
zaufi committed
132
</form>
133 134

{if (($html eq 'y') or ($code eq 'y')) and (strlen($preview_data) gt 0)}
135 136 137 138 139 140 141 142 143 144 145 146
	<h2>{tr}Preview Results{/tr}</h2>
	{if strlen($css_file) > 0}
		<link rel="StyleSheet" href="{$css_file}" type="text/css">
	{/if}
	<div class="integration_preview">
		{if $code eq 'y'}
			<div class="codelisting"><pre>{$preview_data|escape:"html"|wordwrap:120:"\n"}</pre></div>
		{/if}
		{if $html eq 'y'}
				<div class="integrated-page">{$preview_data}</div>
		{/if}
	</div>
147 148 149 150 151
{/if}

<h2>{tr}Rules List{/tr}</h2>

{* Table with list of repositories *}
152 153 154 155 156 157 158 159 160 161 162
{* Use css menus as fallback for item dropdown action menu if javascript is not being used *}
{if $prefs.javascript_enabled !== 'y'}
	{$js = 'n'}
	{$libeg = '<li>'}
	{$liend = '</li>'}
{else}
	{$js = 'y'}
	{$libeg = ''}
	{$liend = ''}
{/if}
<div class="{if $js === 'y'}table-responsive{/if}"> {* table-responsive class cuts off css drop-down menus *}
163
	<table class="table table-striped table-hover" id="integrator_rules">
164 165 166 167 168 169
		<tr>
			<th rowspan="2"><span title="{tr}Rule order{/tr}">#</span></th>
			<th>{tr}Search{/tr}</th>
			<th>{tr}Replace{/tr}</th>
			<th>{tr}Regex{/tr}</th>
			<th>{tr}Case{/tr}</th>
170
			<th></th>
171 172 173
		</tr><tr>
			<th colspan="5">{tr}Description{/tr}</th>
		</tr>
174

175 176 177 178 179 180 181 182 183 184 185 186
		{section name=rule loop=$rules}
			<tr>
				<td{if (strlen($rules[rule].description) > 0)} rowspan="2"{/if}>
					{if $rules[rule].enabled ne 'y'}<s>{$rules[rule].ord|escape}</s>
					{else}{$rules[rule].ord|escape}
					{/if}
				</td>
				<td class="text">{$rules[rule].srch|escape}</td>
				<td class="text">{$rules[rule].repl|escape}</td>
				<td class="text">{$rules[rule].type|escape}</td>
				<td class="text">{$rules[rule].casesense|escape}</td>
				<td class="action">
187 188
					{capture name=integrator_rules_actions}
						{strip}
189
							{$libeg}<a href="tiki-admin_integrator_rules.php?action=edit&amp;repID={$repID|escape}&amp;ruleID={$rules[rule].ruleID|escape}">
190
								{icon name='edit' _menu_text='y' _menu_icon='y' alt="{tr}Edit{/tr}"}
191 192
							</a>{$liend}
							{$libeg}<a href="tiki-admin_integrator_rules.php?action=rm&amp;repID={$repID|escape}&amp;ruleID={$rules[rule].ruleID|escape}">
193
								{icon name='remove' _menu_text='y' _menu_icon='y' alt="{tr}Remove{/tr}"}
194
							</a>{$liend}
195 196
						{/strip}
					{/capture}
197 198 199 200 201
					{if $js === 'n'}<ul class="cssmenu_horiz"><li>{/if}
					<a
						class="tips"
						title="{tr}Actions{/tr}"
						href="#"
202
						{if $js === 'y'}{popup fullhtml="1" center=true text=$smarty.capture.integrator_rules_actions|escape:"javascript"|escape:"html"}{/if}
203 204
						style="padding:0; margin:0; border:0"
					>
205 206
						{icon name='wrench'}
					</a>
207 208 209
					{if $js === 'n'}
						<ul class="dropdown-menu" role="menu">{$smarty.capture.integrator_rules_actions}</ul></li></ul>
					{/if}
210
				</td>
211

212 213 214 215 216 217 218 219
				{* Show description as colspaned row if it is not an empty *}
				{if (strlen($rules[rule].description) > 0)}
					</tr><tr>
						<td colspan="5" class="text">{$rules[rule].description|escape}</td>
				{/if}
			</tr>
		{/section}
	</table>
220
</div>