📄 tpl_folders.php
字号:
<!-- tpl_folders.php -->
<div style="width:18%; float:left; margin-right:10px; line-height:1.5em;">
<h1>Folder Options</h1>
<ul class="ls_menu">
<li><a href="folders.php" class="special">All folders</a></li>
<li><a href="folders.php?action=create" class="special">Create new folder</a></li>
<!--<li><a href="folders.php?action=cgallery" class="special">Create gallery</a></li>-->
</ul>
</div>
<div style="width:80%; float: right;">
<?php /* Create a new folder */ if ( $action == 'create' ) : ?>
<h1>Create folder</h1>
<form method="post" action="folders.php?action=create">
<input type="hidden" name="action" value="create" />
<input type="hidden" name="task" value="create" />
<p>The folder name must contain only alphanumeric (letters and numbers) characters.</p>
<?php /* Errors will be printed here */ if ( isset ( $error ) ) print $error; ?>
<table cellspacing="1" cellpadding="1" border="0" style="margin-top: 10px;">
<tr>
<td>Create new folder in </td>
<td>
<select name="create_in">
<?php /* Loop through list of folders */ reset ( $user_folders ); while ( list ( $i, $folder ) = each ( $user_folders ) ) : $folder['spaces'] = str_repeat ( ' ', $folder['level'] ); ?>
<option value="<?=$folder['path']?>" <?=$folder['is_selected'] ? 'selected="selected"' : ''?> >
<?=$folder['spaces']?><?=$folder['name']=='<MAIN_FOLDER>'?'Main Folder':str_slice($folder['name'],30)?>
</option>
<?php /* End loop */ endwhile; ?>
</select>
</td>
</tr>
<tr>
<td>New folder name</td>
<td>
<input type="text" name="new_folder_name" value="<?=$folder_name?>" size="40" maxlength="50" />
</td>
</tr>
<tr>
<td>Description (optional)</td>
<td><input type="text" name="folder_description" value="" size="75" maxlength="255" /></td>
</tr>
<tr>
<td>Folder properties</td>
<td style="line-height:1.5em;">
<input type="checkbox" name="folder_public" id="folder_public" value="1" class="chkbox" />
<label for="folder_public">Allow other users to view the contents of this folder.</label>
<br />
<input type="checkbox" name="folder_gallery" id="folder_gallery" value="1" class="chkbox" />
<label for="folder_gallery">Make this folder into a photo folder.</label> (<span class="help" onclick="help('This will set the folder as a picture album. You can only upload images (JPEG, PNG, and GIF) into this folder and images will have thumbnails automatically created for each image, you do not have to specify Create thumbnails when uploading images into a photo folder. If you wish to share the photos with your friends, you should also make the folder public.');">More</span>)
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Create" class="blue_button" /> <input type="button" value="Cancel" class="blue_button" onclick="go('folders.php');" /></td>
</tr>
</table>
</form>
<?php /* Rename */ elseif ( $action == 'edit' ) : ?>
<h1>Edit folder properties</h1>
<?php /* Errors will be printed here */ if ( isset ( $error ) ) print $error; ?>
<form method="post" action="folders.php?action=edit">
<input type="hidden" name="action" value="rename" />
<input type="hidden" name="task" value="edit" />
<input type="hidden" name="folder_path" value="<?=$folder_path?>" />
<table cellspacing="3" cellpadding="1" border="0">
<tr>
<td style="width:100px;">Folder name</td>
<td><input type="text" name="folder_name" value="<?=$folder_path==''?'Main Folder':$folder_name?>" <?=$folder_path==''?'disabled="disabled"':''?> size="40" maxlength="50" /></td>
</tr>
<tr>
<td>Description</td>
<td>
<input type="text" name="folder_description" value="<?=$folder_description?>" size="85" maxlength="200" />
</td>
</tr>
<tr>
<td class="tt">Folder properties</td>
<td style="line-height:1.6em;">
<input type="checkbox" class="chkbox" name="folder_public" value="1" id="folder_public" <?=$folder_public ? 'checked="checked"' : '' ?> /> <label for="folder_public">Allow other users to browse this folder's contents.</label>
</td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" value="Apply" class="blue_button" />
<input type="button" value="Cancel" class="blue_button" onclick="go('folders.php');" />
</td>
</tr>
</table>
</form>
<?php /* No task, just list folders */ else: ?>
<table class="rowlines" id="tbl1" style="width:100%;color:#606060;" cellpadding="3" cellspacing="0" border="0">
<tr skip_alternate="1">
<td></td>
<td style="width:50px;"></td>
<td style="width:55px;"></td>
<td style="width:75px;"></td>
</tr>
<?php /* Loop through folders and list them */ reset ( $user_folders ); while ( list ( $i, $folder ) = each ( $user_folders ) ) : $folder['spaces'] = str_repeat ( ' ', $folder['level'] ); ?>
<tr>
<td style="line-height:1.5em;">
<img src="templates/default2/images/<?=$folder['is_public']?'folder3.gif':'folder4.gif'?>" class="img1" alt="" style="cursor:pointer;" onmousedown="togFolderPublic(this,'<?=$folder['is_public']?'folder4.gif':'folder3.gif'?>','<?=$folder['tog_public_url']?>');" />
<?=$folder['spaces']?><a href="<?=$folder['folder_url']?>" <?=$folder['is_gallery']?'class="special_green"':'class="special"'?>><?=$folder['name']?></a>
<span id="folder_description_<?=$i?>" style="padding:2px;">
<?=$folder['description']==''?'No description':htmlentities(substr($folder['description'],0,40));?>
</span>
</td>
<td class="ct"><?=$folder['files'] ? $folder['files'] . ' files' : 'empty' ?></td>
<td class="ct"><?=$folder['size'] != '0.0B' ? $folder['size'] : 'empty' ?></td>
<td class="cr">
<?php /* Can't delete Main folder */ if ( $folder['path'] != '' ) : ?>
<img src="templates/default2/images/b_delete.gif" alt="" title="Delete this folder" onclick="confirmDelete('<?=$folder['delete_url']?>');" style="cursor:pointer;" />
<?php endif; ?>
<img src="templates/default2/images/b_edit.gif" alt="" title="Edit this folder's properties" onclick="go('<?=$folder['edit_url']?>');" style="cursor:pointer;" />
</td>
</tr>
<?php endwhile; ?>
</table>
<p style="padding:5px 0px 0px 3px;color:#505050;">
<img src="templates/default2/images/folder3.gif" alt="Public" class="img1"/> Public - <img src="templates/default2/images/folder4.gif" alt="Public" class="img1"/> Private. Click on the folder icons to toggle folder permissions.
</p>
<?php endif; ?>
</div>
<div class="spacer"><!-- --></div>
<script type="text/javascript">
alternateRowColor(getObj('tbl1'),'tr','#fafafa','#ffffff');
function confirmDelete(sURL)
{
if ( confirm ( 'Are you sure you want to delete this folder?' ) )
{
go ( sURL );
}
}
function func ( )
{
<?php reset ( $user_folders ); while ( list ( $i, $folder ) = each ( $user_folders ) ) : ?>
var desc_<?=$i?> = new quickUpdateDesc ( '<?=$folder['path']?>', '<?=addslashes($folder['description'])?>', getObj('folder_description_<?=$i?>'), 40 );
<?php endwhile; ?>
}
addLoadEvent ( func );
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -