code:
<div class="container transparent <?php echo ($class) ? $class : ''?>" <?php echo ($id) ? ' id="' . $id . '"' : ''?>><input type="submit" name="<?php echo $field; ?>" class="button" value="<?php echo Utils::htmlspecialchars($caption); ?>" <?php echo isset($tabindex) ? ' tabindex="' . $tabindex . '"' : ''?>>
<?php if($message != '') : ?>

<?php echo $message; ?>

<?php endif; ?>


code:
			<label for="<?php echo $id; ?>" class="incontent <?php echo $class; ?>"><?php echo $caption; ?>
			<input type="text" name="<?php echo $field; ?>" id="<?php echo $id; ?>" class="styledformelement text <?php echo $class; ?>" value="<?php echo Utils::htmlspecialchars($value); ?>" <?php echo isset($tabindex) ? ' tabindex="' . $tabindex . '"' : ''?>>

	<?php $control->errors_out('
%s
', '
%s
'); ?>

repo_name: DaSourcerer/habari


code:
			<label for="<?php echo $id; ?>" class="incontent textarea"><?php echo $caption; ?>
			<textarea name="<?php echo $field; ?>" id="<?php echo $id; ?>" class="styledformelement <?php echo $class; ?>" rows="<?php echo isset( $rows ) ? $rows : 20; ?>" cols="<?php echo isset( $cols ) ? $cols : 114; ?>"
<?php echo isset($tabindex) ? ' tabindex="' . $tabindex . '"' : ''?>><?php echo Utils::htmlspecialchars($value); ?></textarea>

	<?php $control->errors_out('
%s
', '
%s
'); ?>


code:
<div<?php echo ($class) ? ' class="' . $class . '"' : ''?><?php echo ($id) ? ' id="' . $id . '"' : ''?>><input type="button" <?php if(isset($disabled) && $disabled) { ?>disabled <?php } if ( isset( $tabindex ) ) { ?> tabindex="<?php echo $tabindex; ?>"<?php } ?> name="<?php echo $field; ?>" value="<?php echo Utils::htmlspecialchars($caption); ?>"
<?php if(isset($onclick) && $onclick != ''): ?>
onclick="return onclick_<?php echo Utils::slugify($id, '_'); ?>();"
<?php endif; ?>
>
<?php if(isset($onclick) && $onclick != ''): ?>

<?php endif; ?>
<?php if($message != '') : ?>

<?php echo $message; ?>

<?php endif; ?>


code:
<div<?php echo ($class) ? ' class="' . $class . '"' : ''?><?php echo ($id) ? ' id="' . $id . '"' : ''?>>
	<label for="<?php echo $field; ?>"><?php echo $this->caption; ?>
	<input type="checkbox" name="<?php echo $field; ?>" id="<?php echo $field; ?>" value="1" <?php echo $value ? 'checked' : ''; ?>>
	<input type="hidden" name="<?php echo $field; ?>_submitted" value="1" >
	<?php $control->errors_out('
%s
', '
%s
'); ?>


code:
<div<?php echo ($class) ? ' class="' . $class . '"' : ''?><?php echo ($id) ? ' id="' . $id . '"' : ''?>>

<?php foreach($options as $key => $text) : ?>

		<label for="<?php echo Utils::slugify($key); ?>"><input type="checkbox" name="<?php echo $field; ?>[]" id="<?php echo Utils::slugify($key); ?>" value="<?php echo $key; ?>"<?php echo ( in_array( $key, (array) $value ) ? ' checked' : '' ); ?>><?php echo Utils::htmlspecialchars($text); ?>

<?php endforeach; ?>

<input type="hidden" name="<?php echo $field; ?>_submitted" value="1">
<?php $control->errors_out('
%s
', '
%s
'); ?>


code:
<fieldset<?php echo ($class) ? ' class="' . $class . '"' : ''?><?php echo ($id) ? ' id="' . $id . '"' : ''?>>
	<legend><?php echo $caption; ?></legend>
	<?php echo $contents; ?>
</fieldset>


code:
<div<?php echo ($class) ? ' class="' . $class . '"' : ''?><?php echo ($id) ? ' id="' . $id . '"' : ''?>>
	<label for="<?php echo $field; ?>"><?php echo $this->caption; ?>
	<input type="file" name="<?php echo $field; ?>" >
	<?php $control->errors_out('
%s
', '
%s
'); ?>


code:
<form
	id="<?php echo $id; ?>"
	method="post"
	action="<?php echo $action; ?>"
	class="<?php echo $class; ?>"
	enctype="<?php echo $enctype; ?>"
	accept-charset="<?php echo $accept_charset; ?>"
	<?php echo $onsubmit; ?>
>
<?php if(isset($message) && $message != ''): ?>

<?php echo $message; ?>

<?php endif; ?>
<input type="hidden" name="FormUI" value="<?php echo $salted_name; ?>">
<?php echo $pre_out; ?>
<?php echo $controls; ?>
</form>


code:
<div<?php echo ($class) ? ' class="' . $class . '"' : ''?><?php echo ($id) ? ' id="' . $id . '"' : ''?>>
	<label for="<?php echo $field; ?>"><?php echo $this->caption; ?><input type="password" name="<?php echo $field; ?>" id="<?php echo $field; ?>" value="<?php echo Utils::htmlspecialchars($outvalue); ?>">
	<?php if($message != '') : ?>

<?php echo $message; ?>

	<?php endif; ?>


code:
<div<?php echo ($class) ? ' class="' . $class . '"' : ''?><?php echo ($id) ? ' id="' . $id . '"' : ''?>>
<?php foreach($options as $key => $text) : ?>
	<input type="radio" name="<?php echo $field; ?>" id="<?php echo Utils::slugify($key, '_'); ?>" value="<?php echo $key; ?>"<?php echo ( ( $value == $key ) ? ' checked' : '' ); ?>><label for="<?php echo Utils::slugify($key); ?>"><?php echo Utils::htmlspecialchars($text); ?>
<?php endforeach; ?>
<?php if($message != '') : ?>

<?php echo $message; ?>

<?php endif; ?>


code:
<div<?php echo ($class) ? ' class="' . $class . '"' : ''?><?php echo ($id) ? ' id="' . $id . '"' : ''?>>
<label for="<?php echo $field; ?>"><?php echo $this->caption; ?>
<select id="<?php echo $field; ?>" name="<?php echo $field . ( $multiple ? '[]' : '' ); ?>"<?php echo ( $multiple ? ' multiple="multiple" size="' . intval($size) . '"' : '' ) ?>>
<?php foreach($options as $opts_key => $opts_val) : ?>
	<?php if (is_array($opts_val)) : ?>
		<optgroup label="<?php echo $opts_key; ?>">
		<?php foreach($opts_val as $opt_key => $opt_val) : ?>
			<option value="<?php echo $opt_key; ?>"<?php echo ( in_array( $opt_key, (array) $value ) ? ' selected' : '' ); ?>><?php echo Utils::htmlspecialchars($opt_val); ?></option>
		<?php endforeach; ?>
		</optgroup>
	<?php else : ?>
		<option value="<?php echo $opts_key; ?>"<?php echo ( in_array( $opts_key, (array) $value ) ? ' selected' : '' ); ?>><?php echo Utils::htmlspecialchars($opts_val); ?></option>
	<?php endif; ?>
<?php endforeach; ?>
</select>
<?php if($message != '') : ?>

<?php echo $message; ?>

<?php endif; ?>


code:
		<?php foreach($silos as $ct => $silodir): ?>
<a href="#silo_<?php echo $ct; ?>"<?php if($silodir->icon != NULL): ?> style="background-image: url(<?php echo $silodir->icon; ?>)"<?php endif; ?>><?php echo $silodir->path; ?>
<?php endforeach; ?>

	<?php foreach($silos as $ct => $silodir): ?>
		<div id="silo_<?php echo $ct; ?>" class="splitter mediasplitter ui-tabs-hide">

<?php echo $silodir->path; ?>

			<div id="silo_<?php echo Utils::slugify($silodir->path); ?>" class="splitterinside">

					<?php /*
<input type="file"><input type="submit" value="<?php _e('Upload'); ?>">
*/ ?>

	<?php endforeach; ?>


code:
<div<?php echo ($class) ? ' class="' . $class . '"' : ''?><?php echo ($id) ? ' id="' . $id . '"' : ''?>><input type="submit"<?php if(isset($disabled) && $disabled) { ?>disabled <?php } if ( isset( $tabindex ) ) { ?> tabindex="<?php echo $tabindex; ?>"<?php } ?> name="<?php echo $field; ?>" value="<?php echo Utils::htmlspecialchars($caption); ?>">
<?php if($message != '') : ?>

<?php echo $message; ?>

<?php endif; ?>


code:
<div class="container pagesplitter" id="<?php echo $id; ?>">

		<?php $ct =0;foreach($controls as $title => $tabcontent):$ct++;?>
<a href="#tab_<?php echo $id; ?>_<?php echo $ct; ?>"><?php echo $title; ?>
<?php endforeach; ?>

	<?php $ct =0;foreach($controls as $title => $tabcontent):$ct++;?>
		<div id="tab_<?php echo $id; ?>_<?php echo $ct; ?>" class="splitter">

<?php echo $tabcontent; ?>

	<?php endforeach; ?>


code:
<div<?php echo isset( $class ) ? " class=\"$class\"" : ''; ?><?php echo isset( $id ) ? " id=\"$id\"" : ''; ?>>
	<label<?php if ( isset( $label_title ) ) { ?> title="<?php echo $label_title; ?>"<?php } else { echo ( isset( $title ) ? " title=\"$title\"" : '' ); } ?> for="<?php echo $field; ?>"><?php echo $this->caption; ?>
	<input<?php if ( isset( $control_title ) ) { ?> title="<?php echo $control_title; ?>"<?php } else { echo ( isset( $title ) ? " title=\"$title\"" : '' ); } if ( isset( $tabindex ) ) { ?> tabindex="<?php echo $tabindex; ?>"<?php } if ( isset( $size ) ) { ?> size="<?php echo $size; ?>"<?php } ?> type="text" id="<?php echo $field; ?>" name="<?php echo $field; ?>" value="<?php echo Utils::htmlspecialchars( $value ); ?>">
	<?php $control->errors_out( '
%s
', '
%s
' ); ?>


code:
<div<?php echo( isset( $id ) ? " id=\"$id\"" : '' ); ?>>
<label<?php if ( isset( $label_title ) ) { ?> title="<?php echo $label_title; ?>"<?php $label_title = ''; } else { echo ( isset( $title ) ? "  title=\"$title\"" : '' ); } ?> for="<?php echo $field; ?>">
<?php echo $this->caption; ?>
<textarea name="<?php echo $field; ?>" id="<?php echo $field; ?>"<?php echo ( isset( $class ) ? " class=\"$class\"" : '' ) .
	" rows=\"" . ( isset( $rows ) ? $rows : 10 ) . "\" cols=\"" . ( isset( $cols ) ? $cols : 100 );
	if ( isset( $control_title ) ) { echo "\" title=\"$control_title\""; } else { echo ( isset( $title ) ? "\" title=\"$title\"" : '"' ); } if ( isset( $tabindex ) ) { ?> tabindex="<?php echo $tabindex; ?>"<?php } ?>><?php
echo Utils::htmlspecialchars( $value ); ?></textarea>
<?php if ( $message != '' ) : ?>

<?php echo $message; ?>

<?php endif; ?>


code:
<div<?php echo ($class) ? ' class="' . $class . '"' : ''?><?php echo ($id) ? ' id="' . $id . '"' : ''?>>
<?php if($message != '') : ?>

<?php echo $message; ?>

<?php endif; ?>

<?php echo $this->caption; ?>

<?php
if(!is_array($value)) {
	$value = array($value);
}
$i = 0;
foreach($value as $value_1) :
$i++;
?>
	<input type="text" name="<?php echo $field; ?>[]" id="<?php echo $field . '_' . $i; ?>" value="<?php echo Utils::htmlspecialchars($value_1); ?>"> <label for="<?php echo $field . '_' . $i; ?>">[<?php _e('remove'); ?>]
<?php
endforeach;
?>
<a href="#" onclick="return controls.textmulti.add(this, '<?php echo $field; ?>');">[<?php _e('add'); ?>]


code:
<div id="<?php echo $id; ?>" class="<?php echo $class; ?>">
<?php echo $contents; ?>


code:
<div<?php echo ($class) ? ' class="' . $class . '"' : ''?><?php echo ($id) ? ' id="' . $id . '"' : ''?>>
	<label for="<?php echo $field; ?>"><?php echo $this->caption; ?>
	<input type="checkbox" name="<?php echo $field; ?>" id="<?php echo $field; ?>" value="1" <?php echo $value ? 'checked' : ''; ?> <?php echo isset($tabindex) ? ' tabindex="' . $tabindex . '"' : ''?>>
	<?php if(!empty($helptext)) : ?>
	<?php echo $helptext; ?>
	<?php endif; ?>
	<input type="hidden" name="<?php echo $field; ?>_submitted" value="1" >
	<?php if($message != '') : ?>

<?php echo $message; ?>

	<?php endif; ?>


code:
<div<?php echo ($class) ? ' class="' . $class . '"' : ''?><?php echo ($id) ? ' id="' . $id . '"' : ''?>>
	<label for="<?php echo $field; ?>"><?php echo $this->caption; ?>
	<select name="<?php echo $field . ( $multiple ? '[]' : '' ); ?>" id="<?php echo $field; ?>" <?php echo ( $multiple ? 'multiple="multiple" size="' . intval($size) . '"' : '' ) ?> <?php echo isset($tabindex) ? ' tabindex="' . $tabindex . '"' : ''?>>
	<?php foreach($options as $opts_key => $opts_val) : ?>
		<?php if (is_array($opts_val)) : ?>
			<optgroup label="<?php echo $opts_key; ?>">
			<?php foreach($opts_val as $opt_key => $opt_val) : ?>
				<option value="<?php echo $opt_key; ?>"<?php echo ( in_array( $opt_key, (array) $value ) ? ' selected' : '' ); ?>><?php echo Utils::htmlspecialchars($opt_val); ?></option>
			<?php endforeach; ?>
			</optgroup>
		<?php else : ?>
			<option value="<?php echo $opts_key; ?>"<?php echo ( in_array( $opts_key, (array) $value ) ? ' selected' : '' ); ?>><?php echo Utils::htmlspecialchars($opts_val); ?></option>
		<?php endif; ?>
	<?php endforeach; ?>
	</select>
	<?php if(!empty($helptext)) : ?>
	<?php echo $helptext; ?>
	<?php endif; ?>
	<?php if($message != '') : ?>

<?php echo $message; ?>

	<?php endif; ?>


code:
<div<?php echo ($class) ? ' class="' . $class . '"' : ''?> <?php echo ($id) ? ' id="' . $id . '"' : ''?>>
	<input type="submit" name="<?php echo $field; ?>" class="button" value="<?php echo Utils::htmlspecialchars($caption); ?>" <?php echo isset($tabindex) ? ' tabindex="' . $tabindex . '"' : ''?>>
	<?php if($message != '') : ?>

<?php echo $message; ?>

	<?php endif; ?>


code:
<div<?php echo ($class) ? ' class="' . $class . '"' : ''?><?php echo ($id) ? ' id="' . $id . '"' : ''?>>
	<label for="<?php echo $field; ?>"><?php echo $caption; ?>
	<input type="<?php echo (isset($this->type)) ? $type : 'text'?>" name="<?php echo $field; ?>" id="<?php echo $field; ?>" value="<?php echo Utils::htmlspecialchars( $value ); ?>" <?php echo isset($tabindex) ? ' tabindex="' . $tabindex . '"' : ''?>>
	<?php if(!empty($helptext)) : ?>
	<?php echo $helptext; ?>
	<?php endif; ?>
	<?php if($message != '') : ?>

<?php echo $message; ?>

	<?php endif; ?>


code:
<div<?php echo ($class) ? ' class="' . $class . '"' : ''?><?php echo ($id) ? ' id="' . $id . '"' : ''?>>
	<label for="<?php echo $field; ?>"><?php echo $caption; ?>
	<textarea name="<?php echo $field; ?>" id="<?php echo $field; ?>" class="resizable"<?php
		echo isset($tabindex) ? ' tabindex="' . $tabindex . '"' : ''?>><?php echo Utils::htmlspecialchars( $value ); ?></textarea>
	<?php if($message != '') : ?>

<?php echo $message; ?>

	<?php endif; ?>


code:
<div class="container<?php echo ($class) ? ' ' . $class : ''?>">

<label for="<?php echo $id; ?>"><?php echo $this->caption; ?>

		<input type="checkbox" id="<?php echo $id; ?>" name="<?php echo $field; ?>" class="styledformelement" value="1" <?php echo $value ? 'checked' : ''; ?>>
		<input type="hidden" name="<?php echo $field; ?>_submitted" value="1" >


code:
<div class="container<?php echo ($class) ? ' ' . $class : ''?>">

<label for="<?php echo $id; ?>"><?php echo $this->caption; ?>

	 	<select class="longselect" id="<?php echo $id; ?>" name="<?php echo $field . ( !empty( $multiple ) ? '[]" multiple="multiple" size="' . intval( $size ) . '"' : '"' ); ?>>
<?php foreach($options as $opts_key => $opts_val) : ?>
	<?php if (is_array($opts_val)) : ?>
		<optgroup label="<?php echo $opts_key; ?>">
		<?php foreach($opts_val as $opt_key => $opt_val) : ?>
			<option value="<?php echo $opt_key; ?>"<?php echo ( in_array( $opt_key, (array) $value ) ? ' selected' : '' ); ?>><?php echo Utils::htmlspecialchars($opt_val); ?></option>
		<?php endforeach; ?>
		</optgroup>
	<?php else : ?>
		<option value="<?php echo $opts_key; ?>"<?php echo ( in_array( $opts_key, (array) $value ) ? ' selected' : '' ); ?>><?php echo Utils::htmlspecialchars($opts_val); ?></option>
	<?php endif; ?>
<?php endforeach; ?>
</select>


code: <li class="<?php echo ($class) ? ' ' . $class : ''?>"><?php echo $this->caption; ?>


code:
<div class="container<?php echo ($class) ? ' ' . $class : ''?>">

<label for="<?php echo $id; ?>"><?php echo $this->caption; ?>

<input type="text" name="<?php echo $field; ?>" id="<?php echo $id; ?>" class="styledformelement" value="<?php echo Utils::htmlspecialchars( $value ); ?>">


code:
<div class="container<?php echo ($class) ? ' ' . $class : ''?>">

<label for="<?php echo $id; ?>"><?php echo $this->caption; ?>

<textarea name="<?php echo $field; ?>" id="<?php echo $id; ?>" class="styledformelement" rows="<?php echo isset( $rows ) ? $rows : 10; ?>" cols="<?php echo isset( $cols ) ? $cols : 30; ?>"><?php echo Utils::htmlspecialchars( $value ); ?></textarea>


code:
<?php include('header.php'); ?>

		<select name="navigationdropdown" onchange="navigationDropdown.changePage();" tabindex="1">
			<option value="<?php echo URL::get('admin', 'page=groups'); ?>"><?php _e('All Groups'); ?></option>
			<?php foreach ( $groups as $group_nav ): ?>
				<option value="<?php echo URL::get('admin', 'page=group&id=' . $group_nav->id); ?>"<?php if($group_nav->id == $id): ?> selected="selected"<?php endif; ?>><?php echo $group_nav->name; ?></option>
			<?php endforeach; ?>
		</select>

		<?php _e('or'); ?>

		<input type="search" id="search" placeholder="<?php _e('search settings'); ?>" tabindex="2">

<?php echo sprintf( _n( 'Group %1$s has %2$d member', 'Group %1$s has %2$d members', count( $members ) ), "$group->name", count( $members ) ); ?>

<form name="update-group" id="update-group" action="<?php URL::out('admin', 'page=group'); ?>" method="post">

<?php _e('Group Members'); ?>

				<?php _e('Members'); ?>

				<?php _e('Members To Add'); ?>

				<select name="assign_user" id="assign_user"></select>
				<input type="button" id="add_user" value="<?php _e('Add'); ?>" class="button add">

				<?php _e('Members To Remove'); ?>

		<?php foreach ( $users as $user ): ?>
			<input type="hidden" name="user[<?php echo $user->id; ?>]" value="<?php echo ($user->membership) ? '1' : 0; ?>" id="user_<?php echo $user->id; ?>">
		<?php endforeach; ?>

<?php _e('Group Permissions'); ?>

	<?php
	foreach ( $grouped_tokens as $group_name => $token_group ):
		$crud_tokens = ( isset($token_group['crud']) ) ? $token_group['crud'] : array();
		$bool_tokens = ( isset($token_group['bool']) ) ? $token_group['bool'] : array();
	?>

<?php echo $group_name; ?>

		<?php if ( !empty( $crud_tokens ) ): ?>
			<table id="<?php echo $group_name; ?>-crud-permissions" class="pct100 crud-permissions">

					<?php _e( 'Token Description' ); ?>
					<?php foreach ( $access_names as $name ): ?>
					<?php echo $name; ?>
					<?php endforeach; ?>

				<?php foreach ( $crud_tokens as $token ): ?>

					<?php echo $token->description; ?>
					<?php
					foreach ( $access_names as $name ):
						$checked = ( isset($token->access) && ACL::access_check( $token->access, $name ) ) ? ' checked' : '';
					?>

							<input type="checkbox" id="token_<?php echo $token->id . '_' . $name; ?>" class="bitflag-<?php echo $name; ?>" name="tokens[<?php echo $token->id . '][' . $name; ?>]" <?php echo $checked; ?>>

					<?php endforeach; ?>

				<?php endforeach; ?>

		<?php endif; ?>
		<?php if ( !empty( $bool_tokens ) ): ?>
			<table id="<?php echo $group_name; ?>-bool-permissions" class="pct100 bool-permissions">

					<?php _e( 'Token Description' ); ?>
					<?php _e( 'allow' ); ?>
					<?php _e( 'deny' ); ?>

				<?php foreach ( $bool_tokens as $token ): ?>

					<?php echo $token->description; ?>
					<?php $checked = ( isset($token->access) && ACL::access_check( $token->access, 'any' ) ) ? ' checked' : '';?>

						<input type="checkbox" id="token_<?php echo $token->id . '_full'; ?>" class="bitflag-full" name="tokens[<?php echo $token->id; ?>][full]" <?php echo $checked; ?>>

					<?php $checked = ( isset($token->access) && ACL::access_check( $token->access, 'deny' ) ) ? ' checked' : '';?>

						<input type="checkbox" id="token_<?php echo $token->id . '_deny'; ?>" class="bitflag-deny" name="tokens[<?php echo $token->id; ?>][deny]" <?php echo $checked; ?>>

				<?php endforeach; ?>

		<?php endif; ?>

	<?php endforeach; ?>

		<input type="submit" name="delete" value="<?php _e('Delete'); ?>" class="delete button">

		<input type="submit" value="<?php _e('Apply'); ?>" class="button save">

	<input type="hidden" name="id" id="id" value="<?php echo $group->id; ?>">

	<input type="hidden" name="nonce" id="nonce" value="<?php echo $wsse['nonce']; ?>">
	<input type="hidden" name="timestamp" id="timestamp" value="<?php echo $wsse['timestamp']; ?>">
	<input type="hidden" name="PasswordDigest" id="PasswordDigest" value="<?php echo $wsse['digest']; ?>">

</form>

<?php include('footer.php');?>


code:
<?php include('header.php'); ?>

		<select name="navigationdropdown" onchange="navigationDropdown.changePage();" tabindex="1">
			<option value="all"><?php _e('All Groups'); ?></option>
			<?php foreach($groups as $group): ?>
				<option value="<?php echo URL::get('admin', 'page=group&id=' . $group->id); ?>"><?php echo $group->name; ?></option>
			<?php endforeach; ?>
		</select>

		<?php _e('or'); ?>

		<input type="search" id="search" placeholder="<?php _e('search settings'); ?>" tabindex="2">

<form method="post" action="" id="groupform">

<?php _e('Group Management'); ?>

		<?php foreach ( $groups as $group ):
			$users = array();
			foreach ( $group->users as $user ) {
				if ( $user->id == 0 ) {
					$users[] = '' . $user->displayname . '';
				}
				elseif ( $user->username == User::identify()->username ) {
					$users[] = '' . $user->displayname . '';
				}
				else {
					$users[] = ' 'user', 'user' => $user->username ) ) . '">' . $user->displayname . '';
				}
			}
			include('groups_item.php');
		endforeach; ?>

<?php _e('Add Group'); ?>

			<?php _e( 'Group Name' ); ?>

			<input type="text" name="new_groupname" id="new_groupname" value="<?php echo ( isset( $addform['name'] ) ) ? $addform['name'] : ''; ?>" class="border">

	<input type="hidden" name="nonce" id="nonce" value="<?php echo $wsse['nonce']; ?>">
	<input type="hidden" name="timestamp" id="timestamp" value="<?php echo $wsse['timestamp']; ?>">
	<input type="hidden" name="PasswordDigest" id="PasswordDigest" value="<?php echo $wsse['digest']; ?>">

			<input type="submit" name="newgroup" value="<?php _e('Add Group'); ?>">

</form>

<?php include('footer.php');?>


code:
<div class="group item clear" id="item-<?php echo $group->id; ?>">

<a href="<?php echo URL::get('admin', 'page=group&id=' . $group->id) ?>" title="<?php _e('Edit group'); ?>"><?php echo $group->name; ?>

			<?php $actions = array(
				'edit' => array('url' => URL::get('admin', 'page=group&id=' . $group->id), 'title' => _t('Edit group'), 'label' => _t('Edit')),
				'remove' => array('url' => 'javascript:itemManage.remove('. $group->id . ', \'group\');', 'title' => _t('Delete this group'), 'label' => _t('Delete'))
			);
			$actions = Plugins::filter('group_actions', $actions);
			foreach ( $actions as $action ):
			?>

<a href="<?php echo $action['url']; ?>" title="<?php echo $action['title']; ?>"><?php echo $action['label']; ?>

			<?php endforeach; ?>

	<?php if ( count($users) > 0 ): ?>

<?php echo _t('Members: ') . Format::and_list($users); ?>

	<?php else: ?>

<?php _e( 'No members' ); ?>

	<?php endif; ?>


code:
<!doctype html>

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title><?php Options::out('title'); ?> · <?php echo $admin_title; ?></title>

	<?php
		Plugins::act( 'admin_header', $this );
		Stack::out( 'admin_header_javascript', array('Stack', 'scripts') );
		Stack::out( 'admin_stylesheet', array('Stack', 'styles') );
	?>

	<?php
		Plugins::act( 'admin_header_after', $this );
	?>

<body class="page-<?php echo $page; ?>">

<a href="<?php echo $admin_page_url; ?>"><?php echo ( isset( $mainmenu[$admin_page]['text'] ) ? $mainmenu[$admin_page]['text'] : $admin_page ); ?> Q

			<?php foreach($mainmenu as $menu_id => $menu): ?>
				<li id="link-<?php echo $menu_id ?>" class="<?php if($menu['selected'] == TRUE) { echo 'selected'; } ?><?php if(isset($menu['submenu'])): ?> submenu<?php endif; ?>" title="<?php echo $menu['title']; ?>"><a class="top" href="<?php echo $menu['url']; ?>"><?php echo $menu['text']; ?>
				<?php if ( isset($menu['hotkey']) && $menu['hotkey'] != '' ): ?><?php echo $menu['hotkey']; ?><?php endif; ?>

				<?php if ( isset($menu['submenu']) ): ?>

				 <?php foreach($menu['submenu'] as $submenu_id => $submenu_item): ?>
				 	<li id="link-<?php echo $submenu_id ?>" title="<?php echo $submenu_item['title']; ?>" class="sub<?php if(isset($submenu_item['hotkey']) && $submenu_item['hotkey'] != ''): ?> hotkey-<?php echo $submenu_item['hotkey']; ?><?php endif; ?>"><a href="<?php echo $submenu_item['url']; ?>"><?php echo $submenu_item['text']; ?>
				 	<?php if ( isset($submenu_item['hotkey']) && $submenu_item['hotkey'] != '' ): ?><?php echo $submenu_item['hotkey']; ?><?php endif; ?>

				 <?php endforeach; ?>

				<?php endif; ?>

			<?php endforeach; ?>

	<a href="<?php Site::out_url('habari'); ?>" id="site" title="<?php _e('Go to Site'); ?>"><?php Options::out('title'); ?>

<?php Plugins::act('admin_info', $theme, $page); ?>


code:
<?php include('header.php'); ?>

<?php _e('Import'); ?>

		<form method="post" action="" enctype="<?php echo $enctype; ?>">
			<?php
				if ( empty($_POST['importer']) ) :
					$import_names = array();
					$import_names = Plugins::filter('import_names', $import_names);
					if ( count($import_names) == 0 ):
						?>

<?php _e('You do not currently have any import plugins installed.'); ?>

<?php printf( _t('Please activate an import plugin to enable importing.'), URL::get('admin', 'page=plugins') ); ?>

							<?php else: ?>

<?php _e('Please choose the type of import to perform:'); ?>

							<select name="importer" class="pct50">
								<?php
								foreach ( $import_names as $name ) {
									echo "<option>{$name}</option>";
								}
								?>
							</select>

<input type="submit" class="button" name="import" value="<?php _e('Select'); ?>">

						<?php
					endif;
				else:
					echo Plugins::filter('import_stage', '', @$_POST['importer'], @$_POST['stage'], @$_POST['step']);
				endif;

				if ( isset($_POST['importer']) ) {
					echo '<input type="hidden" name="importer" value="' . $_POST['importer'] . '">';
				}
			?>
		</form>

<?php
	// unset db_connection, since we don't need it any more
	Config::clear( 'db_connection' );
?>
<?php include('footer.php'); ?>


code:
<?php
header("Location: ../..");
?>


code:
// Habari ajax. All Habari Ajax calls should go through here. It allows us to use uniform humanmsg stuff,
// as well as uniform error handling
var habari_ajax = {
	post: function(post_url, post_data, local_cb) {
		habari_ajax.ajax('POST', post_url, post_data, local_cb);
	},

	get: function(get_url, get_data, local_cb) {
		habari_ajax.ajax('GET', get_url, get_data, local_cb);
	},

	ajax: function(type, url, data, local_cb) {
		$.ajax({
			url: url,
			data: data,
		  success: function(json_data) {
				habari_ajax.success(json_data, local_cb);
			},
			error: habari_ajax.error,
		  dataType: 'json',
			type: type
		});
	},

	success: function(json_data, local_cb)
	{
		spinner.stop();

		if ( json_data.response_code = 200 ) {
			humanMsg.displayMsg( json_data.message );
		}

		local_cb(json_data.data);
	},

	error: function(XMLHttpRequest, textStatus, errorThrown) {
		spinner.stop();
		humanMsg.displayMsg ("Uh Oh. An error has occured. Please try again later.");
	}
}

// DASHBOARD
var dashboard = {
	init: function() {
		$('.modules').sortable({
			items: '.module:not(.add-item-module)',
			handle: 'div.handle',
			opacity: 0.9,
			stop: function() {
				dashboard.update();
			}
		});

		$('.options').toggle(function() {
				$(this).parents('li').addClass('viewingoptions');
			}, function() {
				$(this).parents('li').removeClass('viewingoptions');
			});

		$('.close', '.modules').click( function() {
			// grab the module ID from the parent DIV id attribute.
			matches = $(this).parents('.module').attr('id').split( ':', 2 );
			dashboard.remove( matches[0] );
		});
		findChildren();
	},
	update: function() {
		spinner.start();
		// disable dragging and dropping while we update
		$('.modules').sortable('disable');
		var query = {};
		$('.module', '.modules').not('.ui-sortable-helper').each( function(i) {
			query['module' + i] = this.getAttribute('id');
		} );
		query.action = 'updateModules';
		habari_ajax.post(
			habari.url.ajaxDashboard,
			query,
			function() {
				$('.modules').sortable('enable');
			}
		);
	},
	updateModule: function() {
		//spinner.start();
		// disable dragging and dropping while we update
		// here we would update the modules options then
		// reload the modules
	},
	add: function() {
		spinner.start();
		// disable dragging and dropping while we update
		$('.modules').sortable('disable');
		var query = {};
		query.action = 'addModule';
		query.module_name = $('#dash_additem option:selected').val();
		habari_ajax.post(
			habari.url.ajaxDashboard,
			query,
			function( json ) {
				$('.modules').html( json.modules );
				dashboard.init();
				//$('.modules').sortable('enable');
			}
		);
	},
	remove: function( id ) {
		spinner.start();
		// disable dragging and dropping while we update
		$('.modules').sortable('disable');
		var query = {};
		query.action = 'removeModule';
		query.moduleid = id;
		habari_ajax.post(
			habari.url.ajaxDashboard,
			query,
			function( json ) {
				$('.modules').html( json.modules );
				dashboard.init();
				//$('.modules').sortable('enable');
			}
		);
	}
};

// Item Management
var itemManage = {
	init: function() {
		if ($('.page-users, .page-options, .page-user, .page-tags, .page-plugins, .page-groups').length !== 0) {
			$("input#search").keyup(function (e) {
				var str = $('input#search').val();
				itemManage.simpleFilter(str);
			});
		}

		if (!$('.item.controls input[type=checkbox]')) {return;}

		itemManage.initItems();

		$('.item.controls input[type=checkbox]').change(function () {
			if ($('.item.controls label.selectedtext').hasClass('all')) {
				itemManage.uncheckAll();
			} else {
				itemManage.checkAll();
			}
		});

		/* for all manage pages except for comments, add an ajax call to the
		 * delete button
		 */
		if ( $('.manage.comments').length === 0 ) {
			$('.item.controls input.button.delete').click(function () {
				itemManage.update( 'delete' );
				return false;
			});
		}

		$('.item.controls input.rename.button').click(function() {
			itemManage.rename();
		});
	},
	initItems: function() {
		$('.item:not(.ignore) .checkbox input[type=checkbox]').change(function () {
			itemManage.changeItem();
		});
		$('.item:not(.ignore) .checkbox input[type=checkbox]').each(function() {
			id = $(this).attr('id');
			id = id.replace(/.*\[(.*)\]/, "$1" ); // checkbox ids have the form name[id]
			if (itemManage.selected['p' + id] == 1) {
				this.checked = 1;
			}
		});
		$('.item .less').click(function() {
			itemManage.expand($(this).parent());
		});
		itemManage.changeItem();
	},
	expand: function(item) {
		$('.item').removeClass('expanded');

		item.addClass('expanded');

		$('.more', item).click(function() {
			itemManage.contract($(this).parent());
		});
	},
	contract: function(item) {
		item.removeClass('expanded');
	},
	selected: [],
	searchCache: [],
	searchRows: [],
	simpleFilter: function( search ) {
		search = $.trim( search.toLowerCase() );

		// cache search items on first call
		if ( itemManage.searchCache.length === 0 ) {
			itemManage.searchRows = $('li.item, .item.plugin, .item.tag, div.settings, .container.plugins, .item.group');
			itemManage.searchCache = itemManage.searchRows.map(function() {
				return $(this).text().toLowerCase();
			});
		}

		itemManage.searchCache.each(function(i) {
			if ( this.search( search ) == -1 ) {
				$(itemManage.searchRows[i]).addClass('hidden');
			} else {
				$(itemManage.searchRows[i]).removeClass('hidden');
			}
		});

		if ($('div.settings').length !== 0 || $('.container.plugins:visible').length > 1) {
			$('select[name=navigationdropdown]').val('all');
		}

		/*
		if ($('li.item').length != 0) {
			itemManage.changeItem();
		}*/
	},
	changeItem: function() {
		var selected = {};

		if (itemManage.selected.length !== 0) {
			selected = itemManage.selected;
		}

		$('.item:not(.ignore) .checkbox input[type=checkbox]:checked').each(function() {
			check = $(this);
			id = check.attr('id');
			id = id.replace(/.*\[(.*)\]/, "$1" );
			selected['p' + id] = 1;
			check.parent().parent().filter('.item').addClass('selected');
			check.parent().parent().parent().filter('.item').addClass('selected');

		});
		$('.item:not(.ignore) .checkbox input[type=checkbox]:not(:checked)').each(function() {
			check = $(this);
			id = check.attr('id');
			id = id.replace(/.*\[(.*)\]/, "$1" );
			selected['p' + id] = 0;
			check.parent().parent().filter('.item').removeClass('selected');
			check.parent().parent().parent().filter('.item').removeClass('selected');

		});

		itemManage.selected = selected;

		visible = $('.item:not(.hidden):not(.ignore) .checkbox input[type=checkbox]:checked').length;

		total = $('.currentposition .total').text();

		count = 0;
		for (var id in itemManage.selected)	{
			if (itemManage.selected[id] == 1) {
				count = count + 1;
			}
		}

		if (count === 0) {
			$('.item.controls input[type=checkbox]').each(function() {
				this.checked = 0;
			});
			$('.item.controls label.selectedtext').addClass('none').removeClass('all').text('None selected');
		} else if (visible == $('.item:not(.hidden):not(.ignore) .checkbox input[type=checkbox]').length) {
			$('.item.controls input[type=checkbox]').each(function() {
				this.checked = 1;
			});
			$('.item.controls label.selectedtext').removeClass('none').addClass('all').html('All ' + count + ' visible selected (Select all ' + total + ')');

			$('.item.controls label.selectedtext .everything').click(function() {
				itemManage.checkEverything();
				return false;
			});

			if (visible != count) {
				$('.item.controls label.selectedtext').text('All visible selected (' + count + ' total)');
			}

			if ((total == count) || $('.currentposition .total').length === 0) {
				$('.item.controls label.selectedtext').removeClass('none').addClass('all').addClass('total').html('All ' + total + ' selected');
			}
		} else {
			$('.item.controls input[type=checkbox]').each(function() {
				this.checked = 0;
			});
			$('.item.controls label.selectedtext').removeClass('none').removeClass('all').text(count + ' selected');

			if (visible != count) {
				$('.item.controls label.selectedtext').text(count + ' selected (' + visible + ' visible)');
			}
		}
	},
	checkEverything: function() {
		itemManage.fetch(0, $('.currentposition .total').text(), false, true);
	},
	uncheckAll: function() {
		$('.item:not(.hidden):not(.ignore) .checkbox input[type=checkbox]').each(function() {
			this.checked = 0;
		});
		itemManage.selected = [];
		itemManage.changeItem();
	},
	checkAll: function() {
		$('.item:not(.hidden):not(.ignore) .checkbox input[type=checkbox]').each(function() {
			this.checked = 1;
		});
		itemManage.changeItem();
	},
	purge: function () {
		itemManage.update( 'purge' );
	},
	update: function( action, id ) {
		spinner.start();
		var query = {};
		if ( id === undefined ) {
			query = itemManage.selected;
		}
		else {
			query['p' + id]= 1;
		}

		query.action = action;
		query.timestamp = $('input#timestamp').attr('value');
		query.nonce = $('input#nonce').attr('value');
		query.digest = $('input#PasswordDigest').attr('value');
		if ( $('.manage.users').length !== 0 ) {
			query.reassign = $('select#reassign').attr('value');
		}

		elItem = $('#item-' + id);

		if (elItem.length > 0 || action == 'delete') {
			elItem.fadeOut();
		}

		$.post(
			itemManage.updateURL,
			query,
			function( result ) {
				spinner.stop();
				jQuery.each( result, function( index, value ) {
					humanMsg.displayMsg( value );
				});
				if ( $('.timeline').length ) {
					/* TODO: calculate new offset and limit based on filtering
					 * and the current action
					 */
					loupeInfo = timeline.getLoupeInfo();
					itemManage.fetch( 0, loupeInfo.limit, true );
					timeline.updateLoupeInfo();
				}
				else {
					itemManage.fetch( 0, 20, false );
				}

				// if we deleted stuff, scroll to the top of the new page
				if ( action == 'delete' ) {
					window.scroll(0,0);
				}

				itemManage.selected = [];
			},
			'json');
	},
	rename: null,
	remove: function( id ) {
		itemManage.update( 'delete', id );
	},
	fetch: function( offset, limit, resetTimeline, silent ) {
		offset = ( offset === undefined ) ? 0 : offset;
		limit = ( limit === undefined ) ? 20: limit;
		silent = ( silent === undefined ) ? false: silent;
		spinner.start();

		$.ajax({
			type: 'GET',
			url: itemManage.fetchURL,
			data: '&search=' + liveSearch.getSearchText() + '&offset=' + offset + '&limit=' + limit,
			dataType: 'json',
			success: function(json) {
				if (silent) {
					itemManage.selected = json.item_ids;
					itemManage.initItems();
				} else {
					itemManage.fetchReplace.html(json.items);
					// if we have a timeline, replace its content
					if ( resetTimeline && $('.timeline').length !== 0 ) {
						// we hide and show the timeline to fix a firefox display bug
						$('.years').html(json.timeline).hide();
						spinner.stop();
						itemManage.initItems();
						setTimeout( function() {
							$('.years').show();
							timeline.reset();
						}, 100 );
						$('input.checkbox').rangeSelect();
					}
					else {
						spinner.stop();
						itemManage.initItems();
						$('input.checkbox').rangeSelect();
					}
					if ( itemManage.inEdit === true ) {
						inEdit.init();
						inEdit.deactivate();
					}
					findChildren();
				}

				spinner.stop();

			}
		});
	}
};

// Plugin Management
var pluginManage = {
	init: function() {
		// Return if we're not on the plugins page
		if (!$('.page-plugins').length) {return;}

		$('.plugins .item').hover( function() {
			$(this).find('#pluginconfigure:visible').parent().css('background', '#FAFAFA');
		}, function() {
			$(this).find('#pluginconfigure:visible').parent().css('background', '');
	  	});

		$('.plugins .item a.help').click(function() {
			var help = $('.pluginhelp', $(this).parents('.item'));

			if( help.hasClass('active') ) {
				help.slideUp();
				help.add(this).removeClass('active');
			}
			else {
				help.slideDown();
				help.add(this).addClass('active');
			}

			return false;

		});
	}
};

// Group Management
var groupManage = {
	init: function(users) {
		this.users = users;

		for(var z in this.users) {
			if (users.hasOwnProperty(z)) {
				$('#assign_user').append($('<option value="' + this.users[z].id + '">' + this.users[z].username + '</option>'));
				if (this.users[z].member) {
					this.addMember(this.users[z].id);
				}
			}
		}

		this.userscanAll();

		$('#add_user').click(function() {
			groupManage.addMember($('#assign_user').val());
		});

		// Apply permission deny/allow toggle rules
		$('.bool-permissions input[type=checkbox],.crud-permissions input[type=checkbox]').change(function(){
			if ($(this).attr('checked')) {
				if ($(this).hasClass('bitflag-deny')) {
					$('input[type=checkbox]', $(this).parents('tr')).filter(function(){return !$(this).hasClass('bitflag-deny');}).attr('checked', false);
				}
				else {
					$('input[type=checkbox].bitflag-deny', $(this).parents('tr')).attr('checked', false);
				}
			}
		});

	},
	removeMember: function(member, id) {
		name = this.users[id].username;

		if (this.users[id].member) {
			if ($('#user_' + id).val() === 0) {
				$('#user_' + id).val('1');
				$('#currentusers .memberlist').append('' + this.users[id].username + '');
			}
			else {
				$('#removedusers .memberlist').append('' + this.users[id].username + '');
				$('#user_' + id).val('0');
			}
		}
		else {
			$('#assign_user').append($('<option value="' + id + '">' + name + '</option>'));
			$('#add_users').show();
			$('#user_' + id).val('0');
		}

		$(member).remove();

		this.userscanAll();
		return false;
	},
	addMember: function(id) {
		$('#assign_user option[value=' + id + ']').remove();

		$('#user_' + id).val('1');

		if (this.users[id].member) {
			$('#currentusers .memberlist').append('' + this.users[id].username + '');
		}
		else {
			$('#newusers .memberlist').append('' + this.users[id].username + '');
		}
		this.userscanAll();
	},
	userscanAll: function() {
		this.userscan('#currentusers');
		this.userscan('#removedusers');
		this.userscan('#newusers');
		if ($('#add_users option').length > 0) {
			$('#add_users').show();
		}
		else {
			$('#add_users').hide();
		}
	},
	userscan: function(div) {
		if ($(div + ' .user').length > 0) {
			$(div).show();
		}
		else {
			$(div).hide();
		}
	}
};

// TIMELINE
var timeline = {
	init: function() {
		// No Timeline? No runny-runny.
		if (!$('.timeline').length) {return;}
		var self = this; // keep context in closures

		// Set up pointers to elements for speed
		timeline.view = $('.timeline');

		// Fix width of years, so they don't spill into the next year
		$('.year > span').each( function() {
			$(this).width( $(this).parents('.year').width() - 4 );
		});

		// Get an array of posts per month
		timeline.monthData = [0];
		timeline.monthWidths = [0];
		timeline.totalCount = 0;
		$('.years .months span').each(function(i) {
			timeline.monthData[i] = $(this).width();
			timeline.monthWidths[i] = $(this).parent().width() + 1; // 1px border
			timeline.totalCount += timeline.monthData[i];
		});

		// manually set the timelineWidth to contain its children for IE7
		var timelineWidth = 0;
		if ( $.browser.msie ) {
			jQuery(timeline.monthWidths).each(function() { timelineWidth += this; } );
			$('.years').width(timelineWidth);
		} else {
			timelineWidth = $('.years').width();
		}

		// check for a timeline larger than its view
		// timeline.overhang = ( timelineWidth > viewWidth ) ? timelineWidth - viewWidth : 0;
		var viewWidth = $('.timeline').width();
		timeline.overhang = ( timelineWidth > viewWidth ) ? timelineWidth - viewWidth : 0;

		// Find the width which makes the loupe select 20 items
		var handleWidth = timelineWidth - timeline.positionFromIndex( timeline.totalCount - 20 );

		// Make the slider bounded by the view
		var maxSliderValue = Math.min( viewWidth, timelineWidth ) - handleWidth;

		// Initialize the timeline handle
		timeline.handle = new timelineHandle( '.handle', handleWidth, maxSliderValue );

		$('.track')
			.width( $('.years').width() - timeline.overhang )
			.bind('dblclick', function(e) { // Double-clicking on either side of the handle moves the handle to the clicked position.
				// Dismiss clicks on handle
				if ($(e.target).add($(e.target).parents()).is('.handle')) {return false;}

				timeline.noJump = true;
				clearTimeout(timeline.t1);
				timeline.handle.value( e.pageX - $('.track').offset().left );
				timeline.change();
			})
			.bind('click', function(e) { // Clicking either side of the handle moves the handle its own length to that side.

				// Dismiss clicks on handle
				if ( $(e.target).add($(e.target).parents()).is('.handle') ) {return false;}

				// Click to left or right of handle?
				if ( e.pageX - $('.track').offset().left < timeline.handle.value() ) {
					timeline.t1 = setTimeout(timeline.skipLoupeLeft, 300);
				} else {
					timeline.t1 = setTimeout(timeline.skipLoupeRight, 300);
				}
			});

		timeline.updateLoupeInfo();
	},
	change: function() {
		var loupeInfo = timeline.getLoupeInfo();
		itemManage.fetch( loupeInfo.offset, loupeInfo.limit, false );
		timeline.updateLoupeInfo();
	},
	skipLoupeLeft: function(e) {
		timeline.handle.value( timeline.handle.value() - timeline.handle.width() )
		timeline.change();
	},
	skipLoupeRight: function(e) {
		timeline.handle.value( timeline.handle.value() + timeline.handle.width() );
		timeline.change();
	},
	updateView: function() {
		if ( ! timeline.overhang ) { return; }
		/*if ( timeline.handle.offset().left <= timeline.view.offset().left + 5) {
			// timeline needs to slide right if we are within 5px of edge
			$('.years').css( 'right', Math.max( parseInt($('.years').css('right'),10) - timeline.handle.width(), 0 - timeline.overhang ) );
		}
		else if ( timeline.handle.offset().left + timeline.handle.width() + 5 >= timeline.view.offset().left + timeline.view.width() ) {
			// slide the timeline to the left
			$('.years').css( 'right', Math.min( parseInt($('.years').css('right'),10) + timeline.handle.width(), 0 ) );
		}*/
	},
	indexFromPosition: function(pos) {
		var monthBoundary = 0;
		var monthIndex = 1;
		var month = 0;
		var i;

		// get the index of the first post in the month that the handle is over

		for ( i = 0; i < timeline.monthWidths.length && monthBoundary + timeline.monthWidths[i] < pos; i++ ) {
			monthBoundary += timeline.monthWidths[i];
			monthIndex += timeline.monthData[i];
			month = i + 1;
		}

		// the index is the offset from this boundary, but it cannot be greater than
		// the number of posts in the month (the month has some extra padding which
		// increases its width).
		var padding = parseInt( $('.years span').css('margin-left'),10);
		padding = padding ? padding : 0;
		return monthIndex + Math.min(
						Math.max( pos - ( monthBoundary + padding ), 0 ),
						timeline.monthData[month] - 1 );
	},
	/* the inverse of the above function */
	positionFromIndex: function(index) {
		var month = 0;
		var position = 0;
		var positionIndex = 1;

		if ( index < 1 ) {return 0;}

		for ( i = 0; i < timeline.monthWidths.length && positionIndex + timeline.monthData[i] < index; i++ ) {
			position+= timeline.monthWidths[i];
			positionIndex+= timeline.monthData[i];
			month = i + 1;
		}

		var padding = parseInt( $('.years .months span').css('margin-left'), 10 );
		padding = padding ? padding : 0;
		return position + padding + ( index - positionIndex );
	},
	getLoupeInfo: function() {
		var cur_overhang = $('.track').offset().left - $('.years').offset().left;
		var loupeStartPosition = timeline.indexFromPosition( timeline.handle.value() + cur_overhang);
		var loupeEndPosition = timeline.indexFromPosition( timeline.handle.value() + timeline.handle.width() + cur_overhang );

		var loupeInfo = {
			start: loupeStartPosition,
			end: loupeEndPosition,
			offset: parseInt(timeline.totalCount, 10) - parseInt(loupeEndPosition, 10),
			limit: 1 + parseInt(loupeEndPosition, 10) - parseInt(loupeStartPosition, 10)
			};
		return loupeInfo;
	},
	updateLoupeInfo: function() {
		var loupeInfo = timeline.getLoupeInfo();
		$('.currentposition').html( loupeInfo.start +'-'+ loupeInfo.end +' of '+ timeline.totalCount + '');

		// Hide 'newer' and 'older' links as necessary
		if (loupeInfo.start == 1) {$('.navigator .older').animate({opacity: '0'}, 200);}
		else {$('.navigator .older').animate({opacity: '1'}, 200);}
		if (loupeInfo.end == timeline.totalCount) {$('.navigator .newer').animate({opacity: '0'}, 200); }
		else {$('.navigator .newer').animate({opacity: '1'}, 200);}
	},
	reset: function () {
		// update the arrays of posts per month
		timeline.monthData = [0];
		timeline.monthWidths = [0];
		timeline.totalCount = 0;
		$('.years .months span').each( function(i) {
			timeline.monthData[i] = $(this).width();
			timeline.monthWidths[i] = $(this).parent().width() + 1; // 1px border
			timeline.totalCount += timeline.monthData[i];
		});

		// manually set the timelineWidth to contain its children for IE7
		var timelineWidth = 0;
		if ( $.browser.msie ) {
			jQuery(timeline.monthWidths).each(function() { timelineWidth += this; } );
			$('.years').width( timelineWidth );
		}
		else {
			timelineWidth = $('.years').width();
		}

		// check for a timeline larger than its view
		// timeline.overhang = ( timelineWidth > viewWidth ) ? timelineWidth - viewWidth : 0;
		var viewWidth = $('.timeline').width();
		timeline.overhang = ( timelineWidth > viewWidth ) ? timelineWidth - viewWidth : 0;

		// find the width which makes the loupe select 20 items
		var handleWidth = timelineWidth - timeline.positionFromIndex( timeline.totalCount - 20 );
		// make the slider bounded by the view
		timeline.handle.max = Math.min( viewWidth, timelineWidth ) - handleWidth;

		// reset the widths
		$('.track').width( $('.years').width() - timeline.overhang );
		$('.handle').width( handleWidth + 'px' );

		// Fix width of years, so they don't spill into the next year
		$('.year > span').each( function() {
			$(this).width( $(this).parents('.year').width() - 4 );
		});

		// move the handle to the max value
		timeline.handle.value( timeline.handle.max );
		timeline.updateLoupeInfo();
	}
};

// TIMELINE SLIDER
function timelineHandle( id, width, maxvalue ) {
	this.handle = $(id, timeline.view);
	this.max = maxvalue;
	this.value( maxvalue );

	this.handle.css( 'width', width + 'px');
	/* force 'right' property to 'auto' so we can check in doDragLeft if we have fixed the
	 * right side of the handle */
	this.handle.css( 'right', 'auto' );

	// this is required to keep context
	var self = this;

	this.handle.mousedown(function(e) {
		return self.mouseDown(e);
	});

	// Resize handles
	$('.resizehandleleft').mousedown(function(e) {
		return self.resize(e, 'left');
	});

	$('.resizehandleright').mousedown(function(e) {
		return self.resize(e, 'right');
	});
}

timelineHandle.prototype = {
	mouseDown: function(e) {
		this.initialpos = e.pageX;

		// keep context in closures
		var self = this;
		$(document)
			.bind( 'mousemove.timeline', function(e) {
				return self.mouseMove.call( self, e );
			})
			.bind( 'mouseup.timeline', function(e) {
				return self.mouseUp.call( self, e );
			});
		return false;
	},
	mouseMove: function(e) {
		var new_value = this.value() + (e.pageX - this.initialpos);
		new_value = ( new_value < 0 ) ? 0 : new_value;
		new_value = ( new_value > this.max ) ? this.max : new_value;
		if ( new_value != this.value() ) {
			this.initialpos = e.pageX;
			this.value( new_value );
		}
		return false;
	},
	mouseUp: function(e) {
		$(document).unbind('mousemove.timeline').unbind('mouseup.timeline');
		timeline.change();
		return false;
	},
	value: function(value) {
			if ( arguments.length ) {
				 value = ( value < 0 ) ? 0 : value;
				 value = ( value > this.max ) ? this.max : value;
				 this.val = parseInt( value, 10 );
				 this.handle.css( 'left', this.val + 'px' );
			}
			return this.val;
	},
	width: function() {
		return this.handle.width();
	},
	resize: function(e, direction) {
		this.initialSize = this.handle.width();
		this.firstMousePos = e.clientX;

		// setup functions to keep context
		var self = this;
		if ( direction == 'left' ) {
			this.dragDelegate = function(e) {
				return self.doDragLeft(e);
			};
		}
		else {
			this.dragDelegate = function(e) {
				return self.doDragRight(e);
			};
		}
		this.endDragDelegate = function(e) {
			return self.endDrag(e);
		};
		$(document).bind('mousemove.timeline', this.dragDelegate)
			.bind('mouseup.timeline', this.endDragDelegate);
		return false;
	},
	doDragLeft: function(e) {
		var h = this.handle;
		var track = h.parents('.track');
		// fix the right side (only do this if we haven't already done it)
		if ( h.css('right') == 'auto' ) {
			h.css({
				'left':	'auto',
				'right': track.width() - ( parseInt(h.css('left'), 10) + h.width() )
			});
		}

		// Set Loupe Width. Min 20, Max 200, no spilling to the left
		h.css( 'width',
			Math.min(
				Math.max( this.initialSize - (e.clientX - this.firstMousePos), 20 ),
				Math.min( track.width() - parseInt(h.css('right'),10 ), 200 )
			)
		);

		return false;
	},
	doDragRight: function(e) {
		var h = this.handle;
		var track = h.parents('.track');
		// fix the left side
		h.css({
			'left': h.offset().left - track.offset().left,
			'right': 'auto'
		});

		// Set Loupe Width. Min 20, Max 200, no spilling to the right
		h.css( 'width',
			Math.min(
				Math.max( this.initialSize + (e.clientX - this.firstMousePos), 20),
				Math.min( track.width() - parseInt(h.css('left'), 10), 200 )
			)
		);

		return false;
	},
	endDrag: function(e) {
		// Reset to using 'left'.
		this.handle.css({
			'left':	this.handle.offset().left - $('.track').offset().left,
			'right': 'auto'
		});

		// update slider max value for the new handle width
		this.max = Math.min( $('.timeline').width(), $('.years').width() ) - this.handle.width();

		// update slider value
		this.value( parseInt( this.handle.css('left'), 10 ) );
		timeline.change();

		$(document).unbind('mousemove.timeline').unbind('mouseup.timeline');

		return false;
	}
};

// SPINNER
var spinner = {
	start: function() {
		$('#spinner')
			.css({ height: 32, width: 32 })
			.css('background-image', 'url(' + habari.url.habari + '/system/admin/images/spin.gif)')
			.show();
	},
	stop: function () {
		$('#spinner').hide();
	}
};

// NAVIGATION DROPDOWNS
var navigationDropdown = {
	init: function() {
		if ($('.page-user').length === 0 && $('.page-options').length === 0) {
			return;
		}

		$('.container.settings, .optiongroup').each(function() {
			$('<option></option>').attr('value', $(this).attr('id')).text($('h2', this).text()).appendTo($('select[name=navigationdropdown]'));
		});
	},
	changePage: function(location) {
		if ( location === undefined ) {
			nextPage = $('select[name=navigationdropdown]').val();
		} else {
			nextPage = location.options[location.selectedIndex].value;
		}

		if (nextPage !== "" && nextPage != document.location.href) {
			document.location.href = nextPage;
		}
	},
	filter: function() {
		var selected = $('select[name=navigationdropdown]').val();

		if ( selected == 'all' ) {
			$('.settings, .container.plugins, .optiongroup').removeClass('hidden');
		}
		else {
			$('.settings:not(#' + selected + '), .container.plugins:not(#' + selected + '), .optiongroup:not(#' + selected + ')').addClass('hidden');
			$('.settings#' + selected + ', .container.plugins#' + selected + ', .optiongroup#' + selected ).removeClass('hidden');
		}
	}
};

// DROPBUTTON
var dropButton = {
	init: function() {
		var currentDropButton = '';
		$('.dropbutton').hover( function(e) {
			dropButton.currentDropButton = $(e.currentTarget);

			// Clear any timers, let the button know it's being hovered
			clearTimeout(dropButton.t1);
			dropButton.showMenu();
		}, function(e) {
			// After mouse out, wait, then close
			dropButton.t1 = setTimeout(dropButton.hideMenu, 500);
		});
	},

	showMenu: function(element) {
		// Close all open dropbuttons
		$('.dropbutton').removeClass('hovering');

		// Open this dropbutton
		$(dropButton.currentDropButton).addClass('hovering');
	},

	hideMenu: function(element) {
		// Fade out and close dropbutton
		$(dropButton.currentDropButton).removeClass('hovering');

		$('.carrot').removeClass('carrot');
	}
};

// THE MENU
var theMenu = {
	init: function() {
		// Carrot functionality
		$('#menulist li').hover(function() {
			$('#menulist li').removeClass('carrot');
			$(this).addClass('carrot');
		}, function() {
			$('#menulist li').removeClass('carrot');
		});

		// Open menu on Q
		$.hotkeys.add('q', {propagate:true, disableInInput: true}, function(){
			if ($('#menu #menulist > ul').css('display') != 'block') {
				dropButton.currentDropButton = $('#menu');
				dropButton.showMenu();
			} else if ($('#menu #menulist > ul').css('display') == 'block') {
				dropButton.hideMenu();
			} else {
				return false;
			}
		});

		// Close menu on ESC
		$.hotkeys.add('esc', {propagate:true, disableInInput: false}, function(){
			$('.carrot').removeClass('carrot');
			dropButton.hideMenu();
		});

		// Down arrow
		$.hotkeys.add('down', {propagate:true, disableInInput: true}, function(evt) {
			if ($('#menulist .carrot ul li.carrot').length !== 0) {
				if ($('#menulist .carrot ul li:last').hasClass('carrot')) {
					// Move to top if at bottom
					$('#menulist .carrot ul li:last').removeClass('carrot');
					$('#menulist .carrot ul li:first').addClass('carrot');
				} else {
					$('#menulist .carrot ul li.carrot').removeClass('carrot').next().addClass('carrot');
				}
				// stop propagation
				evt.preventDefault();
			} else if (($('#menu').hasClass('hovering') === true)) {
				// If carrot doesn't exist, select first item
				if (!$('#menulist li').hasClass('carrot')) {
					$('#menulist li:first').addClass('carrot');
				}
				// If carrot is at bottom, move it to top
				else if ($('#menulist li:last').hasClass('carrot')) {
					$('#menulist li:last').removeClass('carrot');
					$('#menulist li:first').addClass('carrot');
				// If carrot exists, move it down
				} else {
					$('.carrot').removeClass('carrot').next().addClass('carrot');
				}
				// stop propagation
				evt.preventDefault();
			}
			return false;
		});

		// Left arrow
		$.hotkeys.add('left', {propagate:true, disableInInput: true}, function(){
			$('.carrot ul li.carrot').removeClass('carrot');
		});

		// Up arrow
		$.hotkeys.add('up', {propagate:true, disableInInput: true}, function(){
			if ($('#menulist .carrot ul li.carrot').length !== 0) {
				if ($('#menulist .carrot ul li:first').hasClass('carrot')) {
					$('#menulist .carrot ul li:first').removeClass('carrot');
					$('#menulist .carrot ul li:last').addClass('carrot');
				// If carrot exists, move it up
				} else {
					$('#menulist .carrot ul li.carrot').removeClass('carrot').prev().addClass('carrot');
				}
			} else if ($('#menu').hasClass('hovering') === true) {
				// If carrot doesn't exist, select last item
				if (!$('#menulist li').hasClass('carrot')) {
					$('#menulist li:last').addClass('carrot');
				}
				// If carrot is at top, move it to bottom
				else if ($('#menulist li:first').hasClass('carrot')) {
					$('#menulist li:first').removeClass('carrot');
					$('#menulist li:last').addClass('carrot');
				// If carrot exists, move it up
				} else {
					$('.carrot').removeClass('carrot').prev().addClass('carrot');
				}
			} else {
				return false;
			}
		});

		// Right arrow
		$.hotkeys.add('right', {propagate:true, disableInInput: true}, function(){
			if ($('.carrot').hasClass('submenu') === true) {
				$('.carrot ul li:first').addClass('carrot');
			} else {
				return false;
			}
		});

		// Left arrow
		$.hotkeys.add('left', {propagate:true, disableInInput: true}, function(){
			$('.carrot ul li.carrot').removeClass('carrot');
		});

		// Enter & Carrot
		$.hotkeys.add('return', { propagate:true, disableInInput: true }, function() {
			if ($('#menu').hasClass('hovering') === true && $('.carrot')) {
				if($('.carrot .carrot').length > 0) {
					carrot= $('.carrot .carrot a').eq(0);
				} else {
					carrot= $('.carrot a').eq(0);
				}
				theMenu.blinkCarrot(carrot.parent());
				location = carrot.attr('href');
			} else {
				return false;
			}
		});

		// Page hotkeys
		$('#menu ul li').each(function() {
			var hotkey = $('a span.hotkey', this).eq(0).text();
			var href = $('a', this).attr('href');
			var owner = $(this);
			var blinkSpeed = 100;

			if (hotkey) {
				$.hotkeys.add(hotkey, { propagate: true, disableInInput: true }, function() {
					if ($('#menu').hasClass('hovering') === true) {
						if (owner.hasClass('submenu')) {
							$('.carrot').removeClass('carrot');
							owner.addClass('carrot');
						} else if (owner.hasClass('sub')) {
							// Exists in a submenu
							if ($('#menu li.carrot li.hotkey-' + hotkey).length !== 0) {
								// Hotkey exists in an active menu, use that
								location = $('#menu li.carrot li.hotkey-' + hotkey + ' a').attr('href');
								theMenu.blinkCarrot($('#menu li.carrot li.hotkey-' + hotkey));
							} else {
								// Use the first occurance of hotkey, but expand the parent first
								user = $('#menu li li.hotkey-' + hotkey).eq(0);
								user.parent().parent().addClass('carrot');
								location = $('a', user).attr('href');
								theMenu.blinkCarrot(user);
							}
						} else {
							location = href;
							theMenu.blinkCarrot(owner);
						}

					} else {
						return false;
					}
				});
			}
		});

		// View blog hotkey
		$.hotkeys.add('v', { propagate: true, disableInInput: true }, function() {
			location = $('#site').attr('href');
		});

		// Display hotkeys
		$('#menu a .hotkey').addClass('enabled');

		$('#menu ul li a').click( function() {
			theMenu.blinkCarrot(this);
		});

		// If menu is open and mouse is clicked outside menu, close menu.
		$('html').click(function() {
			if ($('#menu #menulist').css('display') == 'block') {
				dropButton.hideMenu();
			}
		});
	},
	blinkCarrot: function(owner) {
		spinner.start();
		var blinkSpeed = 100;
		$(owner).addClass('carrot').addClass('blinking').fadeOut(blinkSpeed).fadeIn(blinkSpeed).fadeOut(blinkSpeed).fadeIn(blinkSpeed, function() {
			dropButton.hideMenu();
		});
	}
};

// LIVESEARCH
var liveSearch = {
	init: function() {
		liveSearch.input = $('.search input');
		liveSearch.searchPrompt = liveSearch.input.attr('placeholder');
		liveSearch.prevSearch = liveSearch.getSearchText();

		liveSearch.input
			.focus( function() {
				if ( $.trim( liveSearch.input.val() ) == liveSearch.searchPrompt ) {
					liveSearch.input.val('');
				}
			})
			.blur( function () {
				if ( $.trim( liveSearch.input.val() ) === '' ) {
					liveSearch.input.val( liveSearch.searchPrompt );
				}
			})
			.keyup( function( event ) {
				var code = event.keyCode;

				if ( code == 27 ) { // ESC key
					liveSearch.input.val('');
					$('.special_search a').removeClass('active');
				}

				if ( code != 13 ) { // anything but enter
					if (liveSearch.timer) {
						clearTimeout(liveSearch.timer);
					}
					liveSearch.timer = setTimeout( liveSearch.doSearch, 500);
				}
			})
			.submit( liveSearch.doSearch );

	},
	searchprompt: '',
	timer: null,
	prevSearch: '',
	input: null,
	doSearch: function() {
		if ( liveSearch.getSearchText() == liveSearch.prevSearch ) {return;}

		spinner.start();

		liveSearch.prevSearch = liveSearch.getSearchText();
		itemManage.fetch( 0, 20, true );
	},
	getSearchText: function() {
		var search_txt = $.trim( liveSearch.input.val() );
		if ( search_txt == liveSearch.searchPrompt ) {
			return '';
		}
		return search_txt;
	}
};

// SEARCH CRITERIA TOGGLE
function toggleSearch() {
	var re = new RegExp('\\s*' + $(this).attr('href').substr(1), 'gi');
	if ($('#search').val().match(re)) {
		$('#search').val(liveSearch.getSearchText().replace(re, ''));
		$(this).removeClass('active');
	}
	else {
		$('#search').val(liveSearch.getSearchText() + ' ' + $(this).attr('href').substr(1));
		$(this).addClass('active');
	}
	liveSearch.doSearch();
	return false;
}

// RESIZABLE TEXTAREAS
$.fn.resizeable = function(){

	this.each(function() {
		function doDrag(ev){
			textarea.height(Math.max(offset + ev.clientY + document.documentElement.scrollTop, 60) + 'px');
			return false;
		}

		function endDrag(ev){
			$(document).unbind('mousemove', doDrag).unbind('mouseup', endDrag);
			textarea.css('opacity', 1.0);
		}

		var textarea = $(this);
		var offset = null;
		var grip = $('

').mousedown(function(ev){
			offset = textarea.height() - (ev.clientY + document.documentElement.scrollTop);
			$(document).mousemove(doDrag).mouseup(endDrag);
		}).mouseup(endDrag);
		var resizer = $('

').css('margin-bottom',$(this).css('margin-bottom'));
		$(this).css('margin-bottom', '0px').wrap(resizer).parent().append(grip);
	});
};

// RANGE SELECT - Courtesy of Barney Boisvert at http://www.barneyb.com/barneyblog/projects/jquery-checkbox-range-selection/
$.fn.rangeSelect = function() {
	var lastCheckbox = null;
	var $spec = this;

	$spec.bind("click", function(e) {
		if (lastCheckbox !== null && e.shiftKey) {
			$spec.slice(
				Math.min($spec.index(lastCheckbox), $spec.index(e.target)),
				Math.max($spec.index(lastCheckbox), $spec.index(e.target)) + 1)
			.attr({checked: e.target.checked ? "checked" : ""});
		}
		lastCheckbox = e.target;
	});
	return $spec;
};

// Home-made pseudo-classes
function findChildren() {
	$('div > .item:first-child, .modulecore .item:first-child, ul li:first-child').addClass('first-child');
	$('div > .item:last-child, .modulecore .item:last-child, ul li:last-child').addClass('last-child');
}

// code for making inline labels which then move above form inputs when the inputs have content
var labeler = {
	focus: null,
	init: function() {
		$('label.incontent').each( function() {
			labeler.check(this);

			// focus on the input when clicking on the label
			$(this).click(function() {
				$('#' + $(this).attr('for')).focus();
			});
		});

		$('.islabeled').focus( function() {
			labeler.focus = $(this);
			labeler.aboveLabel($(this));
		}).blur(function(){
			labeler.focus = null;
			labeler.check($('label[for='+$(this).attr('id')+']'));
		});
	},
	check: function(label) {
		var target = $('#' + $(label).attr('for'));

		if ( !target ) {return;}

		if ( labeler.focus !== null && labeler.focus.attr('id') == target.attr('id') ) {
			labeler.aboveLabel(target);
		}
		else if ( target.val() === '' ) {
			labeler.overLabel(target);
		}
		else {
			labeler.aboveLabel(target);
		}
	},
	aboveLabel: function(el) {
		$(el).addClass('islabeled');
		$('label[for=' + $(el).attr('id') + ']').removeClass('overcontent').removeClass('hidden').addClass('abovecontent');
	},
	overLabel: function(el) {
		$(el).addClass('islabeled');
		// for Safari only, we can simply hide labels when we have provided a
		// placeholder attribute
		if ($.browser.safari && $(el).attr('placeholder') ) {
			$('label[for=' + $(el).attr('id') + ']').addClass('hidden');
		}
		else {
			$('label[for=' + $(el).attr('id') + ']').addClass('overcontent').removeClass('abovecontent');
		}
	}
};

// EDITOR INTERACTION
habari.editor = {
	insertSelection: function(value) {
		var contentel = $('#content')[0];
		if ('selectionStart' in contentel) {
			var content = $('#content').val();
			$('#content').val(content.substr(0, contentel.selectionStart) + value + contentel.value.substr(contentel.selectionEnd, content.length));
		}
		else if (document.selection) {
			contentel.focus();
			document.selection.createRange().text = value;
		}
		else {
			$('#content').filter('.islabeled')
				.val(value);
		}
		$('label[for=content].overcontent').addClass('abovecontent').removeClass('overcontent').hide();
	},
	getContents: function() {
		return $('#content').val();
	},
	setContents: function(contents) {
		$('#content').filter('.islabeled')
			.val('')
			.removeClass('islabeled');
		$('#content').val(contents);
	},
	getSelection: function(contents) {
		if ($('#content').val() === '') {
			return '';
		}
		else {
			var contentel = $('#content')[0];
			if ('selectionStart' in contentel) {
				return $('#content').val().substr(contentel.selectionStart, contentel.selectionEnd - contentel.selectionStart);
			}
			else if (document.selection) {
				contentel.focus();
				var range = document.selection.createRange();
				if ( range === undefined ) {
					return '';
				}
				return range.text;
			}
			else {
				return $('#content').val();
			}
		}
	}
};

// ON PAGE STARTUP
var tagskeyup;

$(window).load( function() {
	// initialize the timeline after window load to make sure CSS has been applied to the DOM
	timeline.init();

	// Icons only for thin-width clients -- Must be run here to work properly in Safari
	if ($('#title').width() < ($('#mediatabs li').length * $('#mediatabs li').width())) {
		$('#mediatabs').addClass('iconify');
	}
});

$(document).ready(function(){
	// Initialize all sub-systems
	dropButton.init();
	theMenu.init();
	dashboard.init();
	itemManage.init();
	pluginManage.init();
	liveSearch.init();
	findChildren();
	navigationDropdown.init();
	labeler.init();

	// fix autofilled passwords overlapping labels
	$(window).load(function(){
		window.setTimeout(function(){
			labeler.check($('label[for=habari_password]'));
		}, 200);
	});

	// Alternate the rows' styling.
	$("table").each( function() {
		$("tr:odd", this).not(".even").addClass("odd");
		$("tr:even", this).not(".odd").addClass("even");
	});

	// Prevent all checkboxes to be unchecked.
	$(".search_field").click(function(){
		if ($(".search_field:checked").size() === 0 && !$(this).attr('checked')) {
			return false;
		}
	});

	// Convert these links into buttons
	$('a.link_as_button').each(function(){
		$(this).after('<button onclick="location.href=\'' + $(this).attr('href') + '\';return false;">' + $(this).html() + '</button>').hide();
	});

	/* Make Textareas Resizable */
	$('.resizable').resizeable();

	/* Init Tabs, using jQuery UI Tabs */
	$('.tabcontrol').parent().tabs({ fx: { height: 'toggle', opacity: 'toggle' }, selected: -1, collapsible: true });

	// LOGIN: Focus cursor on 'Name'.
	$('body.login #habari_username').focus();

	// SEARCH: Set default special search terms and assign click handler
	$('.special_search a')
		.click(toggleSearch)
		.each(function(){
			var re = new RegExp($(this).attr('href').substr(1));
			if ($('#search').val().match(re)) {
				$(this).addClass('active');
			}
		});

	// Take care of AJAX calls
	$('body').bind('ajaxSuccess', function(event, req, opts){
		if (opts.dataType == 'json') {
			eval('var cc=' + req.responseText);
			if (cc.callback) {
				cc.callback();
			}
		}
	});

	// Init shift-click for range select on checkboxes
	$('input.checkbox').rangeSelect();

	// theme popups
	$('.themethumb').click(function(e){
		var themeinfo = $(this).siblings('.themeinfo')
		if(e.clientX > $(window).width()/2) themeinfo.addClass('right'); else themeinfo.removeClass('right');
		$('.themeinfo').not(themeinfo).hide();
		themeinfo.toggle();
	});
});

function resetTags() {
	var current = $('#tags').val();

	$('#tag-list li').each(function(){
		replstr = new RegExp('\\s*"?' + $( this ).text() + '"?\\s*', "gi");
		if (current.match(replstr)) {
			$(this).addClass('clicked');
		}
		else {
			$(this).removeClass('clicked');
		}
	});

	if (current.length === 0 && !$('#tags').hasClass('focus')) {
		$('label[for=tags]').addClass('overcontent').removeClass('abovecontent').show();
	}

}


code:
habari.media = {

	showdir: function (path, el, container) {
		$('.media_browser', container).show();
		$('.media_panel', container).hide();
		if ( !el && !container ) {
			container = $('.mediasplitter:visible');
		}
		if ( el && !container ) {
			container = $(el).parents('.mediasplitter');
		}
		if ( $('.pathstore', container).html() != path || $('.pathstore.toload', container).size() ) {
			$.ajax({
				type: "POST",
				url: habari.url.habari + '/admin_ajax/media',
				data: {path: path},
				dataType: 'json',
				beforeSend: function() {
					spinner.start();
				},
				success: function(result) {

					habari.media.unqueueLoad();
					$('.pathstore', container).html(result.path);

					// If we got dirs to show
					if (result.dirs != '') {
						var output = '

';

						// Build path
						for (var dir in result.dirs) {
							output += '
' + result.dirs[dir].title + '
';
						}

						output += '

';
					}

					// If path changed
					if (el) {
						$($(el).parents('.media_dirlevel')).nextAll().remove();
						$(el).parents('.media_dirlevel').after(output);
					} else if ($('.mediadir', container).html() == '') {
						$('.mediadir', container).html(output);
					}

					// Build Media List
					output = '
';
					var first = ' first';
					var mediaCount = 0;
					habari.media.assets = result.files;

					for (var file in result.files) {
						stats = '';
						output += '
' + file + '';

						if (result.files[file].filetype && habari.media.preview[result.files[file].filetype]) {
							output += habari.media.preview[result.files[file].filetype](file, result.files[file]);
						} else {
							output += habari.media.preview._(file, result.files[file]);
						}

						output += '
'
						if (result.files[file].filetype && habari.media.output[result.files[file].filetype]) {
							for (method in habari.media.output[result.files[file].filetype]) {
								output += '
' + method.replace('_', ' ', 'g') + '
';
							}
						} else {
							for (method in habari.media.output._) {
								output += '
' + method.replace('_', ' ', 'g') + '
';
							}
						}
						output += '
';

						output += '
';
						first = '';
						mediaCount++;
					}

					output += '

';

					$('.mediaphotos', container).html(output);
					$('.media').dblclick(function(){
						habari.media.insertAsset(this);
					});
					$('.media_controls ul li', container).remove();
					$('.media_controls ul', container).append(result.controls);
					labeler.init();

					spinner.stop();

					// When first opened, load the first directory automatically, but only if there are no files in the root
//					if ($('.mediaphotos .media', container).length == 0 && $('.media_dirlevel:first-child li.active', container).length == 0) {
//						$('.media_dirlevel:last-child li:first-child', container).click();
//					}

					$('.media img').addClass('loading');

					// As each image loads
					$(".media img").bind('load',function() {
						$(this)
							.removeClass('loading')
							.siblings('div').width($(this).width()+2)
						});

					findChildren();
				}}
			);
		}
	},

	clickdir: function(el, path) {
		// Clear current media items
		$('.mediaphotos').html('

')

		// Get new media items
		this.showdir(path, el);

		// Mark the current directory
		$(el).addClass('active').siblings().removeClass('active')

		return false;
	},

	showpanel: function (path, panel) {
		$.post(
			habari.url.habari + '/admin_ajax/media_panel',
			{
				path: path,
				panel: panel
			},
			habari.media.jsonpanel,
			'json'
		);
	},

	jsonpanel: function(result) {
		container = $('.mediasplitter:visible');
		$('.media_controls ul li:first', container).nextAll().remove();
		$('.media_controls ul li:first', container).after(result.controls);
		$('.media_panel', container).html(result.panel);
		$('.media_browser', container).hide();
		$('.media_panel', container).show();
	},

	unqueueLoad: function() {
		container = $('.mediasplitter:visible');
		$('.toload', container).removeClass('toload');
	},

	forceReload: function() {
		container = $('.mediasplitter:visible');
		$('.pathstore', container).addClass('toload');
	},

	fullReload: function() {
		container = $('.mediasplitter:visible');
		$('.mediadir', container).html('');
		$('.mediaphotos', container).html('');
		$('.pathstore', container).addClass('toload');
	},

	preview: {
		_: function(fileindex, fileobj) {
			var stats = '';
			return '
#' + fileobj.title + '

 ' + stats + '
';
		}
	},

	output: {
		image_jpeg: {insert_image: function(fileindex, fileobj) {habari.editor.insertSelection('');}},
		image_gif: {insert_image: function(fileindex, fileobj) {habari.editor.insertSelection('');}},
		image_png: {insert_image: function(fileindex, fileobj) {habari.editor.insertSelection('');}},
		audio_mpeg3: {insert_link: function(fileindex, fileobj) {habari.editor.insertSelection('' + fileobj.title + '');}},
		video_mpeg: {insert_link: function(fileindex, fileobj) {habari.editor.insertSelection('' + fileobj.title + '');}},
		audio_wav: {insert_link: function(fileindex, fileobj) {habari.editor.insertSelection('' + fileobj.title + '');}},
		application_x_shockwave_flash: {insert_link: function(fileindex, fileobj) {habari.editor.insertSelection('' + fileobj.title + '');}},
		_: {insert_link: function(fileindex, fileobj) {habari.editor.insertSelection('' + fileobj.title + '');}}
	},

	submitPanel: function(path, panel, form, callback) {
		var query = $(form).serializeArray();
		query.push({name: 'path', value: path});
		query.push({name: 'panel', value: panel});

		$.post(
			habari.url.habari + '/admin_ajax/media_panel',
			query,
			function(result) {
				$('.media_panel').html(result.panel);
				if (callback != '') {
					eval(callback);
				}
			},
			'json');
	},

	insertAsset: function(asset) {
		var id = $('.foroutput', asset).html();
		if(this.assets[id].filetype && habari.media.output[this.assets[id].filetype]) {
			fns = habari.media.output[this.assets[id].filetype];
		}
		else {
			fns = habari.media.output._;
		}
		if(jQuery.makeArray(fns).length == 1) {
			for(var fname in fns) {
				fns[fname](id, this.assets[id]);
			}
		}
		else {
			habari.media.multioutput(fns, id, this.assets[id]);
		}
	},

	multioutput: function(fns, id, asset) {
		/* @todo Create interface for multiple output methods on a single file type */
		for(var fname in fns) {
			fns[fname](id, this.assets[id]);
			break;
		}
	},

	clearSelections: function() {
		var container = $('.mediasplitter:visible')
		// remove all highlights
		$('.mediadir .directory', container).removeClass('active');
		// remove second level directories
		$('.mediadir .media_dirlevel', $('.mediasplitter:visible')).nextAll().remove()
	}

};

$(document).ready(function(){
	$('#mediatabs').parent().tabs({
		fx: { height: 'toggle', opacity: 'toggle' },
		selected: -1,
		collapsible: true,
		show: function(){
			var tabindex = $(this).tabs( 'option', 'selected' );
			var tab = $('.mediasplitter').eq(tabindex);
			var path = $.trim( $('.pathstore', tab).html() );
			if (path != '') {
				habari.media.showdir( path, null, tab );
				habari.media.unqueueLoad();
			}
			return true;
		}
	});
});


code:
<!DOCTYPE HTML>

	<title><?php printf( _t('Login to %s'), Options::get( 'title' ) ); ?></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<?php	Stack::add('admin_stylesheet', array(Site::get_url('admin_theme') . '/css/admin.css', 'screen'), 'admin'); ?>

	<?php
		Plugins::act( 'admin_header', $this );
		Stack::out( 'admin_header_javascript', array('Stack', 'scripts') );
		Stack::out( 'admin_stylesheet', array('Stack', 'styles') );
	?>

<a href="<?php Site::out_url('habari'); ?>" title="<?php _e('Go to Site'); ?>"><?php Options::out('title'); ?>

			<?php Plugins::act( 'theme_loginform_before' ); ?>
				<form method="post" action="<?php URL::out( 'auth', array( 'page' => 'login' ) ); ?>">

						<?php _e('Name'); ?><input type="text" name="habari_username" id="habari_username"<?php if(isset( $habari_username )) { ?> value="<?php echo Utils::htmlspecialchars( $habari_username ); ?>"<?php } ?> placeholder="<?php _e('name'); ?>" class="styledformelement">

						<?php _e('Password'); ?><input type="password" name="habari_password" id="habari_password" placeholder="<?php _e('password'); ?>" class="styledformelement">

					<?php Plugins::act( 'theme_loginform_controls' ); ?>

						<input class="submit" type="submit" name="submit_button" value="<?php _e('Login'); ?>">

						<input class="submit" type="submit" name="submit_button" value="<?php _e('Reset password'); ?>">

				</form>
				<?php Plugins::act( 'theme_loginform_after' ); ?>

<?php
	Plugins::act( 'admin_footer', $this );
	Stack::out( 'admin_footer_javascript', ' '."\r\n" );
?>

<?php
	include ('db_profiling.php');
?>


code:
<?php include_once( 'header.php' ); ?>

<form method="post" action="<?php URL::out('admin', array( 'page' => 'logs' ) ); ?>" class="buttonform">

	« <?php _e('Older'); ?>
	<?php _e('0-0 of 0'); ?>
	<input type="search" name='search' placeholder="<?php _e('Type and wait to search any log entry component'); ?>" value="<?php echo Utils::htmlspecialchars($search); ?>">

	<?php _e('Newer'); ?> »

	<?php if ( isset($years) ) { ?>

			<?php $theme->display( 'timeline_items' )?>

<?php } ?>

	<input type="hidden" name="nonce" id="nonce" value="<?php echo $wsse['nonce']; ?>">
	<input type="hidden" name="timestamp" id="timestamp" value="<?php echo $wsse['timestamp']; ?>">
	<input type="hidden" name="PasswordDigest" id="PasswordDigest" value="<?php echo $wsse['digest']; ?>">

		<input type="checkbox" id="master_checkbox" name="master_checkbox">
		<?php _e('None selected'); ?>

		<?php $page_actions = array(
			'delete' => array('action' => 'itemManage.update(\'delete\');return false;', 'title' => _t('Delete Selected'), 'label' => _t('Delete Selected') ),
			'purge' => array('action' => 'itemManage.update(\'purge\');return false;', 'title' => _t('Purge Logs'), 'label' => _t('Purge Logs') ),
		);
		$page_actions = Plugins::filter('logs_manage_actions', $page_actions);
		foreach( $page_actions as $page_action ) : ?>

<a href="*" onclick="<?php echo $page_action['action']; ?>" title="<?php echo $page_action['title']; ?>"><?php echo $page_action['label']; ?>

		<?php endforeach; ?>

		<?php _e('Date & Time'); ?>
		<?php _e('User'); ?>
		<?php _e('IP'); ?>
		<?php _e('Module'); ?>
		<?php _e('Type'); ?>
		<?php _e('Severity'); ?>
		<?php _e('Message'); ?>

		<?php echo Utils::html_select('date', $dates, $date, array( 'class'=>'pct90')); ?>
		<?php echo Utils::html_select('user', $users, $user, array( 'class'=>'pct90')); ?>
		<?php echo Utils::html_select('address', $addresses, $address, array( 'class'=>'pct90')); ?>
		<?php echo Utils::html_select('module', $modules, $module, array( 'class'=>'pct90')); ?>
		<?php echo Utils::html_select('type', $types, $type, array( 'class'=>'pct90')); ?>
		<?php echo Utils::html_select('severity', $severities, $severity, array( 'class'=>'pct90')); ?>
		<input type="submit" name="filter" value="<?php _e('Filter'); ?>">

	<?php if(isset($years)) { ?>

		<?php $theme->display('logs_items'); ?>

	<?php } else { ?>

	 <?php _e('There are no logs to be displayed at this time.'); ?>

	<?php } ?>

		<input type="checkbox" id="master_checkbox_2" name="master_checkbox_2">
		<?php _e('None selected'); ?>

		<?php $page_actions = array(
			'delete' => array('action' => 'itemManage.update(\'delete\');return false;', 'title' => _t('Delete Selected'), 'label' => _t('Delete Selected') ),
			'purge' => array('action' => 'itemManage.update(\'purge\');return false;', 'title' => _t('Purge Logs'), 'label' => _t('Purge Logs') ),
		);
		$page_actions = Plugins::filter('logs_manage_actions', $page_actions);
		foreach( $page_actions as $page_action ) : ?>

<a href="*" onclick="<?php echo $page_action['action']; ?>" title="<?php echo $page_action['title']; ?>"><?php echo $page_action['label']; ?>

		<?php endforeach; ?>

</form>

<?php include('footer.php'); ?>


code:
<?php foreach ( $logs as $log ): ?>

		<input type="checkbox" class="checkbox" name="checkbox_ids[<?php echo $log->id; ?>]" id="checkbox_ids[<?php echo $log->id; ?>]">
		<?php $log->timestamp->out( "M j, Y" ); ?> · <?php $log->timestamp->out( "H:i" ); ?>

			<?php if ( $log->user_id ) {
				if ( $user = User::get_by_id( $log->user_id ) ) {
					echo $user->displayname;
				}
				else {
					echo $log->user_id;
				}
			} ?>

		<?php echo long2ip($log->ip); ?>
		<?php echo $log->module; ?>
		<?php echo $log->type; ?>
		<?php echo $log->severity; ?>
		<?php echo Utils::truncate(Utils::htmlspecialchars($log->message), 40, false); ?>
		<?php echo Utils::htmlspecialchars($log->message); ?>

<?php endforeach; ?>


code:
<?php include('header.php');?>

		<select name="navigationdropdown" onchange="navigationDropdown.filter();" tabindex="1">
			<option value="all"><?php _e('All options'); ?></option>
		</select>

		<?php _e('or'); ?>

		<input type="search" id="search" placeholder="<?php _e('search settings'); ?>" tabindex="2">

<?php echo $form; ?>

<?php include('footer.php');?>


code:
<?php if ( $plugin['debug'] ): ?>

<?php printf( _t('The plugin file %s had syntax errors and could not load.'), $plugin['file'] ); ?>

		<div style="display:none;" id="error_<?php echo $plugin['plugin_id']; ?>"><?php echo $plugin['error']; ?>

<a href="#" onclick="$('#error_<?php echo $plugin['plugin_id']; ?>').show();"><?php _e('Show Error'); ?>

<?php elseif ( !isset($plugin['info']) ): ?>

<?php printf( _t('The plugin file %s is a legacy plugin, and does not include an XML info file.'), $plugin['file'] ); ?>

<?php else: ?>

<div class="item plugin clear" id="plugin_<?php echo $plugin['plugin_id']; ?>">

		<a href="<?php echo $plugin['info']->url; ?>" class="plugin"><?php echo $plugin['info']->name; ?> <?php echo $plugin['info']->version; ?>
		<?php _e('by'); ?>

		<?php
		$authors = array();
		foreach ( $plugin['info']->author as $author ) {
			$authors[] = isset( $author['url'] ) ? '' . $author . '' : $author;
		}
		echo Format::and_list( $authors, ', ', '' . _t( ' and ' ) . '');
		?>

		<?php if ( isset($plugin['help']) ): ?>
		<a class="help" href="<?php echo $plugin['help']['url']; ?>">?
		<?php endif; ?>

			<?php foreach ( $plugin['actions'] as $plugin_action => $action ) : ?>

<a href="<?php echo Utils::htmlspecialchars( $action['url'] ); ?>"><?php echo $action['caption']; ?>

			<?php endforeach; ?>

		<?php if ( isset($plugin['update']) ): ?>

<?php _e('v1.1 Update Available Now'); ?>

		<?php endif; ?>

		<?php if ( $plugin['active'] != TRUE && isset($plugin['missing']) ): ?>

<?php _e('This plugin cannot be activated because the following features were not present:'); ?>

			<?php foreach ( $plugin['missing'] as $feature => $url): ?>

<?php echo ($url != '') ? sprintf('%s', $url, $feature) : $feature; ?>

			<?php endforeach; ?>

		<?php endif; ?>

<?php echo $plugin['info']->description; ?>

	<div class="pluginhelp"<?php if ( $helpaction == '_help' ): ?> class="active"<?php endif; ?>>
		<?php
		if ( Plugins::is_loaded((string) $plugin['info']->name) ) {
			Plugins::act( 'plugin_ui', $plugin['plugin_id'], '_help' );
		}
		elseif ( isset($plugin['info']->help) ) {
			foreach ( $plugin['info']->help as $help ) {
				if ( (string)$help['name'] == '' ) {
					echo  '
' . $help->value . '
';
				}
			}
		} ?>

	<?php if ( isset($this->engine_vars['configure']) && ($configure == $plugin['plugin_id']) ): ?>

		<?php Plugins::act( 'plugin_ui', $configure, $configaction ); ?>
		<a class="link_as_button" href="<?php URL::out( 'admin', 'page=plugins' ); ?>"><?php _e('Close'); ?>

	<?php endif; ?>

<?php endif; ?>


code:
<?php include('header.php'); ?>

		<select name="navigationdropdown" onchange="navigationDropdown.filter();" tabindex="1">
			<option value="all"><?php _e('All plugins'); ?></option>
			<?php if ( isset($config_plugin) ): ?>
				<option value="configureplugin"><?php echo $config_plugin_caption; ?></option>
			<?php endif; ?>
			<?php if ( count($active_plugins) > 0 ): ?>
				<option value="activeplugins"><?php _e('Active Plugins'); ?></option>
			<?php endif; ?>
			<?php if ( count($inactive_plugins) > 0 ): ?>
				<option value="inactiveplugins"><?php _e('Inactive Plugins'); ?></option>
			<?php endif; ?>
		</select>

		<?php _e('or'); ?>

		<input type="search" id="search" placeholder="<?php _e('search plugins'); ?>" tabindex="2">

<?php
if ( isset($config_plugin) ): ?>

<?php echo $config_plugin['info']->name; ?> · <?php echo $config_plugin_caption; ?>

	<?php

	$theme->config = true;
	$theme->plugin = $config_plugin;
	$theme->display('plugin');

	$theme->config = false;

	?>

<?php endif; ?>

<?php if ( count($active_plugins) > 0 ): ?>

<?php _e('Active Plugins'); ?>

	<?php
	foreach ( $active_plugins as $plugin ) {
		$theme->plugin = $plugin;
		$theme->display('plugin');
	}
	?>

<?php endif; ?>

<?php if ( count($inactive_plugins) > 0 ): ?>

<?php _e('Inactive Plugins'); ?>

	<?php
	foreach ( $inactive_plugins as $plugin) {
		$theme->plugin = $plugin;
		$theme->display('plugin');
	}
	?>

<?php endif; ?>

<?php if ( isset($plugin_loader) && $plugin_loader != '' ): ?>
<?php echo $plugin_loader; ?>
<?php endif; ?>

<?php include('footer.php'); ?>


code:
<?php include('header.php');?>

	« <?php _e('Older'); ?>
	<?php _e('no results'); ?>

		<input id="search" type="search" placeholder="<?php _e('Type and wait to search'); ?>" value="<?php echo Utils::htmlspecialchars($search_args); ?>">

			<?php foreach ( $special_searches as $text => $term ): ?>

<a href="#<?php echo $term; ?>" title="<?php printf( _t('Filter results for \'%s\''), $text ); ?>"><?php echo $text; ?>

			<?php endforeach; ?>

	<?php _e('Newer'); ?> »

			<?php $theme->display( 'timeline_items' )?>

	<input type="hidden" name="nonce" id="nonce" value="<?php echo $wsse['nonce']; ?>">
	<input type="hidden" name="timestamp" id="timestamp" value="<?php echo $wsse['timestamp']; ?>">
	<input type="hidden" name="PasswordDigest" id="PasswordDigest" value="<?php echo $wsse['digest']; ?>">

		<input type="checkbox" id="master_checkbox" name="master_checkbox">
		<?php _e('None selected'); ?>

		<?php $page_actions = array(
			'delete' => array('action' => 'itemManage.update(\'delete\');return false;', 'title' => _t('Delete Selected'), 'label' => _t('Delete Selected') ),
		);
		$page_actions = Plugins::filter('posts_manage_actions', $page_actions);
		foreach( $page_actions as $page_action ) : ?>

<a href="*" onclick="<?php echo $page_action['action']; ?>" title="<?php echo $page_action['title']; ?>"><?php echo $page_action['label']; ?>

		<?php endforeach; ?>

<?php $theme->display('posts_items'); ?>

		<input type="checkbox" id="master_checkbox_2" name="master_checkbox_2">
		<?php _e('None selected'); ?>

		<?php $page_actions = array(
			'delete' => array('action' => 'itemManage.update(\'delete\');return false;', 'title' => _t('Delete Selected'), 'label' => _t('Delete Selected') ),
		);
		$page_actions = Plugins::filter('posts_manage_actions', $page_actions);
		foreach( $page_actions as $page_action ) : ?>

<a href="*" onclick="<?php echo $page_action['action']; ?>" title="<?php echo $page_action['title']; ?>"><?php echo $page_action['label']; ?>

		<?php endforeach; ?>

<?php include('footer.php');?>


code:
<?php if ( count($posts) != 0 ) :
	foreach ( $posts as $post ) :
		$post_permissions = $post->get_access();
?>
<div class="item clear <?php echo $post->statusname; ?>" id="post_<?php echo $post->id; ?>">

		<?php if ( ACL::access_check( $post_permissions, 'delete' ) ) { ?>

			<input type="checkbox" class="checkbox" name="checkbox_ids[<?php echo $post->id; ?>]" id="checkbox_ids[<?php echo $post->id; ?>]">

		<?php } ?>

			<a href="<?php echo URL::out('admin', 'page=publish&id=' . $post->id); ?>" class="title" title="<?php _e('Edit \'%s\'', array( Utils::htmlspecialchars( $post->title ) ) ) ?>"><?php echo ($post->title == '') ? ' ' : Utils::htmlspecialchars( $post->title ); ?>

		<a href="<?php URL::out('admin', array('page' => 'posts', 'type' => $post->content_type, 'status' => $post->status ) ); ?>" title="<?php _e('Search for other %s items', array( $post->statusname ) ); ?>"><?php echo $post->statusname; ?>
		<?php _e('by'); ?> <a href="<?php URL::out('admin', array('page' => 'posts', 'user_id' => $post->user_id, 'type' => $post->content_type, 'status' => 'any') ); ?>" title="<?php _e('Search for other items by %s', array( $post->author->displayname ) ) ?>"><?php echo $post->author->displayname; ?>
		<?php _e('on'); ?> <a href="<?php URL::out('admin', array('page' => 'posts', 'type' => $post->content_type, 'year_month' => $post->pubdate->get('Y-m') ) ); ?>" title="<?php _e('Search for other items from %s', array( $post->pubdate->get( 'M, Y' ) ) ); ?>"><?php $post->pubdate->out('M j, Y'); ?>
		<?php _e('at'); ?> <?php $post->pubdate->out('H:i'); ?>

			<?php $actions = array(
				'edit' => array('url' => URL::get('admin', 'page=publish&id=' . $post->id), 'title' => sprintf( _t('Edit \'%s\''), $post->title ), 'label' => _t('Edit'), 'permission' => 'edit' ),
				'view' => array('url' => $post->permalink . '?preview=1', 'title' => sprintf( _t('View \'%s\''), $post->title ), 'label' => _t('View') ),
				'remove' => array('url' => 'javascript:itemManage.remove('. $post->id . ', \'post\');', 'title' => _t('Delete this item'), 'label' => _t('Delete'), 'permission' => 'delete' )
			);
			$actions = Plugins::filter('post_actions', $actions, $post);
			foreach( $actions as $action ) :
			?>
				<?php if ( !isset( $action['permission'] ) || ACL::access_check( $post_permissions, $action['permission'] ) ) { ?>

<a href="<?php echo $action['url']; ?>" title="<?php echo $action['title']; ?>"><?php echo $action['label']; ?>

				<?php } ?>
			<?php endforeach; ?>

	<?php echo MultiByte::substr( strip_tags( $post->content ), 0, 250); ?>…

<?php endforeach;
else : ?>

<?php _e('No posts could be found to match the query criteria.'); ?>

<?php endif; ?>


code:
<?php include('header.php'); ?>

<div class="create">

	<?php $form->out(); ?>

</div>

<script type="text/javascript">
$(document).ready(function(){
	$('.container').addClass('transparent');
	// If this post has been saved, add a delete button and a nonce for authorising deletes
	<?php if ( isset( $post->id ) && ( $post->id != '' ) && ACL::access_check( $post->get_access(), 'delete' ) ) : ?>
	$('.container.buttons').prepend($('<input type="button" id="delete" class="button delete" tabindex="6" value="<?php _e('Delete'); ?>">'));
	$('#delete').click(function(){
		$('#create-content')
			.append($('<input type="hidden" name="nonce" value="<?php echo $wsse['nonce']; ?>"><input type="hidden" name="timestamp" value="<?php echo $wsse['timestamp']; ?>"><input type="hidden" name="digest" value="<?php echo $wsse['digest']; ?>">'))
			.attr('action', '<?php URL::out( 'admin', array('page' => 'delete_post', 'id' => $post->id )); ?>')
			.submit();
	});
	<?php endif; ?>

	// If the post hasn't been published, add a publish button
	<?php
		$show_publish = ( $post->id == 0 && User::identify()->can_any( array( 'own_posts' => 'create', 'post_any' => 'create', 'post_' . Post::type_name( $post->content_type ) => 'create' ) ) ) || ( $post->id != 0 && ACL::access_check( $post->get_access(), 'edit' ) );
		if ( isset( $statuses['published'] ) && $post->status != $statuses['published'] && $show_publish ) :
	?>
	$('.container.buttons').prepend($('<input type="button" id="publish" class="button publish" tabindex="5" value="<?php _e('Publish'); ?>">'));
	$('#publish').click( function() {
		$('#status').val(<?php echo $statuses['published']; ?>);
	});
	<?php endif; ?>

	// Submit when the publish button is clicked.
	$('#publish').click( function() {
		$('#create-content').submit();
	});

	$('#create-content').submit(function(){
		$('.check-change').each(function() {
			$(this).data('checksum', crc32($(this).val()));
		});
	});

	$('.check-change').each(function() {
		$(this).data('checksum', crc32($(this).val()));
	});

	window.onbeforeunload = function(){
		changed = false;
		$('.check-change').each(function() {
			if ($(this).data('checksum') != crc32($(this).val())) {
				changed = true;
			}
		});
		if (changed) {
			spinner.start(); spinner.stop();
			return '<?php
				// Note to translators: the 'new-line character' is an actual "\n" not a new-line character
				_e('You did not save the changes you made. \nLeaving this page will result in the lose of data.');
				?>';
		}
	};

});
</script>

<?php include('footer.php'); ?>


code:
<?php $admin_title = _t( 'System Information' ); ?>

<?php include_once( 'header.php' ); ?>

<?php _e( "System Information" ); ?>

	<?php $plaintext_output = _t( "SYSTEM INFORMATION\n" ); ?>

	<?php foreach ( $sysinfo as $key => $value ) : ?>

			<?php echo $key;
				$plaintext_output .= $key; ?>
			<?php echo $value;
				$plaintext_output .= ": $value\n"; ?>

	<?php endforeach; ?>

<?php _e( "Site Information" ); ?>

	<?php $plaintext_output .= _t( "\nSITE INFORMATION\n" ); ?>

	<?php foreach ( $siteinfo as $key => $value ) : ?>

			<?php echo $key;
				$plaintext_output .= $key; ?>
			<?php echo $value;
				$plaintext_output .= ": $value\n"; ?>

	<?php endforeach; ?>

<?php _e( "User Classes" ); ?>

	<?php $plaintext_output .= _t( "\nUSER CLASSES\n" ); ?>

	<?php foreach ( $classinfo as $fullpath ) : ?>

			<?php echo $fullpath;
				$plaintext_output .= "$fullpath\n"; ?>

	<?php endforeach; ?>
	<?php if ( empty( $fullpath ) ) : ?>

<?php _e( "None found" );
			$plaintext_output .= _t( "None found\n" ); ?>

	<?php endif; ?>

<?php _e( "Plugin Information" ); ?>

	<?php $plaintext_output .= _t( "\nPLUGIN INFORMATION" ); ?>

	<?php foreach ( $plugins as $section => $sec_plugins ): ?>

<?php echo $section;
		$plaintext_output .= "\n/$section/plugins:\n"; ?>

	<?php foreach ( $sec_plugins as $name => $pluginfile ) : ?>

			<?php echo $name;
				$plaintext_output .= $name; ?>
			<?php echo $pluginfile;
				$plaintext_output .= ": $pluginfile\n"; ?>

	<?php endforeach; ?>
	<?php if ( count($sec_plugins) == 0 ) : ?>

<?php _e( "None found" );
			$plaintext_output .= _t( "None found\n" ); ?>

	<?php endif; ?>

	<?php endforeach; ?>

<?php _e( "All Results" ); ?>

	<textarea rows = "<?php echo substr_count( $plaintext_output, "\n" ); ?>"><?php echo $plaintext_output; ?></textarea>

<?php include('footer.php'); ?>


code:
<?php
$max = intval( $max );
function tag_weight( $count, $max )
{
	return round( 10 * log($count + 1) / log($max + 1) );
}
?>
<?php foreach ( $tags as $tag ) : ?>
		<li id="<?php echo 'tag_' . $tag->id ?>" class="item tag wt<?php echo tag_weight($tag->count, $max); ?>">
		 	<input type="checkbox" class="checkbox" name="checkbox_ids[<?php echo $tag->id; ?>]" id="checkbox_ids[<?php echo $tag->id; ?>]"><label for="checkbox_ids[<?php echo $tag->id; ?>]"><?php echo $tag->tag; ?><a href="<?php URL::out( 'admin', array( 'page' => 'posts', 'search' => 'tag:'. $tag->tag_text_searchable) ); ?>" title="<?php echo Utils::htmlspecialchars( _t( 'Manage posts tagged %1$s', array( $tag->tag_text ) ) ); ?>"><?php echo $tag->count; ?>

<?php endforeach; ?>


code:
<?php include('header.php');?>

	<input type="search" id="search" placeholder="<?php _e('Type and wait to search tags'); ?>">

	<?php $theme->display( 'tag_collection' ); ?>

	<input type="hidden" name="nonce" id="nonce" value="<?php echo $wsse['nonce']; ?>">
	<input type="hidden" name="timestamp" id="timestamp" value="<?php echo $wsse['timestamp']; ?>">
	<input type="hidden" name="PasswordDigest" id="PasswordDigest" value="<?php echo $wsse['digest']; ?>">

		<input type="checkbox" id="master_checkbox" name="master_checkbox">
		<?php _e('None selected'); ?>

	<input type="text" class="renametext">

	<input type="button" value="<?php _e('Rename'); ?>" class="rename button">

	<?php _e('or'); ?>

	<input type="button" value="<?php _e('Delete Selected'); ?>" class="delete button">

<?php include('footer.php');?>