本文整理汇总了PHP中G::toLower方法的典型用法代码示例。如果您正苦于以下问题:PHP G::toLower方法的具体用法?PHP G::toLower怎么用?PHP G::toLower使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类G
的用法示例。
在下文中一共展示了G::toLower方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getListDashboards
/**
* Get list All dashboards
*
* @access public
* @param array $options, Data for list
* @return array
*
* @author Marco Antonio Nina <marco.antonio.nina@colosa.com>
* @copyright Colosa - Bolivia
*/
public function getListDashboards($options = array())
{
Validator::isArray($options, '$options');
G::LoadClass("dashboards");
$dir = isset( $options["dir"] ) ? $options["dir"] : "DESC";
$sort = isset( $options["sort"] ) ? $options["sort"] : "DASHBOARD.DAS_TITLE";
$start = isset( $options["start"] ) ? $options["start"] : "0";
$limit = isset( $options["limit"] ) ? $options["limit"] : "";
$search = isset( $options["search"] ) ? $options["search"] : "";
$paged = isset( $options["paged"] ) ? $options["paged"] : true;
$type = "extjs";
$start = (int)$start;
$start = abs($start);
if ($start != 0) {
$start--;
}
$limit = (int)$limit;
$limit = abs($limit);
if ($limit == 0) {
G::LoadClass("configuration");
$conf = new \Configurations();
$configList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');
if (isset($configList['casesListRowNumber'])) {
$limit = (int)$configList['casesListRowNumber'];
} else {
$limit = 25;
}
} else {
$limit = (int)$limit;
}
if ($sort != 'DASHBOARD.DAS_TITLE') {
$sort = G::toUpper($sort);
$columnsAppCacheView = DashboardPeer::getFieldNames(\BasePeer::TYPE_FIELDNAME);
if (!(in_array($sort, $columnsAppCacheView))) {
$sort = 'APP_CACHE_VIEW.APP_NUMBER';
}
}
$dir = G::toUpper($dir);
if (!($dir == 'DESC' || $dir == 'ASC')) {
$dir = 'DESC';
}
$dashboards = new \Dashboards();
$result = $dashboards->getListDashboards($start, $limit, $sort, $dir, $search);
if ($paged == false) {
$response = $result['data'];
} else {
$response['total'] = $result['totalCount'];
$response['start'] = $start+1;
$response['limit'] = $limit;
$response['sort'] = G::toLower($sort);
$response['dir'] = G::toLower($dir);
$response['search'] = $search;
$response['data'] = $result['data'];
}
return $response;
}
示例2: getList
//.........这里部分代码省略.........
$result = $list->loadList($userUid, $filters);
if (!empty($result)) {
foreach ($result as &$value) {
if (isset($value['DEL_PREVIOUS_USR_UID'])) {
$value['PREVIOUS_USR_UID'] = $value['DEL_PREVIOUS_USR_UID'];
$value['PREVIOUS_USR_USERNAME'] = $value['DEL_PREVIOUS_USR_USERNAME'];
$value['PREVIOUS_USR_FIRSTNAME'] = $value['DEL_PREVIOUS_USR_FIRSTNAME'];
$value['PREVIOUS_USR_LASTNAME'] = $value['DEL_PREVIOUS_USR_LASTNAME'];
}
if (isset($value['DEL_DUE_DATE'])) {
$value['DEL_TASK_DUE_DATE'] = $value['DEL_DUE_DATE'];
}
if (isset($value['APP_PAUSED_DATE'])) {
$value['APP_UPDATE_DATE'] = $value['APP_PAUSED_DATE'];
}
if (isset($value['DEL_CURRENT_USR_USERNAME'])) {
$value['USR_USERNAME'] = $value['DEL_CURRENT_USR_USERNAME'];
$value['USR_FIRSTNAME'] = $value['DEL_CURRENT_USR_FIRSTNAME'];
$value['USR_LASTNAME'] = $value['DEL_CURRENT_USR_LASTNAME'];
$value['APP_UPDATE_DATE'] = $value['DEL_DELEGATE_DATE'];
}
if (isset($value['APP_STATUS'])) {
$value['APP_STATUS_LABEL'] = G::LoadTranslation( "ID_{$value['APP_STATUS']}" );
}
//$value = array_change_key_case($value, CASE_LOWER);
}
}
$response = array();
if ($filters["paged"]) {
$filtersData = array();
$filtersData['start'] = $filters["start"];
$filtersData['limit'] = $filters["limit"];
$filtersData['sort'] = G::toLower($filters["sort"]);
$filtersData['dir'] = G::toLower($filters["dir"]);
$filtersData['cat_uid'] = $filters["category"];
$filtersData['pro_uid'] = $filters["process"];
$filtersData['search'] = $filters["search"];
$filtersData['date_from'] = $filters["dateFrom"];
$filtersData['date_to'] = $filters["dateTo"];
$response['filters'] = $filtersData;
$response['data'] = $result;
$filtersData['action'] = $filters["action"];
$response['totalCount'] = $list->countTotal($userUid, $filtersData);
} else {
$response = $result;
}
return $response;
}
示例3: testToLower
/**
* @covers G::toLower
* @todo Implement testToLower().
*/
public function testToLower()
{
$name = 'BRAYAN';
$this->assertEquals('brayan', G::toLower($name));
}
示例4: getSystemDate
public function getSystemDate($dateTime, $type='dateFormat')
{
$oConf = new Configurations();
$oConf->getFormats();
$dateFormat = $oConf->UserConfig['dateFormat'];
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
$creationDateMask = isset($oConf->aConfig[$type]) ? $oConf->aConfig[$type] : '';
$creationDateMask = ($creationDateMask == '') ? $dateFormat : $creationDateMask;
if ($creationDateMask != '') {
if (strpos($dateTime, ' ') !== false) {
list ($date, $time) = explode(' ', $dateTime);
list ($y, $m, $d) = explode('-', $date);
list ($h, $i, $s) = explode(':', $time);
$newCreation = '';
$maskTime = array('d' => '%d', 'D' => '%A', 'j' => '%d', 'l' => '%A', 'G' => '%I', 'g' => '%i', 'N' => '%u', 'S' => '%d', 'w' => '%w', 'z' => '%j', 'W' => '%W', 'F' => '%B', 'm' => '%m', 'M' => '%B', 'n' => '%m', 'o' => '%Y', 'Y' => '%Y', 'y' => '%g', 'a' => '%p', 'A' => '%p', 'g' => '%I', 'G' => '%H', 'h' => '%I', 'H' => '%H', 'i' => '%M', 's' => '%S');
$creationDateMask = trim($creationDateMask);
if (strpos($creationDateMask, ' \\d\\e ') !== false) {
$creationDateMask = str_replace(' \\d\\e ', ' [xx] ', $creationDateMask);
}
for ($j = 0; $j < strlen($creationDateMask); $j++) {
if ($creationDateMask[$j] != ' ' && isset($maskTime[$creationDateMask[$j]])) {
$newCreation .= $maskTime[$creationDateMask[$j]];
} else {
$newCreation .= $creationDateMask[$j];
}
}
$langLocate = SYS_LANG;
require_once 'model/Language.php';
$language = new language();
$lanLocation = $language->findLocationByLanId(SYS_LANG);
$location = isset($lanLocation['LAN_LOCATION']) ? $lanLocation['LAN_LOCATION'] : '';
if (G::toLower(PHP_OS) == 'linux' || G::toLower(PHP_OS) == 'darwin') {
if (SYS_LANG == 'es') {
$langLocate = 'es_ES';
} else if (strlen(SYS_LANG) > 2) {
$langLocate = str_replace('-', '_', SYS_LANG);
} else if ($location != '') {
$langLocate = SYS_LANG.'_'.$location;
} else {
$langLocate = 'en_US';
}
} else {
switch (SYS_LANG) {
case 'es':
case 'es_ES':
$langLocate = 'ESN';
break;
case 'pt':
case 'pt-BR':
$langLocate = 'PTB';
break;
case 'en':
case 'en-US':
default:
$langLocate = 'EST';
break;
}
}
if (defined('PARTNER_FLAG')) {
setlocale(LC_TIME, $langLocate);
$dateTime = utf8_encode(strftime($newCreation, mktime($h, $i, $s, $m, $d, $y)));
} else {
setlocale(LC_TIME, $langLocate . ".utf8");
$dateTime = strftime($newCreation, mktime($h, $i, $s, $m, $d, $y));
}
if (strpos($dateTime, ' ') !== false) {
$dateTime = ucwords($dateTime);
}
if (strpos($dateTime, ' [xx] ') !== false) {
$dateTime = str_replace('[xx]', ' de ', $dateTime);
}
}
}
return $dateTime;
}
示例5: catch
$record["APP_UPDATE_DATE"] = $record["DEL_DELEGATE_DATE"];
}
if (isset($record["APP_STATUS"])) {
$record["APP_STATUS_LABEL"] = G::LoadTranslation("ID_" . $record["APP_STATUS"]);
}
//Return
return $record;
} catch (Exception $e) {
throw $e;
}
});
$filtersData = array();
$filtersData['start'] = $filters['start'];
$filtersData['limit'] = $filters['limit'];
$filtersData['sort'] = G::toLower($filters['sort']);
$filtersData['dir'] = G::toLower($filters['dir']);
$filtersData['cat_uid'] = $filters['category'];
$filtersData['pro_uid'] = $filters['process'];
$filtersData['search'] = $filters['search'];
$filtersData['date_from'] = $filters['dateFrom'];
$filtersData['date_to'] = $filters['dateTo'];
$filtersData["action"] = $filters["action"];
$filtersData["filterStatus"] = $filters['filterStatus'];
$response = array();
$response['filters'] = $filtersData;
$response['totalCount'] = $list->countTotal($userUid, $filtersData);
$response = $filter->xssFilterHard($response);
$response['data'] = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($result);
echo G::json_encode($response);
} catch (Exception $e) {
$msg = array("error" => $e->getMessage());
示例6: getSystemDate
public function getSystemDate($dateTime)
{
$oConf = new Configurations();
$dateFormat = 'M d, Y';
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
$creationDateMask = isset($oConf->aConfig['dateFormat']) ? $oConf->aConfig['dateFormat'] : '';
$creationDateMask = $creationDateMask == '' ? $dateFormat : $creationDateMask;
if ($creationDateMask != '') {
if (strpos($dateTime, ' ') !== false) {
list($date, $time) = explode(' ', $dateTime);
list($y, $m, $d) = explode('-', $date);
list($h, $i, $s) = explode(':', $time);
$dateTime = date($creationDateMask, mktime($h, $i, $s, $m, $d, $y));
} else {
list($y, $m, $d) = explode('-', $dateTime);
$newCreation = '';
$maskTime = array('d' => '%d', 'D' => '%A', 'j' => '%e', 'l' => '%A', 'N' => '%u', 'S' => '%d', 'w' => '%w', 'z' => '%j', 'W' => '%W', 'F' => '%B', 'm' => '%m', 'M' => '%B', 'n' => '%m', 'o' => '%Y', 'Y' => '%Y', 'y' => '%g', 'a' => '%P', 'A' => '%p', 'g' => '%l', 'G' => '%k', 'h' => '%I', 'H' => '%H', 'i' => '%M', 's' => '%S');
$creationDateMask = trim($creationDateMask);
if (strpos($creationDateMask, ' \\d\\e ') !== false) {
$creationDateMask = str_replace(' \\d\\e ', ' [xx] ', $creationDateMask);
}
for ($i = 0; $i < strlen($creationDateMask); $i++) {
if ($creationDateMask[$i] != ' ' && isset($maskTime[$creationDateMask[$i]])) {
$newCreation .= $maskTime[$creationDateMask[$i]];
} else {
$newCreation .= $creationDateMask[$i];
}
}
$langLocate = SYS_LANG;
if (G::toLower(PHP_OS) == 'linux' || G::toLower(PHP_OS) == 'darwin') {
if (SYS_LANG == 'es') {
$langLocate = 'es_ES';
} else {
if (strlen(SYS_LANG) > 2) {
$langLocate = str_replace('-', '_', SYS_LANG);
} else {
$langLocate = 'en_US';
}
}
} else {
switch (SYS_LANG) {
case 'es':
case 'es_ES':
$langLocate = 'ESN';
break;
case 'pt':
case 'pt-BR':
$langLocate = 'PTB';
break;
case 'en':
case 'en-US':
default:
$langLocate = 'EST';
break;
}
}
setlocale(LC_TIME, $langLocate);
$dateTime = utf8_encode(strftime($newCreation, mktime(0, 0, 0, $m, $d, $y)));
if (strpos($dateTime, ' ') !== false) {
$dateTime = ucwords($dateTime);
}
if (strpos($dateTime, ' [xx] ') !== false) {
$dateTime = str_replace('[xx]', ' de ', $dateTime);
}
}
}
return $dateTime;
}
示例7: lowerCase
/**
*
* @method
*
* Returns a string with all the letters converted into lower case letters.
*
* @name lowerCase
* @label Lower Case
* @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#lowerCase.28.29
*
* @param string(32) | $sText | Text To Convert | A string to convert to lower case letters.
* @return string | $TextC | Text Converted | Returns a string with the text converted into lower case letters.
*
*/
function lowerCase($sText)
{
return G::toLower($sText);
}
示例8: getList
//.........这里部分代码省略.........
}
if ($action == 'search' || $action == 'to_reassign') {
$userUid = ($user == "CURRENT_USER") ? $userUid : $user;
if ($first) {
$result = array();
$result['totalCount'] = 0;
$result['data'] = array();
return $result;
}
}
if ((
$action == "todo" || $action == "draft" || $action == "paused" || $action == "sent" ||
$action == "selfservice" || $action == "unassigned" || $action == "search"
) &&
(($solrConf = \System::solrEnv()) !== false)
) {
G::LoadClass("AppSolr");
$ApplicationSolrIndex = new \AppSolr(
$solrConf["solr_enabled"],
$solrConf["solr_host"],
$solrConf["solr_instance"]
);
if ($ApplicationSolrIndex->isSolrEnabled() && $solrConf['solr_enabled'] == true) {
//Check if there are missing records to reindex and reindex them
$ApplicationSolrIndex->synchronizePendingApplications();
$solrEnabled = true;
}
}
if ($solrEnabled) {
$result = $ApplicationSolrIndex->getAppGridData(
$userUid,
$start,
$limit,
$action,
$filter,
$search,
$process,
$status,
$type,
$dateFrom,
$dateTo,
$callback,
$dir,
$sort,
$category
);
} else {
G::LoadClass("applications");
$apps = new \Applications();
$result = $apps->getAll(
$userUid,
$start,
$limit,
$action,
$filter,
$search,
$process,
$status,
$type,
$dateFrom,
$dateTo,
$callback,
$dir,
(strpos($sort, ".") !== false)? $sort : "APP_CACHE_VIEW." . $sort,
$category,
true,
$paged
);
}
if (!empty($result['data'])) {
foreach ($result['data'] as &$value) {
$value = array_change_key_case($value, CASE_LOWER);
}
}
if ($paged == false) {
$response = $result['data'];
} else {
$response['total'] = $result['totalCount'];
$response['start'] = $start+1;
$response['limit'] = $limit;
$response['sort'] = G::toLower($sort);
$response['dir'] = G::toLower($dir);
$response['cat_uid'] = $category;
$response['pro_uid'] = $process;
$response['search'] = $search;
if ($action == 'search') {
$response['app_status'] = G::toLower($status);
$response['usr_uid'] = $user;
$response['date_from'] = $dateFrom;
$response['date_to'] = $dateTo;
}
$response['data'] = $result['data'];
}
return $response;
}
示例9: deleteTableData
/**
* Delete Data for PmTable
* @var string $pmt_uid. Uid for PmTable
* @var string $rows. Data for rows of PmTable
*
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @return void
*/
public function deleteTableData($pmt_uid, $rows)
{
$pmt_uid = $this->validateTabUid($pmt_uid, false);
$rows = array_merge(array_change_key_case($rows, CASE_LOWER), array_change_key_case($rows, CASE_UPPER));
$oAdditionalTables = new AdditionalTables();
$table = $oAdditionalTables->load($pmt_uid, true);
$primaryKeys = $oAdditionalTables->getPrimaryKeys('keys');
foreach ($primaryKeys as $value) {
if (!isset($rows[$value])) {
throw new \Exception("The field for column '{$value}' is required");
} else {
$params[] = is_numeric($rows[$value]) ? $rows[$value] : "'" . $rows[$value] . "'";
}
}
$className = $table['ADD_TAB_CLASS_NAME'];
$classPeerName = $className . 'Peer';
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
if (!file_exists($sPath . $className . '.php')) {
throw new \Exception('Update:: ' . G::loadTranslation('ID_PMTABLE_CLASS_DOESNT_EXIST', $className));
}
require_once $sPath . $className . '.php';
$obj = null;
eval('$obj = ' . $classPeerName . '::retrieveByPk(' . implode(',', $params) . ');');
if (is_object($obj)) {
foreach ($rows as $key => $value) {
// validation, don't modify primary keys
if (in_array(G::toUpper($key), $primaryKeys) || in_array(G::toLower($key), $primaryKeys)) {
unset($rows[$key]);
}
$action = 'set' . AdditionalTables::getPHPName($key);
$obj->{$action}($value);
}
if ($r = $obj->validate()) {
$obj->delete();
} else {
$msg = '';
foreach ($obj->getValidationFailures() as $objValidationFailure) {
$msg .= $objValidationFailure->getMessage() . "\n";
}
throw new \Exception($msg);
}
} else {
throw new \Exception("The key " . implode(',', $params) . " not exist");
}
}