<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/**
 * Description of rtgc_edit_link
 *
 * @author Igor Ratsun
 */
class rtgc_edit_link implements rtgc_callback
{
    protected $CI = NULL;
    protected $uri_string = '';


    public function __construct()
    {
        $this->CI = & get_instance();
        $this->uri_string = base_url($this->CI->uri->uri_string()) . '/edit/';
    }

    public function column($value = '', $data = array())
    {
        $link = $this->uri_string . reset($data);
        return '<a href="' . $link . '">' . $value . '</a>';
    }
    
    public function field($name = '', $value = NULL)
    {
        return $this->CI->rtgrid_field_callback->input($name, $value);
    }

}
