18 require_once SQ_INCLUDE_PATH.
'/asset_management.inc';
40 Asset_Management::__construct($pm);
48 'wysiwyg_classes' => Array(
50 'type' =>
'serialise',
52 'description' =>
'Use saved classes in the wysiwyg dropdown list',
54 'div_classes' => Array(
56 'type' =>
'serialise',
58 'description' =>
'Use saved classes in the DIV container properties class dropdown',
60 'limbo_no_frames' => Array(
64 'parameters' => Array (
65 'allow_empty' => FALSE,
67 'description' =>
'LIMBO no frame options for each design, not using frames while inside LIMBO mode',
69 'static_url_versioning' => Array(
73 'parameters' => Array(
'allow_empty' => FALSE),
91 $res = parent::_upgrade($current_version);
93 if (version_compare($current_version,
'0.3',
'<')) {
94 pre_echo(
'UPGRADING DESIGN FROM v < 0.3');
97 $design_ids = $GLOBALS[
'SQ_SYSTEM']->am->getTypeAssetids(
'design', TRUE, TRUE);
98 foreach ($design_ids as $design_id => $type) {
99 $design = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($design_id, $type[
'type_code']);
100 $design->setAttrValue(
'static_url_versioning', FALSE);
101 $design->saveAttributes();
102 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($design);
109 if (version_compare($current_version,
'0.4',
'<')) {
110 pre_echo(
'UPGRADING DESIGN FROM v < 0.4');
113 $design_ids = $GLOBALS[
'SQ_SYSTEM']->am->getTypeAssetids(
'design', TRUE, TRUE);
114 foreach ($design_ids as $design_id => $type) {
115 $vars = Array(
'assetid' => $design_id);
116 $hh = $GLOBALS[
'SQ_SYSTEM']->getHipoHerder();
117 $hh->freestyleHipo(
'hipo_job_regenerate_design', $vars);
122 if (version_compare($current_version,
'0.5',
'<')) {
123 pre_echo(
'UPGRADING DESIGN FROM v < 0.5');
125 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db2');
126 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'BEGIN');
127 $sql =
'UPDATE sq_ast_lnk SET is_exclusive = \'1\' WHERE link_type = \'2\' AND value = \'customisation\' AND minorid IN ';
128 $sql .=
'(SELECT assetid from sq_ast WHERE type_code = \'design_customisation\')';
131 }
catch (Exception $e) {
132 throw new Exception(
'Failed to get package information for package "'.$package_name.
'" due to database error: '.$e->getMessage());
134 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'COMMIT');
135 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();