18 require_once SQ_INCLUDE_PATH.
'/asset_management.inc';
40 Asset_Management::__construct($pm);
50 'type' =>
'serialise',
52 'show_cascade_metadata_field' => FALSE,
71 'event_name' =>
'requestKeywords',
72 'broadcast_type_code' =>
'content_type',
73 'broadcast_strict_type_code' => FALSE,
75 'side_of_link' =>
'major',
77 'is_exclusive' => NULL,
80 'link_type' => SQ_LINK_TYPE_2 | SQ_LINK_TYPE_1,
98 'popups/print_limbo_keywords.php',
114 if (!parent::_upgrade($current_version))
return FALSE;
116 $asset_name = strtoupper($this->_pm->getTypeInfo($this->getAssetType(),
'name'));
117 $am = $GLOBALS[
'SQ_SYSTEM']->am;
119 if (version_compare($current_version,
'0.2',
'<')) {
121 pre_echo(
'STARTING '.$asset_name.
' UPGRADE - TO VERSION 0.2');
123 $default_val = Array(
'show_cascade_metadata_field' => FALSE);
125 $pages = $GLOBALS[
'SQ_SYSTEM']->am->getTypeAssetids($this->
getAssetType(), TRUE, TRUE);
127 foreach ($pages as $assetid => $type_code) {
128 $asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($assetid, $type_code[
'type_code']);
129 if (is_null($asset))
continue;
130 echo
'Upgrading Asset #'.$assetid.
"...\n";
134 if (!$asset->setAttrValue(
'options', $default_val)) {
135 echo
'Asset #', $asset->id,
' (', $asset->name,
') Could not add "options" attribute to existing Layout',
"\n";
139 if (!$asset->saveAttributes()) {
140 echo
'Asset #', $asset->id,
' (', $asset->name,
') Unable to save attributes',
"\n";
143 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($asset);
146 pre_echo($asset_name.
' UPGRADE COMPLETE - TO VERSION 0.2');