You are here

private function sweaver_plugin_editor::sweaver_recursive_table_element in Sweaver 7

1 call to sweaver_plugin_editor::sweaver_recursive_table_element()
sweaver_plugin_editor::sweaver_form_render in plugins/sweaver_plugin_editor/sweaver_plugin_editor.inc
Frontend form render.

File

plugins/sweaver_plugin_editor/sweaver_plugin_editor.inc, line 638
Properties editor class.

Class

sweaver_plugin_editor
@file Properties editor class.

Code

private function sweaver_recursive_table_element($property, $properties) {
  if (is_array($property)) {
    foreach ($property as $kee => $value) {
      if (is_array($value)) {
        $property[$kee] = $this
          ->sweaver_recursive_table_element($value, $properties);
      }
      elseif (preg_match('/^{([a-zA-Z_-]+)}$/', $value, $property_name)) {

        // $property_name[0] contains the entire string and $property_name[1] the first variable
        $property_name = $property_name[1];
        if (isset($properties[$property_name])) {
          $property[$kee] = $properties[$property_name];
        }
      }
    }
    return $property;
  }
}