spaces_controller_boxes.inc in Boxes 6
File
plugins/spaces_controller_boxes.inc
View source
<?php
class spaces_controller_boxes extends spaces_controller {
protected function load_original_values($id = NULL) {
if (empty($this->loaded_all['original'])) {
if (!isset($id)) {
$boxes = array();
foreach (ctools_export_load_object('box') as $box) {
$boxes[$box->delta] = $box;
}
$this->values['original'] = $boxes;
$this->loaded_all['original'] = TRUE;
}
else {
if (!isset($this->loaded['original'][$id])) {
if ($box = array_pop(ctools_export_load_object('box', 'names', array(
$id,
)))) {
$this->values['original'][$id] = $box;
$this->loaded['original'][$id] = TRUE;
}
}
}
}
}
function set($id, $value) {
unset($value->new);
unset($value->export_type);
$box = new stdClass();
foreach ($value as $k => $v) {
$box->{$k} = $v;
}
parent::set($id, $box);
}
}