Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
remap_manager_management.inc
1 <?php
2 
19 require_once SQ_INCLUDE_PATH.'/asset_management.inc';
20 
32 {
33 
34 
42  {
43  Asset_Management::__construct($pm);
44 
45  $this->vars = Array(
46  '404_asset' => Array(
47  'added' => '0.0.1',
48  'type' => 'assetid',
49  'default' => '0',
50  ),
51  'remap_upon_webpath_change' => Array(
52  'added' => '0.2.1',
53  'type' => 'boolean',
54  'default' => TRUE,
55  ),
56  'never_delete_remap_default' => Array(
57  'added' => '0.2.1',
58  'type' => 'boolean',
59  'default' => FALSE,
60  ),
61  'preserve_url_parameters' => Array(
62  'added' => '0.2.1',
63  'type' => 'boolean',
64  'default' => TRUE,
65  ),
66  );
67 
68  }//end constructor
69 
70 
79  public function _upgrade($current_version)
80  {
81  if (!parent::_upgrade($current_version)) return FALSE;
82 
83  if (version_compare($current_version, '0.2.2', '<')) {
84 
85  $rm = $GLOBALS['SQ_SYSTEM']->am->getSystemAsset('remap_manager');
86 
87  $sql = "SELECT custom_val FROM sq_ast_attr a, sq_ast_attr_val v where v.assetid = '".$rm->id."' AND a.name='never_delete_remap_default' AND a.attrid=v.attrid";
88  $record = MatrixDAL::executeSqlAssoc($sql);
89 
90  if (empty($record)) {
91  $rm->setAttrValue('never_delete_remap_default', '1');
92  $rm->saveAttributes();
93  }
94  }
95 
96  return TRUE;
97 
98  }//end _updrade()
99 
100 }//end class
101 
102 ?>