<?php
// Version: 1.0 RC1; PageManagement
function template_page_management()
{
global $scripturl, $settings, $context, $txt;
echo '
<script language="JavaScript1.2" type="text/javascript"><!--
function DoConfirm(message, url)
{
if (confirm(message))
location.href = url;
}
//--></script>';
echo '
<a href="' . $scripturl . '?action=admin"><img src="' . $settings['images_url'] . '/icons/folder_open.gif" border="0" /> <b>' . $txt['pm99'] . '</b></a><br />
<a href="' . $scripturl . '?op=PageManagement"><img src="' . $settings['images_url'] . '/icons/linktree_main.gif" border="0" /><img src="' . $settings['images_url'] . '/icons/folder_open.gif" border="0" /> ' . $txt['pm37'] . '</a><br />';
// If we're inside a folder structure, indent tree and show it
$tline = '<img src="' . $settings['images_url'] . '/icons/linktree_side.gif" border="0" />';
$indent = '';
if (isset($context['foldertree'])) {
while (list($key,$val) = each($context['foldertree'])) {
$indent .= $tline;
echo'
<a href="' . $val['url'] . '">' . $tline . $indent . '<img src="' . $settings['images_url'] . '/icons/folder_open.gif" border="0" /> ' . $val['name'] . '</a><br />
';
}
} else {
$indent = '';
}
echo '
<a href="' . $scripturl . '?op=PageManagement#apge">' . $tline . $indent . '<img src="' . $settings['images_url'] . '/icons/folder_open.gif" border="0" /> ' . $txt['pm32'] . '</a><br />
<a href="' . $scripturl . '?op=PageManagement#pges">' . $tline . $indent . '<img src="' . $settings['images_url'] . '/icons/folder_open.gif" border="0" /> ' . $txt['pm87'] . ':</a><br />
<a name="pges"></a>
<table width="100%" border="0" class="bordercolor" cellspacing="1" align="center">
<tr>
<td class="catbg">
<b>' . $txt['pm100'] . '</b>
</td>
<td class="catbg">
<b>' . $txt['pm38'] . '</b>
</td>
<td class="catbg">
<b>' . $txt['pm73'] . '<b>
</td>
<td class="catbg">
<b>' . $txt['pm39'] . '</b>
</td>
</tr>
';
if (!empty($context['curr_folder']['subs']))
foreach ($context['curr_folder']['subs'] AS $subs)
{
echo '
<tr>
<td class="windowbg2"><img src="', $settings['images_url'], '/board.gif" alt="Folder" /> <a href="', $scripturl, '?op=PageManagement;sub=', $subs['id'], '">', $subs['name'], '</a></td>
<td class="windowbg2">', $txt['pm221'], '</td>
<td class="windowbg2">', $txt['pm221'], '</td>
<td class="windowbg2"><a href="', $scripturl, '?op=PageManagement;sa=editpfolder;fte=', $subs['id'], '">', $txt['pm40'], '</a> | <a href="javascript:DoConfirm(\'', $txt['pm312'], '\', \'', $scripturl, '?op=PageManagement;sa=delpfolder;ftd=', $subs['id'], ';sub=', $subs['sub'], '\')">', $txt['pm41'], '</a></td>
</tr>';
}
if (!empty($context['curr_pages']))
foreach ($context['curr_pages'] AS $page)
{
echo '<tr><td class="windowbg2"><img src="', $settings['images_url'], '/icons/im_newmsg.gif" /> <a href="', $scripturl, '?page=', $page['stitle'], '">', $page['title'], '</td>
<td class="windowbg2">', $page['stitle'], '</td>
<td class="windowbg2">', $page['memberGroups'], '</td>
<td class="windowbg2"><a href="', $scripturl, '?op=PageManagement;sa=EditPage;id=', $page['id'], ';sc=', $context['session_id'], '">', $txt['pm40'], '</a> | ';
echo '
<a href="javascript:DoConfirm(\'', $txt['pm312'], '\',\'', $scripturl, '?op=PageManagement;sa=DeletePage;id=', $page['id'], ';sc=', $context['session_id'], '\')">', $txt['pm41'], '</a></td></tr>
';
}
echo '
</table><br />
<br />
<a name="afldr"></a>
<table class="bordercolor" width="100%" border="0" align="center" cellspacing="1" cellpadding="0">
<tr>
<td>
<table class="windowbg" width="100%" border="0" align="center" cellspacing="0" cellpadding="4">
<form name="add_folder" method="POST" action="' . $scripturl . '?op=PageManagement;sa=AddFolder">
<tr>
<td class="titlebg" colspan="2">
<b>' . $txt['pm226'] . '</b>
</td>
</tr>
<tr>
<td>
<b>' . $txt[68] . ':</b>
</td>
<td>
<input type="text" name="name">
</td>
</tr>
<tr>
<td>
<b>' . $txt['pm227'] . ':</b>
</td>
<td>
<select name="isSub">
<option value="">
' . $txt['pm109'] . '
</option>
';
if(!empty($context['folder_op']))
{
foreach ($context['folder_op'] AS $folder)
echo $folder, "\n";
reset($context['folder_op']);
}
echo '
</select>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="submit" value="' . $txt['pm228'] . '">
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>
<br />
<a name="apge"></a>
<form name="apage" method="POST" action="' . $scripturl . '?op=PageManagement;sa=AddPage">
<table class="bordercolor" width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td>
<table class="windowbg" width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td class="titlebg" colspan="2">
<b>' . $txt['pm32'] . '</b>
</td>
</tr>
<tr>
<td>
<b>' . $txt['pm33'] . ':</b>
</td>
<td>
<input type="text" name="title" size="60">
</td>
</tr>
<tr>
<td>
<b>' . $txt['pm34'] . ':</b>
</td>
<td>
<input type="text" name="stitle" size="60">
</td>
</tr>
<tr>
<td colspan="2">
<b>' . $txt['pm35'] . '</b>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<textarea class="editor" rows="20" cols="50" name="contents"></textarea>
</td>
</tr>
<tr>
<td>
<b>' . $txt['pm51'] . '</b>
</td>
<td>
<input type="checkbox" name="phpe" value="1">
</td>
</tr>
<tr>
<td>
<b>' . $txt['pm286'] . '</b><br /><font size="1">' . $txt['pm287'] . '</font>
</td>
<td>
<input type="checkbox" name="yabbce" value="1">
</td>
</tr>
<tr>
<td>
<b>' . $txt['pm72'] . ':</b>
</td>
<td>', groupselect('','pmemg[]',true), '</td>
</tr>
<tr>
<td>
<b>' . $txt['pm401'] . '</b>
</td>
<td>
<input type="checkbox" name="list" value="1" checked>
</td>
</tr>
<tr>
<td>
<b>' . $txt['pm222'] . ':</b>
</td>
<td>
<select name="folder">
<option value="">
' . $txt['pm109'] . '
</option>
';
if(!empty($context['folder_op']))
{
foreach ($context['folder_op'] AS $folder)
echo $folder, "\n";
}
echo '
</select>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="submit" name="addpage" value="' . $txt['pm32'] . '">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
';
}
function template_edit_page()
{
global $scripturl, $settings, $context, $txt;
echo '
<a href="' . $scripturl . '?action=admin"><img src="' . $settings['images_url'] . '/icons/folder_open.gif" border="0" /> <b>' . $txt['pm99'] . '</b></a><br />
<a href="' . $scripturl . '?op=PageManagement"><img src="' . $settings['images_url'] . '/icons/linktree_main.gif" border="0" /><img src="' . $settings['images_url'] . '/icons/folder_open.gif" border="0" /> ' . $txt['pm37'] . '</a><br />';
// If we're inside a folder structure, indent tree and show it
$tline = '<img src="' . $settings['images_url'] . '/icons/linktree_side.gif" border="0" />';
if (isset($context['foldertree'])) {
while (list($key,$val) = each($context['foldertree'])) {
$indent .= $tline;
echo'
<a href="' . $val['url'] . '">' . $tline . $indent . '<img src="' . $settings['images_url'] . '/icons/folder_open.gif" border="0" /> ' . $val['name'] . '</a><br />
';
}
} else {
$indent = '';
}
echo '
' . $tline . $indent . '<img src="' . $settings['images_url'] . '/icons/folder_open.gif" border="0" /> ' . $txt['pm42'] . ':<br />';
echo '
<form name="epage" method="post" action="' . $scripturl . '?op=PageManagement;sa=EditPage2">
<table class="bordercolor" width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
<tr>
<td>
<table class="windowbg" width="100%" border="0" cellspacing="0" cellpadding="4" align="center">
<tr>
<td class="titlebg" colspan="2">
<b>' . $txt['pm216'] . '</b> - ' . $context['pte']['title'] . '
</td>
</tr>
<tr>
<td>
<b>' . $txt['pm33'] . ':</b>
</td>
<td>
<input type="text" name="title" size="60" value="' . $context['pte']['title'] . '">
</td>
</tr>
<tr>
<td>
<b>' . $txt['pm34'] . ':</b>
</td>
<td>
<input type="text" name="stitle" size="60" value="' . $context['pte']['stitle'] . '">
</td>
</tr>
<tr>
<td colspan="2">
<b>' . $txt['pm35'] . '</b>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<textarea class="editor" rows="20" cols="50" name="contents">' . $context['pte']['contents'] . '</textarea>
</td>
</tr> <tr>
<td>
<b>' . $txt['pm51'] . '</b>
</td>
<td>
<input type="checkbox" name="phpe" value="1" ' . $context['pte']['phpe'] . '>
</td>
</tr>
<tr>
<td>
<b>' . $txt['pm286'] . '</b><br /><font size="1">' . $txt['pm287'] . '</font>
</td>
<td>
<input type="checkbox" name="yabbce" value="1" ' . $context['pte']['yabbce'] . '>
</td>
</tr>
<tr>
<td>
<b>' . $txt['pm13'] . '</b><br />
' . $txt['pm214'] . '
</td>
<td>', groupselect($context['pte']['memberGroup'],'pmemg[]'), '</td>
</tr>
<tr>
<td>
<b>' . $txt['pm401'] . '</b>
</td>
<td>
<input type="checkbox" name="list" value="1" ' . $context['pte']['list'] . '>
</td>
</tr>
<tr>
<td>
<b>' . $txt['pm222'] . ':</b>
</td>
<td>
<select name="folder">
<option value="">' . $txt['pm109'] . '</option>
';
if (!empty($context['folder_op']) && is_array($context['folder_op']))
foreach ($context['folder_op'] AS $folder)
echo $folder, "\n";
echo '
</select>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="submit" name="formaction" value="' . $txt['pm40'] . '">
<input type="hidden" name="sub" value="' . $context['pte']['folder'] . '">
<input type="hidden" name="id" value="' . $context['pte']['id'] . '">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
';
}
function template_edit_folder()
{
global $scripturl, $context, $txt, $settings;
echo '
<a href="' . $scripturl . '?action=admin"><img src="' . $settings['images_url'] . '/icons/folder_open.gif" border="0" /> <b>' . $txt['pm99'] . '</b></a><br />
<a href="' . $scripturl . '?op=PageManagement"><img src="' . $settings['images_url'] . '/icons/linktree_main.gif" border="0" /><img src="' . $settings['images_url'] . '/icons/folder_open.gif" border="0" /> ' . $txt['pm37'] . '</a><br />';
// If we're inside a folder structure, indent tree and show it
$tline = '<img src="' . $settings['images_url'] . '/icons/linktree_side.gif" border="0" />';
if (isset($context['foldertree'])) {
while (list($key,$val) = each($context['foldertree'])) {
$indent .= $tline;
echo'
<a href="' . $val['url'] . '">' . $tline . $indent . '<img src="' . $settings['images_url'] . '/icons/folder_open.gif" border="0" /> ' . $val['name'] . '</a><br />
';
}
} else {
$indent = '';
}
echo '
' . $tline . $indent . '<img src="' . $settings['images_url'] . '/icons/folder_open.gif" border="0" /> ' . $txt['pm44'] . ':<br />';
echo '
<table class="bordercolor" width="100%" cellspacing="1" cellpadding="0" border="0" align="center"><tr><td align="center">
<table width="100%" cellspacing="0" cellpadding="4" border="0" align="center">
<tr>
<td class="windowbg2" colspan="2" align="center"><b>', $txt['pm225'], ' -</b> ', $context['folder_stuff']['name'], '</td>
<form name="edit_folder" method="POST" action="', $scripturl, '?op=PageManagement;sa=editpfolder2">
</tr>
<tr>
<td class="windowbg2"><b>', $txt[68], ':</b></td>
<td class="windowbg2"><input type="text" name="name" value="', $context['folder_stuff']['name'], '"></td>
</tr>
<tr>
<td class="windowbg2"><b>', $txt['pm227'], ':</b></td>
<td class="windowbg2"><select name="isSub">
<option value="">', $txt['pm109'], '</option>';
foreach ($context['folders'] AS $folder)
echo '<option value="', $folder['id'], '" ', $folder['sel'], '>', $folder['name'], '</option>';
echo '
</select></td>
</tr>
<tr>
<td class="windowbg2" colspan="2" align="center"><input type="hidden" name="id" value="', $context['folder_stuff']['fte'], '"><input type="submit" name="submit" value="', $txt['pm163'], '"></td>
</tr></form>
</table>
</td></tr></table>';
}
function template_delete_folder()
{
global $scripturl, $context, $txt;
echo '
<br />
<table border=0 width="80%" cellspacing=1 class="bordercolor" align="center" cellpadding="4">
<tr>
<td class="titlebg"><font size=2 class="text1"><b>', $txt['pm223'], '</b></font></td>
</tr>
<tr>
<td class="windowbg"><font size=2>', $txt['pm224'], '</font><br />
<a href="', $scripturl, '?op=PageManagement;sa=delpfolder2;sub=', $context['dfolder']['sub'], ';ftd=', $context['dfolder']['ftd'], '"><b>', $txt['pm40'], '</b></a> | <a href="', $scripturl, '?op=PageManagement;sub=', $context['dfolder']['sub'], '"><b>', $txt[164], '</b></a></td>
</tr>
</table>
';
}
?>