本文整理汇总了PHP中registry::load方法的典型用法代码示例。如果您正苦于以下问题:PHP registry::load方法的具体用法?PHP registry::load怎么用?PHP registry::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类registry
的用法示例。
在下文中一共展示了registry::load方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
public function display($arrValues = false)
{
registry::load("form");
$arrFields = $this->fields();
$form = register('form', array('sso_settings'));
$form->use_fieldsets = true;
$form->use_dependency = true;
$form->lang_prefix = 'es_sl_';
$form->add_fieldsets($arrFields);
if (!$arrValues && $this->in->get('slaveid', 0)) {
$arrValues = $this->pdh->get('eqdkp_sso', 'data', array($this->in->get('slaveid', 0)));
//Encrypt some Values
$crypt = register('encrypt', array($this->sso->get_own_master_key()));
$arrValues['db_host'] = $crypt->decrypt($arrValues['db_host']);
$arrValues['db_user'] = $crypt->decrypt($arrValues['db_user']);
$arrValues['db_password'] = $crypt->decrypt($arrValues['db_password']);
$arrValues['db_database'] = $crypt->decrypt($arrValues['db_database']);
$arrValues['db_prefix'] = $crypt->decrypt($arrValues['db_prefix']);
}
$form->output($arrValues);
$this->tpl->assign_var('SLAVEID', $this->in->get('slaveid', 0));
$this->core->set_vars(array('page_title' => $this->user->lang('settings'), 'template_path' => $this->pm->get_data('eqdkp_sso', 'template_path'), 'template_file' => 'admin/slaves.html', 'header_format' => 'simple', 'display' => true));
}
示例2: display
public function display()
{
$this->pdh->enqueue_hook('eqdkp_sso_update');
$this->pdh->process_hook_queue();
registry::load("form");
$arrFields = $this->fields();
$form = register('form', array('sso_settings'));
$form->reset_fields();
$form->use_fieldsets = true;
$form->use_dependency = true;
$form->lang_prefix = 'es_';
$form->add_fieldsets($arrFields);
$arrValues = $this->config->get_config('eqdkp_sso');
//Decrypt some values;
if (isset($arrValues['master_key'])) {
$arrValues['master_key'] = $this->encrypt->decrypt($arrValues['master_key']);
}
if (isset($arrValues['db_host'])) {
$arrValues['db_host'] = $this->encrypt->decrypt($arrValues['db_host']);
}
if (isset($arrValues['db_user'])) {
$arrValues['db_user'] = $this->encrypt->decrypt($arrValues['db_user']);
}
if (isset($arrValues['db_password'])) {
$arrValues['db_password'] = $this->encrypt->decrypt($arrValues['db_password']);
}
if (isset($arrValues['db_database'])) {
$arrValues['db_database'] = $this->encrypt->decrypt($arrValues['db_database']);
}
if (isset($arrValues['db_prefix'])) {
$arrValues['db_prefix'] = $this->encrypt->decrypt($arrValues['db_prefix']);
}
$form->output($arrValues);
$arrIDList = $this->pdh->get('eqdkp_sso', 'id_list');
foreach ($arrIDList as $intID) {
$data = $this->pdh->get('eqdkp_sso', 'data', array($intID));
$this->tpl->assign_block_vars('field_row', array('ID' => $intID, 'NAME' => $data['name'], 'DOMAIN' => $data['domain'], 'UNIQUEID' => $data['uniqueid'], 'COOKIE_NAME' => $data['cookie_name'], 'DEL_HASH' => $this->CSRFGetToken('del')));
}
$this->jquery->Dialog('editSlave', $this->user->lang('es_edit_slave'), array('url' => 'slaves.php' . $this->SID . "&slaveid='+id+'", 'withid' => 'id', 'width' => 920, 'height' => 740, 'onclose' => 'settings.php' . $this->SID));
$this->tpl->assign_vars(array('S_INSERT_MASTER' => $this->blnMasterTest));
$this->core->set_vars(array('page_title' => $this->user->lang('settings'), 'template_path' => $this->pm->get_data('eqdkp_sso', 'template_path'), 'template_file' => 'admin/settings.html', 'display' => true));
}
示例3: edit
public function edit($foptions = '', $ftype = '')
{
if ($this->in->exists('id')) {
$options = $this->apa->get_apa_edit_form($this->in->get('id'));
$type = $this->apa->get_data('type', $this->in->get('id'));
} else {
$type = $this->in->get('type');
$options = $this->apa->get_apa_add_form($type);
}
$options = $foptions ? $foptions : $options;
$type = $ftype ? $ftype : $type;
if (!$options || !is_array($options)) {
$this->display();
}
registry::load('form');
foreach ($options as $name => $option) {
if ($name == 'pools') {
$option['options'] = $this->pdh->aget('multidkp', 'name', 0, array($this->pdh->get('multidkp', 'id_list')));
if (!$this->in->exists('id')) {
$used = $this->apa->get_pools_used($type);
foreach ($used as $dkpid) {
if (!in_array($dkpid, $option['value'])) {
unset($option['options'][$dkpid]);
}
}
}
}
$lang = $this->user->lang('apa_' . $type . '_' . $name, false, false) ? $this->user->lang('apa_' . $type . '_' . $name) : '';
$help = $this->user->lang('apa_' . $type . '_' . $name . '_help', false, false) ? $this->user->lang('apa_' . $type . '_' . $name . '_help') : '';
$this->tpl->assign_block_vars('input', array('NAME' => $lang ? $lang : $this->user->lang('apa_' . $name, true, false), 'HELP' => $help ? $help : $this->user->lang('apa_' . $name . '_help', false, false), 'FIELD' => form::field($name, $option), 'FUNC' => $name == 'calc_func' ? true : false));
$lang = $help = '';
}
$job_list = $this->apa->list_apas();
//Add function button
$beforeclose = "\$('#calc_func').append('<option value=\"func_'+\$('body').data('func_name')+'\">func_'+\$('body').data('func_name')+'<option>');";
$this->jquery->dialog('edit_function', $this->user->lang('apa_edit_function'), array('url' => "manage_auto_points.php" . $this->SID . "&simple_head=true&edit_func=true", 'width' => '650', 'height' => '600', 'beforeclose' => $beforeclose));
$this->tpl->add_js("\n\t\t\t\$('#add_func').click(function(){\n\t\t\t\tedit_function();\n\t\t\t});", 'docready');
//fetch events
$events_dd = $this->pdh->aget('event', 'name', 0, array($this->pdh->get('event', 'id_list')));
asort($events_dd);
//fetch mdkppools
$pool_dd = $this->pdh->aget('multidkp', 'name', 0, array($this->pdh->get('multidkp', 'id_list')));
asort($pool_dd);
$this->tpl->assign_vars(array('HEAD_TEXT' => $this->in->exists('id') ? sprintf($this->user->lang('apa_edit'), "'" . $this->user->lang('apa_of_type') . " " . $this->user->lang('apa_type_' . $type) . "'") : sprintf($this->user->lang('apa_add'), "'" . $this->user->lang('apa_type_' . $type) . "'"), 'HIDDEN_NAME' => $this->in->exists('id') ? 'id' : 'type', 'HIDDEN_VAL' => $this->in->exists('id') ? $this->in->get('id') : $type));
$this->core->set_vars(array('page_title' => $this->user->lang('apa_manager'), 'template_file' => 'admin/manage_auto_points_edit.html', 'header_format' => $this->simple_head, 'display' => true));
}
示例4: edit
public function edit($messages = false, $name = false)
{
// The JavaScript Magic...
$this->tpl->add_js('
// Return a helper with preserved width of cells
var fixHelper = function(e, ui) {
ui.children().each(function() {
$(this).width($(this).width());
});
return ui;
};
$(".sortingtable tbody").sortable({
helper: fixHelper,
cancel: \'.not-sortable, .th_add, .td_add\',
});
// Delete the row
$(document).on("click", ".del_me", function(){
var mydelid = jQuery.trim($(this).parent().parent().find(".delete_id").text());
var mypreset = jQuery.trim($(this).parent().parent().find(".presetname").text());
$("#dp"+mydelid).removeAttr("disabled");
$("#button_"+mydelid).removeAttr("disabled");
$("#dp"+mydelid).append("<option value=\'"+mypreset+"\'>"+mypreset+"</option>");
var body = $(this).parent().parent().parent();
$(this).parent().parent().remove();
if(body.children().length == 1) {
body.find(".del_me").css("display", "none");
}
});
$(".add_row_button").click(function() {
var key = parseInt($(this).attr("id").substr(7));
//reenable deletion
$("#table_"+key+" > tbody").find(".del_me").removeAttr("style");
var row = $("#table_"+key+" > tbody > tr:last").clone();
var prefix = jQuery.trim($(".prefix_id", row).text());
var id = jQuery.trim($(".delete_id", row).text());
var selected = jQuery.trim($("#dp"+id).val());
var name = jQuery.trim($("#dp"+id+ " :selected").text());
// The name of the field
$(".presetname", row).empty();
$(".presetname", row).append(name);
// The value fields
$(".sortable", row).attr("name", prefix+"[sortable]["+selected+"]");
$("label.sortable input", row).attr("name", prefix+"[sortable]["+selected+"]");
$(".default_sort", row).val(selected);
$(".td_add", row).attr("name", prefix+"[td_add]["+selected+"]");
$(".th_add", row).attr("name", prefix+"[th_add]["+selected+"]");
// Remove the option in select
$("#dp"+id+" option[value=\'"+selected+"\']").remove();
// Disable if no selection available
if($("#dp"+id+" option").length == 0){
$("#dp"+id).attr("disabled","disabled");
$("#button_"+id).attr("disabled","disabled");
}
$("#table_"+key+" > tbody > tr:last").after(row);
});
$(".sortingtable tr:odd").addClass("row1");
$(".sortingtable tr:even").addClass("row2");
$("#lb_columns").change(function(){
if($(this).val() == "classid") {
$("#leaderboard_classid").removeAttr("style");
$("#leaderboard_defaultrole").css("display", "none");
} else {
$("#leaderboard_classid").css("display", "none");
$("#leaderboard_defaultrole").removeAttr("style");
}
});', 'docready');
$layout_name = $name ? $name : $this->in->get('layout');
if (!$this->pdh->user_layout_exists($layout_name)) {
$layout_name = $this->pdh->make_editable($layout_name);
}
if (!$layout_name) {
$this->display(array('title' => $this->user->lang('error'), 'text' => $this->user->lang('layout_not_exists'), 'color' => 'red'));
}
$this->pdh->auto_update_layout($layout_name);
$layout_def = $this->pdh->get_eqdkp_layout($layout_name);
//Tabs
$this->jquery->Tab_header('plus_pm_pages_tabs');
//Get all defined pages from current system file
$pages = $this->pdh->get_page_list();
$page_id = 1;
$page_object_id = 1;
$page_tabs = '';
$table_sort_dirs['asc'] = $this->user->lang('lm_sort_asc');
$table_sort_dirs['desc'] = $this->user->lang('lm_sort_desc');
registry::load('form');
//general options
if (is_array($layout_def['options']) && !empty($layout_def['options'])) {
foreach ($layout_def['options'] as $key => $value) {
$name = 'params_' . $key;
//.........这里部分代码省略.........
示例5: get_output
public function get_output()
{
$games = array();
$this->game = registry::register('game', array(true, $this->in->get('inst_lang')));
//set lang_name in game-class
foreach ($this->game->get_games() as $sgame) {
$games[$sgame] = $this->game->game_name($sgame);
}
// Build the default language & Locales dropdowns
if (!$this->def_lang) {
$this->def_lang = $this->in->get('inst_lang');
}
if (!$this->def_game_lang) {
$this->def_game_lang = $this->in->get('inst_lang');
}
if (!$this->def_server_path) {
$this->def_server_path = str_replace('install/index.php', '', $this->env->phpself);
}
if (!$this->def_timezone) {
$this->def_timezone = date_default_timezone_get();
}
if (!$this->def_startday) {
$this->def_startday = $this->in->get('inst_lang') == 'german' ? 'monday' : 'sunday';
}
$langs = sdir($this->root_path . 'language');
foreach ($langs as $slang) {
if (!is_file($this->root_path . 'language/' . $slang . '/lang_main.php')) {
continue;
}
include $this->root_path . 'language/' . $slang . '/lang_main.php';
$lang_name_tp = $lang['ISO_LANG_NAME'] ? $lang['ISO_LANG_NAME'] . ' (' . $lang['ISO_LANG_SHORT'] . ')' : ucfirst($slang);
$language_array[$slang] = isset($lang['ISO_LANG_NAME']) ? $lang['ISO_LANG_NAME'] : ucfirst($slang);
$locale_array[$lang['ISO_LANG_SHORT']] = $lang_name_tp;
if ($slang == $this->def_lang && !$this->def_locale) {
$this->def_locale = $lang['ISO_LANG_SHORT'];
}
}
$startdays = array('sunday' => $this->lang['sunday'], 'monday' => $this->lang['monday']);
registry::load('timehandler');
$content = '<table class="no-borders" style="border-collapse: collapse;" width="100%">
<tr>
<th class="" colspan="2">' . $this->lang['lang_config'] . '</th>
</tr>
<tr>
<td align="right"><strong>' . $this->lang['default_lang'] . ':</strong></td>
<td>' . new hdropdown('default_lang', array('options' => $language_array, 'value' => $this->def_lang)) . '</td>
</tr>
<tr>
<td align="right"><strong>' . $this->lang['default_locale'] . ':</strong></td>
<td>' . new hdropdown('default_locale', array('options' => $locale_array, 'value' => $this->def_locale)) . '</td>
</tr>
<tr>
<th class="" colspan="2">' . $this->lang['game_config'] . '</th>
</tr>
<tr>
<td colspan="2">
<div class="infobox infobox-large infobox-blue clearfix">
<i class="fa fa-info-circle fa-4x pull-left"></i>' . $this->lang['game_info'] . '
</div>
</td>
</tr>
<tr>
<td align="right"><strong>' . $this->lang['default_game'] . ':</strong></td>
<td>' . new hdropdown('game', array('options' => $games, 'value' => $this->def_game)) . ' <select name="game_lang" id="game_lang">' . self::ajax_out(false, $this->def_game) . '</select></td>
</tr>
<tr>
<th class="" colspan="2">' . $this->lang['server_config'] . '</th>
</tr>
<tr>
<td align="right"><strong>' . $this->lang['server_path'] . ':</strong></td>
<td><input type="text" name="server_path" size="25" value="' . $this->def_server_path . '" class="input" /></td>
</tr>
<tr>
<td align="right"><strong>' . $this->lang['timezone'] . ':</strong></td>
<td>' . new hdropdown('timezone', array('options' => timehandler::fetch_timezones(), 'value' => $this->def_timezone)) . '</td>
</tr>
<tr>
<td align="right"><strong>' . $this->lang['startday'] . ':</strong></td>
<td>' . new hdropdown('startday', array('options' => $startdays, 'value' => $this->def_startday)) . '</td>
</tr>
</table>';
return $content;
}
示例6: display
/**
* display
* Display the page
*
* @param array $messages Array of Messages to output
*/
public function display()
{
registry::load("form");
$arrFields = $this->fields();
$form = register('form', array('ci_import'));
$form->reset_fields();
$form->use_fieldsets = true;
$form->use_dependency = true;
$form->lang_prefix = 'ci_';
$form->add_fieldsets($arrFields);
$arrValues = array();
$form->output($arrValues);
// -- EQDKP ---------------------------------------------------------------
$this->core->set_vars(array('page_title' => $this->user->lang('ci_import'), 'template_path' => $this->pm->get_data('cmsimport', 'template_path'), 'template_file' => 'admin/import_init.html', 'display' => true));
}
示例7: display
public function display()
{
if ($this->config->get('cmsbridge_active') == 1 && !$this->bridge->status) {
$this->bridge->deactivate_bridge();
$this->core->message($this->user->lang('bridge_disabled_message'), $this->user->lang('error'), 'red');
}
if ($this->config->get('cmsbridge_active') != 1) {
$this->delete_settings();
}
registry::load("form");
$arrPrefix = $this->get_prefix($this->config->get('cmsbridge_notsamedb'));
$arrPrefix = array_merge(array('' => ''), $arrPrefix);
$arrKeys = array_keys($arrPrefix);
if ($this->in->get('edit') == 'true') {
$this->core->message($this->user->lang('pk_succ_saved'), $this->user->lang('pk_save_title'), 'green');
}
$a_linkMode = array('0' => $this->user->lang('pk_set_link_type_self'), '1' => $this->user->lang('pk_set_link_type_link'), '2' => $this->user->lang('pk_set_link_type_iframe'), '4' => $this->user->lang('pk_set_link_type_D_iframe_womenues'), '5' => $this->user->lang('pk_set_link_type_D_iframe_woblocks'));
$arrSelectedGroups = $this->config->get('cmsbridge_active') == 1 ? $this->bridge->get_user_groups(true) : array();
//Bridge Settings
$settings = $this->bridge->get_settings();
$form = register('form', array('bridge_settings'));
if (is_array($settings)) {
$form->add_fields($settings);
//Build Settings Array
foreach ($settings as $name => $confvars) {
$arrValues[$name] = $this->config->get($name);
}
$form->output($arrValues);
}
$arrBridges = $this->bridge->get_available_bridges();
ksort($arrBridges);
$arrSyncFields = $this->bridge->get_available_sync_fields();
$this->tpl->assign_vars(array('MS_USERGROUPS' => $this->jquery->MultiSelect('usergroups', $arrSelectedGroups, explode(',', $this->config->get('cmsbridge_groups')), array('height' => 170, 'width' => 300)), 'S_BRIDGE_ACTIVE' => $this->config->get('cmsbridge_active') == 1 ? true : false, 'S_PROFILEFIELDS_INFO' => $this->config->get('cmsbridge_active') == 1 && count($arrSyncFields) ? true : false, 'S_BRIDGE_SETTINGS' => is_array($settings) && count($settings) > 0 ? true : false, 'DD_SYSTEMS' => new hdropdown('cms_type', array('options' => $arrBridges, 'value' => $this->config->get('cmsbridge_type'), 'js' => 'onchange="onchange_type()"')), 'S_SAMEDB' => $this->config->get('cmsbridge_notsamedb') == '0' && $this->config->get('cmsbridge_active') == 1 ? true : false, 'S_NOTSAMEDB' => $this->config->get('cmsbridge_notsamedb') == '1' && $this->config->get('cmsbridge_active') == 1 ? true : false, 'DB_HOST' => $this->crypt->decrypt($this->config->get('cmsbridge_host')) == '' ? $this->dbhost : $this->crypt->decrypt($this->config->get('cmsbridge_host')), 'DB_USER' => $this->crypt->decrypt($this->config->get('cmsbridge_user')) == '' ? $this->dbuser : $this->crypt->decrypt($this->config->get('cmsbridge_user')), 'DB_PW' => $this->crypt->decrypt($this->config->get('cmsbridge_password')) == '' ? '' : $this->crypt->decrypt($this->config->get('cmsbridge_password')), 'DB_DATABASE' => $this->crypt->decrypt($this->config->get('cmsbridge_database')), 'DD_PREFIX' => new hdropdown('db_prefix', array('options' => $arrPrefix, 'value' => $this->config->get('cmsbridge_prefix'), 'js' => 'onchange="onchange_prefix()"')), 'OWN_PREFIX' => !in_array($this->config->get('cmsbridge_prefix'), $arrPrefix) ? $this->config->get('cmsbridge_prefix') : '', 'S_ACTIVATE_MESSAGE' => $this->in->get('activate') == 'true' ? true : false, 'DD_EMBEDD_OPTIONS' => new hdropdown('cms_embedded', array('options' => $a_linkMode, 'value' => $this->config->get('cmsbridge_embedded'))), 'CMS_URL' => $this->config->get('cmsbridge_url'), 'CMS_PWRESET_URL' => $this->config->get('cmsbridge_pwreset_url'), 'CMS_REG_URL' => $this->config->get('cmsbridge_reg_url'), 'S_ONLYCMSUSERLOGIN' => (int) $this->config->get('cmsbridge_onlycmsuserlogin') ? true : false, 'MS_SYNC_USERGROUPS' => $this->jquery->MultiSelect('sync_usergroups', $arrSelectedGroups, explode(',', $this->config->get('cmsbridge_sync_groups')), array('height' => 170, 'width' => 300))));
$this->core->set_vars(array('page_title' => $this->user->lang('manage_bridge'), 'template_file' => 'admin/manage_bridge.html', 'display' => true));
}