setPublishAction() public method

Set the published state to switch to when the "publish time" arrives: NULL for no action, 'P' for Publish, or 'U' for Unpublish.
public setPublishAction ( $p_value ) : void
return void
Exemplo n.º 1
0
// Schedule future event
echo "Scheduling future event...<br>";
$datetime = strftime("2100-%m-%d %H:%M:00");
$articlePublishObj2 = new ArticlePublish($newArticle->getArticleId(), 1, $datetime);
$articlePublishObj2->create();
$articlePublishObj2->setPublishAction('P');

// Verify
echo "Number of pending actions (should be zero): ".count(ArticlePublish::GetPendingActions())."<br>";

// Schedule past event
echo "Scheduling past event...<br>";
$datetime = strftime("1900-%m-%d %H:%M:00");
$articlePublishObj3 = new ArticlePublish($newArticle->getArticleId(), 1, $datetime);
$articlePublishObj3->create();
$articlePublishObj3->setPublishAction('P');

// Verify
echo "Number of pending actions (should be one): ".count(ArticlePublish::GetPendingActions())."<br>";

// delete the article
echo "Deleting the article.<br>";
$newArticle->delete();

echo "Deleting the events.<br>";
$articlePublishObj->delete();
$articlePublishObj2->delete();
$articlePublishObj3->delete();

echo "<h2>ISSUE AUTOPUBLISH TESTS</h2>";
echo "Creating an issue...<br>";
Exemplo n.º 2
0
			        parent.$.fancybox.close();
			    } catch (e) {
			    }
			    </script>
			    <?php 
                exit;
            }
        }
    }
    $articlePublishObj = new ArticlePublish();
    $articlePublishObj->create();
    $articlePublishObj->setArticleNumber($tmpArticle->getArticleNumber());
    $articlePublishObj->setLanguageId($tmpArticle->getLanguageId());
    $articlePublishObj->setActionTime($publishTime);
    if ($f_publish_action == "P" || $f_publish_action == "U") {
        $articlePublishObj->setPublishAction($f_publish_action);
    }
    if ($f_front_page_action == "S" || $f_front_page_action == "R") {
        $articlePublishObj->setFrontPageAction($f_front_page_action);
    }
    if ($f_section_page_action == "S" || $f_section_page_action == "R") {
        $articlePublishObj->setSectionPageAction($f_section_page_action);
    }
    Log::ArticleMessage($tmpArticle, getGS('Scheduled action added'), $g_user->getUserId(), 37);
}
if ($f_mode == "multi") {
    $args = $_REQUEST;
    unset($args["f_article_code"]);
    $argsStr = camp_implode_keys_and_values($args, "=", "&");
    camp_html_add_msg(getGS("Scheduled action added."), "ok");
    camp_html_goto_page("/{$ADMIN}/articles/index.php?" . $argsStr);