本文整理汇总了PHP中Configurations::saveConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Configurations::saveConfig方法的具体用法?PHP Configurations::saveConfig怎么用?PHP Configurations::saveConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configurations
的用法示例。
在下文中一共展示了Configurations::saveConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updatePageSize
function updatePageSize()
{
G::LoadClass('configuration');
$c = new Configurations();
$arr['pageSize'] = $_REQUEST['size'];
$arr['dateSave'] = date('Y-m-d H:i:s');
$config = array();
$config[] = $arr;
$c->aConfig = $config;
$c->saveConfig('skinsList', 'pageSize', '', $_SESSION['USER_LOGGED']);
echo '{success: true}';
}
示例2: stdclass
$result = new stdclass();
switch ($request) {
case "getUserMaskList":
$result->rows = Configurations::getUserNameFormats();
print G::json_encode($result);
break;
case "getDateFormats":
$result->rows = Configurations::getDateFormats();
print G::json_encode($result);
break;
case "getCasesListDateFormat":
$result->rows = Configurations::getDateFormats();
print G::json_encode($result);
break;
case "getCasesListRowNumber":
for ($i = 10; $i <= 50; $i += 5) {
$formats[] = array("id" => "{$i}", "name" => "{$i}");
}
$result->rows = $formats;
print G::json_encode($result);
break;
case "save":
$conf = new Configurations();
$conf->aConfig = array("format" => $_POST["userFormat"], "dateFormat" => $_POST["dateFormat"], "startCaseHideProcessInf" => isset($_POST["hideProcessInf"]) ? true : false, "casesListDateFormat" => $_POST["casesListDateFormat"], "casesListRowNumber" => intval($_POST["casesListRowNumber"]), "casesListRefreshTime" => intval($_POST["txtCasesRefreshTime"]));
$conf->saveConfig("ENVIRONMENT_SETTINGS", "");
$response = new stdclass();
$response->success = true;
$response->msg = G::LoadTranslation("ID_SAVED_SUCCESSFULLY");
echo G::json_encode($response);
break;
}
示例3: upgradeCasesDirectoryStructure
//.........这里部分代码省略.........
} else {
CLI::logging(CLI::error("Error: Failure at coping from $UIdDir...\n"));
}
} else {
CLI::logging("$UIdDir is empty, removing it\n");
rmdir($UIdDir);//remove the diretory itself
}
}
}
//Start '0' directory migration
$black = PATH_DOCUMENT . $blackHoleDir . '/';
if (is_dir($black)) {
$newpattern = array();
$file = glob($black . '*.*');//files only
$dirlen = count($file);
for ($index = 0; $index < $dirlen; $index++) {
$levelfile = explode('/', $file[$index]);
$lastlevel = sizeof($levelfile);
$goalFile = $levelfile[$lastlevel - 1];
$newpattern = G::getPathFromFileUIDPlain($blackHoleDir, $goalFile);
CLI::logging("Migrating $blackHoleDir file: $goalFile\n");
G::mk_dir($blackHoleDir . PATH_SEP . $newpattern[0], 0777);
//echo `cp -R $black$goalFile $black$newpattern[0]/$newpattern[1]`;
if (copy($black . $goalFile, $black . $newpattern[0] . '/' . $newpattern[1])) {
unlink($file[$index]);
} else {
CLI::logging(CLI::error("Error: Failure at copy $file[$index] files...\n"));
}
}
}
//Set value of 2 to the directory structure version.
$this->initPropel(true);
G::LoadClass("configuration");
$conf = new Configurations();
if (!$conf->exists("ENVIRONMENT_SETTINGS")) {
$conf->aConfig = array ("format" => '@userName (@firstName @lastName)',
"dateFormat" => 'd/m/Y',
"startCaseHideProcessInf" => false,
"casesListDateFormat" => 'Y-m-d H:i:s',
"casesListRowNumber" => 25,
"casesListRefreshTime" => 120 );
$conf->saveConfig( 'ENVIRONMENT_SETTINGS', '' );
}
$conf->setDirectoryStructureVer(2);
CLI::logging(CLI::info("Version Directory Structure is 2 now.\n"));
}
示例4: sizeof
$index = sizeof($aCat) - 1;
$aCat[$index]['TOTAL_PROCESSES'] = isset($aProcess[$aCat[$index]['CATEGORY_UID']]) ? $aProcess[$aCat[$index]['CATEGORY_UID']] : 0;
}
$result['data'] = $aCat;
$result['totalCount'] = $total_categories;
echo G::json_encode($result);
break;
case 'updatePageSize':
G::LoadClass('configuration');
$c = new Configurations();
$arr['pageSize'] = $_REQUEST['size'];
$arr['dateSave'] = date('Y-m-d H:i:s');
$config = array();
$config[] = $arr;
$c->aConfig = $config;
$c->saveConfig('processCategoryList', 'pageSize', '', $_SESSION['USER_LOGGED']);
echo '{success: true}';
break;
case 'checkCategoryName':
require_once 'classes/model/ProcessCategory.php';
$catName = $_REQUEST['cat_name'];
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_NAME);
$oCriteria->add(ProcessCategoryPeer::CATEGORY_NAME, $catName);
$oDataset = ProcessCategoryPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$row = $oDataset->getRow();
$response = isset($row['CATEGORY_NAME']) ? 'false' : 'true';
echo $response;
break;
示例5: Configurations
$configuration = new Configurations();
$importResults = $language->import($languageFile);
G::LoadClass("wsTools");
$renegerateContent = new workspaceTools(SYS_SYS);
$messs = $renegerateContent->upgradeContent();
$result->msg = G::LoadTranslation('IMPORT_LANGUAGE_SUCCESS') . "\n";
$result->msg .= G::LoadTranslation("ID_FILE_NUM_RECORD") . $importResults->recordsCount . "\n";
$result->msg .= G::LoadTranslation("ID_SUCCESS_RECORD") . $importResults->recordsCountSuccess . "\n";
$result->msg .= G::LoadTranslation("ID_FAILED_RECORD") . ($importResults->recordsCount - $importResults->recordsCountSuccess) . "\n";
if ($importResults->errMsg != '') {
$result->msg .= G::LoadTranslation("ID_ERROR_REGISTERED") . " \n" . $importResults->errMsg . "\n";
}
//$result->msg = htmlentities($result->msg);
$result->success = true;
//saving metadata
$configuration->aConfig = array('headers' => $importResults->headers, 'language' => $importResults->lang, 'import-date' => date('Y-m-d H:i:s'), 'user' => '', 'version' => '1.0');
$configuration->saveConfig('LANGUAGE_META', $importResults->lang);
$dir = PATH_CORE . 'content' . PATH_SEP . 'translations' . PATH_SEP;
if (!is_writable($dir)) {
throw new Exception(G::LoadTranslation('ID_TRANSLATIONS_FOLDER_PERMISSIONS'));
}
G::uploadFile($languageFile, $dir, $languageFilename, 0777);
ini_set('max_execution_time', $sMaxExecutionTime);
} catch (Exception $oError) {
$result->msg = $oError->getMessage();
//print_r($oError->getTrace());
$result->success = false;
//G::SendTemporalMessage($oError->getMessage(), 'error', 'string');
//G::header('location: languages_ImportForm');
}
echo G::json_encode($result);
示例6: updateProperties
//.........这里部分代码省略.........
}
$this->unsetVar($arrayProperty, "TAS_DEF_MESSAGE");
} else {
if (empty($arrayProperty["TAS_DEF_MESSAGE"])) {
throw (new \Exception("Invalid value specified for 'tas_def_message'"));
}
$this->unsetVar($arrayProperty, "TAS_DEF_MESSAGE_TEMPLATE");
}
//Additional configuration
if (isset($arrayProperty["TAS_DEF_MESSAGE_TYPE"])) {
\G::LoadClass("configuration");
$oConf = new \Configurations();
if (!isset($arrayProperty["TAS_DEF_MESSAGE_TEMPLATE"])) {
$arrayProperty["TAS_DEF_MESSAGE_TEMPLATE"] = "alert_message.html";
}
$oConf->aConfig = array("TAS_DEF_MESSAGE_TYPE" => $arrayProperty["TAS_DEF_MESSAGE_TYPE"], "TAS_DEF_MESSAGE_TEMPLATE" => $arrayProperty["TAS_DEF_MESSAGE_TEMPLATE"]);
$oConf->saveConfig("TAS_EXTRA_PROPERTIES", $arrayProperty["TAS_UID"], "", "");
}
} else {
$this->unsetVar($arrayProperty, "TAS_DEF_SUBJECT_MESSAGE");
$this->unsetVar($arrayProperty, "TAS_DEF_MESSAGE_TYPE");
$this->unsetVar($arrayProperty, "TAS_DEF_MESSAGE");
$this->unsetVar($arrayProperty, "TAS_DEF_MESSAGE_TEMPLATE");
}
$result = $task->update($arrayProperty);
if (!empty($arrayProperty['CONSOLIDATE_DATA'])) {
if (!empty($arrayProperty['CONSOLIDATE_DATA']['consolidated_dynaform'])) {
G::LoadClass("consolidatedCases");
$consolidated = new \ConsolidatedCases();
$dataConso = array(
'con_status' => $arrayProperty['CONSOLIDATE_DATA']['consolidated_enable'],
'tas_uid' => $arrayProperty['TAS_UID'],
示例7: print
print(G::json_encode($result));
die;
}
*/
/* Saving preferences */
$def_lang = $form['PREF_DEFAULT_LANG'];
$def_menu = $form['PREF_DEFAULT_MENUSELECTED'];
$def_cases_menu = isset($form['PREF_DEFAULT_CASES_MENUSELECTED']) ? $form['PREF_DEFAULT_CASES_MENUSELECTED'] : '';
G::loadClass('configuration');
$oConf = new Configurations();
$aConf = array('DEFAULT_LANG' => $def_lang, 'DEFAULT_MENU' => $def_menu, 'DEFAULT_CASES_MENU' => $def_cases_menu);
/* UPDATING SESSION VARIABLES */
$aUser = $RBAC->userObj->load($_SESSION['USER_LOGGED']);
//$_SESSION['USR_FULLNAME'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
$oConf->aConfig = $aConf;
$oConf->saveConfig('USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED']);
}
if ($_SESSION['USER_LOGGED'] == $form['USR_UID']) {
/* UPDATING SESSION VARIABLES */
$aUser = $RBAC->userObj->load($_SESSION['USER_LOGGED']);
$_SESSION['USR_FULLNAME'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
}
//Save Calendar assigment
if (isset($form['USR_CALENDAR'])) {
//Save Calendar ID for this user
G::LoadClass("calendar");
$calendarObj = new Calendar();
$calendarObj->assignCalendarTo($aData['USR_UID'], $form['USR_CALENDAR'], 'USER');
}
$result->success = true;
print G::json_encode($result);
示例8: saveOrderDashlet
public function saveOrderDashlet($data)
{
$this->setResponseType('json');
try {
$orderDashlet[0] = Bootstrap::json_decode($data->positionCol0);
$orderDashlet[1] = Bootstrap::json_decode($data->positionCol1);
$orderDashlet[2] = Bootstrap::json_decode($data->positionCol2);
G::loadClass('configuration');
$oConfiguration = new Configurations();
$aConfiguration = $oConfiguration->load('Dashboard', '', '', $_SESSION['USER_LOGGED']);
$dataDashboard = array();
if (isset($aConfiguration["CFG_VALUE"])) {
$dataDashboard = $aConfiguration["CFG_VALUE"];
}
$dataNow['ORDER'] = $orderDashlet;
if (isset($data->columns)) {
$dataNow['COLUMNS'] = Bootstrap::json_decode($data->columns);
}
$dataDashboard = array_merge($dataDashboard, $dataNow);
$oConfiguration->aConfig = $dataDashboard;
$oConfiguration->saveConfig('Dashboard', '', '', $_SESSION['USER_LOGGED']);
$result->success = '1';
return $result;
} catch (Exception $error) {
//ToDo: Display a error message
}
}
示例9: Configurations
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
//if (($RBAC_Response=$RBAC->userCanAccess("PM_USERS"))!=1) return $RBAC_Response;
G::LoadInclude('ajax');
$_POST['action'] = get_ajax_value('action');
switch ($_POST['action']) {
case 'updatePageSize':
G::LoadClass('configuration');
$c = new Configurations();
$arr['pageSize'] = $_REQUEST['size'];
$arr['dateSave'] = date('Y-m-d H:i:s');
$config = array();
$config[] = $arr;
$c->aConfig = $config;
$c->saveConfig('casesSchedulerLogList', 'pageSize', '', $_SESSION['USER_LOGGED']);
echo '{success: true}';
break;
break;
}
示例10: isset
<?php
$request = isset($_REQUEST['request']) ? $_REQUEST['request'] : null;
switch ($request) {
case 'getLangList':
$Translations = G::getModel('Translation');
$result = new stdClass();
$result->rows = array();
$langs = $Translations->getTranslationEnvironments();
foreach ($langs as $lang) {
$result->rows[] = array('LAN_ID' => $lang['LOCALE'], 'LAN_NAME' => $lang['LANGUAGE']);
}
print G::json_encode($result);
break;
case 'saveSettings':
$memcache =& PMmemcached::getSingleton(defined('SYS_SYS') ? SYS_SYS : '');
G::LoadClass('configuration');
$conf = new Configurations();
$conf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
$conf->aConfig['login_enableForgotPassword'] = isset($_REQUEST['forgotPasswd']);
$conf->aConfig['login_enableVirtualKeyboard'] = isset($_REQUEST['virtualKeyboad']);
$conf->aConfig['login_defaultLanguage'] = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : 'en';
$conf->saveConfig('ENVIRONMENT_SETTINGS', '');
//remove from memcache when this value is updated/created
$memcache->delete('flagForgotPassword');
$response->success = true;
echo G::json_encode($response);
break;
}
示例11: urldecode
$field['new' . $key] = urldecode($value);
}
//join
$ntable->ses->execute($ntable->replaceDataField($ntable->sqlUpdate, $field));
break;
case "insert":
$ntable->prepareQuery();
parse_str(get_ajax_value('field'), $field);
foreach ($field as $key => $value) {
$field[$key] = urldecode($value);
}
$ntable->ses->execute($ntable->replaceDataField($ntable->sqlInsert, $field));
break;
case "printForm":
parse_str(get_ajax_value('field'), $field);
parse_str(get_ajax_value('field'), $field);
foreach ($field as $key => $value) {
$field[$key] = urldecode($value);
}
$ntable->printForm(get_ajax_value('filename'), $field);
return;
}
$ntable->renderTable("content");
G::LoadClass("configuration");
$conf = new Configurations();
$conf->setConfig($ntable->__Configuration, $ntable, $conf->aConfig);
if (isset($_SESSION["USER_LOGGED"])) {
$conf->saveConfig("pagedTable", $ntable->__OBJ_UID, "", $_SESSION["USER_LOGGED"], "");
} else {
$conf->saveConfig("pagedTable", $ntable->__OBJ_UID);
}
示例12: foreach
* @autor erik <erik@colosa.com>
*/
foreach ($aData as $k => $v) {
$aData[$k] = str_replace('@amp@', '&', $v);
}
if (isset($aData['SEND_EMAIL'])) {
$aData['TAS_SEND_LAST_EMAIL'] = $aData['SEND_EMAIL'] == 'TRUE' ? 'TRUE' : 'FALSE';
} else {
$aData['TAS_SEND_LAST_EMAIL'] = 'FALSE';
}
//Additional configuration
if (isset($aData['TAS_DEF_MESSAGE_TYPE']) && isset($aData['TAS_DEF_MESSAGE_TEMPLATE'])) {
G::LoadClass('configuration');
$oConf = new Configurations();
$oConf->aConfig = array('TAS_DEF_MESSAGE_TYPE' => $aData['TAS_DEF_MESSAGE_TYPE'], 'TAS_DEF_MESSAGE_TEMPLATE' => $aData['TAS_DEF_MESSAGE_TEMPLATE']);
$oConf->saveConfig('TAS_EXTRA_PROPERTIES', $aData['TAS_UID'], '', '');
unset($aData['TAS_DEF_MESSAGE_TYPE']);
unset($aData['TAS_DEF_MESSAGE_TEMPLATE']);
}
//Validating TAS_ASSIGN_VARIABLE value
if ($aData['TAS_ASSIGN_TYPE'] == 'SELF_SERVICE_EVALUATE') {
$aData['TAS_ASSIGN_TYPE'] = 'SELF_SERVICE';
} else {
$aData['TAS_GROUP_VARIABLE'] = '';
}
$result = $oTask->update($aData);
$response["status"] = "OK";
if ($result == 3) {
$response["status"] = "CRONCL";
}
echo G::json_encode($response);
示例13: setHashPassword
public function setHashPassword($object)
{
$type = array('md5', 'sha256');
if (!in_array($object->hash, $type)) {
throw new Exception('Type: ' . $object->hash . ' No valid.');
return false;
}
G::LoadClass("configuration");
$config = new Configurations();
$typeEncrypt = $config->getConfiguration('ENTERPRISE_SETTING_ENCRYPT', '');
if ($typeEncrypt == null) {
$typeEncrypt = array('current' => $object->hash, 'previous' => 'md5');
} else {
$typeEncrypt['previous'] = $typeEncrypt['current'];
$typeEncrypt['current'] = $object->hash;
}
if ($object->hash != $typeEncrypt['previous']) {
$config->aConfig = $typeEncrypt;
$config->saveConfig('ENTERPRISE_SETTING_ENCRYPT', '');
}
require_once 'classes/model/RbacUsersPeer.php';
require_once 'classes/model/UsersProperties.php';
$userProperty = new UsersProperties();
$criteria = new Criteria($object->workspace->dbInfo['DB_RBAC_NAME']);
$criteria->add(RbacUsersPeer::USR_STATUS, 0, Criteria::NOT_EQUAL);
$dataset = RbacUsersPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($dataset->next()) {
$row = $dataset->getRow();
$property = $userProperty->loadOrCreateIfNotExists($row['USR_UID'], array());
$property['USR_LOGGED_NEXT_TIME'] = 1;
$userProperty->update($property);
}
}
示例14: foreach
}
parse_str(get_ajax_value('update'), $fieldup);
foreach ($fieldup as $key => $value) {
$field['new' . $key] = urldecode($value);
}
//join
$ntable->ses->execute($ntable->replaceDataField($ntable->sqlUpdate, $field));
break;
case "insert":
$ntable->prepareQuery();
parse_str(get_ajax_value('field'), $field);
foreach ($field as $key => $value) {
$field[$key] = urldecode($value);
}
$ntable->ses->execute($ntable->replaceDataField($ntable->sqlInsert, $field));
break;
case "printForm":
parse_str(get_ajax_value('field'), $field);
parse_str(get_ajax_value('field'), $field);
foreach ($field as $key => $value) {
$field[$key] = urldecode($value);
}
$ntable->printForm(get_ajax_value('filename'), $field);
return;
}
$ntable->renderTable('content');
G::LoadClass('configuration');
$conf = new Configurations();
$conf->setConfig($ntable->__Configuration, $ntable, $conf->aConfig);
$conf->saveConfig('pagedTable', $ntable->__OBJ_UID, '', $_SESSION['USER_LOGGED'], '');
示例15: sizeof
$index = sizeof($aCals) - 1;
$aCals[$index]['TOTAL_USERS'] = isset($aUsers[$aCals[$index]['CALENDAR_UID']]) ? $aUsers[$aCals[$index]['CALENDAR_UID']] : 0;
$aCals[$index]['TOTAL_TASKS'] = isset($aTasks[$aCals[$index]['CALENDAR_UID']]) ? $aTasks[$aCals[$index]['CALENDAR_UID']] : 0;
$aCals[$index]['TOTAL_PROCESS'] = isset($aProcess[$aCals[$index]['CALENDAR_UID']]) ? $aProcess[$aCals[$index]['CALENDAR_UID']] : 0;
}
echo '{cals: ' . G::json_encode($aCals) . ', total_cals: ' . $total_cals . '}';
break;
case 'updatePageSize':
G::LoadClass('configuration');
$c = new Configurations();
$arr['pageSize'] = $_REQUEST['size'];
$arr['dateSave'] = date('Y-m-d H:i:s');
$config = array();
$config[] = $arr;
$c->aConfig = $config;
$c->saveConfig('calendarList', 'pageSize', '', $_SESSION['USER_LOGGED']);
echo '{success: true}';
break;
case 'canDeleteCalendar':
$cal_uid = $_POST['CAL_UID'];
G::LoadClass('calendar');
$cal = new calendar();
$total = 0;
$u = $cal->getAllCounterByCalendar('USER');
$t_u = isset($u[$cal_uid]) ? $u[$cal_uid] : 0;
$t = $cal->getAllCounterByCalendar('TASK');
$t_t = isset($t[$cal_uid]) ? $t[$cal_uid] : 0;
$p = $cal->getAllCounterByCalendar('PROCESS');
$t_p = isset($p[$cal_uid]) ? $p[$cal_uid] : 0;
$total = $t_u + $t_t + $t_p;
$response = $total == 0 ? 'true' : 'false';