function data_alias($pData, $pParams, $pCommonObject) { $page = ''; require_once WIKI_PKG_PATH . "BitPage.php"; foreach ($pParams as $key => $value) { if (!empty($value)) { switch ($key) { case 'page': $page = $value; break; default: break; } } } return tra("This page is an alias for:") . ' ' . BitPage::getPageLink($page, LibertyContent::pageExists($page)); }
/** * see if the documentation page exists, if not create it and return the appropriate content_id * * @param array $pPackage * @access public * @return TRUE on success, FALSE on failure - mErrors will contain reason for failure */ function getDocumentionPage($pPackage = NULL) { global $gBitUser, $gBitSystem; $ret = FALSE; if (empty($pPackage) && $this->isValid()) { $pPackage = $this->mPackage; } if (!empty($pPackage)) { $page = ucfirst($pPackage) . "Package"; require_once LIBERTY_PKG_PATH . "LibertyContent.php"; $lc = new LibertyContent(); $ret = $lc->pageExists($page); if ($gBitSystem->isPackageActive('wiki') && !$ret && $gBitUser->hasPermission('p_wiki_edit_page')) { require_once WIKI_PKG_PATH . "BitPage.php"; $wp = new BitPage(); $create = array('title' => $page, 'creator_user_id' => $gBitUser->mUserId, 'modifier_user_id' => $gBitUser->mUserId, 'edit' => "This page contains information about {$pPackage}"); // get some rudimentary page details if ($wp->store($create)) { $ret = $lc->pageExists($page); } } } return $ret; }