--- views_customfield_handler_field_phpcode.inc.org	2010-02-21 17:29:11.000000000 +0100
+++ views_customfield_handler_field_phpcode.inc	2010-11-17 20:28:27.000000000 +0100
@@ -38,6 +38,7 @@
         .' '.t('Available variables:').'<br/>'
         .t('$data: contains the retrieved record from the database (e.g. $data->nid).').'<br/>'
         .t('$static: can be used to store reusable data per row.')
+		.t('$args: can be used to access args of the view.')
       ,
     );
   }
@@ -68,7 +69,7 @@
       }
     }
     
-    return $this->render_phpcode($this->options['value'], $this->static, $values);
+    return $this->render_phpcode($this->options['value'], $this->static, $values, $this->view->args);
   }
 
   /**
@@ -81,7 +82,7 @@
    * @param array $data
    * @return string
    */
-  function render_phpcode($code, &$static, $data) {
+  function render_phpcode($code, &$static, $data, $args) {
     global $theme_path, $theme_info, $conf;
   
     // Store current theme path.
@@ -97,7 +98,7 @@
       $theme_path = dirname($theme_info->filename);
     }
   
-    $output = $this->eval_phpcode($code, $static, $data);
+    $output = $this->eval_phpcode($code, $static, $data, $args);
   
     // Recover original theme path.
     $theme_path = $old_theme_path;
@@ -113,7 +114,7 @@
    * @param array $data
    * @return string
    */
-  function eval_phpcode($code, &$static, $data) {
+  function eval_phpcode($code, &$static, $data, $args) {
     ob_start();
     print eval('?>'. $code);
     return ob_get_clean();
