1
0
Fork 0

recoding to use as plugin with CL

Dieser Commit ist enthalten in:
o.pinke 2020-08-20 18:30:16 +02:00
Ursprung 244621b05f
Commit e8b0c80921
22 geänderte Dateien mit 2187 neuen und 2341 gelöschten Zeilen

Datei anzeigen

@ -1,4 +1,5 @@
<?php
/**
* Project:
* Contenido Content Management System
@ -25,8 +26,7 @@
* }}
*
*/
if(!defined('CON_FRAMEWORK')) {
if (!defined('CON_FRAMEWORK')) {
die('Illegal call');
}
@ -38,77 +38,69 @@ if(!defined('CON_FRAMEWORK')) {
* @copyright four for business 2003
*/
class WorkflowActions extends ItemCollection {
/**
/**
* Constructor Function
* @param string $table The table to use as information source
*/
function __construct()
{
global $cfg;
parent::__construct($cfg["tab"]["workflow_actions"], "idworkflowaction");
function __construct() {
global $cfg;
parent::__construct($cfg["tab"]["workflow_actions"], "idworkflowaction");
$this->_setItemClass("WorkflowAction");
}
/**
*
* @param type $idworkflowitem
* @param type $action
* @return boolean
*/
function get($idworkflowitem, $action)
{
$this->select("idworkflowitem = '".Contenido_Security::escapeDB($idworkflowitem, NULL)."' AND action = '".Contenido_Security::escapeDB($action, NULL)."'");
if ($this->next())
{
return true;
} else {
return false;
}
}
function getAvailableWorkflowActions ()
{
$availableWorkflowActions = array (
"publish" => i18n("Publish article", "workflow"),
"lock" => i18n("Lock article", "workflow"),
"last" => i18n("Move back to last editor", "workflow"),
"reject" => i18n("Reject article", "workflow"),
"articleedit" => i18n("Edit article content", "workflow"),
"propertyedit" => i18n("Edit article properties", "workflow"),
"templateedit" => i18n("Edit template", "workflow"),
"revise" => i18n("Revise article", "workflow"));
return($availableWorkflowActions);
}
}
/**
*
* @param type $idworkflowitem
* @param type $action
* @return boolean
*/
function get($idworkflowitem, $action) {
$this->select("idworkflowitem = '" . Contenido_Security::escapeDB($idworkflowitem, NULL) . "' AND action = '" . Contenido_Security::escapeDB($action, NULL) . "'");
if ($this->next()) {
return true;
} else {
return false;
}
}
function getAvailableWorkflowActions() {
$availableWorkflowActions = array(
"publish" => i18n("Publish article", "workflow"),
"lock" => i18n("Lock article", "workflow"),
"last" => i18n("Move back to last editor", "workflow"),
"reject" => i18n("Reject article", "workflow"),
"articleedit" => i18n("Edit article content", "workflow"),
"propertyedit" => i18n("Edit article properties", "workflow"),
"templateedit" => i18n("Edit template", "workflow"),
"revise" => i18n("Revise article", "workflow"));
return($availableWorkflowActions);
}
function set($idworkflowitem, $action) {
$this->select("idworkflowitem = '" . Contenido_Security::escapeDB($idworkflowitem, NULL) . "' AND action = '" . Contenido_Security::escapeDB($action, NULL) . "'");
if (!$this->next()) {
$newitem = parent::createNewItem();
$newitem->setField("idworkflowitem", $idworkflowitem);
$newitem->setField("action", $action);
$newitem->store();
}
}
function remove($idworkflowitem, $action) {
$this->select("idworkflowitem = '$idworkflowitem' AND action = '$action'");
if ($item = $this->next()) {
$this->delete($item->getField("idworkflowaction"));
}
}
function select($where = "", $group_by = "", $order_by = "", $limit = "") {
global $client;
return parent::select($where, $group_by, $order_by, $limit);
}
function set ($idworkflowitem, $action)
{
$this->select("idworkflowitem = '".Contenido_Security::escapeDB($idworkflowitem, NULL)."' AND action = '".Contenido_Security::escapeDB($action, NULL)."'");
if (!$this->next())
{
$newitem = parent::createNewItem();
$newitem->setField("idworkflowitem",$idworkflowitem);
$newitem->setField("action",$action);
$newitem->store();
}
}
function remove ($idworkflowitem, $action)
{
$this->select("idworkflowitem = '$idworkflowitem' AND action = '$action'");
if ($item = $this->next())
{
$this->delete($item->getField("idworkflowaction"));
}
}
function select ($where = "", $group_by = "", $order_by = "", $limit = "")
{
global $client;
return parent::select($where, $group_by, $order_by, $limit);
}
}
/**
@ -119,14 +111,16 @@ class WorkflowActions extends ItemCollection {
* @copyright four for business 2003
*/
class WorkflowAction extends Item {
/**
* Constructor
* @global type $cfg
*/
function __construct() {
function __construct() {
global $cfg;
parent::__construct($cfg["tab"]["workflow_actions"], "idworkflowaction");
}
}
?>