Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

render_share_options()

Description

Render the share options (used on collection_share.php and resource_share.php)

Parameters

ColumnTypeDefaultDescription
$collectionshare true
$ref
$emailing false

Return

void

Location

include/render_functions.php lines 2537 to 2634

Definition

 
function render_share_options($collectionshare=true$ref$emailing=false)
    {
    global 
$baseurl$lang$ref$userref$usergroup$internal_share_only$resource_share_expire_never$resource_share_expire_days$hide_resource_share_generate_url$access$minaccess$user_group$expires$editing$editexternalurl$email_sharing$generateurl$query_string$allowed_external_share_groups;
    
    if(!
hook('replaceemailaccessselector')): ?>
        <div class="Question" id="question_access">
            <label for="archive"> echo ($emailing $lang["externalselectresourceaccess"] : $lang["access"]) ?></label>
            <select class="stdwidth" name="access" id="access">
            
            
# List available access levels. The highest level must be the minimum user access level.
            
for ($n=$minaccess;$n<=1;$n++) 
                { 
                
$selected getvalescaped("editaccesslevel","") == $n;
                
?>
                <option value=" echo $n?> if($selected) echo "selected";?>> echo $lang["access" $n]?></option>
                 
                

                
?>
            </select>
            <div class="clearerleft"> </div>
        </div>
     endif; #hook replaceemailaccessselector
    
    
if(!hook('replaceemailexpiryselector'))
        {
        
?>
        <div class="Question">
            <label> echo ($emailing $lang["externalselectresourceexpires"] : $lang["expires"]) ?></label>
            <select name="expires" class="stdwidth">
             
            
if($resource_share_expire_never
                { 
?>
                <option value=""> echo $lang["never"]?></option> 
                

            for (
$n=1;$n<=$resource_share_expire_days;$n++)
                {
                
$date       time() + (60*60*24*$n);
                
$ymd_date   date('Y-m-d'$date);
                
$selected   = (substr(getvalescaped("editexpiration",""),0,10) == $ymd_date);
                
$date_text  nicedate($ymd_date,false,true);
                
$option_class '';
                
$day_date date('D'$date);
                if ((
$day_date == "Sun") || ($day_date == "Sat"))
                    {
                    
$option_class 'optionWeekend';
                    }
                
?>
                <option class=" echo $option_class ?>" value=" echo $ymd_date ?> if($selected) echo "selected"?>> echo $date_text ?></option>
                
                
?>
            </select>
            <div class="clearerleft"> </div>
        </div>
         
        
}
    if (
checkperm("x")) 
        {
        
# Allow the selection of a user group to inherit permissions from 
        # for this share (the default is to use the current user's user group).
        
?>
        <div class="Question">
            <label for="groupselect"> echo ($emailing $lang["externalshare_using_permissions_from_user_group"] : $lang["share_using_permissions_from_user_group"]) ?></label>
            <select id="groupselect" name="usergroup" class="stdwidth">
             $grouplist get_usergroups(true);
            foreach (
$grouplist as $group)
                {
                if(!empty(
$allowed_external_share_groups) && !in_array($group['ref'], $allowed_external_share_groups))
                    {
                    continue;
                    }

                
$selected getval("editgroup","") == $group["ref"] || (getval("editgroup","") == "" && $usergroup == $group["ref"]);
                
?>
                <option value=" echo $group["ref"?> if ($selected) echo "selected" ?>> echo $group["name"?></option>
                
                
}
                
?>
            </select>
            <div class="clearerleft"> </div>
        </div>
         
        
}
    else if(!
checkperm("x") && !empty($allowed_external_share_groups) && in_array($usergroup$allowed_external_share_groups))
        {
        
?>
        <input type="hidden" name="usergroup" value=" echo $usergroup?>">
        
        
}
        
?>
        <div class="Question">
            <label for="sharepassword"> echo htmlspecialchars($lang["share-set-password"]) ?></label>
            <input type="password" id="sharepassword" name="sharepassword" class="stdwidth">
        </div>
        
        hook
("additionalresourceshare");
        
?>
            
    
}

This article was last updated 11th July 2020 02:35 Europe/London time based on the source file dated 8th July 2020 11:40 Europe/London time.