Exemplo n.º 1
0
}
if (value("action") == "launcharticle" && $auth->checkAccessToFunction("CHANNEL_LAUNCH")) {
    $article = value("article", "NUMERIC");
    launchArticle($article, 10, variation());
}
if (value("action") == "expirearticle" && $auth->checkAccessToFunction("CHANNEL_LAUNCH")) {
    $article = value("article", "NUMERIC");
    expireArticle($article, 10, variation());
}
$selch = new SelectMenu($lang->get("channel_select", "Select Channel"), "chsel", "channels", "NAME", "CHID", "1");
$lang->delete("help_articles");
$selch->tipp = $lang->get("help_articles", "The form displays articles.<br><br>The color codes are:<li>red: article not published<li>grey: article not translated<li>green: article published");
$rowOrderFilter = "VERSION=0 AND CHID=" . $selch->selected;
if (value("action") == "up") {
    $article = value("article", "NUMERIC");
    moveRowUp("channel_articles", "ARTICLE_ID", $article, "POSITION", $rowOrderFilter);
} else {
    if (value("action") == "down") {
        $article = value("article", "NUMERIC");
        moveRowDown("channel_articles", "ARTICLE_ID", $article, "POSITION", $rowOrderFilter);
    }
}
$filtermenu = new StdMenu("");
require_once $c["path"] . "modules/channels/menu.inc.php";
$oid = value("oid", "NUMERIC");
if ($selch->selected != "0" && $selch->selected != "-1" && $selch->selected != 0) {
    sortTableRows("channel_articles", "ARTICLE_ID", "POSITION", $rowOrderFilter);
    $form = new ArticleSelectForm($selch->selected);
    $form->newAction = "modules/channels/edit.php?sid={$sid}&action=createarticle";
    $form->buttonbar->setVariationSelector(getChannelVariations($selch->selected), variation());
    $form->editAction = $c["docroot"] . "modules/channels/edit.php";
		/**
		 * Move one item up or down
		 * @param string direction [UP|DOWN]
		 */
		function move($direction="UP") {
			$moved = false;
			$eid = value("eid", "NUMERIC");
			for ($i = 0; $i < count($this->members); $i++) {
				if ($eid == $this->members[$i][1]) {
					if (strtoupper($direction)=="UP") {
						moveRowUp("cluster_content", "CLCID", $eid, "POSITION", "CLTI_ID = $this->clti AND CLID = $this->cl");
						$moved=true;
					} else if (strtoupper($direction) =="DOWN") {
						moveRowDown("cluster_content", "CLCID", $eid, "POSITION", "CLTI_ID = $this->clti AND CLID = $this->cl");
						$moved=true;
					}
				}
			}
			if ($moved) $this->members = $this->getItemData();	
		}
Exemplo n.º 3
0
		/**
		 * Move the item with pk ID one position up.
		 * @param integer ID of the Item to move.
		 */
		function move_up($id) {
			$oid = value("oid", "NUMERIC");
			moveRowUp($this->item_table, $this->item_pkname, $id, "POSITION", $this->item_parentKeyName . "=$oid");
		}