本文整理汇总了PHP中Content::addContent方法的典型用法代码示例。如果您正苦于以下问题:PHP Content::addContent方法的具体用法?PHP Content::addContent怎么用?PHP Content::addContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Content
的用法示例。
在下文中一共展示了Content::addContent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setStgTitle
/**
* Set the stg_title column value.
*
* @param string $v new value
* @return void
*/
public function setStgTitle($v)
{
if ($this->getStgUid() == "") {
throw new Exception("Error in setStgTitle, the setStgUid() can't be blank");
}
$v = isset($v) ? (string) $v : '';
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
if ($this->stg_title !== $v || $v === "") {
$this->stg_title = $v;
$res = Content::addContent('STG_TITLE', '', $this->getStgUid(), $lang, $this->stg_title);
return $res;
}
return 0;
}
示例2: setEvnDescription
/**
* Set the evn_description column value.
*
* @param string $v new value
* @return void
*/
public function setEvnDescription($v)
{
if ($this->getEvnUid() == "") {
throw new Exception("Error in setEvnDescription, the setEvnUid() can't be blank");
}
$v = isset($v) ? (string) $v : '';
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
if ($this->evn_description !== $v || $v === "") {
$this->evn_description = $v;
$res = Content::addContent('EVN_DESCRIPTION', '', $this->getEvnUid(), $lang, $this->evn_description);
return $res;
}
return 0;
}
示例3: addContent
function addContent($data, $fields)
{
$obj = new Content();
$ConCategory = $fields['CON_CATEGORY'];
$ConParent = $fields['CON_PARENT'];
$ConId = $fields['CON_ID'];
$ConLang = $fields['CON_LANG'];
$ConValue = $fields['CON_VALUE'];
try {
$res = $obj->addContent($ConCategory, $ConParent, $ConId, $ConLang, $ConValue);
} catch (Exception $e) {
return $e;
}
return $res;
}
示例4: setGrpTitle
/**
* Set the [grp_title] column value.
*
* @param string $v new value
* @return void
*/
public function setGrpTitle($v)
{
if ($this->getGrpUid() == '') {
throw new Exception("Error in setGrpTitle, the GRP_UID can't be blank");
}
// Since the native PHP type for this column is string,
// we will cast the input to a string (if it is not).
if ($v !== null && !is_string($v)) {
$v = (string) $v;
}
if ($this->grp_title !== $v || $v === '') {
$this->grp_title = $v;
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
$res = Content::addContent('GRP_TITLE', '', $this->getGrpUid(), $lang, $this->grp_title);
}
}
示例5: putSubprocesss
/**
* Put SubProcess in Process
* @var string $pro_uid. Uid for Process
* @var string $spr_uid. Uid for SubProcess
* @var array $spr_data. Data for SubProcess
*
*
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @return array
*/
public function putSubprocesss($pro_uid, $tas_uid, $spr_data)
{
$pro_uid = $this->validateProUid($pro_uid);
$tas_uid = $this->validateTasUid($tas_uid);
if (empty($spr_data)) {
throw new \Exception("The request data is empty.");
}
if (isset($spr_data['spr_pro'])) {
$spr_data['spr_pro'] = $this->validateProUid($spr_data['spr_pro']);
}
if (isset($spr_data['spr_tas'])) {
$spr_data['spr_tas'] = $this->validateTasUid($spr_data['spr_tas']);
}
$dataTemp = $this->getSubprocesss($pro_uid, $tas_uid);
$spr_data = array_merge($dataTemp, $spr_data);
$spr_data['spr_variables_in'] = isset($spr_data['spr_variables_in']) ? $spr_data['spr_variables_in'] : array();
$oSubProcess = new \SubProcess();
$aData = array('SP_UID' => $spr_data['spr_uid'], 'PRO_UID' => $spr_data['spr_pro'], 'TAS_UID' => $spr_data['spr_tas'], 'PRO_PARENT' => $pro_uid, 'TAS_PARENT' => $tas_uid, 'SP_TYPE' => 'SIMPLE', 'SP_SYNCHRONOUS' => (int) $spr_data['spr_synchronous'], 'SP_SYNCHRONOUS_TYPE' => 'ALL', 'SP_SYNCHRONOUS_WAIT' => 0, 'SP_VARIABLES_OUT' => serialize($spr_data['spr_variables_out']), 'SP_VARIABLES_IN' => serialize($spr_data['spr_variables_in']), 'SP_GRID_IN' => '');
$oSubProcess->update($aData);
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
\Content::addContent('TAS_TITLE', '', $tas_uid, $lang, $spr_data['spr_name']);
}
示例6: array
$_POST['port'] = 'none';
}
$aData = array('DBS_UID' => $_POST['dbs_uid'], 'PRO_UID' => $_SESSION['PROCESS'], 'DBS_TYPE' => $_POST['type'], 'DBS_SERVER' => $_POST['server'], 'DBS_DATABASE_NAME' => $_POST['db_name'], 'DBS_USERNAME' => $_POST['user'], 'DBS_PASSWORD' => ($_POST['passwd'] == 'none' ? "" : G::encrypt($_POST['passwd'], $_POST['db_name'])) . "_2NnV3ujj3w", 'DBS_PORT' => $_POST['port'] == 'none' ? "" : $_POST['port'], 'DBS_ENCODE' => $_POST['enc']);
$oDBSource->update($aData);
$oContent->addContent('DBS_DESCRIPTION', '', $_POST['dbs_uid'], SYS_LANG, $_POST['desc']);
break;
case 'saveConnection':
$oDBSource = new DbSource();
$oContent = new Content();
if (strpos($_POST['server'], "\\")) {
$_POST['port'] = 'none';
}
$aData = array('PRO_UID' => $_SESSION['PROCESS'], 'DBS_TYPE' => $_POST['type'], 'DBS_SERVER' => $_POST['server'], 'DBS_DATABASE_NAME' => $_POST['db_name'], 'DBS_USERNAME' => $_POST['user'], 'DBS_PASSWORD' => ($_POST['passwd'] == 'none' ? "" : G::encrypt($_POST['passwd'], $_POST['db_name'])) . "_2NnV3ujj3w", 'DBS_PORT' => $_POST['port'] == 'none' ? "" : $_POST['port'], 'DBS_ENCODE' => $_POST['enc']);
$newid = $oDBSource->create($aData);
$sDelimiter = DBAdapter::getStringDelimiter();
$oContent->addContent('DBS_DESCRIPTION', '', $newid, SYS_LANG, $_POST['desc']);
break;
case 'deleteDbConnection':
try {
$oDBSource = new DbSource();
$oContent = new Content();
$DBS_UID = $_POST['dbs_uid'];
$PRO_UID = $_SESSION['PROCESS'];
$oDBSource->remove($DBS_UID, $PRO_UID);
$oContent->removeContent('DBS_DESCRIPTION', "", $DBS_UID);
$result->success = true;
$result->msg = G::LoadTranslation('ID_DBCONNECTION_REMOVED');
} catch (Exception $e) {
$result->success = false;
$result->msg = $e->getMessage();
}
示例7: createDBConnectionsRows
/**
* Create DB Connections rows from an array of data
*
* @param array $aConnections
* @return void
*/
public function createDBConnectionsRows ($aConnections)
{
foreach ($aConnections as $sKey => $aRow) {
$oConnection = new DbSource();
if ($oConnection->Exists( $aRow['DBS_UID'], $aRow['PRO_UID'] )) {
$oConnection->remove( $aRow['DBS_UID'], $aRow['PRO_UID'] );
}
$oConnection->create( $aRow );
// Update information in the table of contents
$oContent = new Content();
$ConCategory = 'DBS_DESCRIPTION';
$ConParent = '';
$ConId = $aRow['DBS_UID'];
$ConLang = SYS_LANG;
if ($oContent->Exists( $ConCategory, $ConParent, $ConId, $ConLang )) {
$oContent->removeContent( $ConCategory, $ConParent, $ConId );
}
$oContent->addContent( $ConCategory, $ConParent, $ConId, $ConLang, $aRow['DBS_DESCRIPTION'] );
}
} #@!neyek
示例8: setInpDocDescription
/**
* Set the [inp_doc_comment] column value.
*
* @param string $sValue new value
* @return void
*/
public function setInpDocDescription($sValue)
{
if ($sValue !== null && !is_string($sValue)) {
$sValue = (string) $sValue;
}
if ($this->inp_doc_description !== $sValue || $sValue === '') {
try {
$this->inp_doc_description = $sValue;
$iResult = Content::addContent('INP_DOC_DESCRIPTION', '', $this->getInpDocUid(), defined('SYS_LANG') ? SYS_LANG : 'en', $this->inp_doc_description);
} catch (Exception $oError) {
$this->inp_doc_description = '';
throw $oError;
}
}
}
示例9: update
//.........这里部分代码省略.........
//Delete
$step = new \Step();
$criteria = new \Criteria("workflow");
$criteria->add(\StepPeer::TAS_UID, $arrayWebEntryEventData["WEE_WE_TAS_UID"]);
$rsCriteria = \StepPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$result = $step->remove($row["STEP_UID"]);
}
//Add
$step = new \Step();
$stepUid = $step->create(array("PRO_UID" => $arrayWebEntryEventData["PRJ_UID"], "TAS_UID" => $arrayWebEntryEventData["WEE_WE_TAS_UID"]));
$result = $step->update(array("STEP_UID" => $stepUid, "STEP_TYPE_OBJ" => "DYNAFORM", "STEP_UID_OBJ" => $arrayData["DYN_UID"], "STEP_POSITION" => 1, "STEP_MODE" => "EDIT"));
}
//Task - User
if (isset($arrayData["USR_UID"]) && $arrayData["USR_UID"] != $arrayWebEntryEventData["USR_UID"]) {
//Unassign
$taskUser = new \TaskUser();
$criteria = new \Criteria("workflow");
$criteria->add(\TaskUserPeer::TAS_UID, $arrayWebEntryEventData["WEE_WE_TAS_UID"]);
$rsCriteria = \TaskUserPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$result = $taskUser->remove($row["TAS_UID"], $row["USR_UID"], $row["TU_TYPE"], $row["TU_RELATION"]);
}
//Assign
$result = $task->assignUser($arrayWebEntryEventData["WEE_WE_TAS_UID"], $arrayData["USR_UID"], 1);
}
//Route
if (isset($arrayData["ACT_UID"]) && $arrayData["ACT_UID"] != $arrayWebEntryEventData["ACT_UID"]) {
//Delete
$result = $task->deleteAllRoutesOfTask($arrayWebEntryEventData["PRJ_UID"], $arrayWebEntryEventData["WEE_WE_TAS_UID"], true);
//Add
$workflow = \ProcessMaker\Project\Workflow::load($arrayWebEntryEventData["PRJ_UID"]);
$result = $workflow->addRoute($arrayWebEntryEventData["WEE_WE_TAS_UID"], $arrayData["ACT_UID"], "SEQUENTIAL");
}
//WebEntry
$arrayDataAux = array();
if (isset($arrayData["DYN_UID"])) {
$arrayDataAux["DYN_UID"] = $arrayData["DYN_UID"];
}
if (isset($arrayData["USR_UID"])) {
$arrayDataAux["USR_UID"] = $arrayData["USR_UID"];
}
if (isset($arrayData["WEE_TITLE"])) {
$arrayDataAux["WE_TITLE"] = $arrayData["WEE_TITLE"];
}
if (isset($arrayData["WEE_DESCRIPTION"])) {
$arrayDataAux["WE_DESCRIPTION"] = $arrayData["WEE_DESCRIPTION"];
}
if (count($arrayDataAux) > 0) {
$arrayDataAux = $this->webEntry->update($arrayWebEntryEventData["WEE_WE_UID"], $userUidUpdater, $arrayDataAux);
}
}
break;
case "DELETE":
$this->deleteWebEntry($arrayWebEntryEventData["WEE_WE_UID"], $arrayWebEntryEventData["WEE_WE_TAS_UID"]);
$arrayData["WEE_WE_UID"] = "";
$arrayData["WEE_WE_TAS_UID"] = "";
break;
}
//WebEntry-Event
$webEntryEvent = \WebEntryEventPeer::retrieveByPK($webEntryEventUid);
$webEntryEvent->fromArray($arrayData, \BasePeer::TYPE_FIELDNAME);
if ($webEntryEvent->validate()) {
$cnn->begin();
$result = $webEntryEvent->save();
$cnn->commit();
//Set WEE_TITLE
if (isset($arrayData["WEE_TITLE"])) {
$result = \Content::addContent("WEE_TITLE", "", $webEntryEventUid, SYS_LANG, $arrayData["WEE_TITLE"]);
}
//Set WEE_DESCRIPTION
if (isset($arrayData["WEE_DESCRIPTION"])) {
$result = \Content::addContent("WEE_DESCRIPTION", "", $webEntryEventUid, SYS_LANG, $arrayData["WEE_DESCRIPTION"]);
}
//Return
$arrayData = $arrayDataBackup;
if (!$this->formatFieldNameInUppercase) {
$arrayData = array_change_key_case($arrayData, CASE_LOWER);
}
return $arrayData;
} else {
$msg = "";
foreach ($webEntryEvent->getValidationFailures() as $validationFailure) {
$msg = $msg . ($msg != "" ? "\n" : "") . $validationFailure->getMessage();
}
throw new \Exception(\G::LoadTranslation("ID_REGISTRY_CANNOT_BE_UPDATED") . ($msg != "" ? "\n" . $msg : ""));
}
} catch (\Exception $e) {
$cnn->rollback();
$this->deleteWebEntry($this->webEntryEventWebEntryUid, $this->webEntryEventWebEntryTaskUid);
throw $e;
}
} catch (\Exception $e) {
throw $e;
}
}
示例10: setPermissionName
/**
*
* @param string $name
*/
public function setPermissionName($name)
{
if ($this->getPerUid() == '') {
throw new Exception("Error in setPerTitle, the PER_UID can't be blank");
}
if ($name !== null && !is_string($name)) {
$name = (string) $name;
}
if ($this->permission_name !== $name || $name === '') {
$this->permission_name = $name;
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
$res = Content::addContent('PER_NAME', '', $this->getPerUid(), $lang, $this->permission_name);
}
}
示例11: setAppDocFilename
/**
* Set the [app_doc_filename] column value.
*
* @param string $sValue new value
* @return void
*/
public function setAppDocFilename ($sValue)
{
if ($sValue !== null && ! is_string( $sValue )) {
$sValue = (string) $sValue;
}
if ($this->app_doc_filename !== $sValue || $sValue === '') {
try {
$this->app_doc_filename = $sValue;
$iResult = Content::addContent( 'APP_DOC_FILENAME', $this->getDocVersion(), $this->getAppDocUid(), (defined( 'SYS_LANG' ) ? SYS_LANG : 'en'), $this->app_doc_filename );
} catch (Exception $oError) {
$this->app_doc_filename = '';
throw ($oError);
}
}
}
示例12: update
/**
* Update Web Entry
*
* @param string $webEntryUid Unique id of Web Entry
* @param string $userUidUpdater Unique id of updater User
* @param array $arrayData Data
*
* return array Return data of the Web Entry updated
*/
public function update($webEntryUid, $userUidUpdater, array $arrayData)
{
try {
//Verify data
$process = new \ProcessMaker\BusinessModel\Process();
$validator = new \ProcessMaker\BusinessModel\Validator();
$validator->throwExceptionIfDataIsNotArray($arrayData, "\$arrayData");
$validator->throwExceptionIfDataIsEmpty($arrayData, "\$arrayData");
//Set data
$arrayData = array_change_key_case($arrayData, CASE_UPPER);
//Set variables
$arrayWebEntryData = $this->getWebEntry($webEntryUid, true);
//Verify data
$this->throwExceptionIfNotExistsWebEntry($webEntryUid, $this->arrayFieldNameForException["webEntryUid"]);
$this->throwExceptionIfDataIsInvalid($webEntryUid, $arrayWebEntryData["PRO_UID"], $arrayData);
//Update
$cnn = \Propel::getConnection("workflow");
try {
$webEntry = \WebEntryPeer::retrieveByPK($webEntryUid);
$webEntry->fromArray($arrayData, \BasePeer::TYPE_FIELDNAME);
$webEntry->setWeUpdateUsrUid($userUidUpdater);
$webEntry->setWeUpdateDate("now");
if ($webEntry->validate()) {
$cnn->begin();
$result = $webEntry->save();
$cnn->commit();
//Set WE_TITLE
if (isset($arrayData["WE_TITLE"])) {
$result = \Content::addContent("WE_TITLE", "", $webEntryUid, SYS_LANG, $arrayData["WE_TITLE"]);
}
if (isset($arrayData["WE_DESCRIPTION"])) {
$result = \Content::addContent("WE_DESCRIPTION", "", $webEntryUid, SYS_LANG, $arrayData["WE_DESCRIPTION"]);
}
//Set WE_DATA
$this->setWeData($webEntryUid);
//Return
if (!$this->formatFieldNameInUppercase) {
$arrayData = array_change_key_case($arrayData, CASE_LOWER);
}
return $arrayData;
} else {
$msg = "";
foreach ($webEntry->getValidationFailures() as $validationFailure) {
$msg = $msg . ($msg != "" ? "\n" : "") . $validationFailure->getMessage();
}
throw new \Exception(\G::LoadTranslation("ID_REGISTRY_CANNOT_BE_UPDATED") . ($msg != "" ? "\n" . $msg : ""));
}
} catch (\Exception $e) {
$cnn->rollback();
throw $e;
}
} catch (\Exception $e) {
throw $e;
}
}
示例13: setTasDefSubjectMessage
/**
* Set the tas_def_subject_message column value.
*
* @param string $v new value
* @return void
*/
public function setTasDefSubjectMessage($v)
{
if ($this->getTasUid() == "") {
throw new Exception("Error in setTasDefSubjectMessage, the getTasUid() can't be blank");
}
$v = isset($v) ? (string) $v : '';
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
if ($this->tas_def_subject_message !== $v || $v === "") {
$this->tas_def_subject_message = $v;
$res = Content::addContent('TAS_DEF_SUBJECT_MESSAGE', '', $this->getTasUid(), $lang, $v);
return $res;
}
return 0;
}
示例14: array
$out = array();
for ($i = 1; $i <= count($_POST['form']['grid1']); $i++) {
$out[$_POST['form']['grid1'][$i]['VAR_OUT1']] = $_POST['form']['grid1'][$i]['VAR_OUT2'];
}
$in = array();
for ($j = 1; $j <= count($_POST['form']['grid2']); $j++) {
$in[$_POST['form']['grid2'][$j]['VAR_IN1']] = $_POST['form']['grid2'][$j]['VAR_IN2'];
}
require_once 'classes/model/Task.php';
$oTask = new Task();
//$aTask=$oTask->load($_POST['form']['TASKS']);
//$aTask=$oTask->load($_POST['form']['PRO_UID']);
$aTask = $_POST['form']['TASKS'] != 0 ? $oTask->load($_POST['form']['TASKS']) : 0;
//$aTask['PRO_UID']=0;
if (isset($_POST['form']['SP_SYNCHRONOUS']) && $_POST['form']['SP_SYNCHRONOUS'] == '') {
$_POST['form']['SP_SYNCHRONOUS'] = '0';
}
if (!isset($_POST['form']['SP_SYNCHRONOUS'])) {
$_POST['form']['SP_SYNCHRONOUS'] = '0';
}
require_once 'classes/model/SubProcess.php';
$oOP = new SubProcess();
$aData = array('SP_UID' => $_POST['form']['SP_UID'], 'PRO_UID' => isset($aTask['PRO_UID']) ? $aTask['PRO_UID'] : '', 'TAS_UID' => $_POST['form']['TASKS'], 'PRO_PARENT' => $_POST['form']['PRO_PARENT'], 'TAS_PARENT' => $_POST['form']['TAS_PARENT'], 'SP_TYPE' => 'SIMPLE', 'SP_SYNCHRONOUS' => $_POST['form']['SP_SYNCHRONOUS'], 'SP_SYNCHRONOUS_TYPE' => 'ALL', 'SP_SYNCHRONOUS_WAIT' => 0, 'SP_VARIABLES_OUT' => serialize($out), 'SP_VARIABLES_IN' => serialize($in), 'SP_GRID_IN' => '');
$oOP->update($aData);
require_once 'classes/model/Content.php';
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
//$cont = Content::addContent( 'SP_TITLE', '', $_POST['form']['SP_UID'], $lang, $_POST['form']['SPROCESS_NAME'] );
$cont = Content::addContent('TAS_TITLE', '', $_POST['form']['TAS_PARENT'], $lang, $_POST['form']['SPROCESS_NAME']);
//$cont = Content::addContent( 'TAS_TITLE', '', $_POST['form']['SP_UID'], $lang, $_POST['form']['SPROCESS_NAME'] );
//G::header('location: processes_Map?PRO_UID='. $_POST['form']['PRO_UID']);
die;
示例15: setOutDocTemplate
/**
* Set the [out_doc_template] column value.
*
* @param string $sValue new value
* @return void
*/
public function setOutDocTemplate($sValue)
{
if ($sValue !== null && !is_string($sValue)) {
$sValue = (string) $sValue;
}
if ($this->out_doc_template !== $sValue || $sValue === '') {
try {
$this->out_doc_template = $sValue;
$iResult = Content::addContent('OUT_DOC_TEMPLATE', '', $this->getOutDocUid(), defined('SYS_LANG') ? SYS_LANG : 'en', $this->out_doc_template);
} catch (Exception $oError) {
$this->out_doc_template = '';
throw $oError;
}
}
}