示例#1
0
/**
 * Callback function to propagate data
 * @return bool must return true or other hooks don't get called
 */
function propagateMySourceMove(&$title, &$newTitle, &$user, $pageId, $redirPageId)
{
    $ns = $title->getNamespace();
    if ($ns == NS_MYSOURCE) {
        // update people and families that link to this mysource, because source citation has changed
        $u = new HTMLCacheUpdate($title, 'pagelinks');
        $u->doUpdate();
        $u = new HTMLCacheUpdate($newTitle, 'pagelinks');
        $u->doUpdate();
        StructuredData::copyPageLinks($title, $newTitle);
    }
    return true;
}
示例#2
0
/**
 * Callback function to copy page links and propagate data
 * @return bool must return true or other hooks don't get called
 */
function propagateSourceMove(&$title, &$newTitle, &$user, $pageId, $redirPageId)
{
    $ns = $title->getNamespace();
    if ($ns == NS_SOURCE) {
        StructuredData::copyPageLinks($title, $newTitle);
        $source = new Source($title->getText());
        $source->propagateMove($newTitle);
    }
    return true;
}