コード例 #1
0
 /**
  * Custom logic for updating a character.
  * @override
  * @return mixed
  */
 function update(array $data, $id, $attribute = "id")
 {
     $character = $this->newQuery()->findOrFail($id);
     if ($data['realm_id'] != $character->realm_id) {
         $realm = $this->realms->newQuery()->findOrFail($data['realm_id']);
         $data['region'] = $realm->region;
     }
     parent::update($data, $id, $attribute = "id");
 }
コード例 #2
0
ファイル: characters.php プロジェクト: ubick/lorekeepers.org
        $this->jquery->Dialog('EditChar', $this->user->lang('uc_edit_char'), array('withid' => 'editid', 'url' => "addcharacter.php" . $this->SID . "&simple_head=true&editid='+editid+'", 'width' => '640', 'height' => '600', 'onclose' => $this->env->link . 'characters.php'));
        // The javascript for the mainchar change
        $this->tpl->add_js("\n\t\t\t\$('.cmainradio').change( function(){\n\t\t\t\t\$.post('characters.php" . $this->SID . "&link_hash=" . $this->CSRFGetToken('maincharchange') . "', { maincharchange: \$(this).val() },\n\t\t\t\t\tfunction(data){\n\t\t\t\t\t\t\$('#notify_container').notify('create', 'success', {text: data,title: '',custom: true,},{expires: true, speed: 1000});\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\$('.cdefroledd').change( function(){\n\t\t\t\t\$.post('characters.php" . $this->SID . "&link_hash=" . $this->CSRFGetToken('defrolechange') . "', { defrolechange: \$(this).val(), defrolechange_memberid: \$(this).attr('name').replace('defaultrole_', '') },\n\t\t\t\t\tfunction(data){\n\t\t\t\t\t\t\$('#notify_container').notify('create', 'success', {text: data,title: '',custom: true,},{expires: true, speed: 1000});\n\t\t\t\t\t});\n\t\t\t});\n\t\t", 'docready');
        // The Importer things..
        if ($this->game->get_importAuth('u_member_add', 'char_import')) {
            $this->jquery->Dialog('AddCharArmory', $this->user->lang('uc_ext_import_sh'), array('url' => $this->game->get_importers('char_import', true) . $this->SID, 'width' => '600', 'height' => '300', 'onclose' => $this->env->link . 'characters.php' . $this->SID));
        }
        if ($this->game->get_importAuth('u_member_view', 'char_update')) {
            $this->jquery->Dialog('UpdateChar', $this->user->lang('uc_ext_import_sh'), array('url' => $this->game->get_importers('char_update', true) . $this->SID . "&member_id='+memberid+'", 'width' => '600', 'height' => '300', 'onclose' => $this->env->link . 'characters.php' . $this->SID, 'withid' => 'memberid'));
        }
        if ($this->game->get_importAuth('a_members_man', 'char_mupdate')) {
            $this->jquery->Dialog('MassUpdateChars', $this->user->lang('uc_cache_update'), array('url' => $this->game->get_importers('char_mupdate', true) . $this->SID, 'width' => '600', 'height' => '450', 'onclose' => $this->env->link . 'characters.php' . $this->SID));
        }
        $show_no_conn_info = false;
        if ($this->pdh->get('member', 'connection_id', array($this->user->data['user_id'])) < 1 && $this->user->is_signedin()) {
            $show_no_conn_info = true;
        }
        $view_list = $this->pdh->get('member', 'connection_id', array($this->user->data['user_id']));
        $hptt_psettings = $this->pdh->get_page_settings('manage_characters', 'hptt_manage_characters');
        $hptt = $this->get_hptt($hptt_psettings, $view_list, $view_list, array('%link_url%' => 'viewcharacter.php', '%link_url_suffix%' => ''), $this->user->id);
        $footer_text = sprintf($this->user->lang('listmembers_footcount'), is_array($view_list) ? count($view_list) : 0);
        $page_suffix = '&amp;start=' . $this->in->get('start', 0);
        $sort_suffix = '&amp;sort=' . $this->in->get('sort');
        $this->tpl->assign_vars(array('CHAR_LIST' => $hptt->get_html_table($this->in->get('sort', ''), $page_suffix, $this->in->get('start', 0), $this->user->data['user_climit'], $footer_text), 'CHAR_PAGINATION' => generate_pagination('characters.php' . $this->SID . $sort_suffix, is_array($view_list) ? count($view_list) : 0, $this->user->data['user_climit'], $this->in->get('start', 0)), 'NEW_CHARS' => $this->user->check_auth('u_member_add', false), 'CONNECT_CHARS' => $this->user->check_auth('u_member_conn', false), 'DELETE_CHARS' => $this->user->check_auth('u_member_del', false), 'JS_CONNECTIONS' => $this->jquery->MultiSelect('member_id', $mselect_list, $mselect_selected, array('width' => 350, 'height' => 180, 'filter' => true)), 'ADD_MENU' => $this->jquery->DropDownMenu('colortab', $cm_addmenu, 'images/global', '<img border="0" src="images/global/add.png" alt="" /> ' . $this->user->lang('uc_add_char')), 'S_SHOW_NO_CONN_INFO' => $show_no_conn_info));
        $this->core->set_vars(array('page_title' => $this->user->lang('manage_members_titl'), 'template_file' => 'characters.html', 'display' => true));
    }
}
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    registry::add_const('short_characters', characters::__shortcuts());
}
registry::register('characters');