=====Source: show.php===== author: KlenWell %%(php) to template; * @todo replace $_REQUEST with either $_GET or $_POST (or both if really * necessary) - #312 */ // *** Show Flags for Controller $_SHOW['page_start'] = 0; $_SHOW['no_access'] = 0; $_SHOW['not_exists'] = 0; $_SHOW['page_body'] = 0; $_SHOW['revision_info'] = 0; $_SHOW['revision_edit_form'] = 0; $_SHOW['comments'] = 0; $_SHOW['hidden_comments'] = 0; $_SHOW['no_comments'] = 0; $_SHOW['comment_form'] = 0; $_SHOW['page_close'] = 0; // *** HTML Blocks $_HTML['page'] = ''; $_HTML['page_start'] = ''; $_HTML['no_access'] = ''; $_HTML['not_exists'] = ''; $_HTML['revision_info'] = ''; $_HTML['page_body'] = ''; $_HTML['revision_edit_form'] = ''; $_HTML['page_close_div'] = ''; $_HTML['comments_header'] = ''; $_HTML['comments'] = ''; $_HTML['comment_form'] = ''; $_HTML['hidden_comments'] = ''; $_HTML['page_close'] = ''; // *** Controller // Default Shows $_SHOW['page_start'] = 1; $_SHOW['page_close'] = 1; // Has Page Access if (!$this->HasAccess('read')) { $_SHOW['no_access'] = 1; } // Page Exists if ( !$this->page ) { $_SHOW['not_exists'] = 1; } else { $_SHOW['page_body'] = 1; } // As Revision if ($this->page['latest'] == 'N') { $_SHOW['revision_info'] = 1; } // Revision w/ write access if ( ($this->page['latest'] == 'N' && $this->HasAccess('write')) && ($latest = $this->LoadPage($this->tag)) ) { $_SHOW['revision_edit_form'] = 1; } // Show Comment Form if ( $this->GetConfigValue('hide_comments') != 1 ) { // get page tag $tag = $this->GetPageTag(); // session settings? if ( !isset($_SESSION['show_comments'][$tag]) ) { $_SESSION['show_comments'][$tag] = ($this->UserWantsComments() ? '1' : '0'); } // GET setting takes precedence if ( isset($_GET['show_comments']) ) #312 { if ( $_GET['show_comments'] == 0 ) { $_SESSION['show_comments'][$tag] = 0; } elseif ( $_GET['show_comments'] == 1 ) { $_SESSION['show_comments'][$tag] = 1; } } if ($_SESSION['show_comments'][$tag]) { $_SHOW['comment_form'] = 1; } else { $_SHOW['hidden_comments'] = 1; } } // Show Comments? $comments = $this->LoadComments($this->tag); if ( $_SESSION['show_comments'][$tag] && $comments ) { $_SHOW['comments'] = 1; } // *** Viewer Blocks // Page Start if ( $_SHOW['page_start'] ) { $_js = ( ($user = $this->GetUser()) && ($user['doubleclickedit'] == 'N') || !$this->HasAccess('write') ) ? '' : 'ondblclick="document.location=\''.$this->Href('edit').'\';" '; $_HTML['page_start'] = <<