Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
design_area_login_form_edit_fns.inc
1 <?php
18 require_once SQ_CORE_PACKAGE_PATH.'/designs/design_area/design_area_edit_fns.inc';
19 
32 {
33 
34 
39  function __construct()
40  {
41  parent::__construct();
42 
43  }//end constructor
44 
45 
55  public function _processContents(Design_Area_Login_Form $asset, Array &$contents)
56  {
57  if (!$this->_setVariables($asset, $contents)) {
58  return FALSE;
59  }
60  $all_contents = Array();
61 
62  foreach ($contents as $index => $element) {
63  if ($element['_type'] != 'TAG') continue;
64  if ($element['operation'] != 'login_section' && $element['operation'] != 'logout_section') {
65  $all_contents[] = $element;
66  continue;
67  }
68 
69  // get 'login' or 'logout'
70  $section = substr($element['operation'], 0, -8);
71 
72  // if there is some contents then save it to our arrays
73  if (!$element['self_terminating'] && !empty($element['contents'])) {
74  $all_contents = array_merge($all_contents, $element['contents']);
75  if (!$asset->setAttrValue($section.'_contents', $element['contents'])) {
76  return FALSE;
77  }
78  }
79 
80  }//end foreach
81 
82  if (!$this->_setVariables($asset, $all_contents)) {
83  return FALSE;
84  }
85  $GLOBALS['SQ_PROCESSED_DESIGN_AREAS'][$asset->attr('id_name')] = TRUE;
86  $asset->setAttrValue('contents', $contents);
87  return $asset->saveAttributes();
88 
89  }//end _processContents()
90 
91 
92 }//end class
93 ?>