Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class am_signup_handler_field_ops extends views_handler_field {
- function query() {
- // do nothing -- to override the parent query.
- }
- function render( $v ) {
- $tokens = $this->get_render_tokens($v);
- $tokens = array_map('strip_tags',$tokens);
- return l(
- t('remove'),
- strtr('am_signup/remove/' . $this->options['nid_token'] . '/' . $this->options['uid_token'],$tokens),
- array('attributes' => array('class'=> 'am-signup-remove-link'))
- );
- }
- function option_definition() {
- $options = parent::option_definition();
- $options['alter']['contains']['alter_text'] = array('default' => TRUE);
- $options['uid_token'] = array('default' => $this->definition['uid_token']);
- $options['nid_token'] = array('default' => $this->definition['nid_token']);
- return $options;
- }
- function options_form(&$form, &$form_state) {
- $tokens = array_keys($this->get_render_tokens());
- $tokens = array_combine($tokens,$tokens);
- $form['uid_token'] = array(
- '#title'=> 'User ID Field',
- '#type' => 'select',
- '#options' => $tokens,
- '#default_value' => $this->options['uid_token']
- );
- $form['nid_token'] = array(
- '#title'=> 'Shift NID Field',
- '#type' => 'select',
- '#options' => $tokens,
- '#default_value' => $this->options['nid_token']
- );
- parent::options_form( $form, $form_state);
- }
- }
Add Comment
Please, Sign In to add comment