Updates to Module administration
This commit is contained in:
@@ -171,6 +171,21 @@ abstract class ORM_OSB extends ORM {
|
||||
return array_key_exists($key,$this->$column) ? $this->{$column}[$key] : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a bootstrap label button for a field with a boolean value
|
||||
*/
|
||||
public function label_bool($column,$render=FALSE) {
|
||||
if (! isset($this->_table_columns[$column]))
|
||||
return NULL;
|
||||
|
||||
if (! $render)
|
||||
return $this->display($column);
|
||||
|
||||
return View::factory(Config::theme().'/label/bool')
|
||||
->set('label',$this->$column ? 'label-success' : '')
|
||||
->set('column',$this->display($column));
|
||||
}
|
||||
|
||||
final public function module() {
|
||||
return ORM::factory(Kohana::classname($this->name));
|
||||
}
|
||||
@@ -223,15 +238,7 @@ abstract class ORM_OSB extends ORM {
|
||||
}
|
||||
|
||||
public function status($render=FALSE) {
|
||||
if (! isset($this->_table_columns['status']))
|
||||
return NULL;
|
||||
|
||||
if (! $render)
|
||||
return $this->display('status');
|
||||
|
||||
return View::factory(Config::theme().'/status')
|
||||
->set('label',$this->status ? 'label-success' : '')
|
||||
->set('status',$this->display('status'));
|
||||
return $this->label_bool('status',$render);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user