';
// Buttons
$html .= '';
$html .= ' ';
break;
case 'add_decision':
// we need:
// - a label for the decision
// - the decision direction (none, north, south, etc. from the predefined list)
// - a target page ID (list of all existing pages in the adventurebook to choose from)
// - an optional backlink (if this is set, the target page will have a backlink to this page)
// - a restriction type (none, item, stat, skill)
// - a restriction value (item ID, stat name, skill name)
$html .= '
';
$html .= '';
$html .= '';
// target page, select from all pages in this adventurebook
// add the option to select "New Page" which will create a new page and link to it, in this case the value is -1
$adventurebook_id = wp_get_post_parent_id( $page_id );
$pages = get_posts( array(
'post_type' => 'adventurebook_page',
'post_status' => 'publish',
'posts_per_page' => - 1,
'post_parent' => $adventurebook_id,
'orderby' => 'title',
'order' => 'ASC',
) );
$html .= '';
// new page title input field, hidden by default, only shown if "New Page" is selected
$html .= '';
// backlink
$html .= '';
// restriction type
$html .= '';
// restriction value
$html .= '';
$html .= '';
// show cancel button
$html .= ' ';
break;
case 'add_item_spawn':
$html .= '