本文整理汇总了PHP中G::loadTranslation方法的典型用法代码示例。如果您正苦于以下问题:PHP G::loadTranslation方法的具体用法?PHP G::loadTranslation怎么用?PHP G::loadTranslation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类G
的用法示例。
在下文中一共展示了G::loadTranslation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: translate
/**
* To implement pmos translation function on smarty templates
*
* example use:
*
* <h1>{translate label="ID_HOME_TITLE"}</h1>
*
* @params $params mixed array containg all parameters passed from smarty plugin call
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com, erik@colosa.com>
*/
function translate($params)
{
if (array_key_exists('lang', $params)) {
$lang = $params['lang'];
} elseif (defined('SYS_LANG')) {
$lang = SYS_LANG;
} else {
$lang = 'en';
}
if (!array_key_exists('label', $params)) {
throw new Exception('Error: Param "label" is missing on "tranlate" smarty function, it should be called like: {translate label="SOME_LABEL_ID"}');
}
echo G::loadTranslation($params['label'], $lang);
}
示例2: lookforchildren
function lookforchildren($parent, $level)
{
global $xVar;
global $template;
global $lastDept;
$oDept = new Department();
$allDepartments = $oDept->getDepartments($parent);
$level = $level + 1;
if (!isset($lastDept[$level])) {
$lastDept[$level] = true;
}
$lastDept[$level] = true;
foreach ($allDepartments as $department) {
$xVar++;
$depUID = htmlentities($department['DEP_UID']);
$depTitle = strip_tags($department['DEP_TITLE']);
$template->newBlock('department');
$template->assign('xVar', $xVar);
$template->assign('UID', $depUID);
$template->assign('DEPO_TITLE', $depTitle);
$template->assign('ID_EDIT', G::LoadTranslation('ID_EDIT'));
$template->assign('ID_MEMBERS', G::LoadTranslation('ID_MEMBERS'));
$template->assign('ID_NEW', G::loadTranslation("ID_NEW"));
for ($iLevel = 2; $iLevel <= $level; $iLevel++) {
$template->newBlock('level');
$template->assign('UID', $iLevel);
if ($iLevel == $level) {
if ($department['DEP_LAST']) {
$lastDept[$level] = false;
}
$template->assign('image', $department['DEP_LAST'] == 0 ? 'ftv2node' : 'ftv2lastnode');
$template->assign('background', $department['DEP_LAST'] == 0 ? 'ftv2vertline' : 'ftv2blank');
} else {
$template->assign('image', 'ftv2blank');
$template->assign('background', $lastDept[$iLevel] ? 'ftv2vertline' : 'ftv2blank');
}
}
if ($department['HAS_CHILDREN'] == 0) {
$template->newBlock('delete');
$template->assign('UID', $depUID);
$template->assign('ID_DELETE', G::LoadTranslation('ID_DELETE'));
}
lookforchildren($depUID, $level);
}
return;
}
示例3: dbConnections
} else {
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP'] = $aPreviousStep['PAGE'];
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = G::loadTranslation("ID_PREVIOUS_STEP");
}
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = $aNextStep['PAGE'];
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = G::loadTranslation("ID_NEXT_STEP");
/** Added By erik date: 16-05-08
* Description: this was added for the additional database connections */
G::LoadClass('dbConnections');
$oDbConnections = new dbConnections($_SESSION['PROCESS']);
$oDbConnections->loadAdditionalConnections();
$stepFilename = "{$sNamespace}/{$sStepName}";
G::evalJScript("\n if (parent.setCurrent) {\n parent.setCurrent('" . $_GET['UID'] . "');\n }");
$G_PUBLISH->AddContent('content', $stepFilename);
} else {
$aMessage['MESSAGE'] = G::loadTranslation('ID_EXTERNAL_STEP_MISSING', SYS_LANG, array("plugin" => $sNamespace));
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
}
break;
}
//Add content content step - End
} catch (Exception $e) {
G::SendTemporalMessage(G::LoadTranslation('ID_PROCESS_DEF_PROBLEM'), 'error', 'string', 3, 100);
$aMessage = array();
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
G::RenderPage('publish', 'blank');
die;
}
$oHeadPublisher =& headPublisher::getSingleton();
示例4: _dataUpdate
/**
* Update data from a addTable record
*
* @param $row
*/
public function _dataUpdate($row, $primaryKeys)
{
$keys = G::decrypt($row['__index__'], 'pmtable');
$keys = explode(',', $keys);
unset($row['__index__']);
$params = array();
foreach ($keys as $key) {
$params[] = is_numeric($key) ? $key : "'{$key}'";
}
$obj = null;
eval('$obj = ' . $this->classPeerName . '::retrieveByPk(' . implode(',', $params) . ');');
if (is_object($obj)) {
foreach ($row as $key => $value) {
// validation, don't modify primary keys
if (in_array($key, $primaryKeys)) {
throw new Exception(G::loadTranslation('ID_DONT_MODIFY_PK_VALUE', array($key)));
}
$action = 'set' . AdditionalTables::getPHPName($key);
$obj->{$action}($value);
}
if ($r = $obj->validate()) {
$obj->save();
$result = true;
} else {
$msg = '';
foreach ($obj->getValidationFailures() as $objValidationFailure) {
$msg .= $objValidationFailure->getMessage() . "\n";
}
throw new Exception($msg);
}
} else {
$result = false;
}
return $result;
}
示例5: Publisher
global $_DBArray;
$_DBArray ['langOptions'] = $availableLangArray;
$_DBArray ['availableWorkspace'] = $availableWorkspaceArray;
$_SESSION ['_DBArray'] = $_DBArray;
$aField ['LOGIN_VERIFY_MSG'] = G::loadTranslation ('LOGIN_VERIFY_MSG');
$aField['USER_LANG'] = SYS_LANG;
$G_PUBLISH = new Publisher ();
if (!defined('WS_IN_LOGIN')) {
define('WS_IN_LOGIN', 'serverconf');
}
$fileLogin = 'login/sysLogin';
示例6: catch
echo G::json_encode($result);
} catch (Exception $e) {
$confParams = array('lang' => $lang, 'status' => 'failed');
$appCacheViewEngine = $oServerConf->setProperty('APP_CACHE_VIEW_ENGINE', $confParams);
echo '{success: false, msg:"' . $e->getMessage() . '"}';
}
break;
case 'recreate-root':
$sh = md5(filemtime(PATH_GULLIVER . "/class.g.php"));
$h = G::encrypt($_POST['host'] . $sh . $_POST['user'] . $sh . $_POST['password'] . $sh . 1, $sh);
$insertStatements = "define ( 'HASH_INSTALLATION','{$h}' ); \ndefine ( 'SYSTEM_HASH', '{$sh}' ); \n";
$lines = array();
$content = '';
$filename = PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths_installed.php';
$lines = file($filename);
$count = 1;
foreach ($lines as $line_num => $line) {
$pos = strpos($line, "define");
if ($pos !== false && $count < 3) {
$content = $content . $line;
$count++;
}
}
$content = "<?php \n" . $content . "\n" . $insertStatements . "\n";
if (file_put_contents($filename, $content) != false) {
echo G::loadTranslation('ID_MESSAGE_ROOT_CHANGE_SUCESS');
} else {
echo G::loadTranslation('ID_MESSAGE_ROOT_CHANGE_FAILURE');
}
break;
}
示例7: getCaseNotes
/**
* import process fromLibrary: downloads and imports a process from the ProcessMaker library
*
* @param string sessionId : The session ID (which was obtained at login).
* @param string processId :
* @param string version :
* @param string importOption :
* @param string usernameLibrary : The username to obtain access to the ProcessMaker library.
* @param string passwordLibrary : The password to obtain access to the ProcessMaker library.
* @return $eturns will return an object
*/
public function getCaseNotes ($applicationID, $userUid = '')
{
try {
G::LoadClass( 'case' );
$result = new wsGetCaseNotesResponse( 0, G::loadTranslation( 'ID_SUCCESS' ), Cases::getCaseNotes( $applicationID, 'array', $userUid ) );
$var = array ();
foreach ($result->notes as $key => $value) {
$var2 = array ();
foreach ($value as $keys => $values) {
$field = strtolower( $keys );
$var2[$field] = $values;
}
$var[] = $var2;
}
$result->notes = $var;
return $result;
} catch (Exception $e) {
$result = new wsResponse( 100, $e->getMessage() );
return $result;
}
}
示例8: getUsersFromDepartment
public function getUsersFromDepartment($sDepUid, $sManagerUid)
{
try {
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
$oCriteria->addSelectColumn(UsersPeer::USR_REPORTS_TO);
$oCriteria->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
$oCriteria->add(UsersPeer::DEP_UID, $sDepUid);
$rs = UsersPeer::doSelectRS($oCriteria);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oUser = new Users();
$aUsers[] = array('USR_UID' => 'char', 'USR_USERNAME' => 'char', 'USR_FULLNAME' => 'char', 'USR_REPORTS_TO' => 'char', 'USR_MANAGER' => 'char');
$rs->next();
$row = $rs->getRow();
while (is_array($row)) {
$usrFields = $oUser->LoadDetails($row['USR_UID']);
$row['USR_USERNAME'] = $usrFields['USR_USERNAME'];
$row['USR_FULLNAME'] = $usrFields['USR_FULLNAME'];
$row['USR_MANAGER'] = $row['USR_UID'] == $sManagerUid ? G::loadTranslation("ID_YES") : G::loadTranslation("ID_NO");
$row['DEP_UID'] = $sDepUid;
if ($row['USR_REPORTS_TO'] != '') {
try {
$managerFields = $oUser->LoadDetails($row['USR_REPORTS_TO']);
$row['USR_REPORTS_NAME'] = $managerFields['USR_FULLNAME'];
} catch (exception $e) {
$row['USR_REPORTS_NAME'] = '.';
}
} else {
$row['USR_REPORTS_NAME'] = '.';
}
$aUsers[] = $row;
$rs->next();
$row = $rs->getRow();
}
G::LoadClass('ArrayPeer');
global $_DBArray;
$_DBArray['DepartmentUserList'] = $aUsers;
$_SESSION['_DBArray'] = $_DBArray;
$oCriteriaT = new Criteria('dbarray');
$oCriteriaT->setDBArrayTable('DepartmentUserList');
return $oCriteriaT;
} catch (exception $e) {
throw $e;
}
}
示例9: catch
if (isset($_GET['type'])) {
$sType = $_GET['type'];
} else {
$sType = '';
}
try {
$aNextStep = $oCase->getNextSupervisorStep($_SESSION['PROCESS'], $_SESSION['STEP_POSITION'], $sType);
$aPreviousStep = $oCase->getPreviousSupervisorStep($_SESSION['PROCESS'], $_SESSION['STEP_POSITION'], $sType);
} catch (exception $e) {
G::SendTemporalMessage($e->getMessage(), 'error', 'string');
}
if (!$aPreviousStep) {
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
} else {
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP'] = 'cases_StepToRevise?type=DYNAFORM&DYN_UID=' . $aPreviousStep['UID'] . '&position=' . $aPreviousStep['POSITION'] . '&APP_UID=' . $_GET['APP_UID'] . '&DEL_INDEX=' . $_GET['DEL_INDEX'];
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = G::loadTranslation("ID_PREVIOUS_STEP");
}
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = 'cases_StepToRevise?type=DYNAFORM&DYN_UID=' . $aNextStep['UID'] . '&position=' . $aNextStep['POSITION'] . '&APP_UID=' . $_GET['APP_UID'] . '&DEL_INDEX=' . $_GET['DEL_INDEX'];
/** Added By erik
* date: 16-05-08
* Description: this was added for the additional database connections */
G::LoadClass('dbConnections');
$oDbConnections = new dbConnections($_SESSION['PROCESS']);
$oDbConnections->loadAdditionalConnections();
$G_PUBLISH = new Publisher();
if ($_GET['DYN_UID'] != '') {
$_SESSION['CURRENT_DYN_UID'] = $_GET['DYN_UID'];
$G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_GET['DYN_UID'], '', $Fields['APP_DATA'], 'cases_SaveDataSupervisor?UID=' . $_GET['DYN_UID']);
}
G::RenderPage('publish', 'blank');
if (!isset($_GET['ex'])) {
示例10: getUxTypesList
public function getUxTypesList($type = 'assoc')
{
$list = array();
if ($type == 'assoc') {
$list = array('NORMAL' => G::loadTranslation('ID_UXS_NORMAL'), 'SIMPLIFIED' => G::loadTranslation('ID_UXS_SIMPLIFIED'), 'SWITCHABLE' => G::loadTranslation('ID_UXS_SWITCHABLE'), 'SINGLE' => G::loadTranslation('ID_UXS_SINGLE'));
} else {
$list = array(array('NORMAL', G::loadTranslation('ID_UXS_NORMAL')), array('SIMPLIFIED', G::loadTranslation('ID_UXS_SIMPLIFIED')), array('SWITCHABLE', G::loadTranslation('ID_UXS_SWITCHABLE')), array('SINGLE', G::loadTranslation('ID_UXS_SINGLE')));
}
return $list;
}
示例11: Users
$_SESSION['TRIGGER_DEBUG']['info'][1]['TIME'] = 'AFTER';
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_NAMES'] = $oCase->getTriggerNames($triggers);
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_VALUES'] = $triggers;
}
$oCase->updateCase($_SESSION['APPLICATION'], $appFields);
// Send notifications - Start
$oUser = new Users();
$aUser = $oUser->load($_SESSION['USER_LOGGED']);
if (trim($aUser['USR_EMAIL']) == '') {
$aUser['USR_EMAIL'] = 'info@' . $_SERVER['HTTP_HOST'];
}
$sFromName = '"' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . '" <' . $aUser['USR_EMAIL'] . '>';
try {
$oCase->sendNotifications($_SESSION['TASK'], $_POST['form']['TASKS'], $appFields['APP_DATA'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $sFromName);
} catch (Exception $e) {
G::SendTemporalMessage(G::loadTranslation('ID_NOTIFICATION_ERROR') . ' - ' . $e->getMessage(), 'warning', 'string', null, '100%');
}
// Send notifications - End
// Events - Start
$oEvent = new Event();
$oEvent->closeAppEvents($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['TASK']);
$oCurrentAppDel = AppDelegationPeer::retrieveByPk($_SESSION['APPLICATION'], $_SESSION['INDEX'] + 1);
$multipleDelegation = false;
// check if there are multiple derivations
if (count($_POST['form']['TASKS']) > 1) {
$multipleDelegation = true;
}
// If the case has been delegated
if (isset($oCurrentAppDel)) {
// if there is just a single derivation the TASK_UID can be set by the delegation data
if (!$multipleDelegation) {
示例12:
?>
" href="#" onclick="__ActionDelete('<?php
echo $node_name;
?>
', '<?php
echo $node['__ATTRIBUTES__']['type'];
?>
');return false;"><img src="/images/e_Delete.png" width="15" height="15" border="0" onmouseout="backImage(this,'')" onmouseover="backImage(this,'url(/images/dynamicForm/hover.gif) no-repeat')"/></a>
</div>
<?php
} else {
?>
<div class="tool"><img src="/images/options.png" width="12" height="12" border="0"/> </div>
<div class="jq-checkpointSubhead" style="display:none">
<a title="<?php
echo G::loadTranslation('ID_REMOVE_FIELD');
?>
" href="#" onclick="__ActionDelete('<?php
echo $node_name;
?>
', '<?php
echo $node['__ATTRIBUTES__']['type'];
?>
');return false;"><img src="/images/e_Delete.png" width="15" height="15" border="0" onmouseout="backImage(this,'')" onmouseover="backImage(this,'url(/images/dynamicForm/hover.gif) no-repeat')"/></a>
</div>
<?php
}
?>
</td>
</tr>
</table>
示例13: Exception
case -2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
}
if (empty($_POST) || !isset($_POST['form'])) {
if (empty($_FILES)) {
throw new Exception(G::loadTranslation('ID_ERROR_UPLOADING_FILENAME'));
} else {
throw new Exception(G::loadTranslation('ID_POSTED_DATA_EMPTY'));
}
}
$form = $_POST['form'];
if (isset($_GET['USR_UID'])) {
$form['USR_UID'] = $_GET['USR_UID'];
} else {
$form['USR_UID'] = '';
}
if (isset($_FILES['form']['name']['USR_RESUME'])) {
if ($_FILES['form']['tmp_name']['USR_RESUME'] != '') {
$form['USR_RESUME'] = $_FILES['form']['name']['USR_RESUME'];
} else {
$form['USR_RESUME'] = '';
}
}
示例14: _getSystemInfo
private function _getSystemInfo()
{
G::LoadClass("system");
if (getenv('HTTP_CLIENT_IP')) {
$ip = getenv('HTTP_CLIENT_IP');
} else {
if (getenv('HTTP_X_FORWARDED_FOR')) {
$ip = getenv('HTTP_X_FORWARDED_FOR');
} else {
$ip = getenv('REMOTE_ADDR');
}
}
$redhat = '';
if (file_exists('/etc/redhat-release')) {
$fnewsize = filesize('/etc/redhat-release');
$fp = fopen('/etc/redhat-release', 'r');
$redhat = trim(fread($fp, $fnewsize));
fclose($fp);
}
$redhat .= " (" . PHP_OS . ")";
if (defined("DB_HOST")) {
G::LoadClass('net');
G::LoadClass('dbConnections');
$dbNetView = new NET(DB_HOST);
$dbNetView->loginDbServer(DB_USER, DB_PASS);
$dbConns = new dbConnections('');
$availdb = '';
foreach ($dbConns->getDbServicesAvailables() as $key => $val) {
if ($availdb != '') {
$availdb .= ', ';
}
$availdb .= $val['name'];
}
try {
$sMySQLVersion = $dbNetView->getDbServerVersion(DB_ADAPTER);
} catch (Exception $oException) {
$sMySQLVersion = '?????';
}
}
if (file_exists(PATH_HTML . "lib/versions")) {
$versions = json_decode(file_get_contents(PATH_HTML . "lib/versions"), true);
$pmuiVer = $versions["pmui_ver"];
$mafeVer = $versions["mafe_ver"];
$pmdynaformVer = $versions["pmdynaform_ver"];
} else {
$pmuiVer = $mafeVer = $pmdynaformVer = "(unknown)";
}
$sysSection = G::loadTranslation('ID_SYSTEM_INFO');
$pmSection = G::LoadTranslation('ID_PROCESS_INFORMATION');
$properties = array();
$ee = class_exists('pmLicenseManager') ? " - Enterprise Edition" : '';
$systemName = 'ProcessMaker';
if (defined('SYSTEM_NAME')) {
$systemName = SYSTEM_NAME;
}
$properties[] = array($systemName . ' Ver.', System::getVersion() . $ee, $pmSection);
$properties[] = array("PMUI JS Lib. Ver.", $pmuiVer, $pmSection);
$properties[] = array("MAFE JS Lib. Ver.", $mafeVer, $pmSection);
$properties[] = array("PM Dynaform JS Lib. Ver.", $pmdynaformVer, $pmSection);
if (file_exists(PATH_DATA . 'log/upgrades.log')) {
$properties[] = array(G::LoadTranslation('ID_UPGRADES_PATCHES'), '<a href="#" onclick="showUpgradedLogs(); return false;">' . G::LoadTranslation('ID_UPGRADE_VIEW_LOG') . '</a>', $pmSection);
} else {
$properties[] = array(G::LoadTranslation('ID_UPGRADES_PATCHES'), G::LoadTranslation('ID_UPGRADE_NEVER_UPGRADE'), $pmSection);
}
$properties[] = array(G::LoadTranslation('ID_OPERATING_SYSTEM'), $redhat, $sysSection);
$properties[] = array(G::LoadTranslation('ID_TIME_ZONE'), defined('TIME_ZONE') ? TIME_ZONE : "Unknown", $sysSection);
$properties[] = array(G::LoadTranslation('ID_WEB_SERVER'), getenv('SERVER_SOFTWARE'), $sysSection);
$properties[] = array(G::LoadTranslation('ID_SERVER_NAME'), getenv('SERVER_NAME'), $pmSection);
$properties[] = array(G::LoadTranslation('ID_SERVER_IP'), $this->lookup($ip), $sysSection);
$properties[] = array(G::LoadTranslation('ID_PHP_VERSION'), phpversion(), $sysSection);
if (defined("DB_HOST")) {
$properties[] = array(G::LoadTranslation('ID_DATABASE'), $dbNetView->dbName(DB_ADAPTER) . ' (Version ' . $sMySQLVersion . ')', $pmSection);
$properties[] = array(G::LoadTranslation('ID_DATABASE_SERVER'), DB_HOST, $pmSection);
$properties[] = array(G::LoadTranslation('ID_DATABASE_NAME'), DB_NAME, $pmSection);
$properties[] = array(G::LoadTranslation('ID_AVAILABLE_DB'), $availdb, $sysSection);
} else {
$properties[] = array(G::LoadTranslation('ID_DATABASE'), "Not defined", $pmSection);
$properties[] = array(G::LoadTranslation('ID_DATABASE_SERVER'), "Not defined", $pmSection);
$properties[] = array(G::LoadTranslation('ID_DATABASE_NAME'), "Not defined", $pmSection);
$properties[] = array(G::LoadTranslation('ID_AVAILABLE_DB'), "Not defined", $sysSection);
}
$properties[] = array(G::LoadTranslation('ID_WORKSPACE'), defined("SYS_SYS") ? SYS_SYS : "Not defined", $pmSection);
$properties[] = array(G::LoadTranslation('ID_SERVER_PROTOCOL'), getenv('SERVER_PROTOCOL'), $sysSection);
$properties[] = array(G::LoadTranslation('ID_SERVER_PORT'), getenv('SERVER_PORT'), $sysSection);
//$sysSection[] = array('Remote Host', getenv ('REMOTE_HOST'), $sysSection);
$properties[] = array(G::LoadTranslation('ID_SERVER_NAME'), getenv('SERVER_ADDR'), $sysSection);
$properties[] = array(G::LoadTranslation('ID_USER_BROWSER'), getenv('HTTP_USER_AGENT'), $sysSection);
return $properties;
}
示例15: _getSystemInfo
private function _getSystemInfo()
{
G::LoadClass("system");
if (getenv('HTTP_CLIENT_IP')) {
$ip = getenv('HTTP_CLIENT_IP');
} else {
if (getenv('HTTP_X_FORWARDED_FOR')) {
$ip = getenv('HTTP_X_FORWARDED_FOR');
} else {
$ip = getenv('REMOTE_ADDR');
}
}
$redhat = '';
if (file_exists('/etc/redhat-release')) {
$fnewsize = filesize('/etc/redhat-release');
$fp = fopen('/etc/redhat-release', 'r');
$redhat = trim(fread($fp, $fnewsize));
fclose($fp);
}
$redhat .= " (" . PHP_OS . ")";
if (defined("DB_HOST")) {
G::LoadClass('net');
G::LoadClass('dbConnections');
$dbNetView = new NET(DB_HOST);
$dbNetView->loginDbServer(DB_USER, DB_PASS);
$dbConns = new dbConnections('');
$availdb = '';
foreach ($dbConns->getDbServicesAvailables() as $key => $val) {
if ($availdb != '') {
$availdb .= ', ';
}
$availdb .= $val['name'];
}
try {
$sMySQLVersion = $dbNetView->getDbServerVersion(DB_ADAPTER);
} catch (Exception $oException) {
$sMySQLVersion = '?????';
}
}
$sysSection = G::loadTranslation('ID_SYSTEM_INFO');
$pmSection = 'ProcessMaker Information';
$properties = array();
$ee = class_exists('pmLicenseManager') ? " - Enterprise Edition" : '';
$properties[] = array('ProcessMaker Ver.', System::getVersion() . $ee, $pmSection);
$properties[] = array('Operating System', $redhat, $sysSection);
$properties[] = array('Time Zone', defined('TIME_ZONE') ? TIME_ZONE : "Unknown", $sysSection);
$properties[] = array('Web Server', getenv('SERVER_SOFTWARE'), $sysSection);
$properties[] = array('Server Name', getenv('SERVER_NAME'), $pmSection);
$properties[] = array('Server IP Address', $this->lookup($ip), $sysSection);
$properties[] = array('PHP Version', phpversion(), $sysSection);
if (defined("DB_HOST")) {
$properties[] = array('Data Base', $dbNetView->dbName(DB_ADAPTER) . ' (Version ' . $sMySQLVersion . ')', $pmSection);
$properties[] = array('Data Base Server', DB_HOST, $pmSection);
$properties[] = array('Data Base Name', DB_NAME, $pmSection);
$properties[] = array('Available DB Engines', $availdb, $sysSection);
} else {
$properties[] = array('Data Base', "Not defined", $pmSection);
$properties[] = array('Data Base Server', "Not defined", $pmSection);
$properties[] = array('Data Base Name', "Not defined", $pmSection);
$properties[] = array('Available DB Engines', "Not defined", $sysSection);
}
$properties[] = array('Workspace', defined("SYS_SYS") ? SYS_SYS : "Not defined", $pmSection);
$properties[] = array('Server Protocol', getenv('SERVER_PROTOCOL'), $sysSection);
$properties[] = array('Server Port', getenv('SERVER_PORT'), $sysSection);
//$properties[] = array('Remote Host', getenv ('REMOTE_HOST'), $sysSection);
$properties[] = array('Server Addr.', getenv('SERVER_ADDR'), $sysSection);
$properties[] = array('User\'s Browser', getenv('HTTP_USER_AGENT'), $sysSection);
return $properties;
}