mirror of
https://github.com/DzzXH/DzzOffice.git
synced 2026-01-22 20:27:27 +08:00
更新至v1.87.3,更新内容在Dzzoffice笔记中查看
This commit is contained in:
33
core/function/cache/cache_fields_optional.php
vendored
Normal file
33
core/function/cache/cache_fields_optional.php
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/*
|
||||
* @copyright Leyun internet Technology(Shanghai)Co.,Ltd
|
||||
* @license http://www.dzzoffice.com/licenses/license.txt
|
||||
* @package DzzOffice
|
||||
* @link http://www.dzzoffice.com
|
||||
* @author zyx(zyx@dzz.cc)
|
||||
*/
|
||||
if(!defined('IN_DZZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
function build_cache_fields_optional() {
|
||||
$data = array();
|
||||
|
||||
foreach(C::t('user_profile_setting')->fetch_all_by_available_required(1, 0) as $field) {
|
||||
$choices = array();
|
||||
if($field['selective']) {
|
||||
foreach(explode("\n", $field['choices']) as $item) {
|
||||
list($index, $choice) = explode('=', $item);
|
||||
$choices[trim($index)] = trim($choice);
|
||||
}
|
||||
$field['choices'] = $choices;
|
||||
} else {
|
||||
unset($field['choices']);
|
||||
}
|
||||
$data['field_'.$field['fieldid']] = $field;
|
||||
}
|
||||
|
||||
savecache('fields_optional', $data);
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user