includes/paths.php
changeset 1252 e34c23a35dc9
parent 1227 bdac73ed481e
child 1264 28c82f292a52
equal deleted inserted replaced
1251:d543689ed2eb 1252:e34c23a35dc9
   163 			{
   163 			{
   164 				list($page_id) = explode('/', $page_id);
   164 				list($page_id) = explode('/', $page_id);
   165 			}
   165 			}
   166 			$this->page = $this->nslist[$namespace] . $page_id;
   166 			$this->page = $this->nslist[$namespace] . $page_id;
   167 			$this->page_id = $page_id;
   167 			$this->page_id = $page_id;
       
   168 			
       
   169 			$ns = namespace_factory($page_id, $namespace);
       
   170 			$this->cpage = $ns->get_cdata();
       
   171 			$this->page_exists = $ns->exists();
       
   172 			$this->wiki_mode = false;
       
   173 			$wiki_mode_eligible = ($session->user_logged_in && getConfig('wiki_mode_require_login', 0) == 1) || getConfig('wiki_mode_require_login', 0) == 0;
       
   174 			$global_wiki_mode = getConfig('wiki_mode', 0) == 1;
       
   175 			if ( $wiki_mode_eligible && (($this->cpage['wiki_mode'] == 2 && $global_wiki_mode) || $this->cpage['wiki_mode'] == 1))
       
   176 				$this->wiki_mode = true;
   168 			// die("All done setting parameters. What we've got:<br/>namespace: $namespace<br/>fullpage: $this->fullpage<br/>page: $this->page<br/>page_id: $this->page_id");
   177 			// die("All done setting parameters. What we've got:<br/>namespace: $namespace<br/>fullpage: $this->fullpage<br/>page: $this->page<br/>page_id: $this->page_id");
   169 		}
   178 		}
   170 		else
   179 		else
   171 		{
   180 		{
   172 			// Starting up Enano with the API from a page that wants to do its own thing. Generate
   181 			// Starting up Enano with the API from a page that wants to do its own thing. Generate
   216 			if(!isset($this->cpage['wiki_mode'])) $this->cpage['wiki_mode'] = 2;
   225 			if(!isset($this->cpage['wiki_mode'])) $this->cpage['wiki_mode'] = 2;
   217 			
   226 			
   218 			// Determine the wiki mode for this page, now that we have this->cpage established
   227 			// Determine the wiki mode for this page, now that we have this->cpage established
   219 			if($this->cpage['wiki_mode'] == 2)
   228 			if($this->cpage['wiki_mode'] == 2)
   220 			{
   229 			{
   221 				$this->wiki_mode = (int)getConfig('wiki_mode');
   230 				$this->wiki_mode = (int)getConfig('wiki_mode', 0);
   222 			}
   231 			}
   223 			else
   232 			else
   224 			{
   233 			{
   225 				$this->wiki_mode = $this->cpage['wiki_mode'];
   234 				$this->wiki_mode = $this->cpage['wiki_mode'];
   226 			}
   235 			}