当前位置: 首页>>代码示例>>PHP>>正文


PHP Location::js方法代码示例

本文整理汇总了PHP中Location::js方法的典型用法代码示例。如果您正苦于以下问题:PHP Location::js方法的具体用法?PHP Location::js怎么用?PHP Location::js使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Location的用法示例。


在下文中一共展示了Location::js方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: alertstatus

 /**
  * Put your own methods below this...
  */
 function alertstatus()
 {
     $this->auth->check_access('site/settings', TRUE);
     /* load models */
     $this->load->model('alertstatus_model', 'alert');
     $alerts = $this->alert->get_alerts();
     if ($alerts->num_rows() > 0) {
         foreach ($alerts->result() as $alert) {
             $imgstat = 'off';
             if ($alert->alert_active == 'y') {
                 $imgstat = 'on';
             }
             $data['alerts'][$alert->alert_id] = array('img' => array('src' => Location::asset('images/alerts', $alert->alert_image . '-' . $imgstat . '.png'), 'alt' => $alert->alert_name, 'class' => $imgstat, 'currStat' => $alert->alert_image, 'id' => 'al' . $alert->alert_id), 'name' => $alert->alert_name, 'desc' => $alert->alert_description, 'active' => $alert->alert_active, 'id' => $alert->alert_id, 'imgbase' => $alert->alert_image);
             $data_js['img'][$alert->alert_id] = array('src' => $alert->alert_image . '-hover.png', 'id' => $alert->alert_id);
         }
     }
     $data['loading'] = array('src' => Location::asset('images/alerts', 'black-bg-loading.gif'), 'alt' => '', 'class' => 'image');
     $data['imglocation'] = base_url() . Location::asset('images/alerts', '');
     $data['activealert'] = $this->alert->get_current_alert();
     $data['header'] = 'Alert Status';
     $data['text'] = 'Set the current alert status of your ship by clicking on the proper alert claxon.';
     $this->_regions['content'] = Location::view('admin_alertstatus', $this->skin, 'admin', $data);
     $this->_regions['javascript'] = Location::js('admin_alertstatus_js', $this->skin, 'admin');
     $this->_regions['title'] .= $data['header'];
     Template::assign($this->_regions);
     Template::render();
 }
开发者ID:rajeltomari,项目名称:Sim-Alert,代码行数:30,代码来源:admin.php

示例2: character


//.........这里部分代码省略.........
         $data['awardcount'] = $this->awards->count_character_awards($id);
         $data['last_post'] = mdate($this->options['date_format'], gmt_to_local($character->last_post, $this->timezone, $this->dst));
         $name_array = array('first_name' => $character->first_name, 'middle_name' => $character->middle_name, 'last_name' => $character->last_name, 'suffix' => $character->suffix);
         $name = parse_name($name_array);
         $abbr_name = parse_name(array('first_name' => $character->first_name, 'last_name' => $character->last_name));
         $rank = $this->ranks->get_rank($character->rank, 'rank_name');
         $data['character_info'] = array(array('label' => ucfirst(lang('labels_name')), 'value' => $name), array('label' => ucfirst(lang('global_position')), 'value' => $this->pos->get_position($character->position_1, 'pos_name')), array('label' => ucwords(lang('order_second') . ' ' . lang('global_position')), 'value' => $this->pos->get_position($character->position_2, 'pos_name')), array('label' => ucfirst(lang('global_rank')), 'value' => $rank));
         $data['character']['id'] = $id;
         $data['character']['name'] = $name;
         $data['character']['rank'] = $character->rank;
         $data['character']['position_1'] = $character->position_1;
         $data['character']['position_2'] = $character->position_2;
         $data['character']['user'] = $character->user;
         if ($character->images > '') {
             $images = explode(',', $character->images);
             $images_count = count($images);
             $src = strstr($images[0], 'http://') !== false ? $images[0] : base_url() . Location::asset('images/characters', trim($images[0]));
             $data['character']['image'] = array('src' => $src, 'alt' => $name, 'class' => 'image', 'width' => 200);
             $data['character']['image_array'] = array();
             for ($i = 1; $i < $images_count; $i++) {
                 $src = strstr($images[$i], 'http://') !== false ? trim($images[$i]) : base_url() . Location::asset('images/characters', trim($images[$i]));
                 $data['character']['image_array'][] = array('src' => $src, 'alt' => $name, 'class' => 'image');
             }
         } else {
             $data['character']['noavatar'] = array('src' => Location::img('no-avatar.png', $this->skin, 'main'), 'alt' => '', 'class' => 'image', 'width' => 200);
         }
         $tabs = $this->char->get_bio_tabs();
         $sections = $this->char->get_bio_sections();
         if ($tabs->num_rows() > 0) {
             $i = 1;
             foreach ($tabs->result() as $tab) {
                 $data['tabs'][$i]['id'] = $tab->tab_id;
                 $data['tabs'][$i]['name'] = $tab->tab_name;
                 $data['tabs'][$i]['link'] = $tab->tab_link_id;
                 ++$i;
             }
         }
         if ($sections->num_rows() > 0) {
             $i = 1;
             foreach ($sections->result() as $sec) {
                 $fields = $this->char->get_bio_fields($sec->section_id);
                 if ($fields->num_rows() > 0) {
                     $j = 1;
                     foreach ($fields->result() as $field) {
                         $data['fields'][$sec->section_id][$j]['label'] = $field->field_label_page;
                         $data['fields'][$sec->section_id][$j]['value'] = false;
                         $info = $this->char->get_field_data($field->field_id, $id);
                         if ($info->num_rows() > 0) {
                             foreach ($info->result() as $item) {
                                 $data['fields'][$sec->section_id][$j]['value'] = $item->data_value;
                             }
                         }
                         ++$j;
                     }
                 }
                 if ($tabs->num_rows() > 0) {
                     $data['sections'][$sec->section_tab][$i]['id'] = $sec->section_id;
                     $data['sections'][$sec->section_tab][$i]['name'] = $sec->section_name;
                 } else {
                     $data['sections'][$i]['id'] = $sec->section_id;
                     $data['sections'][$i]['name'] = $sec->section_name;
                 }
                 ++$i;
             }
         }
         // set the header
         $data['header'] = $rank . ' ' . $abbr_name;
         $this->_regions['title'] .= ucfirst(lang('labels_biography')) . ' - ' . $abbr_name;
     } else {
         $data['header'] = sprintf(lang('error_title_invalid_char'), ucfirst(lang('global_character')));
         $data['msg_error'] = sprintf(lang_output('error_msg_invalid_char'), lang('global_character'));
         $this->_regions['title'] .= lang('error_pagetitle');
     }
     if (Auth::is_logged_in()) {
         $data['edit_valid_form'] = Auth::check_access('site/bioform', false) ? true : false;
         if (Auth::check_access('characters/bio', false) === true) {
             if (Auth::get_access_level('characters/bio') == 3) {
                 $data['edit_valid'] = true;
             } elseif (Auth::get_access_level('characters/bio') == 2) {
                 $characters = $this->char->get_user_characters($this->session->userdata('userid'), '', 'array');
                 $data['edit_valid'] = (in_array($id, $characters) or $character->crew_type == 'npc') ? true : false;
             } elseif (Auth::get_access_level('characters/bio') == 1) {
                 $characters = $this->char->get_user_characters($this->session->userdata('userid'), '', 'array');
                 $data['edit_valid'] = in_array($id, $characters);
             } else {
                 $data['edit_valid'] = false;
             }
         } else {
             $data['edit_valid'] = false;
         }
     } else {
         $data['edit_valid'] = false;
         $data['edit_valid_form'] = false;
     }
     $data['label'] = array('edit' => ucwords(lang('actions_edit') . ' ' . lang('global_character')), 'view_all_posts' => ucwords(lang('actions_seeall') . ' ' . lang('global_missionposts')), 'view_all_logs' => ucwords(lang('actions_seeall') . ' ' . lang('global_personallogs')), 'view_all_awards' => ucwords(lang('actions_seeall') . ' ' . lang('global_awards')), 'view_all_images' => ucwords(lang('actions_seeall') . ' ' . lang('labels_images')), 'view_user' => ucwords(lang('global_user') . ' ' . lang('labels_info')), 'mission_posts' => ucwords(lang('global_missionposts')), 'personal_logs' => ucwords(lang('global_personallogs')), 'news_items' => ucwords(lang('global_newsitems')), 'comments' => ucwords(lang('labels_comments')), 'last_post' => ucwords(lang('order_last') . ' ' . lang('global_post')), 'stats' => ucfirst(lang('labels_stats')), 'back_manifest' => LARROW . ' ' . ucfirst(lang('actions_back')) . ' ' . lang('labels_to') . ' ' . ucfirst(lang('labels_manifest')));
     $this->_regions['content'] = Location::view('personnel_character', $this->skin, 'main', $data);
     $this->_regions['javascript'] = Location::js('personnel_character_js', $this->skin, 'main');
     Template::assign($this->_regions);
     Template::render();
 }
开发者ID:rajeltomari,项目名称:Join-Form,代码行数:101,代码来源:personnel.php

示例3: join


//.........这里部分代码省略.........
                 $user = $check_user === false ? $user_id : $check_user;
                 $character_array = array('user' => $user, 'first_name' => $first_name, 'middle_name' => $middle_name, 'last_name' => $last_name, 'suffix' => $suffix, 'position_1' => $position, 'crew_type' => 'pending', 'new_member' => $new_member);
                 $character = $this->char->create_character($character_array);
                 $character_id = $this->db->insert_id();
                 if ($check_user === false) {
                     $main_char = array('main_char' => $character_id);
                     $update_main = $this->user->update_user($user, $main_char);
                 }
                 $this->sys->optimize_table('characters');
                 $this->sys->optimize_table('users');
                 $name = array($first_name, $middle_name, $last_name, $suffix);
                 $app_array = array('app_email' => $email, 'app_ip' => $this->input->ip_address(), 'app_user' => $user, 'app_user_name' => $real_name, 'app_character' => $character_id, 'app_character_name' => parse_name($name), 'app_position' => $this->pos->get_position($position, 'pos_name'), 'app_date' => now(), 'new_member' => $new_member);
                 $apps = $this->apps->insert_application($app_array);
                 foreach ($_POST as $key => $value) {
                     if (is_numeric($key)) {
                         // build the array
                         $array = array('data_field' => $key, 'data_char' => $character_id, 'data_user' => $user, 'data_value' => $value, 'data_updated' => now());
                         // insert the data
                         $this->char->create_character_data($array);
                     }
                 }
                 if ($character < 1 and $users < 1) {
                     $message = sprintf(lang('flash_failure'), ucfirst(lang('actions_join') . ' ' . lang('actions_request')), lang('actions_submitted'), lang('flash_additional_contact_gm'));
                     $flash['status'] = 'error';
                     $flash['message'] = text_output($message);
                 } else {
                     $user_data = array('email' => $email, 'password' => $password, 'name' => $real_name);
                     $email_user = $this->options['system_email'] == 'on' ? $this->_email('join_user', $user_data) : false;
                     $gm_data = array('email' => $email, 'name' => $real_name, 'id' => $character_id, 'user' => $user, 'sample_post' => $this->input->post('sample_post'), 'ipaddr' => $this->input->ip_address());
                     $email_gm = $this->options['system_email'] == 'on' ? $this->_email('join_gm', $gm_data) : false;
                     $message = sprintf(lang('flash_success'), ucfirst(lang('actions_join') . ' ' . lang('actions_request')), lang('actions_submitted'), '');
                     $flash['status'] = 'success';
                     $flash['message'] = text_output($message);
                 }
             }
         }
         $this->_regions['flash_message'] = Location::view('flash', $this->skin, 'main', $flash);
     } elseif ($this->options['system_email'] == 'off') {
         $flash['status'] = 'info';
         $flash['message'] = lang_output('flash_system_email_off');
         $this->_regions['flash_message'] = Location::view('flash', $this->skin, 'main', $flash);
     }
     if ($agree == false and $submit == false) {
         $data['msg'] = $this->msgs->get_message('join_disclaimer');
         if ($this->uri->segment(3) != false) {
             $data['position'] = $this->uri->segment(3);
         }
         $view_loc = 'main_join_1';
     } else {
         $sections = $this->char->get_bio_sections();
         if ($sections->num_rows() > 0) {
             foreach ($sections->result() as $sec) {
                 $sid = $sec->section_id;
                 $data['join'][$sid]['name'] = $sec->section_name;
                 $fields = $this->char->get_bio_fields($sec->section_id);
                 if ($fields->num_rows() > 0) {
                     foreach ($fields->result() as $field) {
                         $f_id = $field->field_id;
                         $data['join'][$sid]['fields'][$f_id]['field_label'] = $field->field_label_page;
                         switch ($field->field_type) {
                             case 'text':
                                 $input = array('name' => $field->field_id, 'id' => $field->field_fid, 'class' => $field->field_class, 'value' => $field->field_value);
                                 $data['join'][$sid]['fields'][$f_id]['input'] = form_input($input);
                                 break;
                             case 'textarea':
                                 $input = array('name' => $field->field_id, 'id' => $field->field_fid, 'class' => $field->field_class, 'value' => $field->field_value, 'rows' => $field->field_rows);
                                 $data['join'][$sid]['fields'][$f_id]['input'] = form_textarea($input);
                                 break;
                             case 'select':
                                 $value = false;
                                 $values = false;
                                 $input = false;
                                 $values = $this->char->get_bio_values($field->field_id);
                                 if ($values->num_rows() > 0) {
                                     foreach ($values->result() as $value) {
                                         $input[$value->value_field_value] = $value->value_content;
                                     }
                                 }
                                 $data['join'][$sid]['fields'][$f_id]['input'] = form_dropdown($field->field_id, $input);
                                 break;
                         }
                     }
                 }
             }
         }
         $data['msg'] = $this->msgs->get_message('join_instructions');
         $view_loc = 'main_join_2';
         $data['inputs'] = array('name' => array('name' => 'name', 'id' => 'name'), 'email' => array('name' => 'email', 'id' => 'email'), 'password' => array('name' => 'password', 'id' => 'password'), 'dob' => array('name' => 'date_of_birth', 'id' => 'date_of_birth'), 'im' => array('name' => 'instant_message', 'id' => 'instant_message', 'rows' => 4), 'first_name' => array('name' => 'first_name', 'id' => 'first_name'), 'middle_name' => array('name' => 'middle_name', 'id' => 'middle_name'), 'last_name' => array('name' => 'last_name', 'id' => 'last_name'), 'suffix' => array('name' => 'suffix', 'id' => 'suffix', 'class' => 'medium'), 'sample_post' => array('name' => 'sample_post', 'id' => 'sample_post', 'rows' => 30), 'new_member_yes' => array('name' => 'new_member', 'id' => 'new_member', 'value' => 'yes', 'checked' => true), 'new_member_no' => array('name' => 'new_member', 'id' => 'new_member', 'value' => 'no', 'checked' => false));
         $data['sample_post_msg'] = $this->msgs->get_message('join_post');
         $data['label'] = array('user_info' => ucwords(lang('global_user') . ' ' . lang('labels_information')), 'name' => ucwords(lang('labels_name')), 'email' => ucwords(lang('labels_email_address')), 'password' => ucwords(lang('labels_password')), 'dob' => lang('labels_dob'), 'im' => ucwords(lang('labels_im')), 'im_inst' => lang('text_im_instructions'), 'fname' => ucwords(lang('order_first') . ' ' . lang('labels_name')), 'mname' => ucwords(lang('order_middle') . ' ' . lang('labels_name')), 'next' => ucwords(lang('actions_next') . ' ' . lang('labels_step')) . ' ' . RARROW, 'lname' => ucwords(lang('order_last') . ' ' . lang('labels_name')), 'suffix' => ucfirst(lang('labels_suffix')), 'position' => ucwords(lang('global_position')), 'other' => ucfirst(lang('labels_other')), 'samplepost' => ucwords(lang('labels_sample_post')), 'character' => ucfirst(lang('global_character')), 'character_info' => ucwords(lang('global_character') . ' ' . lang('labels_info')), 'new_member' => lang('new_member'), 'new_member_yes' => lang('new_member_yes'), 'new_member_no' => lang('new_member_no'));
     }
     $data['button'] = array('submit' => array('type' => 'submit', 'class' => 'button-main', 'name' => 'submit', 'value' => 'submit', 'id' => 'submitJoin', 'content' => ucwords(lang('actions_submit'))), 'next' => array('type' => 'submit', 'class' => 'button-sec', 'name' => 'submit', 'value' => 'submit', 'id' => 'nextTab', 'content' => ucwords(lang('actions_next') . ' ' . lang('labels_step'))), 'agree' => array('type' => 'submit', 'class' => 'button-main', 'name' => 'button_agree', 'value' => 'agree', 'content' => ucwords(lang('actions_agree'))));
     $data['header'] = ucfirst(lang('actions_join'));
     $data['loading'] = array('src' => Location::img('loading-circle.gif', $this->skin, 'main'), 'alt' => lang('actions_loading'), 'class' => 'image');
     $this->_regions['content'] = Location::view($view_loc, $this->skin, 'main', $data);
     $this->_regions['javascript'] = Location::js('main_join_js', $this->skin, 'main');
     $this->_regions['title'] .= $data['header'];
     Template::assign($this->_regions);
     Template::render();
 }
开发者ID:rajeltomari,项目名称:Join-Form,代码行数:101,代码来源:main.php

示例4: bio


//.........这里部分代码省略.........
                     $c = $this->char->get_character($id);
                     $u = $this->user->get_user($user);
                     if ($u->status == 'inactive') {
                         $user_update_data['status'] = 'active';
                         $user_update_data['leave_date'] = null;
                         $user_update_data['last_update'] = now();
                         $user_update_data['access_role'] = Access_Model::STANDARD;
                     }
                     if ($maincharacter) {
                         $user_update_data['main_char'] = $id;
                         $user_update_data['last_update'] = now();
                     }
                     $character_update_data['crew_type'] = 'active';
                     $character_update_data['user'] = $user;
                     $this->pos->update_open_slots($c->position_1, 'add_crew');
                     if ($c->position_2 > 0 and $c->position_2 !== null) {
                         $this->pos->update_open_slots($c->position_2, 'add_crew');
                     }
                     if (isset($user_update_data)) {
                         $update_user = $this->user->update_user($user, $user_update_data);
                     }
                     $update_char = $this->char->update_character($id, $character_update_data);
                     $message = sprintf($update_char > 0 ? lang('flash_success') : lang('flash_failure'), ucfirst(lang('global_character')), lang('actions_updated'), '');
                     $flash['status'] = $update_char > 0 ? 'success' : 'error';
                     $flash['message'] = text_output($message);
                 }
                 break;
         }
         $this->_regions['flash_message'] = Location::view('flash', $this->skin, 'admin', $flash);
     }
     $char = $this->char->get_character($id);
     $sections = $this->char->get_bio_sections();
     if ($sections->num_rows() > 0) {
         foreach ($sections->result() as $sec) {
             $sid = $sec->section_id;
             $data['join'][$sid]['name'] = $sec->section_name;
             $fields = $this->char->get_bio_fields($sec->section_id);
             if ($fields->num_rows() > 0) {
                 foreach ($fields->result() as $field) {
                     $f_id = $field->field_id;
                     $data['join'][$sid]['fields'][$f_id]['field_label'] = $field->field_label_page;
                     $info = $this->char->get_field_data($field->field_id, $data['id']);
                     $row = $info->num_rows() > 0 ? $info->row() : false;
                     switch ($field->field_type) {
                         case 'text':
                             $input = array('name' => $field->field_id, 'id' => $field->field_fid, 'class' => $field->field_class, 'value' => $row !== false ? $row->data_value : '');
                             $data['join'][$sid]['fields'][$f_id]['input'] = form_input($input);
                             break;
                         case 'textarea':
                             $input = array('name' => $field->field_id, 'id' => $field->field_fid, 'class' => $field->field_class, 'value' => $row !== false ? $row->data_value : '', 'rows' => $field->field_rows);
                             $data['join'][$sid]['fields'][$f_id]['input'] = form_textarea($input);
                             break;
                         case 'select':
                             $value = false;
                             $values = false;
                             $input = false;
                             $values = $this->char->get_bio_values($field->field_id);
                             $data_val = $row !== false ? $row->data_value : '';
                             if ($values->num_rows() > 0) {
                                 foreach ($values->result() as $value) {
                                     $input[$value->value_field_value] = $value->value_content;
                                 }
                             }
                             $data['join'][$sid]['fields'][$f_id]['input'] = form_dropdown($field->field_id, $input, $data_val);
                             break;
                     }
                 }
             }
         }
     }
     $pos1 = $this->pos->get_position($char->position_1);
     $pos2 = $this->pos->get_position($char->position_2);
     $rank = $this->ranks->get_rank($char->rank);
     $rankcat = $this->ranks->get_rankcat($this->rank);
     $data['inputs'] = array('first_name' => array('name' => 'first_name', 'id' => 'first_name', 'value' => $char->first_name), 'middle_name' => array('name' => 'middle_name', 'id' => 'middle_name', 'value' => $char->middle_name), 'last_name' => array('name' => 'last_name', 'id' => 'last_name', 'value' => $char->last_name), 'suffix' => array('name' => 'suffix', 'id' => 'suffix', 'class' => 'medium', 'value' => $char->suffix), 'position1_id' => $char->position_1, 'position2_id' => $char->position_2, 'position1_name' => $pos1 !== false ? $pos1->pos_name : '', 'position2_name' => $pos2 !== false ? $pos2->pos_name : '', 'position1_desc' => $pos1 !== false ? $pos1->pos_desc : '', 'position2_desc' => $pos2 !== false ? $pos2->pos_desc : '', 'rank_id' => $char->rank, 'rank_name' => $rank !== false ? $rank->rank_name : '', 'rank' => array('src' => $rank !== false ? Location::rank($this->rank, $rank->rank_image, $rankcat->rankcat_extension) : '', 'alt' => $rank !== false ? $rank->rank_name : '', 'class' => 'image'), 'crew_type' => $char->crew_type, 'images' => !empty($char->images) ? explode(',', $char->images) : '');
     $data['values']['crew_type'] = array('active' => ucwords(lang('status_playing') . ' ' . lang('global_character')), 'npc' => ucwords(lang('status_nonplaying') . ' ' . lang('global_character')), 'inactive' => ucwords(lang('status_inactive') . ' ' . lang('global_character')), 'pending' => ucwords(lang('status_pending') . ' ' . lang('global_character')));
     $data['directory'] = array();
     $dir = $this->sys->get_uploaded_images('bio');
     if ($dir->num_rows() > 0) {
         foreach ($dir->result() as $d) {
             if ($d->upload_user == $this->session->userdata('userid')) {
                 $data['myuploads'][$d->upload_id] = array('image' => array('src' => Location::asset('images/characters', $d->upload_filename), 'alt' => $d->upload_filename, 'class' => 'image image-height-100'), 'file' => $d->upload_filename, 'id' => $d->upload_id);
             } else {
                 $data['directory'][$d->upload_id] = array('image' => array('src' => Location::asset('images/characters', $d->upload_filename), 'alt' => $d->upload_filename, 'class' => 'image image-height-100'), 'file' => $d->upload_filename, 'id' => $d->upload_id);
             }
         }
     }
     $data['header'] = ucwords(lang('actions_edit') . ' ' . lang('labels_bio')) . ' - ' . $this->char->get_character_name($data['id']);
     $data['image_instructions'] = sprintf(lang('text_image_select'), lang('labels_bio'));
     $data['button'] = array('submit' => array('type' => 'submit', 'class' => 'button-main', 'name' => 'submit', 'value' => 'submit', 'content' => ucwords(lang('actions_submit'))), 'use' => array('type' => 'submit', 'class' => 'button-sec add', 'name' => 'use', 'value' => 'use', 'content' => ucwords(lang('actions_use') . ' ' . lang('labels_image'))), 'update' => array('type' => 'submit', 'class' => 'button-main', 'name' => 'submit', 'value' => 'submit', 'id' => 'update', 'rel' => $data['id'], 'content' => ucwords(lang('actions_update'))), 'activate' => array('type' => 'submit', 'class' => 'button-main', 'name' => 'submit', 'value' => 'submit', 'id' => 'char-activate', 'myid' => $id, 'content' => ucwords(lang('actions_activate') . ' ' . lang('global_character'))), 'deactivate' => array('type' => 'submit', 'class' => 'button-main', 'name' => 'submit', 'value' => 'submit', 'id' => 'char-deactivate', 'myid' => $id, 'content' => ucwords(lang('actions_deactivate') . ' ' . lang('global_character'))), 'npc' => array('type' => 'submit', 'class' => 'button-main', 'name' => 'submit', 'value' => 'submit', 'id' => 'char-npc', 'myid' => $id, 'content' => ucwords(lang('actions_make') . ' ' . strtoupper(lang('abbr_npc')))), 'playing' => array('type' => 'submit', 'class' => 'button-main', 'name' => 'submit', 'value' => 'submit', 'id' => 'char-playingchar', 'myid' => $id, 'content' => ucwords(lang('actions_make') . ' ' . lang('status_playing') . ' ' . lang('global_character'))));
     $data['images'] = array('loading' => array('src' => Location::img('loading-circle.gif', $this->skin, 'admin'), 'alt' => lang('actions_loading'), 'class' => 'image'), 'upload' => array('src' => Location::img('image-upload.png', $this->skin, 'admin'), 'alt' => lang('actions_upload'), 'class' => 'image'), 'loader' => array('src' => Location::img('loading-bar.gif', $this->skin, 'admin'), 'alt' => lang('actions_loading'), 'class' => 'image'));
     $data['label'] = array('character' => ucfirst(lang('global_character')), 'fname' => ucwords(lang('order_first') . ' ' . lang('labels_name')), 'images' => ucfirst(lang('labels_images')), 'info' => ucfirst(lang('labels_info')), 'loading' => ucfirst(lang('actions_loading')) . '...', 'lname' => ucwords(lang('order_last') . ' ' . lang('labels_name')), 'mname' => ucwords(lang('order_middle') . ' ' . lang('labels_name')), 'myuploads' => ucwords(lang('labels_my') . ' ' . lang('labels_uploads')), 'other' => ucfirst(lang('labels_other')), 'position1' => ucwords(lang('order_first') . ' ' . lang('global_position')), 'position2' => ucwords(lang('order_second') . ' ' . lang('global_position')), 'rank' => ucfirst(lang('global_rank')), 'suffix' => ucfirst(lang('labels_suffix')), 'type' => ucwords(lang('global_character') . ' ' . lang('labels_type')), 'type_active' => ucwords(lang('status_active') . ' ' . lang('global_characters')), 'type_inactive' => ucwords(lang('status_inactive') . ' ' . lang('global_characters')), 'type_npc' => ucwords(lang('status_nonplaying') . ' ' . lang('global_characters')), 'upload' => ucwords(lang('actions_upload') . ' ' . lang('labels_images') . ' ' . RARROW), 'change' => ucwords(lang('actions_change') . ' ' . lang('global_character') . ' ' . lang('labels_status')), 'available_images' => ucwords(lang('labels_available') . ' ' . lang('labels_images')), 'character_images' => ucwords(lang('global_character') . ' ' . lang('labels_images')));
     $js_data['rankloc'] = $this->rank;
     $js_data['id'] = $data['id'];
     $this->_regions['content'] = Location::view('characters_bio', $this->skin, 'admin', $data);
     $this->_regions['javascript'] = Location::js('characters_bio_js', $this->skin, 'admin', $js_data);
     $this->_regions['title'] .= $data['header'];
     Template::assign($this->_regions);
     Template::render();
 }
开发者ID:rajeltomari,项目名称:Join-Form,代码行数:101,代码来源:characters.php

示例5: index


//.........这里部分代码省略.........
                         $characters = $this->char->get_characters_for_position($pos->pos_id, array('rank' => 'asc'));
                         if ($characters->num_rows() > 0) {
                             $c = 1;
                             foreach ($characters->result() as $char) {
                                 // get the character name and rank
                                 $name = $this->char->get_character_name($char->charid, true);
                                 // get the rank data we need
                                 $ranksdata = $this->ranks->get_rank($char->rank, array('rank_name', 'rank_image'));
                                 // build the rank image array
                                 $rank_img = array('src' => Location::rank($this->rank, $ranksdata['rank_image'], $rank->rankcat_extension), 'alt' => $ranksdata['rank_name'], 'class' => 'image');
                                 // get char image
                                 $char_img = '';
                                 if ($char->images > '') {
                                     // get the images
                                     $images = explode(',', $char->images);
                                     $images_count = count($images);
                                     $src = strstr($images[0], 'http://') !== false ? $images[0] : base_url() . Location::asset('images/characters', trim($images[0]));
                                     list($imgwidth, $imgheight, $imgtype, $imgattr) = getimagesize($src);
                                     if ($imgwidth < $imgheight) {
                                         $factor = round($imgwidth / 80, 2);
                                     } else {
                                         $factor = round($imgheight / 80, 2);
                                     }
                                     // set the image
                                     $char_img = array('src' => $src, 'alt' => $name, 'class' => 'charimg', 'height' => $imgheight / $factor, 'width' => $imgwidth / $factor);
                                 } else {
                                     //no image:
                                     list($imgwidth, $imgheight, $imgtype, $imgattr) = getimagesize(base_url() . Location::img('no-avatar.png', $this->skin, 'main'));
                                     if ($imgwidth < $imgheight) {
                                         $factor = round($imgwidth / 80, 2);
                                     } else {
                                         $factor = round($imgheight / 80, 2);
                                     }
                                     // set the image
                                     $char_img = array('src' => Location::img('no-avatar.png', $this->skin, 'main'), 'alt' => '', 'class' => 'charimg', 'height' => $imgheight / $factor, 'width' => $imgwidth / $factor);
                                 }
                                 // set the color
                                 $color = '';
                                 if ($char->user > 0) {
                                     $color = $this->user->get_loa($char->user) == 'loa' ? '_loa' : $color;
                                     $color = $this->user->get_loa($char->user) == 'eloa' ? '_eloa' : $color;
                                 }
                                 $color = $char->crew_type == 'inactive' ? '' : $color;
                                 $color = $char->crew_type == 'npc' ? '_npc' : $color;
                                 // build the combadge image array
                                 $cb_img = array('src' => Location::cb('combadge' . $color . '.png', $this->skin, 'main'), 'alt' => ucwords(lang('actions_view') . ' ' . lang('labels_bio')), 'class' => 'image');
                                 $f_species = $this->char->get_field_data(2, $char->charid);
                                 if ($f_species->num_rows() > 0) {
                                     $fr_species = $f_species->result();
                                     $species = $fr_species[0]->data_value;
                                 }
                                 $f_gender = $this->char->get_field_data(1, $char->charid);
                                 if ($f_gender->num_rows() > 0) {
                                     $fr_gender = $f_gender->result();
                                     $gender = $fr_gender[0]->data_value;
                                 }
                                 if ($char->crew_type == 'active' and empty($char->user)) {
                                     // don't do anything
                                 } else {
                                     // set the data for characters in a position in the dept
                                     $data['depts'][$dept]['pos'][$b]['chars'][$c]['char_id'] = $char->charid;
                                     $data['depts'][$dept]['pos'][$b]['chars'][$c]['name'] = $name;
                                     $data['depts'][$dept]['pos'][$b]['chars'][$c]['rank_img'] = $rank_img;
                                     $data['depts'][$dept]['pos'][$b]['chars'][$c]['crew_type'] = $char->crew_type;
                                     $data['depts'][$dept]['pos'][$b]['chars'][$c]['combadge'] = $cb_img;
                                     $data['depts'][$dept]['pos'][$b]['chars'][$c]['char_gender'] = $gender;
                                     //1=gender
                                     $data['depts'][$dept]['pos'][$b]['chars'][$c]['char_species'] = $species;
                                     //2=species
                                     $data['depts'][$dept]['pos'][$b]['chars'][$c]['char_image'] = $char_img;
                                     ++$c;
                                 }
                             }
                         }
                         ++$b;
                     }
                 }
             }
         }
     }
     // pull the top open positions
     $top = $this->pos->get_open_positions('y', true);
     if ($top->num_rows() > 0) {
         foreach ($top->result() as $t) {
             $data['top'][$t->pos_id] = array('name' => $t->pos_name, 'id' => $t->pos_id, 'dept' => $this->dept->get_dept($t->pos_dept, 'dept_name'), 'blank_img' => $blank_img);
         }
     }
     // set the javascript data
     $js_data = array('display' => $this->uri->rsegment(3), 'manifest_defaults' => $MD->manifest_view);
     // set the data being sent to the view
     $data['display'] = $this->uri->rsegment(3, 'crew');
     $data['header'] = ucwords(lang('labels_crew') . ' ' . lang('labels_manifest'));
     $data['loader'] = array('src' => Location::img('loader.gif', $this->skin, 'main'), 'alt' => '', 'class' => 'image');
     $data['label'] = array('playing_chars' => ucwords(lang('status_playing') . ' ' . lang('global_characters')), 'inactive_chars' => ucwords(lang('status_inactive') . ' ' . lang('global_characters')), 'all_chars' => ucwords(lang('labels_all') . ' ' . lang('global_characters')), 'open' => ucwords(lang('status_open') . ' ' . lang('global_positions')), 'show' => ucfirst(lang('actions_show')), 'toggle' => ucfirst(lang('actions_toggle')), 'npcs' => lang('abbr_npcs'), 'loading' => ucfirst(lang('actions_loading')), 'inactive' => ucfirst(lang('status_inactive')), 'apply' => ucwords(lang('global_position') . ' ' . lang('status_open') . ' ' . NDASH . ' ' . lang('actions_apply') . ' ' . lang('time_now')), 'npc' => lang('abbr_npc'), 'manifests' => ucwords(lang('labels_site') . ' ' . lang('labels_manifests')), 'top_positions' => ucwords(lang('labels_top') . ' ' . lang('status_open') . ' ' . lang('global_positions')));
     $this->_regions['content'] = Location::view('personnel_index', $this->skin, 'main', $data);
     $this->_regions['javascript'] = Location::js('personnel_index_js', $this->skin, 'main', $js_data);
     $this->_regions['title'] .= $data['header'];
     Template::assign($this->_regions);
     Template::render();
 }
开发者ID:rajeltomari,项目名称:Manifest-Details,代码行数:101,代码来源:personnel.php


注:本文中的Location::js方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。