function WikiDB_Page(&$wikidb, $pagename) { $this->_wikidb =& $wikidb; $this->_pagename = $pagename; if (DEBUG) { if (!(is_string($pagename) and $pagename != '')) { if (function_exists("xdebug_get_function_stack")) { echo "xdebug_get_function_stack(): "; var_dump(xdebug_get_function_stack()); } elseif (function_exists("debug_backtrace")) { // >= 4.3.0 printSimpleTrace(debug_backtrace()); } trigger_error("empty pagename", E_USER_WARNING); return false; } } else { assert(is_string($pagename) and $pagename != ''); } }
function _findFile($file, $missing_okay = false) { if (file_exists($this->file($file))) { return "{$this->_theme}/{$file}"; } // FIXME: this is a short-term hack. Delete this after all files // get moved into themes/... // Needed for button paths in parent themes if (file_exists($this->_path . $file)) { return $file; } /* Derived classes should search all parent classes */ foreach ($this->_parents as $parent) { $path = $parent->_findFile($file, 1); if ($path) { return $path; } elseif (0 and DEBUG & _DEBUG_VERBOSE + _DEBUG_REMOTE) { trigger_error("{$parent->_theme}/{$file}: not found", E_USER_NOTICE); } } if (isset($this->_default_theme)) { return $this->_default_theme->_findFile($file, $missing_okay); } else { if (!$missing_okay) { trigger_error("{$this->_theme}/{$file}: not found", E_USER_NOTICE); if (DEBUG & _DEBUG_TRACE && function_exists('debug_backtrace')) { // >= 4.3.0 echo "<pre>", printSimpleTrace(debug_backtrace()), "</pre>\n"; } } } return false; }
function _findFile($file, $missing_okay = false) { if (file_exists($this->file($file))) { return "{$this->_theme}/{$file}"; } // FIXME: this is a short-term hack. Delete this after all files // get moved into themes/... if (file_exists($this->_path . $file)) { return $file; } if (isset($this->_default_theme)) { return $this->_default_theme->_findFile($file, $missing_okay); } else { if (!$missing_okay) { if (DEBUG & function_exists('debug_backtrace')) { // >= 4.3.0 echo "<pre>", printSimpleTrace(debug_backtrace()), "</pre>\n"; } trigger_error("{$this->_theme}/{$file}: not found", E_USER_NOTICE); } } return false; }
function homePage() { if (!$this->_userid) { return false; } if (!empty($this->_homepage)) { return $this->_homepage; } else { if (empty($this->_dbi)) { if (DEBUG) { printSimpleTrace(debug_backtrace()); } } else { $this->_homepage = $this->_dbi->getPage($this->_userid); } return $this->_homepage; } }