Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
system_asset_config.inc
1 <?php
18 require_once SQ_LIB_PATH.'/config/config.inc';
19 
32 {
33 
34  // Dummy entry for the printing of the system asset() fn
35  var $config_vars = Array(
36  'PRINT_SYSTEM_ASSETS' => Array('editable' => 0, 'default' => ''),
37  );
38 
39 
44  function __construct()
45  {
46  parent::__construct();
47  $this->config_file = SQ_DATA_PATH.'/private/conf/system_assets.inc';
48 
49  }//end constructor
50 
51 
63  function save($vars, $backup_existing=FALSE, $send_message=TRUE)
64  {
65  // we don't really care about any values that they have entered
66  return parent::save(Array(), $backup_existing);
67 
68  }//end save()
69 
70 
82  function _paintConfigVar($var_name, $value, $var_export=true)
83  {
84  switch ($var_name) {
85  case 'PRINT_SYSTEM_ASSETS' :
86 
87  $packages = $GLOBALS['SQ_SYSTEM']->getInstalledPackages();
88 
89  $system_assets = Array();
90  // GET THE ASSETIDS FOR ALL THE $system_assets types
91  foreach ($packages as $data) {
92 
93  $package = $data['code_name'];
94 
95  if ($package == '__core__') {
96  require_once SQ_CORE_PACKAGE_PATH.'/package_manager_core.inc';
97  $class = 'package_manager_core';
98  } else {
99  require_once SQ_PACKAGES_PATH.'/'.$package.'/package_manager_'.$package.'.inc';
100  $class = 'package_manager_'.$package;
101  }
102 
103  $package_obj = new $class;
104  $sys_asset_types = $package_obj->getSystemAssetTypes();
105  unset($package_obj);
106 
107  foreach ($sys_asset_types as $type_code) {
108  $assetids = $GLOBALS['SQ_SYSTEM']->am->getTypeAssetids($type_code);
109  if (count($assetids) > 0) {
110  $system_assets[$type_code] = (int) $assetids[0];
111  }
112  }//end foreach
113  }// end foreach
114  echo '$system_assets = ';
115  var_export($system_assets);
116  echo "\n";
117 
118  // reset the list of system assets in the asset manager
119  $GLOBALS['SQ_SYSTEM']->am->resetSystemAssetList();
120 
121  return true;
122  break;
123 
124  default :
125  return parent::_paintConfigVar($var_name, $value, $var_export);
126 
127  }// end switch
128 
129  }//end _paintConfigVar()
130 
131 
132 }//end class
133 
134 ?>