Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

render_edit_selected_btn()

Description

Renders the "Edit selected" button. This is using the special 'COLLECTION_TYPE_SELECTION' collection

Parameters

This function accepts no parameters.

Return

void

Location

include/render_functions.php lines 3133 to 3178

Definition

 
function render_edit_selected_btn()
    {
    global 
$baseurl_short$lang$USER_SELECTION_COLLECTION$restypes$archive;

    
$search "!collection{$USER_SELECTION_COLLECTION}";
    
$editable_resources do_search($search$restypes"resourceid"$archive, -1"desc"false0falsefalse""falsefalsetruetrue);
    
$non_editable_resources do_search($search$restypes"resourceid"$archive, -1"desc"false0falsefalse""falsefalsetruefalse);

    if(!
is_array($editable_resources) || !is_array($non_editable_resources))
        {
        return;
        }

    
$editable_resources_count count($editable_resources);
    
$non_editable_resources_count count($non_editable_resources);

    if(
$editable_resources_count == || $non_editable_resources_count == 0)
        {
        return;
        }

    
// If not all resources are editable, don't show the batch edit button
    
if($editable_resources_count != $non_editable_resources_count)
        {
        return;
        }

    
$batch_edit_url generateURL(
        
"{$baseurl_short}pages/edit.php",
        array(
            
"search"            =>  $search,
            
"collection"        =>  $USER_SELECTION_COLLECTION,
            
"restypes"          =>  $restypes,
            
"order_by"          =>  "resourceid",
            
"archive"           =>  $archive,
            
"sort"              =>  "desc",
            
"daylimit"          =>  "",
            
"editsearchresults" => "true",
            
"modal"             => "true",
        ));

    
$attributes  " id=\"EditSelectedResourcesBtn\"";
    
$attributes .= " onclick=\"ModalLoad('{$batch_edit_url}', true);\"";

    return 
render_filter_bar_button($lang["edit_selected"], $attributesICON_EDIT);
    }

This article was last updated 5th July 2020 05:35 Europe/London time based on the source file dated 3rd July 2020 14:29 Europe/London time.