示例#1
0
 function objectAttributeContent($contentObjectAttribute)
 {
     $contentClassAttribute = $contentObjectAttribute->attribute('contentclass_attribute');
     $section = $contentClassAttribute->attribute(self::CLASS_SECTION_FIELD);
     $parameter = $contentClassAttribute->attribute(self::CLASS_PARAMETER_FIELD);
     $iniInstanceArray = explode(';', $contentClassAttribute->attribute(self::CLASS_INI_INSTANCE_FIELD));
     $siteAccessArray = explode(';', $contentClassAttribute->attribute(self::SITE_ACCESS_LIST_FIELD));
     $filename = $contentClassAttribute->attribute(self::CLASS_FILE_FIELD);
     $modified = array();
     $contentObject = $contentObjectAttribute->attribute('object');
     foreach ($iniInstanceArray as $iniInstance) {
         if ($iniInstance == 0) {
             $path = 'settings/override';
         } else {
             $path = 'settings/siteaccess/' . $siteAccessArray[$iniInstance];
         }
         if (!eZINI::parameterSet($filename, $path, $section, $parameter)) {
             continue;
         }
         $config = eZINI::instance($filename, $path, null, null, null, true);
         if (is_array($config->variable($section, $parameter))) {
             $objectIniArray = array();
             eZIniSettingType::parseArrayInput($contentObjectAttribute->attribute('data_text'), $objectIniArray);
             $existingIniArray = $config->variable($section, $parameter);
             foreach (array_keys($existingIniArray) as $key) {
                 if (!is_int($key) && $existingIniArray[$key] != $objectIniArray[$key]) {
                     $modified[] = array('ini_value' => $parameter . '[' . $key . ']=' . $existingIniArray[$key], 'file' => $path . '/' . $filename);
                 }
             }
         } else {
             if ($config->variable($section, $parameter) != $contentObjectAttribute->attribute('data_text')) {
                 $modified[] = array('ini_value' => $parameter . '=' . $config->variable($section, $parameter), 'file' => $path . '/' . $filename);
             }
         }
     }
     $data = array('data' => $contentObjectAttribute->attribute('data_text'), 'modified' => $modified);
     return $data;
 }