m_conn = MyConnect(); global $HTTP_COOKIE_VARS; $_COOKIE = array_merge($HTTP_COOKIE_VARS, $_COOKIE); $this->m_AccessNumber = $_COOKIE["AccessNumber"]; $this->HTTP = new HTTP(); global $HTTP_POST_VARS; global $HTTP_GET_VARS; global $HTTP_COOKIE_VARS; global $_REQUEST; $this->_REQUEST = array_merge($HTTP_POST_VARS, $HTTP_GET_VARS, $HTTP_COOKIE_VARS, $_REQUEST); global $group_name; $this->m_group_name = $group_name; } function getAccessCode(){ return $this->m_AccessNumber; } function getArgument($name){ return $this->_REQUEST[$name]; } function isArgument($name){ return isset($this->_REQUEST[$name]); } function getConnection(){ return $this->m_conn; } function isAuthorisedAccess($i_object="none",$mode="r",$output=true){ return authorisedAccess($this->m_conn,$this->m_AccessNumber,$i_object, $mode, $output); } function getApplicationVersion(){ return "2.0"; } function getHTTP(){ return $this->HTTP; } function getGroup(){ if($this->m_AccessNumber) return GetCurrentGroup($this->m_conn,$this->m_AccessNumber); else{ return GetCurrentGroup($this->m_conn,$this->m_group_name, "group_name"); } } function getUser(){ return GetCurrentUser($this->m_conn,$this->m_AccessNumber); } function getColors(){ return GetColors($this->m_conn,$this->m_AccessNumber); } } class HTTP { var $URL; function HTTP(){ $this->URL = new URL(); } function getURL(){ return $this->URL; } } class URL { function URL(){ } function getFilePath(){ global $_SERVER; return $_SERVER['PHP_SELF']; } function getFileName(){ return basename($this->getFilePath()); } function getServerName(){ global $_SERVER; return $_SERVER['SERVER_NAME']; } } class Page{ var $application; var $resource_name; var $zalozky_def; var $shown_url; var $window_title; var $sub_pages; var $headers; function Page($i_application, $i_resource_name="none", $i_zalozky_def="", $i_shown_url=""){ $this->application = $i_application; $this->resource_name = $i_resource_name; $this->zalozky_def = $i_zalozky_def; $this->shown_url = $i_shown_url; $this->sub_pages = array(); $this->headers = array(); } function setZalozky($i_zalozky_def, $i_shown_url=null){ $this->zalozky_def = $i_zalozky_def; if($i_shown_url == null) $this->shown_url = $this->application->HTTP->URL->getFileName(); else $this->shown_url = $i_shown_url; } function setWindowTitle($i_window_title){ $this->window_title = $i_window_title; } function isAuthorisedAccess($mode="r",$output=true){ return $this->application->isAuthorisedAccess($this->resource_name, $mode, $output); } function printOknoTop($aktivni_odkazy=1) { printoknotop($this->zalozky_def, $this->shown_url, $aktivni_odkazy,$this->application->getConnection(), $this->application->getAccessCode()); } function printOknoTopAll($aktivni_odkazy=1) { $this->printOknoTop($aktivni_odkazy); for($i_columns=0; $i_columnssub_pages); $i_columns++) for($i_rows=0; $i_rowssub_pages[$i_columns]); $i_rows++) $this->sub_pages[$i_columns][$i_rows]->printOknoTop($aktivni_odkazy); } function printOknoBottom($userList=true, $copyright=0) { if($userList) // Copyright is defaulted by true in the following call printoknobottom($this->application->getConnection(), $this->application->getAccessCode()); else // No userlist, no copyright printoknobottom(0,0,0); } function printOknoBottomAll() { for($i_columns=0; $i_columnssub_pages); $i_columns++) for($i_rows=0; $i_rowssub_pages[$i_columns]); $i_rows++) $this->sub_pages[$i_columns][$i_rows]->printOknoBottom(false); $this->printOknoBottom(); } function printHead($RefreshTimeOut=0,$RefreshTheURL="", $body_properties="") { for($iheader=0; $iheaderheaders); $iheader++) header($this->headers[$iheader]); for($icookie=0; $icookieicookies); $icookie++) SetCookie($this->headers[$icookie]["key"], $this->headers[$icookie]["value"]); printHead ("iso-8859-2",$this->window_title." - ".$this->sub_pages[0][0]->window_title,"piccolo.ccs", $RefreshTimeOut, $RefreshTheURL, $body_properties); } function addSubPage($sub_page, $column=0) { $this->sub_pages[$column][]=$sub_page; } function addHeader($i_text) { if($i_text == "noproxy") { $this->headers[]="Expires: Mon, 26 Jul 1997 05:00:00 GMT"; // Date in the past $this->headers[]="Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"; // always modified $this->headers[]="Cache-Control: no-cache, must-revalidate"; // HTTP/1.1 $this->headers[]="Pragma: no-cache"; // HTTP/1.0 } $this->headers[]=$i_text; } function addCookie($i_key, $i_value) { $this->cookies[]=array("key"=>$i_key, "value"=>$i_value); } } global $application; $application = new Application(); ?>