18 require_once SQ_CORE_PACKAGE_PATH.
'/folder/folder.inc';
62 require_once SQ_CORE_PACKAGE_PATH.
'/system/system_asset_fns.inc';
63 $this->_tmp[__CLASS__.
'_in_create'] = TRUE;
65 if (!system_asset_fns_create_pre_check($this)) {
69 $ret_val = parent::create($link);
72 throw new Exception(
'Unable to create root folder, as it did not receive asset ID #1. Fragments of another system may exist in the database; please ensure the database is clear of previous installations before installing.');
73 trigger_localised_error(
'CORE0077', E_USER_ERROR);
82 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
83 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
84 throw new Exception(
'Unable to create root folder, as it did not receive link ID #1. Fragments of another system may exist in the database; please ensure the database is clear of previous installations before installing.');
85 trigger_localised_error(
'CORE0078', E_USER_ERROR);
89 require_once SQ_FUDGE_PATH.
'/db_extras/db_extras.inc';
91 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db3');
93 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'BEGIN');
140 }
catch (Exception $e) {
141 throw new Exception(
'Unable to create root folder\'s link #1 entry due to database error: '.$e->getMessage());
162 }
catch (Exception $e) {
163 throw new Exception(
'Unable to create root folder\'s link tree entry due to database error: '.$e->getMessage());
166 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'COMMIT');
167 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
169 if (!system_asset_fns_create_cleanup($this)) {
174 unset($this->_tmp[__CLASS__.
'_in_create']);
191 return ($short_name) ?
'/' : translate(
'root_folder');
252 if (empty($assetids)) {
253 if ($GLOBALS[
'SQ_SYSTEM']->userRoot())
return TRUE;
254 if ($GLOBALS[
'SQ_SYSTEM']->userSystemAdmin()) {
259 return parent::_checkPermissionAccess($perm, $assetids);
276 if ($name ==
'name' && empty($this->_tmp[__CLASS__.
'_in_create'])) {
277 trigger_localised_error(
'CORE0112', E_USER_WARNING);
281 return parent::setAttrValue($name, $value);