Location: PHPKode > scripts > GalleryShuffle > v1.0/php/Views/frontNav.php
<?php

/**
* PICTURES
**/

class view_frontNav extends view_classicView
{
	
	public function getPopupConnect($action, $subject=NULL, $asLogin=false) 
	{
		
		$uid = uniqid();
		
		$html = '
		<p id="connection_state_' . $uid . '" class="state"></p>
		<div id="connection_form_' . $uid . '">
			
			<div class="textAlignLeft separator">';
		
		if($asLogin){
		
			$html .= '
				<label for="connection_login_' . $uid . '">' . $this->LANG->traduc['login'] . '&nbsp;:</label>
				<input id="connection_login_' . $uid . '" name="mail" size="25"/><br />';
				
		}
		
		$html .= '		
				<label for="connection_password_' . $uid . '">' . $this->LANG->traduc['password'] . '&nbsp;:</label>
				<input id="connection_password_' . $uid . '" type="password" name="password" size="10"/>
			
			</div>
			
			<a href="' . "javascript: 
			var object = document.getElementById('connection_state_" . $uid . "'); 
			object.innerHTML = '" . $this->LANG->traduc['connectionWaitRespond'] . "'; 
			object.setVisible();
			" . FUNCTIONS::getAjaxRequestEval($action, 'connection_state_' . $uid, 'connection_form_' . $uid) . '">' . $this->LANG->traduc['connection'] . '</a>
			
		</div>
		<script>document.getElementById("connection_state_' . $uid . '").setHide();</script>
		';
	
		return $this->getPopup($subject, NULL, $html);
		
	}
	
	public function getPopupConnectRespond($password, $sessionIndex, $albumId=0, $isForGallery=0) 
	{
		
		if($_POST['password'] == $password) {
			
			$uid = uniqid('', true);
			
			$model_clientsLogs = new model_clientsLogs();
			$model_clientsLogs->insertNewLine($uid, $_SERVER['REMOTE_ADDR'], $albumId, $isForGallery);
			
			$_SESSION[$sessionIndex] = $uid;
			
			$buffer = $this->LANG->traduc['connectionSuccess'] . "
			<script>
				var timer = setInterval( function(evt) {
					window.location.href='index.php";
					
			if($isForGallery == 0) $buffer .= "?albumId=" . $albumId;
			
			$buffer .= "';
				}, 1000);
			</script>";
			
			return $buffer;
			
		}else{
			
			return $this->LANG->traduc['connectionBadPassword'];
		
		}
		
	}
	
}

?>
Return current item: GalleryShuffle