本文整理汇总了PHP中set_register_value函数的典型用法代码示例。如果您正苦于以下问题:PHP set_register_value函数的具体用法?PHP set_register_value怎么用?PHP set_register_value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_register_value函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_bean_select_array
function get_bean_select_array($add_blank = true, $bean_name, $display_columns, $where = '', $order_by = '', $blank_is_none = false)
{
global $beanFiles;
require_once $beanFiles[$bean_name];
$focus = new $bean_name();
$user_array = array();
$key = $bean_name == 'EmailTemplate' ? $bean_name : $bean_name . $display_columns . $where . $order_by;
$user_array = get_register_value('select_array', $key);
if (!$user_array) {
$db = DBManagerFactory::getInstance();
$temp_result = array();
$query = "SELECT {$focus->table_name}.id, {$display_columns} as display from {$focus->table_name} ";
$query .= "where ";
if ($where != '') {
$query .= $where . " AND ";
}
$query .= " {$focus->table_name}.deleted=0";
if ($order_by != '') {
$query .= " order by {$focus->table_name}.{$order_by}";
}
$GLOBALS['log']->debug("get_user_array query: {$query}");
$result = $db->query($query, true, "Error filling in user array: ");
if ($add_blank == true) {
// Add in a blank row
if ($blank_is_none == true) {
// set 'blank row' to "--None--"
global $app_strings;
$temp_result[''] = $app_strings['LBL_NONE'];
} else {
$temp_result[''] = '';
}
}
// Get the id and the name.
while ($row = $db->fetchByAssoc($result)) {
$temp_result[$row['id']] = $row['display'];
}
$user_array = $temp_result;
set_register_value('select_array', $key, $temp_result);
}
return $user_array;
}
示例2: DynamicField
********************************************************************************/
require_once 'modules/DynamicFields/DynamicField.php';
$module = $_REQUEST['module_name'];
$custom_fields = new DynamicField($module);
if (!empty($module)) {
$class_name = $beanList[$module];
$class_file = $class_name;
if ($class_file == 'aCase') {
$class_file = 'Case';
}
require_once "modules/{$module}/{$class_file}.php";
$mod = new $class_name();
$custom_fields->setup($mod);
} else {
echo "\nNo Module Included Could Not Save";
}
$name = $_REQUEST['field_label'];
$options = '';
if ($_REQUEST['field_type'] == 'enum') {
$options = $_REQUEST['options'];
}
$default_value = '';
$custom_fields->addField($name, $name, $_REQUEST['field_type'], '255', 'optional', $default_value, $options, '', '');
$html = $custom_fields->getFieldHTML($name, $_REQUEST['file_type']);
set_register_value('dyn_layout', 'field_counter', $_REQUEST['field_count']);
$label = $custom_fields->getFieldLabelHTML($name, $_REQUEST['field_type']);
require_once 'modules/DynamicLayout/AddField.php';
$af = new AddField();
$af->add_field($name, $html, $label, 'window.opener.');
echo $af->get_script('window.opener.');
echo "\n<script>window.close();</script>";
示例3: add_field
function add_field($name, $html_code, $html_label, $prefix = '', $table = '')
{
if (empty($table)) {
$table = 'field_table_MSI';
}
$count = get_register_value('dyn_layout', 'field_counter');
if (empty($count)) {
$count = 0;
}
$div_id = 'dyn_field_' . $count;
$counter1 = $count + 1;
$div_label_id = 'dyn_field_' . $counter1;
set_register_value('dyn_layout_fields', $div_id, array($name, $html_code));
set_register_value('dyn_layout_fields', $div_label_id, array($name . '_label', $html_label));
$html_code = $this->quote_cleanup($html_code);
$html_label = $this->quote_cleanup($html_label);
$script = "\n \n" . $prefix . "add_new_field_row_to_table('{$div_id}', '{$html_code}', '{$table}');";
$script .= "\n" . $prefix . "add_new_field_row_to_table('{$div_label_id}', '{$html_label}', '{$table}');";
$count += 2;
set_register_value('dyn_layout', 'field_counter', $count);
$this->script .= $script;
return $script;
/*$this->html .= <<<EOQ
<tr>
<td nowrap><div id='slot_{$div_label_id}' style='display:inline;cursor:pointer;cursor:hand;border:1px solid #ff0000;' onclick="swap_div('$div_label_id');"><input type='text' name='add_$div_label_id' id='add_$div_label_id' value='$html_code'><input type='hidden' id='form_$div_label_id' name='form_$div_label_id' value='-66'><div id='$div_label_id' style='display:inline'>$html_label</div></div></td>
</tr>
<tr>
<td nowrap><div id='slot_{$div_id}' style='display:inline;cursor:pointer;cursor:hand;border:1px solid #ff0000;' onclick="swap_div('$div_id');"><input type='text' name='add_$div_id' id='add_$div_id' value='$html_code'><input type='hidden' name='form_$div_id' id='form_$div_id' value='-66'><div id='$div_id' style='display:inline'>$html_code</div></div></td>
</tr>
EOQ;
$this->counter += 2;
*/
}
示例4: get_bean_select_array
function get_bean_select_array($add_blank = true, $bean_name, $display_columns, $where = '', $order_by = '', $blank_is_none = false)
{
global $beanFiles;
require_once $beanFiles[$bean_name];
$focus = new $bean_name();
$user_array = array();
$key = $bean_name == 'EmailTemplate' ? $bean_name : $bean_name . $display_columns . $where . $order_by;
$user_array = get_register_value('select_array', $key);
if (!$user_array) {
$db = DBManagerFactory::getInstance();
$temp_result = array();
$query = "SELECT {$focus->table_name}.id, {$display_columns} as display from {$focus->table_name} ";
$query .= "where ";
if ($where != '') {
$query .= $where . " AND ";
}
$query .= " {$focus->table_name}.deleted=0";
/* BEGIN - SECURITY GROUPS */
global $current_user, $sugar_config;
if ($focus->module_dir == 'Users' && !is_admin($current_user) && isset($sugar_config['securitysuite_filter_user_list']) && $sugar_config['securitysuite_filter_user_list'] == true) {
require_once 'modules/SecurityGroups/SecurityGroup.php';
$group_where = SecurityGroup::getGroupUsersWhere($current_user->id);
$query .= " AND (" . $group_where . ") ";
} else {
if ($focus->bean_implements('ACL') && ACLController::requireSecurityGroup($focus->module_dir, 'list')) {
require_once 'modules/SecurityGroups/SecurityGroup.php';
$owner_where = $focus->getOwnerWhere($current_user->id);
$group_where = SecurityGroup::getGroupWhere($focus->table_name, $focus->module_dir, $current_user->id);
if (!empty($owner_where)) {
$query .= " AND (" . $owner_where . " or " . $group_where . ") ";
} else {
$query .= ' AND ' . $group_where;
}
}
}
/* END - SECURITY GROUPS */
if ($order_by != '') {
$query .= " order by {$focus->table_name}.{$order_by}";
}
$GLOBALS['log']->debug("get_user_array query: {$query}");
$result = $db->query($query, true, "Error filling in user array: ");
if ($add_blank == true) {
// Add in a blank row
if ($blank_is_none == true) {
// set 'blank row' to "--None--"
global $app_strings;
$temp_result[''] = $app_strings['LBL_NONE'];
} else {
$temp_result[''] = '';
}
}
// Get the id and the name.
while ($row = $db->fetchByAssoc($result)) {
$temp_result[$row['id']] = $row['display'];
}
$user_array = $temp_result;
set_register_value('select_array', $key, $temp_result);
}
return $user_array;
}
示例5: get_category_array
function get_category_array($add_blank = true, $from_cache = false)
{
if ($from_cache) {
$key_name = "xinventory xcategory";
$category_array = get_register_value('category_array', $key_name);
}
if (empty($category_array)) {
$db = DBManagerFactory::getInstance();
$temp_result = array();
// Including deleted users for now.
$query = "SELECT id, name from xcategories WHERE deleted='0'";
$query = $query . ' ORDER BY name ASC';
$GLOBALS['log']->debug("get_category_array query: {$query}");
$result = $db->query($query, true, "Error filling in category array: ");
if ($add_blank == true) {
// Add in a blank row
$temp_result[''] = '';
}
// Get the id and the name.
while ($row = $db->fetchByAssoc($result)) {
$temp_result[$row['id']] = $row['name'];
}
$category_array = $temp_result;
if ($from_cache) {
set_register_value('category_array', $key_name, $temp_result);
}
}
return $category_array;
}