public function getFileList($directory, $recursive = false, $readonly = false)
 {
     $recursiveIteratorIterator = new \RegexIterator(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(rtrim($this->rootPath . '/' . $directory, '/')), \RecursiveIteratorIterator::SELF_FIRST), '/^((?!thumb(_[a-z]+)?).)*$/');
     $jsonFileArray = array();
     $thumbnailList = $this->cx->getMediaSourceManager()->getThumbnailGenerator()->getThumbnails();
     foreach ($recursiveIteratorIterator as $file) {
         /**
          * @var $file \SplFileInfo
          */
         $extension = 'Dir';
         if (!$file->isDir()) {
             $extension = ucfirst(pathinfo($file->getFilename(), PATHINFO_EXTENSION));
         }
         // filters
         if ($file->getFilename() == '.' || $file->getFilename() == 'index.php' || 0 === strpos($file->getFilename(), '.')) {
             continue;
         }
         // set preview if image
         $preview = 'none';
         $hasPreview = false;
         $thumbnails = array();
         if ($this->isImage($extension)) {
             $hasPreview = true;
             $thumbnails = $this->getThumbnails($thumbnailList, $extension, $file, $thumbnails);
             $preview = current($thumbnails);
             if (!file_exists($this->cx->getWebsitePath() . $preview)) {
                 $hasPreview = false;
             }
         }
         $size = \FWSystem::getLiteralSizeFormat($file->getSize());
         $fileInfos = array('filepath' => mb_strcut($file->getPath() . '/' . $file->getFilename(), mb_strlen($this->cx->getWebsitePath())), 'name' => $file->getFilename(), 'size' => $size ? $size : '0 B', 'cleansize' => $file->getSize(), 'extension' => ucfirst(mb_strtolower($extension)), 'preview' => $preview, 'hasPreview' => $hasPreview, 'active' => false, 'type' => $file->getType(), 'thumbnail' => $thumbnails);
         if ($readonly) {
             $fileInfos['readonly'] = true;
         }
         // filters
         if ($fileInfos['name'] == '.' || preg_match('/\\.thumb/', $fileInfos['name']) || $fileInfos['name'] == 'index.php' || 0 === strpos($fileInfos['name'], '.')) {
             continue;
         }
         $path = array($file->getFilename() => array('datainfo' => $fileInfos));
         for ($depth = $recursiveIteratorIterator->getDepth() - 1; $depth >= 0; $depth--) {
             $path = array($recursiveIteratorIterator->getSubIterator($depth)->current()->getFilename() => $path);
         }
         $jsonFileArray = $this->array_merge_recursive($jsonFileArray, $path);
     }
     $jsonFileArray = $this->utf8EncodeArray($jsonFileArray);
     return $jsonFileArray;
 }
 /**
  * @override
  */
 public function getXHtml()
 {
     global $_CORELANG;
     // CSS dependencies
     \JS::activate('cx');
     $uploadPath = $this->getUploadPath('pl');
     $tpl = new \Cx\Core\Html\Sigma(ASCMS_CORE_MODULE_PATH . '/Upload/template/uploaders');
     $tpl->setErrorHandling(PEAR_ERROR_DIE);
     $tpl->loadTemplateFile('pl.html');
     $tpl->setVariable('UPLOAD_FLASH_URL', ASCMS_CORE_MODULE_WEB_PATH . '/Upload/ressources/uploaders/pl/plupload.flash.swf');
     $tpl->setVariable('UPLOAD_CHUNK_LENGTH', \FWSystem::getLiteralSizeFormat(\FWSystem::getMaxUploadFileSize() - 1000));
     $tpl->setVariable('UPLOAD_URL', $uploadPath);
     $tpl->setVariable('UPLOAD_ID', $this->uploadId);
     //I18N
     $tpl->setVariable(array('UPLOAD' => $_CORELANG['UPLOAD'], 'OTHER_UPLOADERS' => $_CORELANG['OTHER_UPLOADERS'], 'FORM_UPLOADER' => $_CORELANG['FORM_UPLOADER'], 'PL_UPLOADER' => $_CORELANG['PL_UPLOADER'], 'JUMP_UPLOADER' => $_CORELANG['JUMP_UPLOADER'], 'SELECT_FILES' => $_CORELANG['SELECT_FILES'], 'ADD_INSTRUCTIONS' => $_CORELANG['ADD_INSTRUCTIONS'], 'FILENAME' => $_CORELANG['FILENAME'], 'STATUS' => $_CORELANG['STATUS'], 'SIZE' => $_CORELANG['SIZE'], 'ADD_FILES' => $_CORELANG['ADD_FILES'], 'STOP_CURRENT_UPLOAD' => $_CORELANG['STOP_CURRENT_UPLOAD'], 'DRAG_FILES_HERE' => $_CORELANG['DRAG_FILES_HERE']));
     return $tpl->get();
 }
 function _configGeneral()
 {
     global $_ARRAYLANG, $_CORELANG;
     $status = true;
     $arrSettings = \User_Setting::getSettings();
     $this->_objTpl->addBlockfile('ACCESS_CONFIG_TEMPLATE', 'module_access_config_general', 'module_access_config_general.html');
     $this->_objTpl->setVariable(array('TXT_ACCESS_PROFILE' => $_ARRAYLANG['TXT_ACCESS_PROFILE'], 'TXT_ACCESS_PROFILE_AVATAR_PIC' => $_ARRAYLANG['TXT_ACCESS_PROFILE_AVATAR_PIC'], 'TXT_ACCESS_PERMISSIONS' => $_ARRAYLANG['TXT_ACCESS_PERMISSIONS'], 'TXT_ACCESS_YES' => $_ARRAYLANG['TXT_ACCESS_YES'], 'TXT_ACCESS_NO' => $_ARRAYLANG['TXT_ACCESS_NO'], 'TXT_ACCESS_ALLOW_USERS_DELETE_ACCOUNT' => $_ARRAYLANG['TXT_ACCESS_ALLOW_USERS_DELETE_ACCOUNT'], 'TXT_ACCESS_ALLOW_USERS_SET_PROFILE_ACCESS' => $_ARRAYLANG['TXT_ACCESS_ALLOW_USERS_SET_PROFILE_ACCESS'], 'TXT_ACCESS_ALLOW_USERS_SET_EMAIL_ACCESS' => $_ARRAYLANG['TXT_ACCESS_ALLOW_USERS_SET_EMAIL_ACCESS'], 'TXT_ACCESS_FRONTEND_BLOCK_FUNCTIONS' => $_ARRAYLANG['TXT_ACCESS_FRONTEND_BLOCK_FUNCTIONS'], 'TXT_ACCESS_CURRENTLY_ONLINE' => $_ARRAYLANG['TXT_ACCESS_CURRENTLY_ONLINE'], 'TXT_ACCESS_LAST_ACTIVE' => $_ARRAYLANG['TXT_ACCESS_LAST_ACTIVE'], 'TXT_ACCESS_LATEST_REGISTERED_USERS' => $_ARRAYLANG['TXT_ACCESS_LATEST_REGISTERED_USERS'], 'TXT_ACCESS_BIRTHDAYS' => $_ARRAYLANG['TXT_ACCESS_BIRTHDAYS'], 'TXT_ACCESS_ACTIVATE_BLOCK_FUNCTION' => $_ARRAYLANG['TXT_ACCESS_ACTIVATE_BLOCK_FUNCTION'], 'TXT_ACCESS_SHOW_USERS_ONLY_WITH_PHOTO' => $_ARRAYLANG['TXT_ACCESS_SHOW_USERS_ONLY_WITH_PHOTO'], 'TXT_ACCESS_MAX_USER_COUNT' => $_ARRAYLANG['TXT_ACCESS_MAX_USER_COUNT'], 'TXT_ACCESS_SAVE' => $_ARRAYLANG['TXT_ACCESS_SAVE'], 'TXT_ACCESS_PROFILE_PIC' => $_CORELANG['TXT_ACCESS_PROFILE_PIC'], 'TXT_ACCESS_MAX_WIDTH' => $_ARRAYLANG['TXT_ACCESS_MAX_WIDTH'], 'TXT_ACCESS_MAX_HEIGHT' => $_ARRAYLANG['TXT_ACCESS_MAX_HEIGHT'], 'TXT_ACCESS_MAX_FILE_SIZE' => $_ARRAYLANG['TXT_ACCESS_MAX_FILE_SIZE'], 'TXT_ACCESS_THUMBNAIL_WIDTH' => $_ARRAYLANG['TXT_ACCESS_THUMBNAIL_WIDTH'], 'TXT_ACCESS_THUMBNAIL_HEIGHT' => $_ARRAYLANG['TXT_ACCESS_THUMBNAIL_HEIGHT'], 'TXT_ACCESS_MAX_THUMBNAIL_WIDTH' => $_ARRAYLANG['TXT_ACCESS_MAX_THUMBNAIL_WIDTH'], 'TXT_ACCESS_MAX_THUMBNAIL_HEIGHT' => $_ARRAYLANG['TXT_ACCESS_MAX_THUMBNAIL_HEIGHT'], 'TXT_ACCESS_PICTURES' => $_ARRAYLANG['TXT_ACCESS_PICTURES'], 'TXT_ACCESS_OTHER_PICTURES' => $_ARRAYLANG['TXT_ACCESS_OTHER_PICTURES'], 'TXT_ACCESS_MISCELLANEOUS' => $_ARRAYLANG['TXT_ACCESS_MISCELLANEOUS'], 'TXT_ACCESS_STANDARD' => $_ARRAYLANG['TXT_ACCESS_STANDARD'], 'TXT_ACCESS_EMAIL' => $_ARRAYLANG['TXT_ACCESS_EMAIL'], 'TXT_ACCESS_SESSION_ON_INTERVAL' => $_ARRAYLANG['TXT_ACCESS_SESSION_ON_INTERVAL'], 'TXT_ACCESS_SESSION_DESCRIPTION' => $_ARRAYLANG['TXT_ACCESS_SESSION_DESCRIPTION'], 'TXT_ACCESS_SESSION_TITLE' => $_ARRAYLANG['TXT_ACCESS_SESSION_TITLE'], 'TXT_ACCESS_USE_SELECTED_ACCESS_FOR_EVERYONE' => $_ARRAYLANG['TXT_ACCESS_USE_SELECTED_ACCESS_FOR_EVERYONE'], 'TXT_ACCESS_CROP_THUMBNAIL_TXT' => $_ARRAYLANG['TXT_ACCESS_CROP_THUMBNAIL_TXT'], 'TXT_ACCESS_SCALE_THUMBNAIL_TXT' => $_ARRAYLANG['TXT_ACCESS_SCALE_THUMBNAIL_TXT'], 'TXT_ACCESS_BACKGROUND_COLOR' => $_ARRAYLANG['TXT_ACCESS_BACKGROUND_COLOR'], 'TXT_ACCESS_THUMBNAIL_GENERATION' => $_ARRAYLANG['TXT_ACCESS_THUMBNAIL_GENERATION'], 'TXT_ACCESS_USE_USERNAMES' => $_ARRAYLANG['TXT_ACCESS_USE_USERNAMES'], 'TXT_ACCESS_USE_USERNAMES_TOOLTIP' => $_ARRAYLANG['TXT_ACCESS_USE_USERNAMES_TOOLTIP'], 'TXT_ACCESS_SOCIALLOGIN_INFORMATION_TITLE' => $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_INFORMATION_TITLE'], 'TXT_ACCESS_DESCRIPTION' => $_ARRAYLANG['TXT_ACCESS_DESCRIPTION'], 'TXT_ACCESS_SOCIALLOGIN_DESCRIPTION' => $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_DESCRIPTION'], 'TXT_ACCESS_SOCIALLOGIN' => $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN'], 'TXT_ACCESS_ENABLE_SOCIALLOGIN' => $_ARRAYLANG['TXT_ACCESS_ENABLE_SOCIALLOGIN'], 'TXT_ACCESS_SOCIALLOGIN_PROVIDERS' => $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_PROVIDERS'], 'TXT_ACCESS_SOCIALLOGIN_SHOW_SIGN_UP' => $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_SHOW_SIGN_UP'], 'TXT_ACCESS_SOCIALLOGIN_SHOW_SIGN_UP_TOOLTIP' => $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_SHOW_SIGN_UP_TOOLTIP'], 'TXT_ACCESS_GROUP_ASSOCIATION_TEXT' => $_ARRAYLANG['TXT_ACCESS_GROUP_ASSOCIATION_TEXT'], 'TXT_ACCESS_AVAILABLE_GROUPS' => $_ARRAYLANG['TXT_ACCESS_AVAILABLE_GROUPS'], 'TXT_ACCESS_CHECK_ALL' => $_ARRAYLANG['TXT_ACCESS_CHECK_ALL'], 'TXT_ACCESS_UNCHECK_ALL' => $_ARRAYLANG['TXT_ACCESS_UNCHECK_ALL'], 'TXT_ACCESS_ASSOCIATED_GROUPS' => $_ARRAYLANG['TXT_ACCESS_ASSOCIATED_GROUPS'], 'TXT_ACCESS_USER_ACCOUNT_ACTIVATION_METHOD_TEXT' => $_ARRAYLANG['TXT_ACCESS_USER_ACCOUNT_ACTIVATION_METHOD_TEXT'], 'TXT_ACCESS_SOCIALLOGIN_ACTIVATED_AUTOMATICALLY' => $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_ACTIVATED_AUTOMATICALLY'], 'TXT_ACCESS_SOCIALLOGIN_ACTIVATED_NOT_AUTOMATICALLY' => $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_ACTIVATED_NOT_AUTOMATICALLY'], 'TXT_ACCESS_SOCIALLOGIN_ACTIVATION_TIME' => $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_ACTIVATION_TIME'], 'TXT_ACCESS_SOCIALLOGIN_UNCOMPLETED_SIGN_UP' => $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_UNCOMPLETED_SIGN_UP'], 'TXT_ACCESS_USER_ACCOUNT_VERIFICATION' => $_ARRAYLANG['TXT_ACCESS_USER_ACCOUNT_VERIFICATION'], 'TXT_ACCESS_USER_ACCOUNT_VERIFICATION_TEXT' => $_ARRAYLANG['TXT_ACCESS_USER_ACCOUNT_VERIFICATION_TEXT']));
     $this->_objTpl->setGlobalVariable(array('TXT_ACCESS_SOCIALLOGIN_MANUAL' => sprintf($_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_MANUAL'], "http://www.cloudrexx.com/wiki/de/index.php?title=Social_Login")));
     if (isset($_POST['access_save_settings'])) {
         // only administrators are allowed to modify the config
         if (!\Permission::hasAllAccess()) {
             \Permission::noAccess();
         }
         $arrSettings['user_delete_account']['status'] = !empty($_POST['access_permissions_delete_account']) ? intval($_POST['access_permissions_delete_account']) : 0;
         $arrSettings['user_config_profile_access']['status'] = !empty($_POST['access_permissions_profile_access']) ? intval($_POST['access_permissions_profile_access']) : 0;
         $arrSettings['user_config_email_access']['status'] = !empty($_POST['access_permissions_email_access']) ? intval($_POST['access_permissions_email_access']) : 0;
         $arrSettings['sociallogin']['status'] = function_exists('curl_init') && !empty($_POST['access_sociallogin_activate']) ? intval($_POST['access_sociallogin_activate']) : 0;
         $arrSettings['use_usernames']['status'] = !empty($_POST['access_permissions_use_usernames']) ? intval($_POST['access_permissions_use_usernames']) : 0;
         $arrSettings['sociallogin_show_signup']['status'] = !empty($_POST['access_sociallogin_show_signup']) ? intval($_POST['access_sociallogin_show_signup']) : 0;
         $arrSettings['sociallogin_assign_to_groups']['value'] = isset($_POST['access_user_associated_groups']) ? implode(',', $_POST['access_user_associated_groups']) : '';
         $arrSettings['sociallogin_active_automatically']['status'] = !empty($_POST['sociallogin_active_automatically']) ? intval($_POST['sociallogin_active_automatically']) : 0;
         $arrSettings['sociallogin_activation_timeout']['value'] = !empty($_POST['sociallogin_activation_timeout']) ? intval($_POST['sociallogin_activation_timeout']) : 10;
         $arrSettings['default_profile_access']['value'] = isset($_POST['access_user_profile_access']) && in_array($_POST['access_user_profile_access'], array('everyone', 'members_only', 'nobody')) ? $_POST['access_user_profile_access'] : 'members_only';
         $arrSettings['default_email_access']['value'] = isset($_POST['access_user_email_access']) && in_array($_POST['access_user_email_access'], array('everyone', 'members_only', 'nobody')) ? $_POST['access_user_email_access'] : 'members_only';
         if (!empty($_POST['access_blocks_currently_online_users'])) {
             $arrSettings['block_currently_online_users']['status'] = 1;
             $arrSettings['block_currently_online_users']['value'] = !empty($_POST['access_blocks_currently_online_users_user_count']) ? intval($_POST['access_blocks_currently_online_users_user_count']) : 0;
             $arrSettings['block_currently_online_users_pic']['status'] = !empty($_POST['access_blocks_currently_online_users_only_with_photo']) && intval($_POST['access_blocks_currently_online_users_only_with_photo']);
         } else {
             $arrSettings['block_currently_online_users']['status'] = 0;
         }
         if (!empty($_POST['access_blocks_last_active_users'])) {
             $arrSettings['block_last_active_users']['status'] = 1;
             $arrSettings['block_last_active_users']['value'] = !empty($_POST['access_blocks_last_active_users_user_count']) ? intval($_POST['access_blocks_last_active_users_user_count']) : 0;
             $arrSettings['block_last_active_users_pic']['status'] = !empty($_POST['access_blocks_last_active_users_only_with_photo']) && intval($_POST['access_blocks_last_active_users_only_with_photo']);
         } else {
             $arrSettings['block_last_active_users']['status'] = 0;
         }
         if (!empty($_POST['access_blocks_latest_registered_users'])) {
             $arrSettings['block_latest_reg_users']['status'] = 1;
             $arrSettings['block_latest_reg_users']['value'] = !empty($_POST['access_blocks_latest_registered_users_user_count']) ? intval($_POST['access_blocks_latest_registered_users_user_count']) : 0;
             $arrSettings['block_latest_reg_users_pic']['status'] = !empty($_POST['access_blocks_latest_registered_users_only_with_photo']) && intval($_POST['access_blocks_latest_registered_users_only_with_photo']);
         } else {
             $arrSettings['block_latest_reg_users']['status'] = 0;
         }
         if (!empty($_POST['access_blocks_birthday_users'])) {
             $arrSettings['block_birthday_users']['status'] = 1;
             $arrSettings['block_birthday_users']['value'] = !empty($_POST['access_blocks_birthday_users_user_count']) ? intval($_POST['access_blocks_birthday_users_user_count']) : 0;
             $arrSettings['block_birthday_users_pic']['status'] = !empty($_POST['access_blocks_birthday_users_only_with_photo']) && intval($_POST['access_blocks_birthday_users_only_with_photo']);
         } else {
             $arrSettings['block_birthday_users']['status'] = 0;
         }
         if (!empty($_POST['accessMaxProfilePicWidth'])) {
             $arrSettings['max_profile_pic_width']['value'] = intval($_POST['accessMaxProfilePicWidth']);
         }
         if (!empty($_POST['accessMaxProfilePicHeight'])) {
             $arrSettings['max_profile_pic_height']['value'] = intval($_POST['accessMaxProfilePicHeight']);
         }
         if (!empty($_POST['accessProfileThumbnailPicWidth'])) {
             $arrSettings['profile_thumbnail_pic_width']['value'] = intval($_POST['accessProfileThumbnailPicWidth']);
         }
         if (!empty($_POST['accessProfileThumbnailPicHeight'])) {
             $arrSettings['profile_thumbnail_pic_height']['value'] = intval($_POST['accessProfileThumbnailPicHeight']);
         }
         if (!empty($_POST['accessMaxProfilePicSize'])) {
             // TODO
             //                if (\FWSystem::getBytesOfLiteralSizeFormat($_POST['accessMaxProfilePicSize']) != $arrSettings['max_profile_pic_size']['value']) {
             //                    // resize profile pics
             //                }
             $arrSettings['max_profile_pic_size']['value'] = \FWSystem::getBytesOfLiteralSizeFormat($_POST['accessMaxProfilePicSize']);
         }
         if (isset($_POST['accessProfileThumbnailMethod']) && $_POST['accessProfileThumbnailMethod'] == 'scale') {
             $arrSettings['profile_thumbnail_method']['value'] = 'scale';
             $color = !empty($_POST['accessProfileThumbnailScaleColor']) ? contrexx_input2raw($_POST['accessProfileThumbnailScaleColor']) : NULL;
             $arrSettings['profile_thumbnail_scale_color']['value'] = $this->validateHexRGBColor($color);
         } else {
             $arrSettings['profile_thumbnail_method']['value'] = 'crop';
         }
         if (!empty($_POST['accessMaxPicWidth'])) {
             $arrSettings['max_pic_width']['value'] = intval($_POST['accessMaxPicWidth']);
         }
         if (!empty($_POST['accessMaxPicHeight'])) {
             $arrSettings['max_pic_height']['value'] = intval($_POST['accessMaxPicHeight']);
         }
         if (!empty($_POST['accessMaxThumbnailPicWidth'])) {
             $arrSettings['max_thumbnail_pic_width']['value'] = intval($_POST['accessMaxThumbnailPicWidth']);
         }
         if (!empty($_POST['accessMaxThumbnailPicHeight'])) {
             $arrSettings['max_thumbnail_pic_height']['value'] = intval($_POST['accessMaxThumbnailPicHeight']);
         }
         // user_account_verification is a checkbox, if this is not set, its not checked. If it is set, it is checked
         // 0 = unchecked, false, 1 = checked, active, true
         $arrSettings['user_account_verification']['value'] = 0;
         if (isset($_POST['user_account_verification'])) {
             $arrSettings['user_account_verification']['value'] = 1;
         }
         if (!empty($_POST['accessMaxPicSize'])) {
             // TODO
             //                if (\FWSystem::getBytesOfLiteralSizeFormat($_POST['accessMaxPicSize']) != $arrSettings['max_pic_size']['value']) {
             //                    // resize pics
             //                }
             $arrSettings['max_pic_size']['value'] = \FWSystem::getBytesOfLiteralSizeFormat($_POST['accessMaxPicSize']);
         }
         $session_on_interval = intval($_POST['sessioninterval']);
         if (trim($session_on_interval) != null) {
             if ($session_on_interval >= 0 && $session_on_interval <= 300) {
                 $arrSettings['session_user_interval']['value'] = $session_on_interval;
             }
         }
         if (!empty($_POST["sociallogin_providers"])) {
             \Cx\Lib\SocialLogin::updateProviders($_POST["sociallogin_providers"]);
         }
         if ($status) {
             if (\User_Setting::setSettings($arrSettings)) {
                 self::$arrStatusMsg['ok'][] = $_ARRAYLANG['TXT_ACCESS_CONFIG_SUCCESSFULLY_SAVED'];
                 if (!empty($_POST['access_force_selected_profile_access'])) {
                     if (!\User::forceDefaultProfileAccess()) {
                         self::$arrStatusMsg['error'][] = $_ARRAYLANG['TXT_ACCESS_SET_DEFAULT_PROFILE_ACCESS_FAILED'];
                     }
                 }
                 if (!empty($_POST['access_force_selected_email_access'])) {
                     if (!\User::forceDefaultEmailAccess()) {
                         self::$arrStatusMsg['error'][] = $_ARRAYLANG['TXT_ACCESS_SET_DEFAULT_EMAIL_ACCESS_FAILED'];
                     }
                 }
             } else {
                 self::$arrStatusMsg['error'][] = $_ARRAYLANG['TXT_ACCESS_CONFIG_FAILED_SAVED'];
                 self::$arrStatusMsg['error'][] = $_ARRAYLANG['TXT_ACCESS_TRY_TO_REPEAT_OPERATION'];
             }
         }
     }
     $curlAvailable = true;
     try {
         $socialloginProviders = \Cx\Lib\SocialLogin::getProviders();
     } catch (\Exception $e) {
         if (!function_exists('curl_init')) {
             $this->_objTpl->setVariable('TXT_ACCESS_SOCIALLOGIN_WARNING', $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_NEED_CURL']);
             $this->_objTpl->parse('sociallogin_need_curl');
             $curlAvailable = false;
         }
     }
     if ($curlAvailable) {
         $this->_objTpl->touchBlock('access_sociallogin_settings');
     } else {
         $this->_objTpl->hideBlock('access_sociallogin_settings');
     }
     // if the current user is no admin, show a message
     $currentUserIsAdmin = \FWUser::getFWUserObject()->objUser->getAdminStatus();
     if (!$currentUserIsAdmin) {
         $this->_objTpl->setVariable('TXT_ACCESS_SOCIALLOGIN_PERMISSION_DENIED', $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_PERMISSION_DENIED']);
         $this->_objTpl->parse('access_sociallogin_permission_denied');
     }
     $socialloginProviderRow = 0;
     foreach ($socialloginProviders as $socialloginProviderName => $providerObject) {
         $settings = $providerObject->getApplicationData();
         $paramId = 0;
         if ($currentUserIsAdmin) {
             foreach (call_user_func(\Cx\Lib\SocialLogin::getClassByProvider($socialloginProviderName) . '::configParams') as $configParam) {
                 $this->_objTpl->setVariable(array('TXT_ACCESS_SOCIALLOGIN_PROVIDER_PARAM_TITLE' => $_ARRAYLANG[$configParam], 'ACCESS_SOCIALLOGIN_PROVIDER_PARAM_VALUE' => contrexx_raw2xhtml(!empty($settings[$paramId]) ? $settings[$paramId] : ''), 'ACCESS_SOCIALLOGIN_PROVIDER_TOGGLE' => $providerObject->isActive() ? '' : 'none', 'ACCESS_SOCIALLOGIN_PROVIDER_NAME' => contrexx_raw2xhtml($socialloginProviderName), 'ACCESS_SOCIALLOGIN_PROVIDER_NAME_UPPER' => contrexx_raw2xhtml(ucfirst($socialloginProviderName))));
                 $this->_objTpl->parse('access_sociallogin_provider_params');
                 $paramId++;
             }
         }
         $this->_objTpl->setVariable(array('ACCESS_SOCIALLOGIN_PROVIDER_ROW' => $socialloginProviderRow % 2 == 0 ? 1 : 2, 'ACCESS_SOCIALLOGIN_PROVIDER_NAME' => contrexx_raw2xhtml($socialloginProviderName), 'ACCESS_SOCIALLOGIN_PROVIDER_NAME_UPPER' => contrexx_raw2xhtml(ucfirst($socialloginProviderName)), 'TXT_ACCESS_SOCIALLOGIN_PROVIDER_ENABLED' => $_ARRAYLANG['TXT_ACCESS_SOCIALLOGIN_PROVIDER_ENABLED'], 'ACCESS_SOCIALLOGIN_PROVIDER_ENABLED_CHECKED' => $currentUserIsAdmin && $providerObject->isActive() ? 'checked="checked"' : '', 'ACCESS_SOCIALLOGIN_PROVIDER_DISABLED' => $currentUserIsAdmin ? '' : 'disabled="disabled"'));
         $this->_objTpl->parse('access_sociallogin_provider');
         $socialloginProviderRow++;
     }
     $this->_objTpl->setVariable(array('ACCESS_SOCIALLOGIN_TOGGLE' => $arrSettings['sociallogin']['status'] ? '' : 'none'));
     $arrAssignedGroups = explode(',', $arrSettings['sociallogin_assign_to_groups']['value']);
     $notAssignedGroups = '';
     $assignedGroups = '';
     $objFWUser = \FWUser::getFWUserObject();
     $objGroup = $objFWUser->objGroup->getGroups();
     while (!$objGroup->EOF) {
         $groupVar = in_array($objGroup->getId(), $arrAssignedGroups) ? 'assignedGroups' : 'notAssignedGroups';
         ${$groupVar} .= '<option value="' . $objGroup->getId() . '">' . contrexx_raw2xhtml($objGroup->getName()) . ' [' . $objGroup->getType() . ']</option>';
         $objGroup->next();
     }
     $this->_objTpl->setVariable(array('ACCESS_USER_NOT_ASSOCIATED_GROUPS' => $notAssignedGroups, 'ACCESS_USER_ASSOCIATED_GROUPS' => $assignedGroups));
     $this->parseAccountAttribute(null, 'profile_access', true, $arrSettings['default_profile_access']['value']);
     $this->parseAccountAttribute(null, 'email_access', true, $arrSettings['default_email_access']['value']);
     $this->_objTpl->setVariable(array('ACCESS_ALLOW_USERS_DELETE_ACCOUNT' => $arrSettings['user_delete_account']['status'] ? 'checked="checked"' : '', 'ACCESS_DONT_ALLOW_USERS_DELETE_ACCOUNT' => $arrSettings['user_delete_account']['status'] ? '' : 'checked="checked"', 'ACCESS_ALLOW_USERS_SET_PROFILE_ACCESS' => $arrSettings['user_config_profile_access']['status'] ? 'checked="checked"' : '', 'ACCESS_DONT_ALLOW_USERS_SET_PROFILE_ACCESS' => $arrSettings['user_config_profile_access']['status'] ? '' : 'checked="checked"', 'ACCESS_ALLOW_USERS_SET_EMAIL_ACCESS' => $arrSettings['user_config_email_access']['status'] ? 'checked="checked"' : '', 'ACCESS_DONT_ALLOW_USERS_SET_EMAIL_ACCESS' => $arrSettings['user_config_email_access']['status'] ? '' : 'checked="checked"', 'ACCESS_BLOCKS_CURRENTLY_ONLINE_USERS' => $arrSettings['block_currently_online_users']['status'] ? 'checked="checked"' : '', 'ACCESS_BLOCKS_CURRENTLY_ONLINE_USERS_DISPLAY' => $arrSettings['block_currently_online_users']['status'] ? '' : 'none', 'ACCESS_BLOCKS_CURRENTLY_ONLINE_USERS_USER_COUNT' => $arrSettings['block_currently_online_users']['value'], 'ACCESS_BLOCKS_CURRENTLY_ONLINE_USERS_ONLY_WITH_PHOTO' => $arrSettings['block_currently_online_users_pic']['status'] ? 'checked="checked"' : '', 'ACCESS_BLOCKS_LAST_ACTIVE_USERS' => $arrSettings['block_last_active_users']['status'] ? 'checked="checked"' : '', 'ACCESS_BLOCKS_LAST_ACTIVE_USERS_DISPLAY' => $arrSettings['block_last_active_users']['status'] ? '' : 'none', 'ACCESS_BLOCKS_LAST_ACTIVE_USERS_USER_COUNT' => $arrSettings['block_last_active_users']['value'], 'ACCESS_BLOCKS_LAST_ACTIVE_USERS_ONLY_WITH_PHOTO' => $arrSettings['block_last_active_users_pic']['status'] ? 'checked="checked"' : '', 'ACCESS_BLOCKS_LATEST_REGISTERED_USERS' => $arrSettings['block_latest_reg_users']['status'] ? 'checked="checked"' : '', 'ACCESS_BLOCKS_LATEST_REGISTERED_USERS_DISPLAY' => $arrSettings['block_latest_reg_users']['status'] ? '' : 'none', 'ACCESS_BLOCKS_LATEST_REGISTERED_USERS_USER_COUNT' => $arrSettings['block_latest_reg_users']['value'], 'ACCESS_BLOCKS_LATEST_REGISTERED_USERS_ONLY_WITH_PHOTO' => $arrSettings['block_latest_reg_users_pic']['status'] ? 'checked="checked"' : '', 'ACCESS_BLOCKS_BIRTHDAY_USERS' => $arrSettings['block_birthday_users']['status'] ? 'checked="checked"' : '', 'ACCESS_BLOCKS_BIRTHDAY_USERS_DISPLAY' => $arrSettings['block_birthday_users']['status'] ? '' : 'none', 'ACCESS_BLOCKS_BIRTHDAY_USERS_USER_COUNT' => $arrSettings['block_birthday_users']['value'], 'ACCESS_BLOCKS_BIRTHDAY_USERS_ONLY_WITH_PHOTO' => $arrSettings['block_birthday_users_pic']['status'] ? 'checked="checked"' : '', 'ACCESS_MAX_PROFILE_PIC_WIDTH' => $arrSettings['max_profile_pic_width']['value'], 'ACCESS_MAX_PROFILE_PIC_HEIGHT' => $arrSettings['max_profile_pic_height']['value'], 'ACCESS_PROFILE_THUMBNAIL_PIC_WIDTH' => $arrSettings['profile_thumbnail_pic_width']['value'], 'ACCESS_PROFILE_THUMBNAIL_PIC_HEIGHT' => $arrSettings['profile_thumbnail_pic_height']['value'], 'ACCESS_MAX_PROFILE_PIC_SIZE' => \FWSystem::getLiteralSizeFormat($arrSettings['max_profile_pic_size']['value']), 'ACCESS_MAX_PIC_WIDTH' => $arrSettings['max_pic_width']['value'], 'ACCESS_MAX_PIC_HEIGHT' => $arrSettings['max_pic_height']['value'], 'ACCESS_MAX_THUMBNAIL_PIC_WIDTH' => $arrSettings['max_thumbnail_pic_width']['value'], 'ACCESS_MAX_THUMBNAIL_PIC_HEIGHT' => $arrSettings['max_thumbnail_pic_height']['value'], 'ACCESS_SESSION_USER_INTERVAL' => $arrSettings['session_user_interval']['value'], 'ACCESS_MAX_PIC_SIZE' => \FWSystem::getLiteralSizeFormat($arrSettings['max_pic_size']['value']), 'ACCESS_PROFILE_THUMBNAIL_CROP' => $arrSettings['profile_thumbnail_method']['value'] == 'crop' ? 'selected="selected"' : '', 'ACCESS_PROFILE_THUMBNAIL_SCALE' => $arrSettings['profile_thumbnail_method']['value'] == 'scale' ? 'selected="selected"' : '', 'ACCESS_PROFILE_THUMBNAIL_SCALE_BOX' => $arrSettings['profile_thumbnail_method']['value'] == 'scale' ? 'inline' : 'none', 'ACCESS_PROFILE_THUMBNAIL_SCALE_COLOR' => $arrSettings['profile_thumbnail_scale_color']['value'], 'ACCESS_USE_USERNAMES' => $arrSettings['use_usernames']['status'] ? 'checked="checked"' : '', 'ACCESS_DONT_USE_USERNAMES' => $arrSettings['use_usernames']['status'] ? '' : 'checked="checked"', 'ACCESS_SOCIALLOGIN_ENABLED' => $arrSettings['sociallogin']['status'] ? 'checked="checked"' : '', 'ACCESS_SOCIALLOGIN_NOT_ENABLED' => $arrSettings['sociallogin']['status'] ? '' : 'checked="checked"', 'ACCESS_SOCIALLOGIN_SHOW_SIGNUP_ENABLED' => $arrSettings['sociallogin_show_signup']['status'] ? 'checked="checked"' : '', 'ACCESS_SOCIALLOGIN_SHOW_SIGNUP_NOT_ENABLED' => $arrSettings['sociallogin_show_signup']['status'] ? '' : 'checked="checked"', 'ACCESS_SOCIALLOGIN_ACTIVATED_AUTOMATICALLY_ENABLED' => $arrSettings['sociallogin_active_automatically']['status'] ? 'checked="checked"' : '', 'ACCESS_SOCIALLOGIN_ACTIVATED_AUTOMATICALLY_NOT_ENABLED' => $arrSettings['sociallogin_active_automatically']['status'] ? '' : 'checked="checked"', 'ACCESS_SOCIALLOGIN_ACTIVATION_TIMEOUT' => intval($arrSettings['sociallogin_activation_timeout']['value']), 'ACCESS_USSER_ACCOUNT_VERIFICATION_CHECKED' => $arrSettings['user_account_verification']['value'] == 1 ? 'checked' : ''));
     $this->_objTpl->parse('module_access_config_general');
 }
Beispiel #4
0
 /**
  * This method has two purposes (see param $return):
  * 1. Parse the \Cx\Core\Html\Sigma template block of a specific profile attribute
  * 2. Generate the HTML code of a specific profile attribute and return it
  *
  * @param User      User object of whoem's profile attribute shall be parsed
  * @param integer   ID of the profile attribute to be parsed
  * @param integer   History version of the profile attribute to be parsed
  * @param boolean   If the profile attribute's value shall be modifyable (set to TRUE)
  *                  or not (set to FALSE)
  * @param boolean   If the profile attribute's \Cx\Core\Html\Sigma template block
  *                  shall be parsed (set to FALSE) or the HTML code of the profile
  *                  attribute shall be generated and returned instead (set to TRUE).
  * @param boolean   In case the profile attribute to be parsed is an other profile
  *                  attribute's child, set this to TRUE, otherwise to FALSE
  * @param boolean   In case the profile attribute to be parsed is located within an
  *                  other profile attribute of the type frame, set this to TRUE,
  *                  otherwise to FALSE
  * @param boolean   The method can use the magic block \Cx\Core\Html\Sigma template
  *                  block access_profile_attribute_list (set to TRUE), instead of using
  *                  the profile attribute specific block like for instance
  *                  access_profile_attribute_firstname (set to FALSE)
  * @param array     Pass additional, preparsed placeholders. The array must be an associated
  *                  array, where the key represents the \Cx\Core\Html\Sigma variable suffix
  *                  and the value the placeholder's value.
  *                  For instance: array('_CSS' => 'someSpecialCSSClass');
  */
 public function parseAttribute($objUser, $attributeId, $historyId = 0, $edit = false, $return = false, $isChild = false, $inFrame = false, $useMagicBlock = true, $arrAdditionalPlaceholders = null)
 {
     global $_CORELANG;
     $objAttribute = $objUser->objAttribute->getById($attributeId);
     $attributeName = $this->attributeNamePrefix . '[' . $attributeId . '][' . $historyId . ']';
     $block = strtolower($this->attributeNamePrefix . '_' . $attributeId);
     $attributeIdUC = strtoupper($attributeId);
     $parentIdUC = strtoupper($objAttribute->getParent());
     if ($edit && $objAttribute->isProtected() && !\Permission::checkAccess($objAttribute->getAccessId(), 'dynamic', true) && !$objAttribute->checkModifyPermission()) {
         $edit = false;
     }
     if ($return) {
         return $this->_getAtrributeCode($objUser, $attributeId, $historyId, $edit);
     }
     $arrPlaceholders = array('' => $this->_getAtrributeCode($objUser, $attributeId, $historyId, $edit), '_DESC' => htmlentities($objAttribute->getName(), ENT_QUOTES, CONTREXX_CHARSET), '_NAME' => $attributeName, '_ID' => $attributeId, '_HISTORY_ID' => $historyId);
     if (is_array($arrAdditionalPlaceholders)) {
         $arrPlaceholders = array_merge($arrPlaceholders, $arrAdditionalPlaceholders);
     }
     switch ($objAttribute->getType()) {
         case 'date':
             $value = $objUser->getProfileAttribute($attributeId, $historyId);
             $arrPlaceholders['_VALUE'] = $value !== false && $value !== '' ? htmlentities(date(ASCMS_DATE_FORMAT_DATE, intval($value)), ENT_QUOTES, CONTREXX_CHARSET) : '';
             $arrPlaceholders['_MONTH'] = $this->getDateMonthMenu($attributeName, date('m', intval($objUser->getProfileAttribute($attributeId, $historyId))));
             $arrPlaceholders['_DAY'] = $this->getDateDayMenu($attributeName, date('d', intval($objUser->getProfileAttribute($attributeId, $historyId))));
             $arrPlaceholders['_YEAR'] = $this->getDateYearMenu($attributeName, date('Y', intval($objUser->getProfileAttribute($attributeId, $historyId))));
             break;
         case 'text':
         case 'mail':
             $arrPlaceholders['_VALUE'] = $edit ? htmlentities($objUser->getProfileAttribute($attributeId, $historyId), ENT_QUOTES, CONTREXX_CHARSET) : html_entity_decode(nl2br($objUser->getProfileAttribute($attributeId, $historyId)), ENT_QUOTES, CONTREXX_CHARSET);
             break;
         case 'uri':
             $uri = $objUser->getProfileAttribute($attributeId, $historyId);
             if (empty($uri)) {
                 $arrPlaceholders['_VALUE'] = '';
                 /*if ($this->_objTpl->blockExists($block.'_no_link')) {
                       $this->_objTpl->setVariable('TXT_ACCESS_NO_SPECIFIED', $_CORELANG['TXT_ACCESS_NO_SPECIFIED']);
                       $this->_objTpl->touchBlock($block.'_no_link');
                   }*/
                 if ($this->_objTpl->blockExists($block . '_link')) {
                     $this->_objTpl->hideBlock($block . '_link');
                 }
             } else {
                 $arrPlaceholders['_VALUE'] = htmlentities($objUser->getProfileAttribute($attributeId, $historyId), ENT_QUOTES, CONTREXX_CHARSET);
                 if ($this->_objTpl->blockExists($block . '_link')) {
                     $this->_objTpl->setVariable(array('TXT_ACCESS_URL_OPEN_RISK_MSG' => $_CORELANG['TXT_ACCESS_URL_OPEN_RISK_MSG'], 'TXT_ACCESS_CONFIRM_OPEN_URL' => $_CORELANG['TXT_ACCESS_CONFIRM_OPEN_URL'], 'TXT_ACCESS_VISIT_WEBSITE' => $_CORELANG['TXT_ACCESS_VISIT_WEBSITE']));
                     $this->_objTpl->touchBlock($block . '_link');
                 }
                 if ($this->_objTpl->blockExists($block . '_no_link')) {
                     $this->_objTpl->hideBlock($block . '_no_link');
                 }
             }
             break;
         case 'image':
             $arrSettings = \User_Setting::getSettings();
             $cx = \Cx\Core\Core\Controller\Cx::instanciate();
             $image = $objUser->getProfileAttribute($objAttribute->getId(), $historyId);
             $imageRepoWeb = $attributeId == 'picture' ? $cx->getWebsiteImagesAccessProfileWebPath() : $cx->getWebsiteImagesAccessPhotoWebPath();
             $imageRepoPath = $attributeId == 'picture' ? $cx->getWebsiteImagesAccessProfilePath() : $cx->getWebsiteImagesAccessPhotoPath();
             if (!$edit || file_exists($imageRepoPath . '/' . $image)) {
                 $arrPlaceholders['_VALUE'] = htmlentities($objUser->getProfileAttribute($objAttribute->getId(), $historyId), ENT_QUOTES, CONTREXX_CHARSET);
             }
             $arrPlaceholders['_SRC'] = $imageRepoWeb . '/' . (!empty($arrPlaceholders['_VALUE']) ? $arrPlaceholders['_VALUE'] : ($attributeId == 'picture' ? \User_Profile::$arrNoAvatar['src'] : \User_Profile::$arrNoPicture['src']));
             if (empty($arrPlaceholders['_VALUE'])) {
                 $arrPlaceholders['_VALUE'] = $_CORELANG['TXT_ACCESS_NO_PICTURE'];
             }
             $arrPlaceholders['_THUMBNAIL'] = $this->getImageAttributeCode($objUser, $attributeName, $image, $attributeId, '', $historyId, $edit, true);
             $arrPlaceholders['_THUMBNAIL_SRC'] = \ImageManager::getThumbnailFilename($arrPlaceholders['_SRC']);
             $arrPlaceholders['_UPLOAD_NAME'] = $this->attributeNamePrefix . '_images[' . $objAttribute->getId() . '][' . $historyId . ']';
             $arrPlaceholders['_MAX_FILE_SIZE'] = \FWSystem::getLiteralSizeFormat($arrSettings['max_' . ($attributeId == 'picture' ? 'profile_' : '') . 'pic_size']['value']);
             $arrPlaceholders['_MAX_WIDTH'] = $arrSettings['max_' . ($attributeId == 'picture' ? 'profile_' : '') . 'pic_width']['value'];
             $arrPlaceholders['_MAX_HEIGHT'] = $arrSettings['max_' . ($attributeId == 'picture' ? 'profile_' : '') . 'pic_height']['value'];
             $arrPlaceholders['_CHOOSE_FILE'] = $_CORELANG['TXT_ACCESS_USER_CHOOSE_FILE'];
             //                if ($attributeId == 'picture') {
             //                    $arrPlaceholders['_DESC'] = htmlentities($objUser->getUsername(), ENT_QUOTES, CONTREXX_CHARSET);
             //                }
             break;
         case 'checkbox':
             $arrPlaceholders['_CHECKED'] = $objUser->getProfileAttribute($attributeId, $historyId) ? 'checked="checked"' : '';
             $arrPlaceholders['_VALUE'] = $objUser->getProfileAttribute($attributeId, $historyId);
             break;
         case 'menu':
             $arrPlaceholders['_VALUE'] = htmlentities($objUser->getProfileAttribute($objAttribute->getId(), $historyId), ENT_QUOTES, CONTREXX_CHARSET);
             if ($arrPlaceholders['_VALUE'] == '0' || $arrPlaceholders['_VALUE'] == 'gender_undefined') {
                 $arrPlaceholders['_VALUE'] = '';
             }
             if ($this->_objTpl->blockExists($this->attributeNamePrefix . '_' . $attributeId . '_children')) {
                 foreach ($objAttribute->getChildren() as $childAttributeId) {
                     $this->parseAttribute($objUser, $childAttributeId, $historyId, $edit, false, true, false, $useMagicBlock);
                 }
             }
             break;
         case 'frame':
             foreach ($objAttribute->getChildren() as $childAttributeId) {
                 $this->parseAttribute($objUser, $childAttributeId, $historyId, $edit, false, true, true, $useMagicBlock);
             }
             $arrPlaceholders['_VALUE'] = $objAttribute->getMenuOptionValue();
             break;
         case 'menu_option':
             $arrPlaceholders['_VALUE'] = $objAttribute->getMenuOptionValue();
             $arrPlaceholders['_SELECTED'] = $objAttribute->getMenuOptionValue() == $objUser->getProfileAttribute($objAttribute->getParent(), $historyId) ? 'selected="selected"' : '';
             if ($objAttribute->isCoreAttribute() && $objAttribute->isUnknownOption()) {
                 $objParentAttribute = $objAttribute->getById($objAttribute->getParent());
                 if ($objParentAttribute->isMandatory()) {
                     $arrPlaceholders['_DESC'] = $_CORELANG['TXT_ACCESS_PLEASE_SELECT'];
                 }
             }
             break;
         case 'group':
             if ($this->_objTpl->blockExists($this->attributeNamePrefix . '_' . $attributeId . '_children')) {
                 foreach ($objAttribute->getChildren() as $childAttributeId) {
                     $this->parseAttribute($objUser, $childAttributeId, $historyId, $edit, false, true, true, $useMagicBlock);
                 }
             }
             break;
         case 'history':
             if (!isset($objUser->arrAttributeHistories[$objUser->getId()][$attributeId])) {
                 $objUser->arrAttributeHistories[$objUser->getId()][$attributeId] = array();
             }
             sort($objUser->arrAttributeHistories[$objUser->getId()][$attributeId]);
             if ($edit && !in_array(0, $objUser->arrAttributeHistories[$objUser->getId()][$attributeId])) {
                 $objUser->arrAttributeHistories[$objUser->getId()][$attributeId][] = 0;
             }
             foreach ($objUser->arrAttributeHistories[$objUser->getId()][$attributeId] as $attributeHistoryId) {
                 if ($this->_objTpl->blockExists($this->attributeNamePrefix . '_' . $attributeId . '_history_list') || $this->_objTpl->blockExists($this->attributeNamePrefix . '_' . $attributeId . '_history_' . $attributeHistoryId)) {
                     foreach ($objAttribute->getChildren() as $childAttributeId) {
                         $this->parseAttribute($objUser, $childAttributeId, $attributeHistoryId, $edit, false, false, false, $useMagicBlock);
                     }
                     $this->_objTpl->setVariable($this->modulePrefix . 'PROFILE_ATTRIBUTE_' . $attributeIdUC . '_HISTORY_ID', $attributeHistoryId);
                     if ($this->_objTpl->blockExists($this->attributeNamePrefix . '_' . $attributeId . '_history_' . $attributeHistoryId)) {
                         $this->_objTpl->parse($this->attributeNamePrefix . '_' . $attributeId . '_history_' . $attributeHistoryId);
                     } else {
                         $this->_objTpl->parse($this->attributeNamePrefix . '_' . $attributeId . '_history_list');
                     }
                 }
             }
             break;
     }
     if (!$edit && isset($arrPlaceholders['_VALUE']) && $arrPlaceholders['_VALUE'] == '') {
         return false;
     }
     if ($inFrame) {
         $objFrameAttribute = $objAttribute->getById($objAttribute->getParent());
     }
     $parsed = false;
     $frameParsed = false;
     $arrPostfix = array('_history_' . $historyId, '');
     foreach ($arrPostfix as $historyPostfix) {
         if (!$parsed) {
             $parsed = true;
             if ($inFrame && $this->_objTpl->blockExists($this->attributeNamePrefix . '_' . $objFrameAttribute->getParent() . '_frame_' . $objAttribute->getParent() . '_child_' . $attributeId . $historyPostfix)) {
                 // specified child of a specified frame
                 $this->parseAttributePlaceholders($arrPlaceholders, true, strtoupper($objFrameAttribute->getParent()), $parentIdUC, $attributeIdUC, true, true);
                 $this->_objTpl->parse($this->attributeNamePrefix . '_' . $objFrameAttribute->getParent() . '_frame_' . $objAttribute->getParent() . '_child_' . $attributeId . $historyPostfix);
             } elseif ($inFrame && $this->_objTpl->blockExists($this->attributeNamePrefix . '_' . $objFrameAttribute->getParent() . '_frame_' . $objAttribute->getParent() . '_children' . $historyPostfix)) {
                 // children of a specified frame
                 $this->parseAttributePlaceholders($arrPlaceholders, true, $objFrameAttribute->getParent(), $parentIdUC, 0, true, true);
                 $this->_objTpl->parse($this->attributeNamePrefix . '_' . $objFrameAttribute->getParent() . '_frame_' . $objAttribute->getParent() . '_children' . $historyPostfix);
             } elseif ($inFrame && $this->_objTpl->blockExists($this->attributeNamePrefix . '_' . $objFrameAttribute->getParent() . '_frame_children' . $historyPostfix)) {
                 // children of a frame
                 $this->parseAttributePlaceholders($arrPlaceholders, true, $objFrameAttribute->getParent(), 0, 0, true, true);
                 $this->_objTpl->parse($this->attributeNamePrefix . '_' . $objFrameAttribute->getParent() . '_frame_children' . $historyPostfix);
             } elseif ($this->_objTpl->blockExists($this->attributeNamePrefix . '_' . $attributeId . $historyPostfix)) {
                 // attribute
                 $this->parseAttributePlaceholders($arrPlaceholders, true, $isChild ? $parentIdUC : $attributeIdUC, 0, 0, false, $isChild);
                 $this->_objTpl->parse($this->attributeNamePrefix . '_' . $attributeId . $historyPostfix);
             } elseif ($objAttribute->getParent() && $this->_objTpl->blockExists($this->attributeNamePrefix . '_' . $objAttribute->getParent() . '_children' . $historyPostfix)) {
                 // children of an attrbiute
                 $this->parseAttributePlaceholders($arrPlaceholders, true, $parentIdUC, 0, 0, false, true);
                 $this->_objTpl->parse($this->attributeNamePrefix . '_' . $objAttribute->getParent() . '_children' . $historyPostfix);
             } elseif ($useMagicBlock && !$isChild && $this->_objTpl->blockExists($this->attributeNamePrefix . '_list' . $historyPostfix)) {
                 // magic block attribute_list
                 $this->parseAttributePlaceholders($arrPlaceholders, false, $isChild ? $parentIdUC : $attributeIdUC, 0, 0);
                 $this->_objTpl->parse($this->attributeNamePrefix . '_list' . $historyPostfix);
             } elseif (!$useMagicBlock) {
                 $this->parseAttributePlaceholders($arrPlaceholders, true, $attributeIdUC, 0, 0);
                 $parsed = empty($historyPostfix);
             } else {
                 $parsed = false;
             }
         }
         if (!$frameParsed) {
             $frameParsed = true;
             if ($objAttribute->getType() == 'frame') {
                 if ($this->_objTpl->blockExists($this->attributeNamePrefix . '_' . $objAttribute->getParent() . '_frame_' . $attributeId . $historyPostfix)) {
                     // current attribute is a frame which has been especially defined
                     $this->parseAttributePlaceholders($arrPlaceholders, true, $parentIdUC, $attributeIdUC, 0, true, false);
                     $this->_objTpl->parse($this->attributeNamePrefix . '_' . $objAttribute->getParent() . '_frame_' . $attributeId . $historyPostfix);
                 } elseif ($this->_objTpl->blockExists($this->attributeNamePrefix . '_' . $objAttribute->getParent() . '_frames' . $historyPostfix)) {
                     // current attributeis a frame
                     $this->parseAttributePlaceholders($arrPlaceholders, true, $parentIdUC, 0, 0, true, false);
                     $this->_objTpl->parse($this->attributeNamePrefix . '_' . $objAttribute->getParent() . '_frames' . $historyPostfix);
                 } else {
                     $frameParsed = false;
                 }
             } else {
                 $frameParsed = false;
             }
         }
     }
     return true;
 }