本文整理汇总了PHP中Family::getPageText方法的典型用法代码示例。如果您正苦于以下问题:PHP Family::getPageText方法的具体用法?PHP Family::getPageText怎么用?PHP Family::getPageText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Family
的用法示例。
在下文中一共展示了Family::getPageText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPageTextFromWLH
protected function getPageTextFromWLH($toEditFields, $request = null)
{
// don't get marriage from request if called by propagation
if ($toEditFields && $request) {
$marriagedate = $request->getVal('md');
$marriageplace = $request->getVal('mp');
} else {
$marriagedate = $marriageplace = '';
}
$pageids = $this->getWhatLinksHere();
return Family::getPageText($marriagedate, $marriageplace, $this->titleString, $pageids);
}
示例2: wfAddPage
/**
* Create family tree page
*
* This is also called by search.js
*
* @param unknown_type $args
* @return GE_SUCCESS, GE_INVALID_ARG, GE_NOT_LOGGED_IN, GE_NOT_AUTHORIZED, GE_NOT_FOUND, GE_DUP_KEY, GE_DB_ERROR
*/
function wfAddPage($args)
{
global $wgUser, $wgAjaxCachePolicy, $wgArticle, $wgTitle, $wgLang;
// set cache policy
$wgAjaxCachePolicy->setPolicy(0);
$status = GE_SUCCESS;
$title = null;
$titleString = null;
$error = '';
$args = AjaxUtil::getArgs($args);
$ns = $wgLang->getNsIndex($args['ns']);
$titleString = @$args['title'];
$update = $args['update'] == 'true';
if (!$wgUser->isLoggedIn()) {
$status = GE_NOT_LOGGED_IN;
} else {
if ($wgUser->isBlocked() || wfReadOnly()) {
$status = GE_NOT_AUTHORIZED;
}
}
if ($status == GE_SUCCESS) {
$dbw =& wfGetDB(DB_MASTER);
$dbw->ignoreErrors(true);
$dbw->begin();
$text = '';
if ($titleString) {
// user passed in existing title; just add to watchlist and trees
$title = Title::newFromText($titleString, $ns);
} else {
if ($ns == NS_PERSON) {
if (ESINHandler::isLivingDates($args['bd'], null, $args['dd'], $args['dp'])) {
$error = 'Living people cannot be added to WeRelate. People born in the last 110 years must have a death date';
} else {
if (ESINHandler::isAmbiguousDate($args['bd']) || ESINHandler::isAmbiguousDate($args['dd'])) {
$error = "Please write dates in D MMM YYYY format so they are unambiguous (ie 5 Jan 1900)";
} else {
if (!$title) {
$title = StructuredData::constructPersonTitle($args['g'], $args['s']);
}
if ($title) {
if ($args['bt'] == 'chr') {
$bird = '';
$birp = '';
$chrd = $args['bd'];
$chrp = $args['bp'];
} else {
$bird = $args['bd'];
$birp = $args['bp'];
$chrd = '';
$chrp = '';
}
if ($args['dt'] == 'bur') {
$dead = '';
$deap = '';
$burd = $args['dd'];
$burp = $args['dp'];
} else {
$dead = $args['dd'];
$deap = $args['dp'];
$burd = '';
$burp = '';
}
$text = Person::getPageText($args['g'], $args['s'], $args['gnd'], $bird, $birp, $dead, $deap, $title->getText(), null, @$args['pf'], @$args['sf'], $chrd, $chrp, $burd, $burp);
}
}
}
} else {
if ($ns == NS_FAMILY) {
if (ESINHandler::isAmbiguousDate($args['md'])) {
$error = "Please write dates in D MMM YYYY format so they are unambiguous (ie 5 Jan 1900)";
} else {
$title = StructuredData::constructFamilyTitle($args['hg'], $args['hs'], $args['wg'], $args['ws']);
if ($title) {
$text = Family::getPageText($args['md'], $args['mp'], $title->getText(), null, @$args['ht'], @$args['wt'], @$args['ct']);
}
}
} else {
if ($ns == NS_SOURCE) {
$title = StructuredData::constructSourceTitle($args['sty'], $args['st'], $args['a'], $args['p'], $args['pi'], $args['pu']);
if ($title) {
$text = Source::getPageText($args['sty'], $args['st'], $args['a'], $args['p'], $args['pi'], $args['pu']);
} else {
$error = 'Required source fields are missing; please press the Back button on your browser to enter the required fields.';
}
} else {
if ($ns == NS_MYSOURCE) {
$t = $args['t'];
if (mb_strpos($t, $wgUser->getName() . '/') != 0) {
$t = $wgUser->getName() . '/' . $t;
}
$title = Title::newFromText($t, NS_MYSOURCE);
if ($title) {
//.........这里部分代码省略.........