Пример #1
0
<p>What will this update do?</p>
<ul>
<li>Add the feature type to Reason</li>
<li>Fix the content sorter for the policy type</li>
</ul>

<form method="post">
<input type="submit" name="go" value="test" />
<input type="submit" name="go" value="run" />
</form>

<?php 
if (!empty($_POST['go']) && ($_POST['go'] == 'run' || $_POST['go'] == 'test')) {
    if ($_POST['go'] == 'run') {
        echo '<p>Running updater...</p>' . "\n";
        $mode = 'run';
    } else {
        echo '<p>Testing updates...</p>' . "\n";
        $mode = 'test';
    }
    if ($mode) {
        $update = new updateTypes($mode, $reason_user_id);
        $update->create_feature_type($mode, $reason_user_id);
        $update->fix_policy_content_sorter($mode, $reason_user_id);
    }
}
?>
<p><a href="index.php">Return to Index</a></p>
</body>
</html>