page = $_SERVER['PHP_SELF']; //Page that instantiates the template. $this->prefix = '../'; //Default prefix. $this->set_page_prefix(); //Assigns the name and prefix of the page. $this->session = 'Iniciar Sesión'; //Default, the session has not started. $this->session_route = 'login/'; //Default, the session has not started. $this->panel = ''; //Default, the session has not started. $this->user_route = 'panel_user/'; //Default, the type of client is user. } //Methods: //Assigns the name and prefix of the page: private function set_page_prefix() { switch(true){ case strpos($this->page, 'panel_user'): $this->page = 'Panel de Usuario'; break; case strpos($this->page, 'panel_manager'): $this->page = 'Panel de Gerente'; break; case strpos($this->page, 'panel_admin'): $this->page = 'Panel de Administrador'; break; case strpos($this->page, 'login'): $this->page = 'Acceso'; break; case strpos($this->page, 'logout'): $this->page = 'Cerrar Sesión'; break; case strpos($this->page, 'showtimes'): $this->page = 'Cartelera'; break; case strpos($this->page, 'cinemas'): $this->page = 'Nuestros Cines'; break; case strpos($this->page, 'about_us'): $this->page = 'Sobre FDI-Cines'; $this->prefix = '../../'; break; case strpos($this->page, 'terms'): $this->page = 'Términos y Condiciones'; $this->prefix = '../../'; break; case strpos($this->page, 'detalles'): $this->page = 'Detalles'; $this->prefix = '../../'; break; case strpos($this->page, 'bocetos'): $this->page = 'Bocetos'; $this->prefix = '../../'; break; case strpos($this->page, 'miembros'): $this->page = 'Miembros'; $this->prefix = '../../'; break; case strpos($this->page, 'planificacion'): $this->page = 'Planificación'; $this->prefix = '../../'; break; case strpos($this->page, 'contacto'): $this->page = 'Contacto'; break; default: $this->page = 'FDI-Cines'; $this->prefix = './'; break; } } //Returns page name: function get_page(){ return $this->page; } //Returns page prefix: function get_prefix(){ return $this->prefix; } //Print generic Head: function print_head(){ $page = $this->page; $prefix = $this->prefix; echo"