Portions created by the Initial Developer are Copyright (C) 2008-2017 the Initial Developer. All Rights Reserved. Contributor(s): Matthew Vale */ if ($domains_processed == 1) { //get the array of xml files $xml_list = glob($_SERVER["PROJECT_ROOT"] . "/*/*/resources/switch/conf/number_translation/*.xml"); //number_translation class $number_translation = new number_translations; //process the xml files foreach ($xml_list as &$xml_file) { //get and parse the xml $number_translation->display_type = $display_type; $number_translation->xml = file_get_contents($xml_file); $number_translation->import(); } //check for existing configuration if (file_exists($_SESSION['switch']['conf']['dir']."/autoload_configs/translate.conf.xml")) { //import existing data $xml = file_get_contents($_SESSION['switch']['conf']['dir']."/autoload_configs/translate.conf.xml"); //convert the xml string to an xml object $xml = simplexml_load_string($xml); //convert to json $json = json_encode($xml); //convert to an array $number_translations = json_decode($json, true); if (array_key_exists('include', $number_translations)) { $number_translations = $number_translations['include']; } if ($number_translations['configuration']['@attributes']['autogenerated'] != 'true') { foreach ($number_translations['configuration']['profiles']['profile'] as $profile) { $json = json_encode($profile); $number_translation->display_type = $display_type; $number_translation->json = $json; $number_translation->import(); } } } } ?>