17 require_once SQ_CORE_PACKAGE_PATH.
'/folder/folder.inc';
42 parent::__construct($assetid);
60 require_once SQ_CORE_PACKAGE_PATH.
'/system/system_asset_fns.inc';
61 if (!system_asset_fns_create_pre_check($this)) {
65 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db2');
66 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'BEGIN');
68 if ($linkid = parent::create($link)) {
69 if (!system_asset_fns_create_cleanup($this)) {
75 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'COMMIT');
77 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
80 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
109 public function morph($new_type_code)
111 trigger_localised_error(
'CORE0091', E_USER_WARNING, $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo($this->type(),
'name'));
128 if ($name ==
'name') {
129 trigger_localised_error(
'CORE0111', E_USER_WARNING, $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo($this->type(),
'name'));
133 return parent::setAttrValue($name, $value);
155 public function createLink(
Asset $minor, $link_type, $value=
'', $sort_order=NULL, $dependant=
'0', $exclusive=
'0')
157 if ($GLOBALS[
'SQ_SYSTEM']->runLevelEnables(SQ_SECURITY_LINK_INTEGRITY)) {
158 trigger_localised_error(
'CORE0117', E_USER_WARNING, $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo($this->type(),
'name'));
161 return parent::createLink($minor, $link_type, $value, $sort_order, $dependant, $exclusive);
177 trigger_localised_error(
'CORE0118', E_USER_WARNING, $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo($this->type(),
'name'));
205 $allowed_links[SQ_LINK_TYPE_1] = Array();
207 $packages = $GLOBALS[
'SQ_SYSTEM']->getInstalledPackages();
208 foreach ($packages as $data) {
209 $package = $data[
'code_name'];
210 if ($package ==
'__core__') {
211 require_once SQ_CORE_PACKAGE_PATH.
'/package_manager_core.inc';
212 $class =
'package_manager_core';
214 require_once SQ_PACKAGES_PATH.
'/'.$package.
'/package_manager_'.$package.
'.inc';
215 $class =
'package_manager_'.$package;
218 eval(
'$sys_asset_types = '.$class.
'::getSystemAssetTypes();');
219 foreach ($sys_asset_types as $type_code) {
220 $allowed_links[SQ_LINK_TYPE_1][$type_code] = Array(
'card' =>
'1',
'exclusive' => TRUE);
225 return $allowed_links;
246 if (empty($assetids)) {
247 if ($GLOBALS[
'SQ_SYSTEM']->userRoot()) {
248 return parent::writeAccess($lock_type, $assetids);
251 $root_user = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'root_user');
252 if (in_array($root_user->id, $assetids)) {
253 return parent::writeAccess($lock_type, $assetids);