本文整理汇总了PHP中Vtiger_Language::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Language::getAll方法的具体用法?PHP Vtiger_Language::getAll怎么用?PHP Vtiger_Language::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Language
的用法示例。
在下文中一共展示了Vtiger_Language::getAll方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insertIntoEntityTable
/** Function to insert values in the specifed table for the specified module
* @param $table_name -- table name:: Type varchar
* @param $module -- module:: Type varchar
*/
function insertIntoEntityTable($table_name, $module)
{
$log = vglobal('log');
$log->info("function insertIntoEntityTable " . $module . ' vtiger_table name ' . $table_name);
$adb = PearDatabase::getInstance();
$current_user = vglobal('current_user');
$insertion_mode = $this->mode;
//Checkin whether an entry is already is present in the vtiger_table to update
if ($insertion_mode == 'edit') {
$check_query = "select * from " . $table_name . " where " . $this->tab_name_index[$table_name] . "=?";
$check_result = $this->db->pquery($check_query, array($this->id));
$num_rows = $this->db->num_rows($check_result);
if ($num_rows <= 0) {
$insertion_mode = '';
}
}
// We will set the crypt_type based on the insertion_mode
$crypt_type = '';
if ($insertion_mode == 'edit') {
$update = '';
$update_params = array();
$tabid = getTabid($module);
$sql = "select * from vtiger_field where tabid=? and tablename=? and displaytype in (1,3,5) and vtiger_field.presence in (0,2)";
$params = array($tabid, $table_name);
} else {
$column = $this->tab_name_index[$table_name];
if ($column == 'id' && $table_name == 'vtiger_users') {
$currentuser_id = $this->db->getUniqueID("vtiger_users");
$this->id = $currentuser_id;
}
$qparams = array($this->id);
$tabid = getTabid($module);
$sql = "select * from vtiger_field where tabid=? and tablename=? and displaytype in (1,3,4,5) and vtiger_field.presence in (0,2)";
$params = array($tabid, $table_name);
$crypt_type = $this->DEFAULT_PASSWORD_CRYPT_TYPE;
}
$result = $this->db->pquery($sql, $params);
$noofrows = $this->db->num_rows($result);
for ($i = 0; $i < $noofrows; $i++) {
$fieldname = $this->db->query_result($result, $i, "fieldname");
$columname = $this->db->query_result($result, $i, "columnname");
$uitype = $this->db->query_result($result, $i, "uitype");
$typeofdata = $adb->query_result($result, $i, "typeofdata");
$typeofdata_array = explode("~", $typeofdata);
$datatype = $typeofdata_array[0];
if (isset($this->column_fields[$fieldname])) {
if ($uitype == 56) {
if ($this->column_fields[$fieldname] === 'on' || $this->column_fields[$fieldname] == 1) {
$fldvalue = 1;
} else {
$fldvalue = 0;
}
} elseif ($uitype == 15) {
if ($this->column_fields[$fieldname] == $app_strings['LBL_NOT_ACCESSIBLE']) {
//If the value in the request is Not Accessible for a picklist, the existing value will be replaced instead of Not Accessible value.
$sql = "select {$columname} from {$table_name} where " . $this->tab_name_index[$table_name] . "=?";
$res = $adb->pquery($sql, array($this->id));
$pick_val = $adb->query_result($res, 0, $columname);
$fldvalue = $pick_val;
} else {
$fldvalue = $this->column_fields[$fieldname];
}
} elseif ($uitype == 5 || $uitype == 6 || $uitype == 23) {
if (isset($current_user->date_format)) {
$fldvalue = getValidDBInsertDateValue($this->column_fields[$fieldname]);
} else {
$fldvalue = $this->column_fields[$fieldname];
}
} elseif ($uitype == 33) {
if (is_array($this->column_fields[$fieldname])) {
$field_list = implode(' |##| ', $this->column_fields[$fieldname]);
} else {
$field_list = $this->column_fields[$fieldname];
}
$fldvalue = $field_list;
} elseif ($uitype == 99) {
$plain_text = $this->column_fields[$fieldname];
$fldvalue = $this->encrypt_password($plain_text, $crypt_type);
// Update the plain-text value with encrypted value and dependent fields
$this->column_fields[$fieldname] = $fldvalue;
$this->column_fields['crypt_type'] = $crypt_type;
$this->column_fields['user_hash'] = $this->get_user_hash($plain_text);
} else {
$fldvalue = $this->column_fields[$fieldname];
$fldvalue = stripslashes($fldvalue);
}
$fldvalue = from_html($fldvalue, $insertion_mode == 'edit' ? true : false);
} else {
$fldvalue = '';
}
if ($uitype == 31) {
$themeList = array_keys(Vtiger_Util_Helper::getAllSkins());
if (!in_array($fldvalue, $themeList) || $fldvalue == '') {
global $default_theme;
if (!empty($default_theme) && in_array($default_theme, $themeList)) {
$fldvalue = $default_theme;
//.........这里部分代码省略.........
示例2: getOptionalModuleDetails
/**
*
* @param String $packagepath - path to the package file.
* @return Array
*/
static function getOptionalModuleDetails($package, $optionalModulesInfo)
{
global $optionalModuleStrings;
$moduleUpdateVersion = $package->getVersion();
$moduleForVtigerVersion = $package->getDependentVtigerVersion();
$moduleMaxVtigerVersion = $package->getDependentMaxVtigerVersion();
if ($package->isLanguageType()) {
$type = 'language';
} else {
$type = 'module';
}
$moduleDetails = null;
$moduleName = $package->getModuleName();
if ($moduleName != null) {
$moduleDetails = array();
$moduleDetails['description'] = $optionalModuleStrings[$moduleName . '_description'];
if (Vtiger_Version::check($moduleForVtigerVersion, '>=') && Vtiger_Version::check($moduleMaxVtigerVersion, '<')) {
$moduleDetails['selected'] = true;
$moduleDetails['enabled'] = true;
} else {
$moduleDetails['selected'] = false;
$moduleDetails['enabled'] = false;
}
$migrationAction = 'install';
if (!$package->isLanguageType()) {
$moduleInstance = null;
if (Vtiger_Utils::checkTable('vtiger_tab')) {
$moduleInstance = Vtiger_Module::getInstance($moduleName);
}
if ($moduleInstance) {
$migrationAction = 'update';
if (version_compare($moduleUpdateVersion, $moduleInstance->version, '>=')) {
$moduleDetails['enabled'] = false;
}
}
} else {
if (Vtiger_Utils::CheckTable(Vtiger_Language::TABLENAME)) {
$languageList = array_keys(Vtiger_Language::getAll());
$prefix = $package->getPrefix();
if (in_array($prefix, $languageList)) {
$migrationAction = 'update';
}
}
}
$optionalModulesInfo[$migrationAction][$type][$moduleName] = $moduleDetails;
}
return $optionalModulesInfo;
}
示例3: getAllLanguages
/**
* Function to returns all language information
* @return <Array>
*/
public static function getAllLanguages()
{
return Vtiger_Language::getAll();
}
示例4: getOutputHtml
//.........这里部分代码省略.........
} elseif ($uitype == 16) {
require_once 'modules/PickList/PickListUtils.php';
$editview_label[] = getTranslatedString($fieldlabel, $module_name);
$fieldname = $adb->sql_escape_string($fieldname);
$pick_query = "select {$fieldname} from vtiger_{$fieldname} order by sortorderid";
$params = array();
$pickListResult = $adb->pquery($pick_query, $params);
$noofpickrows = $adb->num_rows($pickListResult);
$options = array();
$pickcount = 0;
$found = false;
for ($j = 0; $j < $noofpickrows; $j++) {
$value = decode_html($value);
$pickListValue = decode_html($adb->query_result($pickListResult, $j, strtolower($fieldname)));
if ($value == trim($pickListValue)) {
$chk_val = "selected";
$pickcount++;
$found = true;
} else {
$chk_val = '';
}
$pickListValue = to_html($pickListValue);
if (isset($_REQUEST['file']) && $_REQUEST['file'] == 'QuickCreate') {
$options[] = array(htmlentities(getTranslatedString($pickListValue), ENT_QUOTES, $default_charset), $pickListValue, $chk_val);
} else {
$options[] = array(getTranslatedString($pickListValue), $pickListValue, $chk_val);
}
}
$fieldvalue[] = $options;
} elseif ($uitype == 1613) {
require_once 'modules/PickList/PickListUtils.php';
$editview_label[] = getTranslatedString($fieldlabel, $module_name);
$fieldname = $adb->sql_escape_string($fieldname);
$pickListResult = getAllowedPicklistModules();
$options = array();
$options[] = "";
$pickcount = 0;
$found = false;
foreach ($pickListResult as $pKey => $pValue) {
$value = decode_html($value);
$pickListValue = decode_html($pValue);
if ($value == trim($pickListValue)) {
$chk_val = "selected";
$pickcount++;
$found = true;
} else {
$chk_val = '';
}
$pickListValue = to_html($pickListValue);
if (isset($_REQUEST['file']) && $_REQUEST['file'] == 'QuickCreate') {
$options[] = array(htmlentities(getTranslatedString($pickListValue, $pickListValue), ENT_QUOTES, $default_charset), $pickListValue, $chk_val);
} else {
$options[] = array(getTranslatedString($pickListValue, $pickListValue), $pickListValue, $chk_val);
}
}
uasort($options, function ($a, $b) {
return strtolower($a[0]) < strtolower($b[0]) ? -1 : 1;
});
$fieldvalue[] = $options;
} elseif ($uitype == 15 || $uitype == 33) {
require_once 'modules/PickList/PickListUtils.php';
$roleid = $current_user->roleid;
$picklistValues = getAssignedPicklistValues($fieldname, $roleid, $adb);
$valueArr = explode("|##|", $value);
foreach ($valueArr as $key => $value) {
$valueArr[$key] = trim(html_entity_decode($value, ENT_QUOTES, $default_charset));
示例5: getDetailViewOutputHtml
//.........这里部分代码省略.........
//Added for Skype by Minnie
$label_fld[] = getTranslatedString($fieldlabel, $module);
$label_fld[] = $col_fields[$fieldname];
} elseif ($uitype == 26) {
$label_fld[] = getTranslatedString($fieldlabel, $module);
$query = "select foldername from vtiger_attachmentsfolder where folderid = ?";
$result = $adb->pquery($query, array($col_fields[$fieldname]));
$folder_name = $adb->query_result($result, 0, "foldername");
$label_fld[] = $folder_name;
} elseif ($uitype == 27) {
if ($col_fields[$fieldname] == 'I') {
$label_fld[] = getTranslatedString($fieldlabel, $module);
$label_fld[] = $mod_strings['LBL_INTERNAL'];
} else {
$label_fld[] = getTranslatedString($fieldlabel, $module);
$label_fld[] = $mod_strings['LBL_EXTERNAL'];
}
} elseif ($uitype == 31) {
$label_fld[] = getTranslatedString($fieldlabel, $module);
$label_fld[] = $col_fields[$fieldname];
$options = array();
$themeList = get_themes();
foreach ($themeList as $theme) {
if ($current_user->theme == $theme) {
$selected = 'selected';
} else {
$selected = '';
}
$options[] = array(getTranslatedString($theme), $theme, $selected);
}
$label_fld["options"] = $options;
} elseif ($uitype == 32) {
$options = array();
$languageList = Vtiger_Language::getAll();
$label_fld[] = getTranslatedString($fieldlabel, $module);
$label_fld[] = isset($languageList[$col_fields[$fieldname]]) ? $languageList[$col_fields[$fieldname]] : $col_fields[$fieldname];
foreach ($languageList as $prefix => $label) {
if ($current_user->language == $prefix) {
$selected = 'selected';
} else {
$selected = '';
}
$options[] = array(getTranslatedString($label), $prefix, $selected);
}
$label_fld["options"] = $options;
} else {
$label_fld[] = getTranslatedString($fieldlabel, $module);
if ($col_fields[$fieldname] == '0' && $fieldname != 'filedownloadcount' && $fieldname != 'filestatus' && $fieldname != 'filesize') {
$col_fields[$fieldname] = '';
}
//code for Documents module :start
if ($tabid == 8) {
$downloadtype = $col_fields['filelocationtype'];
if ($fieldname == 'filename') {
if ($downloadtype == 'I') {
//$file_value = $mod_strings['LBL_INTERNAL'];
$fld_value = $col_fields['filename'];
$ext_pos = strrpos($fld_value, ".");
$ext = substr($fld_value, $ext_pos + 1);
$ext = strtolower($ext);
if ($ext == 'bin' || $ext == 'exe' || $ext == 'rpm') {
$fileicon = "<img src='" . vtiger_imageurl('fExeBin.gif', $theme) . "' hspace='3' align='absmiddle' border='0'>";
} elseif ($ext == 'jpg' || $ext == 'gif' || $ext == 'bmp') {
$fileicon = "<img src='" . vtiger_imageurl('fbImageFile.gif', $theme) . "' hspace='3' align='absmiddle' border='0'>";
} elseif ($ext == 'txt' || $ext == 'doc' || $ext == 'xls') {
$fileicon = "<img src='" . vtiger_imageurl('fbTextFile.gif', $theme) . "' hspace='3' align='absmiddle' border='0'>";
示例6: get_select_options_with_id
echo get_select_options_with_id(get_themes(), $display_theme);
?>
</select></td>
</tr>
<tr bgcolor="#f5f5f5">
<td class="small" align="right" width="30%"><?php
echo $current_module_strings['LBL_LANGUAGE'];
?>
</td>
<td class="small" align="left" width="70%"><select class="small" name='login_language' style="width:70%" tabindex="4">
<!-- vtlib Customization -->
<?php
/* php echo get_select_options_with_id(get_languages(), $display_language) */
?>
<?php
echo get_select_options_with_id(Vtiger_Language::getAll(), $display_language);
?>
</select></td>
</tr>
<?php
if (isset($_SESSION['validation'])) {
?>
<tr>
<td colspan="2"><font color="Red"> <?php
echo $current_module_strings['VLD_ERROR'];
?>
</font></td>
</tr>
<?php
} else {
if (isset($login_error) && $login_error != "") {