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 5623 to 5643

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 17th November 2024 15:35 Europe/London time based on the source file dated 13th November 2024 14:05 Europe/London time.