function _valid_perform()
 {
     $tree =& tree::instance();
     $params = array();
     $params['identifier'] = $this->dataspace->get('identifier');
     $params['parent_path'] = $this->dataspace->get('parent_path');
     $params['class'] = $this->dataspace->get('class_name');
     $params['title'] = $this->dataspace->get('title');
     $object =& site_object_factory::create($params['class']);
     $is_root = false;
     if (!($parent_data = fetch_one_by_path($params['parent_path']))) {
         if ($params['parent_path'] == '/') {
             $is_root = true;
         } else {
             error("parent wasn't retrieved", __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
         }
     }
     if (!$is_root) {
         $params['parent_node_id'] = $parent_data['node_id'];
     } else {
         $params['parent_node_id'] = 0;
     }
     $object->import_attributes($params);
     if (!$object->create($is_root)) {
         error("object wasn't registered", __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__);
     }
     if (!$is_root) {
         $parent_object =& site_object_factory::instance($parent_data['class_name']);
         $parent_object->import_attributes($parent_data);
         $access_policy =& access_policy::instance();
         $access_policy->save_object_access($object, $parent_object);
     }
     return new close_popup_response(RESPONSE_STATUS_FORM_SUBMITTED);
 }
	function fetch($path=null)
	{
		if(!$path)
			$path = $this->get_path();
		
		$arr = fetch_one_by_path($path);
		$this->import($arr);
	}
 function &get_dataset(&$counter, $params)
 {
     $item = array();
     if (isset($params['path'])) {
         $item =& fetch_one_by_path($params['path']);
     }
     return new array_dataset(array($item));
 }
  function _init_dataspace(&$request)
  {
    parent :: _init_dataspace($request);

    $root = fetch_one_by_path('/root');

    $this->dataspace->set('parent_node_id', $root['node_id']);
  }
 require_once LIMB_DIR . 'core/lib/locale/strings.class.php';
 require_once LIMB_DIR . 'core/lib/http/control_flow.inc.php';
 require_once LIMB_DIR . 'core/fetcher.class.php';
 require_once LIMB_DIR . 'core/model/site_object_factory.class.php';
 start_user_session();
 $user =& user::instance();
 $user->login('admin', 'test');
 debug::add_timing_point('start');
 $db =& db_factory::instance();
 $db->begin();
 define('CONTENT_LOCALE_ID', 'ru');
 define('MANAGEMENT_LOCALE_ID', 'ru');
 $tree =& limb_tree::instance();
 $object =& site_object_factory::create($params['class']);
 $is_root = false;
 if (!($parent_data = fetch_one_by_path($params['parent_path']))) {
     if ($params['parent_path'] == '/') {
         $is_root = true;
     } else {
         echo 'parent object not found';
         exit;
     }
 }
 if (!$is_root) {
     $params['parent_node_id'] = $parent_data['node_id'];
 } else {
     $params['parent_node_id'] = 0;
 }
 $object->import_attributes($params);
 if ($object->create($is_root)) {
     echo $params['parent_path'] . '/' . $params['identifier'] . ' created <br/>';