예제 #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
파일: Source.php 프로젝트: k-hasan-19/wiki
/**
 * 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;
}