示例#1
0
 /**
  * Render
  * 
  * Renders a cell and populates
  * it's rendered value
  * 
  * @access	public
  * @param	Spark\Grid_Column_Cell	Cell
  * @return	Spark\Grid_Column_Renderer_Action
  */
 public function render(\Grid_Column_Cell $cell)
 {
     // Get value
     $value = $cell->get_original_value();
     if ($actions = $cell->get_actions()) {
         if ($actions->count() > 1) {
             // Convert uri to somethign that the browser will like
             $value = \Form::select(null, null, array(null => null) + $actions->get_data(), array('onchange' => 'window.location.href=this.value'));
         } else {
             $value = '';
             foreach ($actions->get_data() as $action => $action_value) {
                 if (is_object($action_value)) {
                     $value .= \Html::anchor($action, $action_value->get_data('title'), array('class' => $action_value->get_data('link_class', '')));
                 } else {
                     $value .= \Html::anchor($action, $action_value);
                 }
             }
         }
     }
     // Set rendered
     $cell->set_rendered_value($value);
     return $this;
 }