コード例 #1
0
ファイル: cloneModel.php プロジェクト: florinp/dexonline
        if ($modelType == 'V') {
            $pm = ParticipleModel::loadByVerbModel($modelNumber);
            $clonePm = Model::factory('ParticipleModel')->create();
            $clonePm->verbModel = $newModelNumber;
            $clonePm->adjectiveModel = $pm->adjectiveModel;
            $clonePm->save();
        }
        // Migrate the selected lexems.
        if ($chooseLexems && $lexemModelIds) {
            foreach ($lexemModelIds as $lexemModelId) {
                $lm = LexemModel::get_by_id($lexemModelId);
                $lm->modelNumber = $newModelNumber;
                $lm->save();
                // It is not necessary to regenerate the paradigm for now, since
                // the inflected forms are identical.
            }
        }
        util_redirect('../admin/index.php');
        exit;
    }
} else {
    $newModelNumber = $modelNumber . ".1";
}
$lexemModels = LexemModel::loadByCanonicalModel($modelType, $modelNumber);
SmartyWrap::assign('modelType', $modelType);
SmartyWrap::assign('modelNumber', $modelNumber);
SmartyWrap::assign('newModelNumber', $newModelNumber);
SmartyWrap::assign('lexemModels', $lexemModels);
SmartyWrap::assign('errorMessage', $errorMessages);
SmartyWrap::assign('recentLinks', RecentLink::loadForUser());
SmartyWrap::displayAdminPage('admin/cloneModel.tpl');