smartified functions_plugins_admin.inc.php
This commit is contained in:
@@ -0,0 +1,205 @@
|
||||
{* serendipity_plugins_admin.inc.php::serendipity_plugin_config() - the OUT_STACK loop *}
|
||||
{if $ctype == 'seperator'}
|
||||
<tr>
|
||||
<td colspan="2"><hr noshade="noshade" size="1" /></td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $ctype == 'select'}
|
||||
<tr>
|
||||
<td style="border-bottom: 1px solid #000000; vertical-align: top"><strong>{$cname}</strong>
|
||||
{if $cdesc != ''}
|
||||
<br><span style="color: #5E7A94; font-size: 8pt;"> {$cdesc}</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td style="border-bottom: 1px solid #000000; vertical-align: middle" width="250">
|
||||
<div>
|
||||
<select class="direction_{$lang_direction}" name="serendipity[{$postKey}][{$config_item}]{($is_multi_select) ? '[]' : ''}" {($is_multi_select) ? 'multiple="multiple"' : ''} {($is_multi_select && ($select_size > 0)) ? "size='{$select_size}'" : ''}>
|
||||
{foreach $select AS $select_value => $select_desc}
|
||||
{assign var="id" value="{$config_item|escape}_{$select_value|escape}"}
|
||||
<!-- case select assign id={$id} -->
|
||||
<option value="{$select_value}" {(in_array($select_value, $selected_options) || in_array($select_value, $pre_selected)) ? 'selected="selected"' : ''} title="{$select_desc|escape}">
|
||||
{$select_desc|escape}
|
||||
</option>
|
||||
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $ctype == 'radio'}
|
||||
<tr>
|
||||
<td style="border-bottom: 1px solid #000000; vertical-align: top"><strong>{$cname}</strong>
|
||||
{if $cdesc != ''}
|
||||
<br /><span style="color: #5E7A94; font-size: 8pt;"> {$cdesc}</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td style="border-bottom: 1px solid #000000; vertical-align: middle;" width="250">
|
||||
{foreach $radio_button AS $r}
|
||||
{if $r['counter'] == 1}
|
||||
<div class="clearfix">
|
||||
{/if}
|
||||
<input class="direction_{$lang_direction} input_radio" type="radio" id="serendipity_plugin_{$r['id']}" name="serendipity[{$postKey}][{$config_item}]" value="{$r['value']}" {(!empty($r['checked'])) ? 'checked="checked"' : ''} title="{$r['index']|escape}" />
|
||||
<label for="serendipity_plugin_{$r['id']}">{$r['index']}{* escape is already done *}</label>
|
||||
{if ($r['counter'] == $per_row)}
|
||||
{assign var="r" value="counter[0]"}
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $ctype == 'string'}
|
||||
<tr>
|
||||
<td style="border-bottom: 1px solid #000000">
|
||||
<strong>{$cname}</strong>
|
||||
<br><span style="color: #5E7A94; font-size: 8pt;"> {$cdesc}</span>
|
||||
</td>
|
||||
<td style="border-bottom: 1px solid #000000" width="250">
|
||||
<div>
|
||||
<input class="direction_{$lang_direction} input_textbox" type="{$input_type}" name="serendipity[{$postKey}][{$config_item}]" value="{$hvalue}" size="30" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if (($ctype == 'html') || ($ctype == 'text'))}
|
||||
<tr>
|
||||
<td colspan="2"><strong>{$cname}</strong>
|
||||
<span style="color: #5E7A94; font-size: 8pt;"> {$cdesc}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div>
|
||||
<textarea class="direction_{$lang_direction}" style="width: 100%" id="nuggets{$elcount}" name="serendipity[{$postKey}][{$config_item}]" rows="{$text_rows}" cols="80">{$hvalue}</textarea>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $ctype == 'content'}
|
||||
<tr>
|
||||
<td colspan="2">{$cbag_default}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $ctype == 'custom'}
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="hidden" id="config_{$postKey}_{$config_item}" name="serendipity[{$postKey}][{$config_item}]" value="{$hvalue}" size="30" />
|
||||
{$cbag_custom}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $ctype == 'hidden'}
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input class="direction_{$lang_direction}" type="hidden" name="serendipity[{$postKey}][{$config_item}]" value="{$cbag_value}" />
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $ctype == 'media'}
|
||||
{if !$mediajs_output}
|
||||
<script type="text/javascript" language="JavaScript" src="serendipity_editor.js"></script>
|
||||
<script type="text/javascript" language="JavaScript" src="{serendipity_getFile file='admin/image_selector.js'}"></script>
|
||||
{/if}
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<strong>{$cname}</strong>
|
||||
<br /><span style="color: #5E7A94; font-size: 8pt;">{$cdesc}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border-bottom: 1px solid #000000">
|
||||
<div id="{$config_item}_preview" style="background-image: url({$value}); width: {$preview_width}; height: {$preview_height}; background-repeat: no-repeat;"> </div>
|
||||
</td>
|
||||
<td style="border-bottom: 1px solid #000000">
|
||||
<input class="input_textbox" type="text" id="serendipity[{$postKey}][{$config_item}]" name="serendipity[{$postKey}][{$config_item}]" value="{$value}" onchange="change_preview('{$config_item}')"/>
|
||||
<br /><a href="#" onclick="choose_media('serendipity[{$postKey}][{$config_item}]')">{$CONST.MEDIA_LIBRARY}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $ctype == 'sequence'}
|
||||
{if !$sequencejs_output}
|
||||
<script src="{serendipity_getFile file='dragdrop.js'}" type="text/javascript"></script>
|
||||
{/if}
|
||||
<tr>
|
||||
<td style="border-bottom: 1px solid #000000; vertical-align: top">
|
||||
<strong>{$cname}</strong>
|
||||
<br /><span style="color: #5E7A94; font-size: 8pt;">{$cdesc}</span>
|
||||
</td>
|
||||
<td style="border-bottom: 1px solid #000000; vertical-align: middle">
|
||||
<input type="hidden" name="serendipity[{$postKey}][{$config_item}]" id="{$config_item}_value" value="{$value}" />
|
||||
<noscript>
|
||||
<!-- Replace standard submit button when using up/down submits -->
|
||||
<input type="hidden" name="SAVECONF" value="Save" />
|
||||
</noscript>
|
||||
<ol id="{$config_item}" class="sequence_container pluginmanager_container">
|
||||
{foreach $order_id as $orid}
|
||||
<li id="{$orid['id']}" class="sequence_item pluginmanager_item_even">
|
||||
<div id="g{$orid['id']}" class="pluginmanager_grablet sequence_grablet"><a href="#"></a></div>
|
||||
{if $checkable}
|
||||
<input type="checkbox" onclick="sort_{$config_item}_Sequence();" name="serendipity[{$postKey}][activate][{$config_item}][{$orid['id']}]" {(in_array($orid['id'], $store_order)) ? ' checked="checked" ' : ''} value="true" id="activate_{$orid['id']}" />
|
||||
{/if}
|
||||
<span>{$items[{$orid['id']}]['display']}</span>
|
||||
{if isset($items[{$orid['id']}]['img'])}
|
||||
<img src="{$items[{$orid['id']}]['img']}" />
|
||||
{/if}
|
||||
<noscript><div>
|
||||
{if ($orid['sort_idx'] == 0)}
|
||||
|
||||
{else}
|
||||
<button id="{$postKey}_{$config_item}_{$orid['sort_idx']}_up" type="submit" name="serendipity[{$postKey}][override][{$config_item}]" value="{$orid['oneup']}">
|
||||
<img src="{serendipity_getFile file='admin/img/uparrow.png'}" alt="Move Up" />
|
||||
</button>
|
||||
{/if}
|
||||
{if ($orid['sort_idx'] == $last)}
|
||||
|
||||
{else}
|
||||
<button id="{$postKey}_{$config_item}_{$orid['sort_idx']}_down" type="submit" name="serendipity[{$postKey}][override][{$config_item}]" value="{$orid['onedown']}">
|
||||
<img src="{serendipity_getFile file='admin/img/downarrow.png'}" alt="Move Down" />
|
||||
</button>
|
||||
{/if}
|
||||
</div></noscript>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ol>
|
||||
{if (!is_array($items) || empty($order_id))}
|
||||
{$none}
|
||||
{/if}
|
||||
{*
|
||||
Smarty 3 has a new auto literal option which is enabled by default.
|
||||
When the { is followed by a space it's not interpreted as smarty delimiter but literal.
|
||||
*}
|
||||
<script type="text/javascript">
|
||||
function sort_{$config_item}_Sequence() {
|
||||
//var seq = DragDrop.serData('{$config_item}_group', null);
|
||||
var seq = DragDrop.serData(null, '+citem+');
|
||||
var start = seq.indexOf("(");
|
||||
var end = seq.indexOf(")");
|
||||
seq = seq.slice((start + 1), end);
|
||||
checkable_seq = seq.split(",");
|
||||
out_seq = '';
|
||||
for (i in checkable_seq) {
|
||||
if (document.getElementById('activate_' + checkable_seq[i]) && !document.getElementById('activate_' + checkable_seq[i]).checked) {
|
||||
continue;
|
||||
} else {
|
||||
if (out_seq != '') {
|
||||
out_seq += ',';
|
||||
}
|
||||
out_seq += checkable_seq[i];
|
||||
}
|
||||
}
|
||||
var order = document.getElementById("{$config_item}_value");
|
||||
order.value = out_seq;
|
||||
}
|
||||
|
||||
function init_{$config_item}_Sequence() {
|
||||
var lst = document.getElementById("{$config_item}");
|
||||
DragDrop.makeListContainer(lst, '{$config_item}_group');
|
||||
lst.onDragOut = function() {
|
||||
sort_{$config_item}_Sequence();
|
||||
};
|
||||
}
|
||||
addLoadEvent(init_{$config_item}_Sequence);
|
||||
</script>
|
||||
</td>
|
||||
{/if}
|
||||
@@ -0,0 +1,89 @@
|
||||
{* serendipity_plugins_admin.inc.php::serendipity_plugin_config() *}
|
||||
|
||||
<script type="text/javascript">
|
||||
var const_view = '{$CONST.VIEW_FULL}';
|
||||
var const_hide = '{$CONST.HIDE}';
|
||||
var img_plus = '{serendipity_getFile file="img/plus.png"}';
|
||||
var img_minus = '{serendipity_getFile file="img/minus.png"}';
|
||||
var jspath = '{$serendipityHTTPPath}include/admin/js/';
|
||||
</script>
|
||||
|
||||
{if $allow_admin_scripts}
|
||||
<script type="text/javascript" language="JavaScript" src="{serendipity_getFile file='admin/admin_scripts.js'}"></script>
|
||||
{/if}
|
||||
|
||||
{if $showSubmit_head}
|
||||
<div style="margin: 0px auto 0px 0px; text-align: right">
|
||||
<input type="submit" name="SAVECONF" value="{$CONST.SAVE}" class="serendipityPrettyButton input_button" />
|
||||
</div>
|
||||
{/if}
|
||||
{if $showTable}
|
||||
<table id="serendipity_plugin_config" border="0" cellspacing="0" cellpadding="3" width="100%">
|
||||
{/if}
|
||||
{if is_array($config_groups)}
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div align="right">
|
||||
<a style="border:0; text-decoration: none" href="#" onClick="showConfigAll({sizeof($config_groups)}); return false" title="{$CONST.TOGGLE_ALL}"><img src="{serendipity_getFile file="img/plus.png"}" id="optionall" alt="+/-" border="0" /> {$CONST.TOGGLE_ALL}</a></a><br />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{foreach $config_groups AS $config_header => $config_groupkeys}
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<h2>
|
||||
<a style="border:0; text-decoration: none;" href="#" onClick='showConfig("el{$config_groupkeys@iteration}"); return false' title="{$CONST.TOGGLE_OPTION}"><img src="{serendipity_getFile file="img/plus.png"}" id="optionel{$config_groupkeys@iteration}" alt="+/-" border="0" />
|
||||
{$config_header}
|
||||
</a>
|
||||
</h2>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<table class="plugin_optiongroup" id="el{$config_groupkeys@iteration}" border="0" cellspacing="0" cellpadding="3" width="100%">
|
||||
{foreach $config_groupkeys AS $config_groupkey}
|
||||
{$OUT_STACK[$config_groupkey]}
|
||||
{/foreach}
|
||||
</table>
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
document.getElementById("el{$config_groupkeys@iteration}").style.display = "none";
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
<tr><td colspan="2" style="height: 100px" id="configuration_footer"> </td></tr>
|
||||
{/if} {* foreach config_groups end *}
|
||||
|
||||
{foreach $OUT_STACK as $out_stack_config_item}
|
||||
{$out_stack_config_item}
|
||||
{/foreach}
|
||||
|
||||
{if $showTable}
|
||||
</table>
|
||||
<br />
|
||||
{/if}
|
||||
{* $serendipity_printConfigJS *}{* outsourced to templates/default/admin/admin_scripts.js - see passed vars on top *}
|
||||
{if $showSubmit_foot}
|
||||
<div style="padding-left: 20px">
|
||||
<input type="submit" name="SAVECONF" value="{$CONST.SAVE}" class="serendipityPrettyButton input_button" />
|
||||
</div>
|
||||
{/if}
|
||||
{if $showExample}
|
||||
<div>
|
||||
{$plugin_example}
|
||||
</div>
|
||||
{/if}
|
||||
{if $spawnNuggets}
|
||||
{serendipity_hookPlugin hook="backend_wysiwyg_nuggets" eventData=$ev hookAll=true}
|
||||
{if ($ev['skip_nuggets'] === false)}
|
||||
<script type="text/javascript">
|
||||
function Spawnnugget() {
|
||||
/* blar */
|
||||
{foreach $htmlnugget AS $htmlnuggetid}
|
||||
Spawnnuggets('{$htmlnuggetid}');
|
||||
{/foreach}
|
||||
}
|
||||
</script>
|
||||
{/if}
|
||||
{/if}
|
||||
@@ -0,0 +1,22 @@
|
||||
{* functions_plugins_admin.inc.php::function ownership() *}
|
||||
|
||||
{if $show_ownership}
|
||||
{if $is_plugin_owner}
|
||||
<select name="serendipity[ownership][{$name}]">
|
||||
<option value="0">{$CONST.ALL_AUTHORS}</option>
|
||||
{/if}
|
||||
|
||||
{foreach $users AS $user}
|
||||
{if (!$is_plugin_owner && ($user['authorid'] == $authorid))}
|
||||
{assign var="realname" value="{$user['realname']|escape}"}
|
||||
{elseif $is_plugin_owner}
|
||||
<option value="{$user['authorid']}"{($user['authorid'] == $authorid) ? ' selected="selected"' : ''}>{$user['realname']|escape}</option>
|
||||
{/if}
|
||||
{/foreach}
|
||||
|
||||
{if $is_plugin_owner}
|
||||
</select>
|
||||
{else}
|
||||
{(empty($realname)) ? $CONST.ALL_AUTHORS : $realname}
|
||||
{/if}
|
||||
{/if}
|
||||
@@ -0,0 +1,93 @@
|
||||
{* functions_plugins_admin.inc.php::function_show_plugins() including output of functions_plugins_admin.inc.php::function ownership() *}
|
||||
|
||||
{if !$eyecandy}
|
||||
<form action="?serendipity[adminModule]=plugins" method="post">
|
||||
{elseif !$event_only}
|
||||
{*
|
||||
Smarty 3 has a new auto literal option which is enabled by default.
|
||||
When the { is followed by a space it's not interpreted as smarty delimiter but literal.
|
||||
*}
|
||||
<script type="text/javascript">
|
||||
function templatePluginMoverInit() {
|
||||
|
||||
{foreach $sidebars AS $sidebar}
|
||||
|
||||
{($is_first) ? 'var ' : ''} list = document.getElementById("{$sidebar}_col");
|
||||
DragDrop.makeListContainer(list, 'g1');
|
||||
list.onDragOver = function() { this.style["border"] = "1px solid #4d759b"; };
|
||||
list.onDragOut = function() { this.style["border"] = "none"; };
|
||||
{assign var="is_first" value=false}
|
||||
|
||||
{/foreach}
|
||||
|
||||
}
|
||||
addLoadEvent(templatePluginMoverInit);
|
||||
</script>
|
||||
|
||||
<form action="?serendipity[adminModule]=plugins" method="post" onsubmit="pluginMovergetSort(); return true">
|
||||
<input type="hidden" name="serendipity[pluginorder]" id="order" value="" />
|
||||
|
||||
{else}
|
||||
<script type="text/javascript">addLoadEvent(pluginMoverInitEvent);</script>
|
||||
<form action="?serendipity[adminModule]=plugins" method="post" onsubmit="pluginMovergetSortEvent(); return true">
|
||||
<input type="hidden" name="serendipity[pluginorder]" id="eventorder" value="" />
|
||||
{/if}
|
||||
|
||||
{$serendipity_setFormToken}
|
||||
|
||||
<table class="pluginmanager" border="0" cellpadding="5" cellspacing="3" width="100%">
|
||||
<tr>
|
||||
|
||||
{foreach $placement as $plugin_placement}
|
||||
<td class="pluginmanager_side pluginmanager_{($event_only) ? 'event' : 'sidebar'}">
|
||||
<div class="heading">{$plugin_placement['ptitle']}</div>
|
||||
<ol id="{$plugin_placement['pid']}_col" class="pluginmanager_container">
|
||||
|
||||
{foreach $plugin_placement['plugin_data'] as $plugin_data}
|
||||
|
||||
<li class="pluginmanager_item_{cycle values="even,uneven"}" id="{$plugin_data['css_key']}">
|
||||
<div id="g{$plugin_data['css_key']}" class="pluginmanager_grablet">
|
||||
<a href="#" id="grab{$plugin_data['css_key']}"></a>
|
||||
</div>
|
||||
{if $plugin_data['is_plugin_editable']}
|
||||
<input class="input_checkbox" type="checkbox" name="serendipity[plugin_to_remove][]" value="{$plugin_data['name']}" />
|
||||
{/if}
|
||||
|
||||
{if $plugin_data['can_configure']}
|
||||
<a class="pluginmanager_configure" href="?serendipity[adminModule]=plugins&serendipity[plugin_to_conf]={$plugin_data['key']}"><img src="{serendipity_getFile file='admin/img/configure.png'}" style="border: 0; vertical-align: bottom;" alt="[C]" /></a>
|
||||
{/if}
|
||||
|
||||
<span class="pluginmanager_title">
|
||||
{if $plugin_data['can_configure']}
|
||||
<a title="{$plugin_data['name']}" href="?serendipity[adminModule]=plugins&serendipity[plugin_to_conf]={$plugin_data['key']}">{$plugin_data['title']}</a>
|
||||
{else}
|
||||
{$plugin_data['title']}
|
||||
{/if}
|
||||
</span><br />
|
||||
<div class="pluginmanager_description" style="font-size: 8pt">{$plugin_data['desc']}</div>
|
||||
<div class="pluginmanager_ownership">
|
||||
{$plugin_data['ownership']}
|
||||
</div>
|
||||
{($eyecandy) ? '<noscript>' : ''}
|
||||
<div class="pluginmanager_place">{$plugin_data['place']}</div>
|
||||
<div class="pluginmanager_move">{$plugin_data['moveup']} {$plugin_data['movedown']}</div>
|
||||
{($eyecandy) ? '</noscript>' : ''}
|
||||
</li>
|
||||
|
||||
{/foreach}
|
||||
|
||||
</ol>
|
||||
</td>
|
||||
{/foreach}
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" align="right">{$CONST.PLUGIN_AVAILABLE_COUNT|sprintf:$total}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
<div>
|
||||
<input type="submit" name="REMOVE" title="{$CONST.DELETE}" value="{$CONST.REMOVE_TICKED_PLUGINS}" class="serendipityPrettyButton input_button" />
|
||||
<input type="submit" name="SAVE" title="{$CONST.SAVE_CHANGES_TO_LAYOUT}" value="{$CONST.SAVE}" class="serendipityPrettyButton input_button" />
|
||||
</div>
|
||||
</form>
|
||||
Reference in New Issue
Block a user