Menu="Share:1" Title="Share Settings" Tag="share-alt-square" --- "", "name" => "", "comment" => "", "allocator" => "highwater", "floor" => "", "splitLevel" => "", "include" => "", "exclude" => "", "useCache" => "no", "cachePool" => "", "cow" => "auto" ]; } elseif (array_key_exists($name, $shares)) { // edit existing share $share = $shares[$name]; } else { // handle share deleted case echo "

"._('Share')." '".htmlspecialchars($name)."' "._('has been deleted').".

"; return; } // Check for non existent pool device if ($share['cachePool'] && !in_array($share['cachePool'],$pools)) $share['useCache'] = "no"; function globalInclude($name) { global $var; return substr($name,0,4)=='disk' && (!$var['shareUserInclude'] || in_array($name,explode(',',$var['shareUserInclude']))); } function sanitize(&$val) { $data = explode('.',str_replace([' ',','],['','.'],$val)); $last = array_pop($data); $val = count($data) ? implode($data).".$last" : $last; } function presetSpace($val) { global $disks,$shares,$name,$pools,$display; if (!$val or strcasecmp($val,'NaN')==0) return; sanitize($val); $small = []; foreach (data_filter($disks) as $disk) $small[] = _var($disk,'fsSize'); $fsSize[""] = min(array_filter($small)); foreach ($pools as $pool) $fsSize[$pool] = _var($disks[$pool],'fsSize',0); $pool = _var($shares[$name],'cachePool'); $size = _var($fsSize,$pool,0); $size = $size>0 ? round(100*$val/$size,1) : 0; $units = ['KB','MB','GB','TB','PB','EB','ZB','YB']; $base = $val>0 ? floor(log($val,1000)) : 0; $size = round($val/pow(1000,$base),1); $unit = _var($units,$base); [$dot,$comma] = str_split(_var($display,'number','.,')); return $size>0 ? number_format($size,$size-floor($size)?1:0,$dot,$comma).' '.$unit : ''; } function fsSize() { global $disks,$pools; $fsSize = $small = []; foreach (data_filter($disks) as $disk) $small[] = _var($disk,'fsSize'); $fsSize[] = '"":"'.min(array_filter($small)).'"'; foreach ($pools as $pool) $fsSize[] = '"'.$pool.'":"'._var($disks[$pool],'fsSize',0).'"'; return implode(',',$fsSize); } function fsType() { global $disks,$pools; $fsType = []; foreach ($pools as $pool) $fsType[] = '"'.$pool.'":"'.str_replace('luks:','',_var($disks[$pool],'fsType')).'"'; return implode(',',$fsType); } function primary() { global $share; return $share['useCache']=='no' ? '' : $share['cachePool']; } function secondary() { global $share; return in_array($share['useCache'],['no','only']) ? '0' : '1'; } function direction() { global $share; return $share['useCache']=='prefer' ? '1' : '0'; } // global shares include/exclude $myDisks = array_filter(array_diff(array_keys(array_filter($disks,'my_disks')), explode(',',$var['shareUserExclude'])), 'globalInclude'); ?> :share_edit_global1_help: :share_edit_global2_help:
_(Read settings from)_
_(Write settings to)_
":">"?>
_(Share name)_: : _(Share name contains invalid characters for ZFS use)_ :share_edit_name_help: _(Comments)_: : :share_edit_comments_help:
_(Minimum free space)_: : _(Calculated free space value)_ :share_edit_free_space_help:
_(Share status)_: : _(Share is empty)_ :share_edit_status_help:
_(Share status)_: :  _(Share contains data)_ :share_edit_delete_help:
_(Exclusive access)_: : _(Yes)_ :share_edit_exclusive_access_help: _(Exclusive access)_: : _(No)_ :share_edit_exclusive_access_help:
_(Primary storage (for new files and folders))_: : :share_edit_primary_storage_help:
_(Enable Copy-on-write)_: : _(Set when adding new share only)_ :share_edit_copy_on_write_help:
_(Allocation method)_: : :share_edit_allocation_method_help: _(Split level)_: : :share_edit_split_level_help: _(Included disk(s))_: : :share_edit_included_disks_help: _(Excluded disk(s))_: : :share_edit_excluded_disks_help:
_(Secondary storage)_: : :share_edit_secondary_storage_help:
_(Allocation method)_: : :share_edit_allocation_method_help: _(Split level)_: : :share_edit_split_level_help: _(Included disk(s))_: : :share_edit_included_disks_help: _(Excluded disk(s))_: : :share_edit_excluded_disks_help:
_(Mover action)_: : :share_edit_mover_action_help:
_(Mover action)_: : :share_edit_mover_action_help:
  :
_(Delete)_ :
  :