Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
page_user_group_manager_edit_fns.inc
1 <?php
18 require_once SQ_CORE_PACKAGE_PATH.'/page/page_edit_fns.inc';
19 
33 {
34 
35 
40  function __construct()
41  {
42  parent::__construct();
43 
44  }//end constructor
45 
46 
57  function paintRootNode(&$asset, &$o, $prefix)
58  {
59  if ($asset->writeAccess('attributes')) {
60  asset_finder($prefix.'_lm_root_node', $asset->attr('root_node'));
61  } else {
62  $root_info = $GLOBALS['SQ_SYSTEM']->am->getAssetInfo(Array($asset->attr('root_node')));
63  if (!empty($root_info)) {
64  echo get_asset_tag_line($asset->attr('root_node'));
65  } else {
66  echo translate('cms_no_root_selected');
67  }
68  }
69 
70  }//end paintRootNode()
71 
72 
83  function processRootNode(&$asset, &$o, $prefix)
84  {
85  // need to have write access to make any changes
86  if (!$asset->writeAccess('attributes')) return FALSE;
87 
88  $root_node = $_REQUEST[$prefix.'_lm_root_node']['assetid'];
89  $asset->setAttrValue('root_node', $root_node);
90 
91  }//end processRootNode()
92 
93 
104  function paintStatus(&$asset, &$o, $prefix)
105  {
106  require_once SQ_INCLUDE_PATH.'/general_occasional.inc';
107  $write_access = $asset->writeAccess('links');
108 
109  $current = $asset->attr('statuses');
110 
111  if ($write_access) {
112  require_once SQ_LIB_PATH.'/html_form/html_form.inc';
113  $statuses = get_constant_values('SQ_STATUS');
114 
115  $options = Array();
116  foreach ($statuses as $constant => $value) {
117  $options[$value] = get_status_description($value);
118  }
119 
120  combo_box($prefix.'_statuses', $options, TRUE, $current);
121  } else {
122  if (empty($current)) {
123  echo translate('no_status_selected');
124  } else {
125  echo '<ul>';
126  foreach ($current as $status) {
127  echo '<li>'.get_status_description($status).'</li>';
128  }
129  echo '</ul>';
130  }
131  }
132 
133  return $write_access;
134 
135  }//end paintStatus()
136 
137 
148  function processStatus(&$asset, &$o, $prefix)
149  {
150  // need to have write access to make any changes
151  if (!$asset->writeAccess('attributes')) return FALSE;
152 
153  $statuses = Array();
154  if (isset($_POST[$prefix.'_statuses'])) {
155  foreach ($_POST[$prefix.'_statuses'] as $status) {
156  $statuses[] = $status;
157  }
158  $statuses = array_unique($statuses);
159  }
160 
161  return $asset->setAttrValue('statuses', $statuses);
162 
163  }//end processStatus()
164 
165 
166 }//end class
167 
168 ?>