Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

render_workflow_state_question()

Description

Renders a dropdown for selecting the workflow state of a resource.

This function generates a dropdown menu with various workflow states,
allowing the user to select the current state of the resource.
The available options are based on permission checks and additional states defined globally.

Parameters

ColumnTypeDefaultDescription
$current int|null null The currently selected state, if any.
$checkaccess bool true Indicates whether to check user permissions for each state.

Location

include/render_functions.php lines 5659 to 5679

Definition

 
function render_workflow_state_question($current=null$checkaccess=true)
    {
    global 
$additional_archive_states$lang;
    
$statusoptions = array();
    for (
$n=-2;$n<=3;$n++)
        {
        if (!
$checkaccess || checkperm("e" $n) || $n==$current)
            {
            
$statusoptions[$n] =  isset($lang["status" $n]) ?  $lang["status" $n] : $n;
            }
        }
    foreach (
$additional_archive_states as $additional_archive_state)
        {
        if (!
$checkaccess || checkperm("e" $additional_archive_state) || $additional_archive_state==$current)
            {
            
$statusoptions[$additional_archive_state] =  isset($lang["status" $additional_archive_state]) ?  $lang["status" $additional_archive_state] : $additional_archive_state;
            }
        }
    
    
render_dropdown_question($lang["status"], "share_status"$statusoptions$current" class=\"stdWidth\"");
    }

This article was last updated 4th December 2024 09:05 Europe/London time based on the source file dated 3rd December 2024 11:55 Europe/London time.