Exemplo n.º 1
0
 $revision_id = PMF_Filter::filterInput(INPUT_POST, 'revision_id', FILTER_VALIDATE_INT);
 $changed = PMF_Filter::filterInput(INPUT_POST, 'changed', FILTER_SANITIZE_STRING);
 // Permissions
 $user_permission = PMF_Filter::filterInput(INPUT_POST, 'userpermission', FILTER_SANITIZE_STRING);
 $restricted_users = 'all' == $user_permission ? -1 : PMF_Filter::filterInput(INPUT_POST, 'restricted_users', FILTER_VALIDATE_INT);
 $group_permission = PMF_Filter::filterInput(INPUT_POST, 'grouppermission', FILTER_SANITIZE_STRING);
 $restricted_groups = 'all' == $group_permission ? -1 : PMF_Filter::filterInput(INPUT_POST, 'restricted_groups', FILTER_VALIDATE_INT);
 if (isset($submit['submit'][1]) && !is_null($question) && !is_null($categories['rubrik'])) {
     // new entry
     $logging = new PMF_Logging();
     $logging->logAdmin($user, 'Beitragcreatesave');
     printf("<h2>%s</h2>\n", $PMF_LANG['ad_entry_aor']);
     $recordData = array('id' => null, 'lang' => $record_lang, 'active' => $active, 'sticky' => !is_null($sticky) ? 1 : 0, 'thema' => html_entity_decode($question), 'content' => html_entity_decode($content), 'keywords' => $keywords, 'author' => $author, 'email' => $email, 'comment' => !is_null($comment) ? 'y' : 'n', 'date' => date('YmdHis'), 'dateStart' => empty($dateStart) ? '00000000000000' : str_replace('-', '', $dateStart) . '000000', 'dateEnd' => empty($dateEnd) ? '99991231235959' : str_replace('-', '', $dateEnd) . '235959', 'linkState' => '', 'linkDateCheck' => 0);
     // Add new record and get that ID
     $faqRecord = new PMF_Faq_Record();
     $faqChangelog = new PMF_Faq_Changelog();
     if ($faqRecord->create($recordData)) {
         $recordId = $faqRecord->getRecordId();
         // Create ChangeLog entry
         $changelogData = array('record_id' => $recordId, 'record_lang' => $recordData['lang'], 'revision_id' => 0, 'user_id' => $user->getUserId(), 'date' => $_SERVER['REQUEST_TIME'], 'changelog' => nl2br($changed));
         $faqChangelog->create($changelogData);
         // Create the visit entry
         $visits = PMF_Visits::getInstance();
         $visits->add($recordId, $recordData['lang']);
         // Insert the new category relations
         $categoryRelations = new PMF_Category_Relations();
         // Insert the tags
         if ($tags != '') {
             $tagging = new PMF_Tags();
             $tagging->saveTags($recordId, explode(',', $tags));
         }
Exemplo n.º 2
0
" name="submit[0]" />
<?php 
    }
    ?>
    </p>
<?php 
    if (is_numeric($faqData['id'])) {
        ?>
    <fieldset class="fullwidth">
    <legend><a href="javascript:void(0);" onclick="javascript:toggleFieldset('ChangelogHistory');"><?php 
        print $PMF_LANG["ad_entry_changelog"];
        ?>
</a></legend>
    <div id="editChangelogHistory" style="display: none;">
<?php 
        $faqChangelog = new PMF_Faq_Changelog();
        $changelogData = $faqChangelog->fetch($faqData['id']);
        foreach ($changelogData as $changelog) {
            $user->getUserById($changelog->user_id);
            ?>
        <p style="font-size: 10px;">
            <strong><?php 
            print $PMF_LANG['ad_entry_revision'] . ' 1.' . $changelog->revision_id . ' / ' . date("Y-m-d H:i:s", $changelog->date) . ": " . $user->getUserData('display_name');
            ?>
</strong><br />
            <?php 
            print $changelog->changelog;
            ?>
        </p>
<?php 
        }