public function grid() { MPC::incl("post-types"); MPV::incl("fields"); MPV::incl("post-types"); $info = MasterPress::$view; $parent = $info->parent; $has_actions = MasterPress::current_user_can("edit_post_type_field_sets,delete_post_type_field_sets,edit_post_type_fields,delete_post_type_fields"); $can_edit = MasterPress::current_user_can("edit_post_type_field_sets"); $can_delete = MasterPress::current_user_can("delete_post_type_field_sets"); $can_create = MasterPress::current_user_can("create_post_type_field_sets"); $can_create_fields = MasterPress::current_user_can("create_post_type_fields"); $can_edit_fields = MasterPress::current_user_can("edit_post_type_fields"); $can_delete_fields = MasterPress::current_user_can("delete_post_type_fields"); $less = ($can_create_fields) ? 1 : 0; $colspan = ( $has_actions ? 4 : 3 ) - $less; ?> <div class="title-info-panel"> <div class="title-info-panel-lt"> <?php if (get_class($parent) == "MPM_PostType") : ?> <h3 class="post-type"><i class="mp-icon mp-icon-post-type mp-icon-post-type-<?php echo $parent->name ?>"></i><span class="label"><?php echo MPV_PostTypes::__s() ?>:</span><span class="value"> <?php echo $parent->display_label() ?></span></h3> <input id="post_type_name" type="hidden" value="<?php echo $parent->name ?>" /> <?php endif; ?> </div> </div> <?php MPV::messages(); ?> <?php $field_sets = MPM_FieldSet::find_by_post_type($parent, "name ASC"); ?> <?php MPV::field_set_icon_styles($field_sets); ?> <?php foreach ($field_sets as $field_set) { if (MPC::is_deleting($field_set->id, "delete-field-set")) { $this->confirm_delete($field_set); } else { foreach ($field_set->fields() as $field) { if (MPC::is_deleting($field->id, "delete-field")) { $this->confirm_delete_field($field); } } } } ?> <?php if (count($field_sets)) : ?> <table cellspacing="0" class="grid grid-field-sets"> <thead> <tr> <th class="first type"><i class="types"></i><span><?php _e("Type", MASTERPRESS_DOMAIN) ?></span></th> <th class="label"><i class="label-string"></i><span><?php _e("Label", MASTERPRESS_DOMAIN) ?></span></th> <th class="front-end-name <?php echo $has_actions ? "" : "last" ?>"><i class="script-php"></i><span><?php _e("Front End Name", MASTERPRESS_DOMAIN) ?></span></th> <?php if ($has_actions) : ?> <th class="actions last"><i class="buttons"></i><span><?php _e("Actions", MASTERPRESS_DOMAIN) ?></span></th> <?php endif; ?> </tr> </thead> <tbody> <?php $fg_count = 0; ?> <?php foreach ($field_sets as $field_set) : $fg_count++; ?> <?php $display = $field_set->display_label(); ?> <?php $display_td = $display; if ($field_set->icon != "") { $display_td = WOOF_HTML::tag("span", array("class" => "with-icon field-set-".$field_set->id), $display); } ?> <?php $deleting_class = MPC::is_deleting($field_set->id, "delete-field-set") ? 'deleting' : ''; $editable_class = $can_edit ? " editable " : ""; $meta = $can_edit ? "{ href: '".MasterPress::admin_url("post-types", "edit-field-set", array("id" => $field_set->id, "parent" => MasterPress::$parent) )."' }" : ""; ?> <?php $disabled = $field_set->disabled ? "disabled" : ""; $title = $field_set->disabled ? ' title="'.__("this field set is disabled", MASTERPRESS_DOMAIN).'" ' : ""; ?> <?php if (!$field_set->in_current_site()) { $disabled = "disabled"; $title = ' title="'.__("field set is not currently available in this site (multi-site setting)", MASTERPRESS_DOMAIN).'" '; } ?> <tr <?php echo $title ?> class="<?php echo $disabled ?> <?php echo $editable_class.$deleting_class ?> <?php echo MPV::updated_class("edit-field-set,create-field-set", $field_set->id) ?> <?php echo $meta ?>"> <?php if ($field_set->allow_multiple) : ?> <th class="first type icon"><i class="metabox-add-remove-large" title="<?php _e("Field Set (Multiple Items)", MASTERPRESS_DOMAIN) ?>"></i></th> <?php else : ?> <th class="first type icon"><i class="metabox-large" title="<?php _e("Field Set", MASTERPRESS_DOMAIN) ?>"></i></th> <?php endif; ?> <th class="label"><strong><?php echo $display_td ?></strong></th> <th class="front-end-name <?php echo $has_actions ? "" : "last" ?>"><span class="tt"><?php echo $field_set->display_name() ?></span></th> <?php if ($has_actions) : ?> <th class="actions last"> <div> <?php if (MPC::is_deleting($field_set->id, "delete-field-set")) : ?> <span class="confirm-action"> </span> <?php else: ?> <?php if ($can_edit) : ?> <?php echo MPV::action_button("post-types", "edit-field-set", self::__edit(), array("id" => $field_set->id, "parent" => MasterPress::$parent), array("class" => "button button-edit") ); ?> <?php endif; ?> <?php if ($can_delete) : ?> <?php echo MPV::action_button("post-types", "delete-field-set", self::__delete(), array("id" => $field_set->id, "parent" => MasterPress::$parent), array("class" => "button button-delete") ); ?> <?php endif; ?> <?php endif; ?> </div> </th> <?php endif; // has_actions ?> </tr> <?php $count = 0; $fields = $field_set->fields(); ?> <?php foreach ($fields as $field) : $count++; $first = $count == 1 ? 'first' : ''; $disabled = $field_set->disabled || $field->disabled ? "disabled" : ""; $title = ($field_set->disabled || $field->disabled) ? ' title="'.__("this field is disabled", MASTERPRESS_DOMAIN).'" ' : ""; ?> <?php if (!$field_set->in_current_site() || !$field->in_current_site()) { $disabled = "disabled"; $title = ' title="'.__("field is not currently available in this site (multi-site setting)", MASTERPRESS_DOMAIN).'" '; } ?> <?php $deleting_class = MPC::is_deleting($field_set->id, "delete-field-set") || MPC::is_deleting($field->id, "delete-field") ? 'deleting' : ''; $editable_class = $can_edit_fields ? " editable " : ""; $meta = $can_edit ? "{ href: '".MasterPress::admin_url("post-types", "edit-field", array("id" => $field->id, "gparent" => $_GET["parent"], "parent" => $field_set->id) )."' }" : ""; ?> <?php if ($type_class = MPFT::type_class($field->type)) : ?> <tr <?php echo $title ?> class="sub <?php echo $editable_class.$deleting_class ?> <?php echo $disabled ?> <?php echo $first ?> <?php echo $count % 2 == 0 ? "even" : "" ?> <?php echo MPV::updated_class("edit-field,create-field", $field->id) ?> <?php echo $meta ?>"> <td class="type icon first" title="<?php echo call_user_func( array($type_class, "__s") ) ?>"><span class="mp-icon mp-icon-field-type-<?php echo $field->type ?>"></span></td> <td class="label"><strong><?php echo $field->display_label() ?></strong></td> <td class="front-end-name <?php echo $has_actions ? "" : "last" ?>"><span class="tt"><span class="arrow">-> </span><?php echo $field->display_name() ?></span></td> <?php if ($has_actions) : ?> <td class="actions last"> <div> <?php if (MPC::is_deleting($field->id, "delete-field")) : ?> <span class="confirm-action"> </span> <?php else: ?> <?php if ($can_edit_fields) : ?> <?php echo MPV::action_button("post-types", "edit-field", self::__edit(), array("id" => $field->id, "gparent" => $_GET["parent"], "parent" => $field_set->id), array("class" => "button button-edit") ); ?> <?php endif; ?> <?php if ($can_delete_fields) : ?> <?php echo MPV::action_button("post-types", "delete-field", self::__delete(), array("id" => $field->id, "gparent" => $_GET["parent"], "parent" => $parent->id), array("class" => "button button-delete") ); ?> <?php endif; ?> <?php endif; ?> </div> </td> <?php endif; // has_actions ?> </tr> <?php else: ?> <!-- TODO - TYPE CLASS DOESN'T EXIST --> <?php endif; ?> <?php endforeach; ?> <tr class="summary <?php echo $can_create_fields ? "editable" : "" ?>"> <?php if (count($fields)) : ?> <td colspan="<?php echo $colspan ?>" class="first <?php echo $can_create_fields ? "" : "last" ?>"><?php printf( __( "%s contains %s", MASTERPRESS_DOMAIN ), $display, MPU::__items( $field_set->field_count(), __("%d custom field", MASTERPRESS_DOMAIN), __("%d custom fields", MASTERPRESS_DOMAIN) ) ) ?></td> <?php else: ?> <td colspan="<?php echo $colspan ?>" class="hl first last"><span><?php printf( __( "<strong>%s</strong> is not yet active as it contains <em>no custom fields</em>. Click here to create one", MASTERPRESS_DOMAIN ), $display ); ?></span></td> <?php endif; ?> <?php if ($can_create_fields) : ?> <td class="last actions <?php echo count($fields) ? "" : "hl" ?>"> <?php echo MPV::action_button("post-types", "create-field", self::__create(MPV_Fields::__s()), array("gparent" => $_GET["parent"], "parent" => $field_set->id), array("class" => "button create-field") ); ?> </td> <?php endif; // can_create_fields ?> </tr> <tr class="gap <?php if ($fg_count == count($field_sets)) { echo "gap-last"; } ?>"> <td colspan="4"> </td> </tr> <?php endforeach; ?> </tbody> </table> <?php if ($can_create) : ?> <div class="grid-foot-controls"> <?php echo MPV::action_button("post-types", "create-field-set", MPV::__create( MPV_FieldSets::__s() ), array("parent" => $parent->id ) ); ?> </div> <?php endif; ?> <?php else: ?> <?php if ($can_create) : ?> <a href="<?php echo MasterPress::admin_url("post-types", "create-field-set", array("parent" => MasterPress::$parent)) ?>" class="no-items-create"> <i class="plus-circle"></i> <span><?php printf( __( "The <strong>%s</strong> post type currently has <em>no field sets</em>. Click here to create one.", MASTERPRESS_DOMAIN ), $parent->display_label() ); ?></span> </a> <?php endif; ?> <?php endif; ?> <?php } // end grid()
public function grid($id = null) { MPV::incl("field-sets"); MPV::incl("fields"); MPV::incl("taxonomies"); MPC::incl("taxonomies"); $post_types = MPM_PostType::find("orderby=disabled,name ASC"); $has_actions = MasterPress::current_user_can("edit_post_types,delete_post_types,manage_post_type_field_sets"); $can_edit = MasterPress::current_user_can("edit_post_types"); $can_delete = MasterPress::current_user_can("delete_post_types"); $can_create = MasterPress::current_user_can("create_post_types"); $can_manage_field_sets = MasterPress::current_user_can("manage_post_type_field_sets"); $less = $can_create ? 1 : 0; $colspan = ( $has_actions ? 8 : 7 ) - $less; ?> <?php MPV::messages(); ?> <?php foreach ($post_types as $post_type) { if (MPC::is_deleting($post_type->id)) { self::confirm_delete($post_type); } } ?> <table cellspacing="0" class="grid grid-post-types"> <thead> <tr> <th class="first menu-icon"><i class="menu-icon" title="<?php _e("Menu Icon", MASTERPRESS_DOMAIN) ?>"></i><span class="ac"><?php _e("Menu Icon", MASTERPRESS_DOMAIN) ?></span></th> <th class="menu-label"><i class="label-string"></i><span><?php _e("Label", MASTERPRESS_DOMAIN) ?></span></th> <th class="post-type-name"><i class="script-php"></i><span><?php _e("Name", MASTERPRESS_DOMAIN) ?></span></th> <th class="hierarchical"><i class="hierarchy"></i><span class="ac" title="<?php _e("Hierarchical?", MASTERPRESS_DOMAIN) ?>"><?php _e("Hierarchical?", MASTERPRESS_DOMAIN) ?></span></th> <th class="field-sets"><i class="metaboxes"></i><span><?php _e("Field Sets", MASTERPRESS_DOMAIN) ?></span></th> <th class="shared-field-sets"><i class="med share-metaboxes"></i><span><?php _e("Shared Field Sets", MASTERPRESS_DOMAIN) ?></span></th> <th class="taxonomies <?php echo $has_actions ? "" : "last" ?>"><i class="tags"></i><span><?php _e("Taxonomies", MASTERPRESS_DOMAIN) ?></span></th> <?php if ($has_actions) : ?> <th class="actions last"><i class="buttons"></i><span><?php _e("Actions", MASTERPRESS_DOMAIN) ?></span></th> <?php endif; ?> </tr> </thead> <tbody> <?php $count = 0; ?> <?php foreach ($post_types as $post_type) : $disabled = ( $post_type->disabled ) ? "disabled" : ""; $title = $post_type->disabled ? ' title="'.__("this post type is disabled", MASTERPRESS_DOMAIN).'" ' : ""; if (!$post_type->in_current_site()) { $disabled = "disabled"; $title = ' title="'.__("this post type is not currently available in this site (multi-site setting)", MASTERPRESS_DOMAIN).'" '; } ?> <?php if ($post_type->still_registered()) : $count++; $first = $count == 1 ? 'first' : ''; ?> <?php $deleting_class = MPC::is_deleting($post_type->id, "delete") ? 'deleting' : ''; $editable_class = $can_edit ? " editable " : ""; $meta = $can_edit ? "{ href: '".MasterPress::admin_url("post-types", "edit", "id=".$post_type->id)."' }" : ""; ?> <tr <?php echo $title ?> class="<?php echo $first ?> <?php echo $editable_class.$deleting_class ?> <?php echo $disabled ?> <?php echo MPV::updated_class("edit,create", $post_type->id) ?> <?php echo $count % 2 == 0 ? "even" : "" ?> sub <?php echo $meta ?>"> <td class="first menu-icon icon"><span class="mp-icon-post-type mp-icon-post-type-<?php echo $post_type->name ?>"></span></td> <td class="menu-label"><strong><?php echo $post_type->labels["menu_name"] ?></strong></td> <td class="post-type-name"><span class="tt"><?php echo $post_type->name ?></span></td> <td class="hierarchical"><?php echo $post_type->hierarchical ? '<i class="tick-small"></i><span class="ac" title="'.__("this post type is hierarchical", MASTERPRESS_DOMAIN).'">yes</span>' : '<span class="note" title="'.__("this post type is not hierarchical", MASTERPRESS_DOMAIN).'">–</span>' ?></td> <?php $field_sets = $post_type->field_sets("name ASC"); ?> <?php if ($post_type->show_ui) : ?> <td class="field-sets <?php echo $can_manage_field_sets ? "manage { href: '".MasterPress::admin_url( "post-types", "manage-field-sets", "parent=".$post_type->id)."' }" : "" ?>"> <?php if ($can_manage_field_sets) : ?> <a href="<?php echo MasterPress::admin_url( "post-types", "manage-field-sets", "parent=".$post_type->id)?>" title="<?php echo strip_tags(self::__manage( MPV_FieldSets::__p() )) ?>"> <i class="go"></i> <?php endif; ?> <?php $field_set_display = MPV::note_none(); if (count($field_sets)) { $field_set_links = array(); foreach ($field_sets as $field_set) { if (!$field_set->is_shared()) { $field_set_links[] = $field_set->display_label(); } } if (count($field_set_links)) { $field_set_display = implode($field_set_links, ", "); } } echo $field_set_display; ?> <?php if ($can_manage_field_sets) : ?> </a> <?php endif; ?> </td> <?php else: ?> <td class="field-sets"> <span title="<?php _e("This post type does not support field sets as the 'show ui' parameter is off", MASTERPRESS_DOMAIN); ?>"><i class="na"></i><?php _e("N/A", MASTERPRESS_DOMAIN); ?></span> </td> <?php endif; ?> <?php if ($post_type->show_ui) : ?> <td class="shared-field-sets"> <?php $field_set_display = MPV::note_none(); if (count($field_sets)) { $field_set_links = array(); foreach ($field_sets as $field_set) { if ($field_set->is_shared()) { $field_set_links[] = $field_set->display_label(); } } if (count($field_set_links)) { $field_set_display = implode($field_set_links, ", "); } } echo $field_set_display; ?> </td> <?php else: ?> <td class="shared-field-sets"> <span title="<?php _e("This post type does not support shared field sets as the 'show ui' parameter is off", MASTERPRESS_DOMAIN); ?>"><i class="na"></i><?php _e("N/A", MASTERPRESS_DOMAIN); ?></span> </td> <?php endif; ?> <td class="taxonomies <?php echo $has_actions ? "" : "last" ?>"> <?php $taxonomies = $post_type->taxonomies(); $tax_display = MPV::note_none(); if (count($taxonomies)) { $tax_links = array(); foreach ($taxonomies as $tax) { $tax_links[] = $tax->labels["name"]; } $tax_display = implode($tax_links, ", "); } echo $tax_display; ?> </td> <?php if ($has_actions) : ?> <td class="actions last"> <div> <?php if (MPC::is_deleting($post_type->id)) : ?> <span class="confirm-action"><?php _e("Please Confirm Delete Action", MASTERPRESS_DOMAIN) ?></span> <?php else: ?> <?php if ($can_manage_field_sets) : ?> <?php if ($post_type->show_ui) : ?> <?php echo MPV::action_button("post-types", "manage-field-sets", self::__manage( MPV_FieldSets::__p_short() ), "parent=".$post_type->id, array("class" => "button button-manage")); ?> <?php else: ?> <?php echo MPV::action_button("post-types", "manage-field-sets", self::__manage( MPV_FieldSets::__p_short() ), "parent=".$post_type->id, array("title" => "This post type does not support field sets as the 'show ui' parameter is off", "disabled" => "disabled", "class" => "button button-manage")); ?> <?php endif; ?> <?php endif; ?> <?php if ($can_edit) : ?> <?php echo MPV::action_button("post-types", "edit", self::__edit( "" ), "id=".$post_type->id, array( "class" => "button primary button-edit" )); ?> <?php endif; ?> <?php if ($can_delete) : ?> <?php if ($post_type->_builtin) : ?> <span class="note" title="<?php _e("This post type cannot be deleted as it is built-in to WordPress", MASTERPRESS_DOMAIN) ?>"><?php _e("( Built-in )", MASTERPRESS_DOMAIN) ?></span> <?php elseif ($post_type->_external) : ?> <span class="note" title="<?php _e("This post type cannot be deleted as it was not created by MasterPress", MASTERPRESS_DOMAIN) ?>"><?php _e("( External )", MASTERPRESS_DOMAIN) ?></span> <?php else: ?> <?php echo MPV::action_button("post-types", "delete", self::__delete( "" ), "id=".$post_type->id, array( "class" => "button button-delete", "title" => "Delete - Requires Confirmation" )); ?> <?php endif; ?> <?php endif; ?> <?php endif; // has_actions ?> </div> </td> <?php endif; ?> </tr> <?php endif; ?> <?php endforeach; ?> <tr class="summary <?php echo $can_create ? "editable" : "" ?>"> <td colspan="<?php echo $colspan ?>" class="first <?php echo $can_create ? "" : "last" ?>"><?php _e( MPU::__items( $count, __("<strong>%d</strong> Post Type", MASTERPRESS_DOMAIN), __("%d Post Types", MASTERPRESS_DOMAIN) ) ) ?></td> <?php if ($can_create) : ?> <td class="last"> <?php echo MPV::action_button("post-types", "create", self::__create(MPV_PostTypes::__s()), "", array( "class" => "button button-create" ) ); ?> </td> <?php endif; ?> </tr> </tbody> </table> <?php } // end grid()
function manage() { global $wf; ?> <?php MPV::messages() ?> <?php MPV::incl("post-types"); MPV::incl("shared-field-sets"); MPV::incl("templates"); MPV::incl("taxonomies"); MPV::incl("roles"); $disabled = ""; $view = MasterPress::$view; $post_types = MPM_PostType::find("orderby=disabled,name ASC"); $taxonomies = MPM_Taxonomy::find("orderby=disabled,name ASC"); $shared_field_sets = MPM_SharedFieldSet::find("orderby=disabled,name ASC"); $templates = get_page_templates(); $site_field_sets = MPM_SiteFieldSet::find("orderby=disabled,name ASC"); $roles = $wf->roles(); ?> <div class="fs fs-masterplan fs-with-tabs"> <div class="fsc"> <div class="fscb"> <?php $tab = ""; if (isset($_REQUEST["tab"])) { $tab = $_REQUEST["tab"]; } ?> <?php // check for restoreable backups $backups = array(); if (file_exists(MASTERPRESS_CONTENT_MASTERPLANS_DIR)) { $iterator = new DirectoryIterator(MASTERPRESS_CONTENT_MASTERPLANS_DIR); foreach ($iterator as $file) { $file_name = $file->getFileName(); if (substr($file_name, 0, 1) == ".") { continue; } if (preg_match("/\_backup\.(?:(.*)\.)?([0-9]+)\.masterplan\.zip/", $file_name, $matches)) { $tag = $matches[1]; $date = $matches[2]; $fdate = $wf->date_format("[date-time-long]", strtotime($date)); $label = $fdate; if ($tag != "") { $label = $fdate." ( ".$tag." )"; } $backups[] = array("file" => $file_name, "label" => $label); } } } ?> <ul class="fs-tabs"> <li><a href="#masterplan-overview" class="<?php echo $tab != '' ? '' : 'current' ?>"><span><i class="info"></i>Overview</span></a></li> <?php if (MasterPress::current_user_can("export_masterplan")) : ?> <li><a href="#masterplan-export" class="<?php echo $tab == "export" ? 'current' : '' ?>"><span><i class="arrow-curve-right"></i>Export</span></a></li> <?php endif; ?> <?php if (MasterPress::current_user_can("import_masterplan")) : ?> <li><a href="#masterplan-import" class="<?php echo $tab == "import" ? 'current' : '' ?>"><span class="import"><i class="arrow-curve-left"></i>Import</span></a></li> <?php endif; ?> <?php if (MasterPress::current_user_can("backup_masterplan")) : ?> <li><a href="#masterplan-backup" class="<?php echo $tab == "backup" ? 'current' : '' ?>"><span class="backup"><i class="buoy"></i>Backup</span></a></li> <?php endif; ?> <?php if (count($backups)) : ?> <?php if (MasterPress::current_user_can("restore_masterplan")) : ?> <li><a href="#masterplan-restore" class="<?php echo $tab == "restore" ? 'current' : '' ?>"><span class="restore"><i class="clock-history"></i>Restore</span></a></li> <?php endif; ?> <?php endif; ?> </ul> <!-- OVERVIEW --> <div id="masterplan-overview" class="tab-panel <?php echo $tab != '' ? '' : 'current' ?>"> <?php if (isset($_GET["import-complete"])) : ?> <ul class="mp-messages"> <li class="success"><?php _e("Import Complete - your new site Masterplan is shown below.", MASTERPRESS_DOMAIN) ?></li> </ul> <?php endif; ?> <?php if (isset($_GET["restore-complete"])) : ?> <ul class="mp-messages"> <li class="success"><?php _e("Restore Complete - your site Masterplan is shown below.", MASTERPRESS_DOMAIN) ?></li> </ul> <?php endif; ?> <div class="row first-row"> <div class="col post-types"> <?php $count = 0; foreach ($post_types as $post_type) { if ($post_type->still_registered()) { $count++; } } ?> <h4><i class="pin"></i> <?php if (MasterPress::current_user_can("manage_post_types")) : ?> <a href="<?php echo MasterPress::admin_url("post-types", "manage") ?>" title="<?php _e("Manage Post Types", MASTERPRESS_DOMAIN) ?>" class="icon"> <?php else : ?> <span class="icon"> <?php endif; ?> <?php echo WOOF::items_number( $count, __("<em>No</em> Post Types", MASTERPRESS_DOMAIN), __("<b>%d</b> Post Type", MASTERPRESS_DOMAIN), __("<b>%d</b> Post Types", MASTERPRESS_DOMAIN) ) ?> <?php if (MasterPress::current_user_can("manage_post_types")) : ?> </a> <?php else : ?> </span> <?php endif; ?> </h4> <div class="body"> <ul class="count-<?php echo $count ?>"> <?php foreach ($post_types as $post_type) : $default_icon = $post_type->menu_icon_exists() ? "" : "default-icon"; $field_sets = $post_type->post_type_field_sets(); $fsc = count($field_sets); $disabled = $post_type->disabled ? 'disabled ' : ''; $disabled_title = $post_type->disabled ? __('This post type is currently disabled', MASTERPRESS_DOMAIN) : ''; ?> <?php if ($post_type->still_registered()) : ?> <li class="<?php echo $disabled ?>post-type-<?php echo $post_type->name ?> <?php echo $default_icon ?> linkify" data-name="<?php echo $post_type->name ?>" title="<?php echo $disabled_title ?>"> <?php if (MasterPress::current_user_can("manage_post_types+edit_post_types")) : ?> <a href="<?php echo MasterPress::admin_url("post-types", "edit", "id=".$post_type->id) ?>" class="item mp-icon-post-type mp-icon-post-type-<?php echo $post_type->name ?>"> <?php else: ?> <div class="item mp-icon-post-type mp-icon-post-type-<?php echo $post_type->name ?>"> <?php endif; ?> <?php echo WOOF::truncate($post_type->display_label(), "length=15&words=0") ?> <?php if (MasterPress::current_user_can("manage_post_types+edit_post_types")) : ?> </a> <?php else: ?> </div> <?php endif; ?> <?php if (MasterPress::current_user_can("manage_post_types+manage_post_type_field_sets")) : ?> <a href="<?php echo MasterPress::admin_url("post-types", "manage-field-sets", "parent=".$post_type->id) ?>" title="<?php _e("Manage Field Sets", MASTERPRESS_DOMAIN) ?>" class="field-sets count-<?php echo $fsc ?>"><?php echo $fsc ?></a> <?php else : ?> <div title="<?php _e("Field Sets", MASTERPRESS_DOMAIN) ?>" class="field-sets count-<?php echo $fsc ?>"><?php echo $fsc ?></div> <?php endif; ?> <?php foreach ($post_type->taxonomies() as $tax) : ?> <span class="tax-link-<?php echo $tax->name ?> related-link asterisk"></span> <?php endforeach; ?> <?php foreach ($post_type->field_sets() as $fs) : ?> <?php if ($fs->is_shared()) : ?> <span class="shared-field-set-link-<?php echo $fs->name ?> related-link asterisk"></span> <?php endif; ?> <?php endforeach; ?> </li> <?php endif; ?> <?php endforeach; ?> <?php if (MasterPress::current_user_can("create_post_types")) : ?> <li class="divide"><a href="<?php echo MasterPress::admin_url("post-types", "create") ?>" class="create-link"><i></i><?php echo MPV::__create( MPV_PostTypes::__s() ) ?></a></li> <?php endif; ?> </ul> </div> <!-- /.body --> </div> <!-- /.col --> <div class="col taxonomies"> <?php $count = 0; foreach ($taxonomies as $tax) { if ($tax->still_registered()) { $count++; } } ?> <h4><i class="tag"></i> <?php if (MasterPress::current_user_can("manage_taxonomies")) : ?> <a href="<?php echo MasterPress::admin_url("taxonomies", "manage") ?>" title="<?php _e("Manage Taxonomies", MASTERPRESS_DOMAIN) ?>" class="icon"> <?php else : ?> <span class="icon"> <?php endif; ?> <?php echo WOOF::items_number( $count, __("<em>No</em> Taxonomies", MASTERPRESS_DOMAIN), __("<b>%d</b> Taxonomy", MASTERPRESS_DOMAIN), __("<b>%d</b> Taxonomies", MASTERPRESS_DOMAIN) ) ?> <?php if (MasterPress::current_user_can("manage_taxonomies")) : ?> </a> <?php else : ?> </span> <?php endif; ?> </h4> <div class="body"> <ul class="count-<?php $count ?>"> <?php foreach ($taxonomies as $tax) : $field_sets = $tax->taxonomy_field_sets(); $fsc = count($field_sets); $disabled = $tax->disabled ? 'disabled ' : ''; $disabled_title = $tax->disabled ? __('This taxonomy is currently disabled', MASTERPRESS_DOMAIN) : ''; ?> <?php if ($tax->still_registered()) : ?> <li class="<?php echo $disabled ?> linkify" data-name="<?php echo $tax->name ?>" title="<?php echo $disabled_title ?>"> <?php if (MasterPress::current_user_can("manage_taxonomies+edit_taxonomies")) : ?> <a href="<?php echo MasterPress::admin_url("taxonomies", "edit", "id=".$tax->id) ?>" class="item mp-icon-taxonomy mp-icon-taxonomy-<?php echo $tax->name ?>"> <?php else: ?> <div class="item mp-icon-taxonomy mp-icon-taxonomy-<?php echo $tax->name ?>"> <?php endif; ?> <?php echo WOOF::truncate($tax->display_label(), "length=15&words=0") ?> <?php if (MasterPress::current_user_can("manage_taxonomies+edit_taxonomies")) : ?> </a> <?php else: ?> </div> <?php endif; ?> <?php if (MasterPress::current_user_can("manage_taxonomies+manage_taxonomy_field_sets")) : ?> <a href="<?php echo MasterPress::admin_url("taxonomies", "manage-field-sets", "parent=".$tax->id) ?>" title="<?php _e("Manage Field Sets", MASTERPRESS_DOMAIN) ?>" class="field-sets count-<?php echo $fsc ?>"><?php echo $fsc ?></a> <?php else : ?> <div title="<?php _e("Field Sets", MASTERPRESS_DOMAIN) ?>" class="field-sets count-<?php echo $fsc ?>"><?php echo $fsc ?></div> <?php endif; ?> <?php foreach ($tax->post_types() as $pt) : ?> <span class="post-type-link-<?php echo $pt->name ?> related-link asterisk"></span> <?php endforeach; ?> <?php foreach ($tax->field_sets() as $fs) : ?> <?php if ($fs->is_shared()) : ?> <span class="shared-field-set-link-<?php echo $fs->name ?> related-link asterisk"></span> <?php endif; ?> <?php endforeach; ?> </li> <?php endif; ?> <?php endforeach; ?> <?php if (MasterPress::current_user_can("create_taxonomies")) : ?> <li class="divide"><a href="<?php echo MasterPress::admin_url("taxonomies", "create") ?>" class="create-link"><i></i><?php echo MPV::__create( MPV_Taxonomies::__s() ) ?></a></li> <?php endif; ?> </ul> </div> <!-- /.body --> </div> <!-- /.col --> <div class="col field-sets shared-field-sets"> <h4><i class="metabox-share"></i> <?php if (MasterPress::current_user_can("manage_shared_field_sets")) : ?> <a href="<?php echo MasterPress::admin_url("shared-field-sets", "manage") ?>" title="<?php _e("Manage Shared Field Sets", MASTERPRESS_DOMAIN) ?>" class="icon"> <?php else : ?> <span class="icon"> <?php endif; ?> <?php echo WOOF::items_number( count($shared_field_sets), __("<em>No</em> Shared Field Sets", MASTERPRESS_DOMAIN), __("<b>%d</b> Shared Field Set", MASTERPRESS_DOMAIN), __("<b>%d</b> Shared Field Sets", MASTERPRESS_DOMAIN) ) ?> <?php if (MasterPress::current_user_can("manage_shared_field_sets")) : ?> </a> <?php else : ?> </span> <?php endif; ?> </h4> <div class="body"> <ul class="count-<?php echo count($shared_field_sets) ?>"> <?php foreach ($shared_field_sets as $field_set) : $multiple = $field_set->allow_multiple ? "allow-multiple" : ''; $disabled = $field_set->disabled ? 'disabled ' : ''; $disabled_title = $field_set->disabled ? __('This shared field set is currently disabled', MASTERPRESS_DOMAIN) : ''; ?> <li class="<?php echo $disabled ?>shared-field-set-<?php echo $field_set->name ?> linkify" data-name="<?php echo $field_set->name ?>" title="<?php echo $disabled_title ?>"> <?php if (MasterPress::current_user_can("manage_shared_field_sets+edit_shared_field_sets")) : ?> <a href="<?php echo MasterPress::admin_url("shared-field-sets", "edit", "id=".$field_set->id) ?>" title="<?php _e("Edit Shared Field Set", MASTERPRESS_DOMAIN) ?>" class="item <?php echo $multiple ?>"> <?php else: ?> <div class="item <?php echo $multiple ?>"> <?php endif; ?> <?php if ($multiple) : ?> <i class="metabox-add-remove"></i> <?php else : ?> <i class="metabox"></i> <?php endif; ?> <?php echo $field_set->display_label() ?></a> <?php if (MasterPress::current_user_can("manage_shared_field_sets+edit_shared_field_sets")) : ?> </a> <?php else: ?> </div> <?php endif; ?> <?php foreach ($field_set->post_types() as $post_type) : ?> <span class="post-type-link-<?php echo $post_type->name ?> related-link asterisk"></span> <?php endforeach; ?> <?php foreach ($field_set->taxonomies() as $tax) : ?> <span class="tax-link-<?php echo $tax->name ?> related-link asterisk"></span> <?php endforeach; ?> <?php foreach ($field_set->roles() as $role) : ?> <span class="role-link-<?php echo $role->id ?> related-link asterisk"></span> <?php endforeach; ?> </li> <?php endforeach; ?> <?php if (MasterPress::current_user_can("create_shared_field_sets")) : ?> <li class="divide"><a href="<?php echo MasterPress::admin_url("shared-field-sets", "create") ?>" class="create-link"><i></i><?php echo MPV::__create( MPV_SharedFieldSets::__s() ) ?></a></li> <?php endif; ?> </ul> </div> <!-- /.body --> </div> <!-- /.col --> </div> <!-- /.row --> <div class="row"> <div class="col templates"> <h4><i class="template"></i> <?php if (MasterPress::current_user_can("manage_templates")) : ?> <a href="<?php echo MasterPress::admin_url("templates", "manage") ?>" title="<?php _e("Manage Templates", MASTERPRESS_DOMAIN) ?>" class="icon"> <?php else : ?> <span class="icon"> <?php endif; ?> <?php echo WOOF::items_number( count($templates), __("<em>No</em> Templates", MASTERPRESS_DOMAIN), __("<b>%d</b> Template", MASTERPRESS_DOMAIN), __("<b>%d</b> Templates", MASTERPRESS_DOMAIN) ) ?> <?php if (MasterPress::current_user_can("manage_templates")) : ?> </a> <?php else : ?> </span> <?php endif; ?> </h4> <div class="body"> <ul class="count-<?php echo count($templates) ?>"> <?php $count = 0; ?> <?php foreach ($templates as $template => $file) : $count++; $fsc = count(MPM_TemplateFieldSet::find_by_template( $file )); ?> <li class="linkify" data-name="<?php echo $file ?>"> <?php if (MasterPress::current_user_can("manage_templates+edit_templates")) : ?> <a href="<?php echo MasterPress::admin_url("templates", "edit", "id=".$file) ?>" class="item"> <?php else: ?> <div class="item"> <?php endif; ?> <?php echo WOOF::truncate($template, "length=20&words=0") ?> <?php if (MasterPress::current_user_can("manage_templates+edit_templates")) : ?> </a> <?php else: ?> </div> <?php endif; ?> <?php if (MasterPress::current_user_can("manage_templates+manage_template_field_sets")) : ?> <a href="<?php echo MasterPress::admin_url("templates", "manage-field-sets", "parent=".$file) ?>" title="<?php _e("Manage Field Sets", MASTERPRESS_DOMAIN) ?>" class="field-sets count-<?php echo $fsc ?>"><?php echo $fsc ?></a> <?php else : ?> <div title="<?php _e("Field Sets", MASTERPRESS_DOMAIN) ?>" class="field-sets count-<?php echo $fsc ?>"><?php echo $fsc ?></div> <?php endif; ?> </li> <?php endforeach; ?> </ul> </div> <!-- /.body --> </div> <!-- /.col --> <div class="col field-sets site-field-sets"> <h4><i class="sitemap"></i> <?php if (MasterPress::current_user_can("manage_site_field_sets")) : ?> <a href="<?php echo MasterPress::admin_url("site-field-sets", "manage") ?>" title="<?php _e("Manage Site Field Sets", MASTERPRESS_DOMAIN) ?>" class="icon"> <?php else : ?> <span class="icon"> <?php endif; ?> <?php echo WOOF::items_number( count($site_field_sets), __("<em>No</em> Site Field Sets", MASTERPRESS_DOMAIN), __("<b>%d</b> site Field Set", MASTERPRESS_DOMAIN), __("<b>%d</b> site Field Sets", MASTERPRESS_DOMAIN) ) ?> <?php if (MasterPress::current_user_can("manage_site_field_sets")) : ?> </a> <?php else : ?> </span> <?php endif; ?> </h4> <div class="body"> <ul class="count-<?php echo count($site_field_sets) ?>"> <?php foreach ($site_field_sets as $field_set) : $multiple = $field_set->allow_multiple ? "allow-multiple" : ''; $disabled = $field_set->disabled ? 'disabled ' : ''; $disabled_title = $field_set->disabled ? __('This site field set is currently disabled', MASTERPRESS_DOMAIN) : ''; ?> <li class="<?php echo $disabled ?>site-field-set-<?php echo $field_set->name ?> linkify" data-name="<?php echo $field_set->name ?>" title="<?php echo $disabled_title ?>"> <?php if (MasterPress::current_user_can("manage_site_field_sets+edit_site_field_sets")) : ?> <a href="<?php echo MasterPress::admin_url("site-field-sets", "edit", "id=".$field_set->id) ?>" title="<?php _e("Edit Site Field Set", MASTERPRESS_DOMAIN) ?>" class="item <?php echo $multiple ?>"> <?php else: ?> <div class="item <?php echo $multiple ?>"> <?php endif; ?> <?php if ($multiple) : ?> <i class="metabox-add-remove"></i> <?php else : ?> <i class="metabox"></i> <?php endif; ?> <?php echo $field_set->display_label() ?></a> <?php if (MasterPress::current_user_can("manage_site_field_sets+edit_site_field_sets")) : ?> </a> <?php else: ?> </div> <?php endif; ?> </li> <?php endforeach; ?> <?php if (MasterPress::current_user_can("create_site_field_sets")) : ?> <li class="divide"><a href="<?php echo MasterPress::admin_url("site-field-sets", "create") ?>" class="create-link"><i></i><?php echo MPV::__create( __("Site Field Set", MASTERPRESS_DOMAIN) ) ?></a></li> <?php endif; ?> </ul> </div> <!-- /.body --> </div> <!-- /.col --> <div class="col roles"> <h4><i class="user"></i> <?php if (MasterPress::current_user_can("manage_user_roles")) : ?> <a href="<?php echo MasterPress::admin_url("roles", "manage") ?>" title="<?php _e("Manage User Roles", MASTERPRESS_DOMAIN) ?>" class="icon"> <?php else : ?> <span class="icon"> <?php endif; ?> <?php echo WOOF::items_number( count($roles), __("<em>No</em> User Roles", MASTERPRESS_DOMAIN), __("<b>%d</b> User Role", MASTERPRESS_DOMAIN), __("<b>%d</b> User Roles", MASTERPRESS_DOMAIN) ) ?> <?php if (MasterPress::current_user_can("manage_user_roles")) : ?> </a> <?php else : ?> </span> <?php endif; ?> </h4> <div class="body"> <?php // cap checking has side-effects to the roles collection, causing an infinite loop. We need to cache the info here $role_cache = array(); foreach ($roles as $role) { $role_cache[] = array("name" => $role->name(), "id" => $role->id()); } ?> <ul class="count-<?php echo count($roles) ?>"> <?php foreach ($role_cache as $role) : $count++; $fsc = count(MPM_RoleFieldSet::find_by_role( $role["id"] )); ?> <li class="linkify" data-name="<?php echo $role["id"] ?>"> <?php if (MasterPress::current_user_can("manage_user_roles+edit_user_roles")) : ?> <a href="<?php echo MasterPress::admin_url("roles", "edit", "id=".$role["id"]) ?>" class="item"> <?php else: ?> <div class="item"> <?php endif; ?> <i class="user-role"></i> <?php echo WOOF::truncate($role["name"], "length=20&words=0") ?> <?php if (MasterPress::current_user_can("manage_user_roles+edit_user_roles")) : ?> </a> <?php else: ?> </div> <?php endif; ?> <?php if (MasterPress::current_user_can("manage_user_roles+manage_user_role_field_sets")) : ?> <a href="<?php echo MasterPress::admin_url("roles", "manage-field-sets", "parent=".$role["id"]) ?>" title="<?php _e("Manage Field Sets", MASTERPRESS_DOMAIN) ?>" class="field-sets count-<?php echo $fsc ?>"><?php echo $fsc ?></a> <?php else : ?> <div title="<?php _e("Field Sets", MASTERPRESS_DOMAIN) ?>" class="field-sets count-<?php echo $fsc ?>"><?php echo $fsc ?></div> <?php endif; ?> <?php foreach ($shared_field_sets as $fs) : ?> <?php if ($fs->visible_in("roles", $role["id"])) : ?> <span class="shared-field-set-link-<?php echo $fs->name ?> related-link asterisk"></span> <?php endif; ?> <?php endforeach; ?> </li> <?php endforeach; ?> <?php if (MasterPress::current_user_can("create_user_roles")) : ?> <li class="divide"><a href="<?php echo MasterPress::admin_url("roles", "create") ?>" class="create-link"><i></i><?php echo MPV::__create( __("User Role", MASTERPRESS_DOMAIN) ) ?></a></li> <?php endif; ?> </ul> </div> <!-- /.body --> </div> <!-- /.col --> </div> <!-- /.row --> </div> <!-- /#masterplan-overview --> <!-- EXPORT --> <?php if (MasterPress::current_user_can("export_masterplan")) : ?> <div id="masterplan-export" class="masterplan-export tab-panel <?php echo $tab == "export" ? 'current' : '' ?>"> <?php MPV::form_open() ?> <div id="export-progress" class="progress"> <?php _e("Exporting Masterplan. Please wait…", MASTERPRESS_DOMAIN) ?> </div> <!-- /#export-progress --> <div id="export-summary" class="summary"> <div id="export-download"> <p><?php _e("Export completed successfully", MASTERPRESS_DOMAIN) ?></p> <a id="export-file-download" href="#" data-message="<?php _e( "Download %s", MASTERPRESS_DOMAIN) ?>"><?php printf( __( "Download %s", MASTERPRESS_DOMAIN ), "file.zip" ) ?></a> </div> <!-- /#export-download --> <div id="extras-summary" class="extras-summary"> <p> <?php _e("Note: the following dependent files were included in the Masterplan package", MASTERPRESS_DOMAIN) ?> </p> <div id="extras-icons"> <h4><?php _e("Icons", MASTERPRESS_DOMAIN); ?></h4> <ul> </ul> </div> <!-- /#extras-icons --> <div id="extras-types"> <h4><?php _e("Field Types", MASTERPRESS_DOMAIN); ?></h4> <ul> </ul> </div> <!-- /#extras-field-types --> </div> </div> <!-- /#export-summary --> <div id="export-ui"> <div id="export-package"> <div class="title"> <h4 class="package-file"><i class="zip"></i><?php _e("Package File", MASTERPRESS_DOMAIN) ?></h4> <button id="button-export" type="submit" class="button-export simple-primary">Export</button> </div> <!-- /.title --> <div id="f-export-filename" class="f"> <label for="export_filename"><?php _e("Name:", MASTERPRESS_DOMAIN) ?></label> <div class="fw"> <input id="export_filename" spellcheck="false" name="export_filename" type="text" value="<?php echo $wf->sanitize( $wf->site_name() ) ?>" class="text" /> <span id="export_filename_extension" class="note"><?php echo ".".$wf->format_date("[date-time-sortable]") ?>.masterplan.zip</span> </div> <!-- /.fw --> </div> <!-- /.f --> </div> <!-- /#export-package --> <div id="export-readme"> <h4 class="readme"><i class="document-text"></i><?php _e('Read Me<span> - this Markdown-formatted text will be stored in <span class="tt">README.markdown</span> inside the Masterplan package</span>', MASTERPRESS_DOMAIN); ?></h4> <div id="f-export_readme"> <textarea id="export_readme" name="export_readme"> # Masterplan for <?php echo $wf->sites()->first()->name ?> # + By: <?php echo $wf->the_user()->fullname() ?> + Created: <?php echo $wf->format_date("[date-time-long]") ?> ------------------------------------------------- </textarea> </div> </div> <!-- /#export-readme --> <div id="export-items"> <div class="title-buttons"> <h4 class="export-items"><i class="hand-point"></i><?php _e("Export Items<span> - check the items you wish to include in the Masterplan package</span>", MASTERPRESS_DOMAIN); ?></h4> <div class="buttons"> <button id="export-select-all" type="button" class="button">Select <span class="all">All</span></button> <button id="export-select-none" type="button" class="button">Select <span class="none">None</span></button> </div> </div> <!-- /.title-buttons --> <div class="fsi"> <div class="fsibv"> <div class="fsit"> <h4 class="post-types"><i class="pin"></i><?php _e("Post Types", MASTERPRESS_DOMAIN) ?></h4> <input id="post-types-check" name="post-types-all" type="checkbox" class="checkbox" checked="checked" /> </div> <div class="fsic"> <ul class="object-tree post-types"> <?php foreach ($post_types as $post_type) : ?> <?php if ($post_type->still_registered()) : ?> <li class="post-type-<?php echo $post_type->name ?>"> <input id="ref-post-type-<?php echo $post_type->name ?>" name="ref[post_types][<?php echo $post_type->name ?>][selected]" checked="checked" value="true" type="hidden" /> <input id="export-post-type-<?php echo $post_type->name ?>" name="export[post_types][<?php echo $post_type->name ?>][selected]" checked="checked" value="true" type="checkbox" class="checkbox" /> <label for="export-post-type-<?php echo $post_type->name ?>" class="mp-icon-post-type mp-icon-post-type-<?php echo $post_type->name ?>"><?php echo $post_type->display_label() ?></label> <?php $field_sets = $post_type->post_type_field_sets() ?> <?php if (count($field_sets)) : ?> <ul class="field-sets"> <?php foreach ($field_sets as $field_set) : $class = $field_set->allow_multiple ? 'metabox-add-remove-large' : 'metabox-large'; ?> <li class="field-set<?php echo $class ?>"> <input id="export-post-type-<?php echo $post_type->name ?>-field-set-<?php echo $field_set->id ?>" checked="checked" name="export[post_types][<?php echo $post_type->name ?>][field_sets][<?php echo $field_set->id ?>][selected]" value="true" type="checkbox" class="checkbox" /> <input id="ref-post-type-<?php echo $post_type->name ?>-field-set-<?php echo $field_set->id ?>" name="ref[post_types][<?php echo $post_type->name ?>][field_sets][<?php echo $field_set->id ?>][selected]" value="true" type="hidden" /> <label for="export-post-type-<?php echo $post_type->name ?>-field-set-<?php echo $field_set->id ?>" class="field-set"><i class="<?php echo $class ?>"></i><?php echo $field_set->display_label() ?></label> <?php $fields = $field_set->fields() ?> <?php if (count($fields)) : ?> <ul class="fields"> <?php foreach ($fields as $field) : ?> <?php if ($type_class = MPFT::type_class($field->type)) : ?> <li class="field"> <input id="export-post-type-<?php echo $post_type->name ?>-field-set-<?php echo $field_set->id ?>-field-<?php echo $field->id ?>" checked="checked" name="export[post_types][<?php echo $post_type->name ?>][field_sets][<?php echo $field_set->id ?>][fields][<?php echo $field->id ?>]" value="true" type="checkbox" class="checkbox" /> <input id="ref-post-type-<?php echo $post_type->name ?>-field-set-<?php echo $field_set->id ?>-field-<?php echo $field->id ?>" checked="checked" name="ref[post_types][<?php echo $post_type->name ?>][field_sets][<?php echo $field_set->id ?>][fields][<?php echo $field->id ?>]" value="true" type="hidden" /> <label for="export-post-type-<?php echo $post_type->name ?>-field-set-<?php echo $field_set->id ?>-field-<?php echo $field->id ?>" class="mp-icon-field-type-<?php echo $field->type ?>"><?php echo $field->display_label() ?></label> </li> <?php endif; ?> <?php endforeach; ?> </ul> <?php endif; ?> </li> <?php endforeach; ?> </ul> <?php endif; ?> </li> <?php endif; ?> <?php endforeach; ?> </ul> </div> <!-- /.fsic --> </div> </div> <!-- /.fsi --> <div class="fsi"> <div class="fsibv"> <div class="fsit"> <h4 class="taxonomies"><i class="tag"></i><?php _e("Taxonomies", MASTERPRESS_DOMAIN) ?></h4> <input id="taxonomies-check" name="taxonomies-all" type="checkbox" class="checkbox" checked="checked" /> </div> <div class="fsic"> <ul class="object-tree taxonomies"> <?php foreach ($taxonomies as $tax) : ?> <?php if ($tax->still_registered()) : ?> <li> <input id="ref-taxonomy-<?php echo $tax->name ?>" name="ref[taxonomies][<?php echo $tax->name ?>][selected]" value="true" type="hidden" /> <input id="export-taxonomy-<?php echo $tax->name ?>" name="export[taxonomies][<?php echo $tax->name ?>][selected]" checked="checked" value="true" type="checkbox" class="checkbox" /> <label for="export-taxonomy-<?php echo $tax->name ?>" class="mp-icon-taxonomy mp-icon-taxonomy-<?php echo $tax->name ?>"><?php echo $tax->display_label() ?></label> <?php $field_sets = $tax->taxonomy_field_sets() ?> <?php if (count($field_sets)) : ?> <ul class="field-sets"> <?php foreach ($field_sets as $field_set) : $class = $field_set->allow_multiple ? 'metabox-add-remove-large' : 'metabox-large'; ?> <li class="field-set<?php echo $class ?>"> <input id="ref-taxonomy-<?php echo $tax->name ?>-field-set-<?php echo $field_set->id ?>" name="ref[taxonomies][<?php echo $tax->name ?>][field_sets][<?php echo $field_set->id ?>][selected]" value="true" type="hidden" /> <input id="export-taxonomy-<?php echo $tax->name ?>-field-set-<?php echo $field_set->id ?>" name="export[taxonomies][<?php echo $tax->name ?>][field_sets][<?php echo $field_set->id ?>][selected]" value="true" checked="checked" type="checkbox" class="checkbox" /> <label for="export-taxonomy-<?php echo $tax->name ?>-field-set-<?php echo $field_set->id ?>" class="field-set"><i class="<?php echo $class ?>"></i><?php echo $field_set->display_label() ?></label> <?php $fields = $field_set->fields() ?> <?php if (count($fields)) : ?> <ul class="fields"> <?php foreach ($fields as $field) : ?> <?php if ($type_class = MPFT::type_class($field->type)) : ?> <li class="field"> <input id="ref-taxonomy-<?php echo $tax->name ?>-field-set-<?php echo $field_set->id ?>-field-<?php echo $field->id ?>" name="ref[taxonomies][<?php echo $tax->name ?>][field_sets][<?php echo $field_set->id ?>][fields][<?php echo $field->id ?>]" value="true" type="hidden" /> <input id="export-taxonomy-<?php echo $tax->name ?>-field-set-<?php echo $field_set->id ?>-field-<?php echo $field->id ?>" checked="checked" name="export[taxonomies][<?php echo $tax->name ?>][field_sets][<?php echo $field_set->id ?>][fields][<?php echo $field->id ?>]" value="true" type="checkbox" class="checkbox" /> <label for="export-taxonomy-<?php echo $tax->name ?>-field-set-<?php echo $field_set->id ?>-field-<?php echo $field->id ?>" class="mp-icon-field-type-<?php echo $field->type ?>"><?php echo $field->display_label() ?></label> </li> <?php endif; ?> <?php endforeach; ?> </ul> <?php endif; ?> </li> <?php endforeach; ?> </ul> <?php endif; ?> </li> <?php endif; ?> <?php endforeach; ?> </ul> </div> <!-- /.fsic --> </div> </div> <!-- /.fsi --> <?php if (count($shared_field_sets)) : ?> <div class="fsi"> <div class="fsibv"> <div class="fsit"> <h4 class="shared-field-sets"><i class="metabox-share"></i><?php _e("Shared Field Sets", MASTERPRESS_DOMAIN) ?></h4> <input id="shared-field-sets-check" name="shared-field-sets-all" type="checkbox" class="checkbox" checked="checked" /> </div> <div class="fsic"> <ul class="object-tree shared-field-sets field-sets"> <?php foreach ($shared_field_sets as $field_set) : $class = $field_set->allow_multiple ? 'metabox-add-remove-large' : 'metabox-large'; ?> <li class="field-set<?php echo $class ?>"> <input id="ref-shared-field-set-<?php echo $field_set->id ?>" name="ref[shared_field_sets][<?php echo $field_set->id ?>][selected]" value="true" type="hidden" /> <input id="export-shared-field-set-<?php echo $field_set->id ?>" name="export[shared_field_sets][<?php echo $field_set->id ?>][selected]" value="true" checked="checked" type="checkbox" class="checkbox" /> <label for="export-shared-field-set-<?php echo $field_set->id ?>" class="field-set"><i class="<?php echo $class ?>"></i><?php echo $field_set->display_label() ?></label> <?php $fields = $field_set->fields() ?> <?php if (count($fields)) : ?> <ul class="fields"> <?php foreach ($fields as $field) : ?> <?php if ($type_class = MPFT::type_class($field->type)) : ?> <li class="field"> <input id="ref-shared-field-set-<?php echo $field_set->id ?>-field-<?php echo $field->id ?>" checked="checked" name="ref[shared_field_sets][<?php echo $field_set->id ?>][fields][<?php echo $field->id ?>]" value="true" type="hidden" /> <input id="export-shared-field-set-<?php echo $field_set->id ?>-field-<?php echo $field->id ?>" checked="checked" name="export[shared_field_sets][<?php echo $field_set->id ?>][fields][<?php echo $field->id ?>]" value="true" type="checkbox" class="checkbox" /> <label for="export-shared-field-set-<?php echo $field_set->id ?>-field-<?php echo $field->id ?>" class="mp-icon-field-type-<?php echo $field->type ?>"><?php echo $field->display_label() ?></label> </li> <?php endif; ?> <?php endforeach; ?> </ul> <?php endif; ?> </li> <?php endforeach; ?> </ul> </div> <!-- /.fsic --> </div> </div> <!-- /.fsi --> <?php endif; ?> <?php if (count($site_field_sets)) : ?> <div class="fsi"> <div class="fsibv"> <div class="fsit"> <h4 class="site-field-sets"><i class="sitemap"></i><?php _e("Site Field Sets", MASTERPRESS_DOMAIN) ?></h4> <input id="site-field-sets-check" name="site-field-sets-all" type="checkbox" class="checkbox" checked="checked" /> </div> <div class="fsic"> <ul class="object-tree site-field-sets field-sets"> <?php foreach ($site_field_sets as $field_set) : $class = $field_set->allow_multiple ? 'metabox-add-remove-large' : 'metabox-large'; ?> <li class="field-set<?php echo $class ?>"> <input id="ref-site-field-set-<?php echo $field_set->id ?>" name="ref[site_field_sets][<?php echo $field_set->id ?>][selected]" value="true" type="hidden" /> <input id="export-site-field-set-<?php echo $field_set->id ?>" name="export[site_field_sets][<?php echo $field_set->id ?>][selected]" value="true" checked="checked" type="checkbox" class="checkbox" /> <label for="export-site-field-set-<?php echo $field_set->id ?>" class="field-set"><i class="<?php echo $class ?>"></i><?php echo $field_set->display_label() ?></label> <?php $fields = $field_set->fields() ?> <?php if (count($fields)) : ?> <ul class="fields"> <?php foreach ($fields as $field) : ?> <?php if ($type_class = MPFT::type_class($field->type)) : ?> <li class="field"> <input id="ref-site-field-set-<?php echo $field_set->id ?>-field-<?php echo $field->id ?>" checked="checked" name="ref[site_field_sets][<?php echo $field_set->id ?>][fields][<?php echo $field->id ?>]" value="true" type="hidden" /> <input id="export-site-field-set-<?php echo $field_set->id ?>-field-<?php echo $field->id ?>" checked="checked" name="export[site_field_sets][<?php echo $field_set->id ?>][fields][<?php echo $field->id ?>]" value="true" type="checkbox" class="checkbox" /> <label for="export-site-field-set-<?php echo $field_set->id ?>-field-<?php echo $field->id ?>" class="mp-icon-field-type-<?php echo $field->type ?>"><?php echo $field->display_label() ?></label> </li> <?php endif; ?> <?php endforeach; ?> </ul> <?php endif; ?> </li> <?php endforeach; ?> </ul> </div> <!-- /.fsic --> </div> </div> <!-- /.fsi --> <?php endif; ?> <div class="fsi"> <div class="fsibv"> <div class="fsit"> <h4 class="templates"><i class="template"></i><?php _e("Templates", MASTERPRESS_DOMAIN) ?></h4> <input id="templates-check" name="templates-all" type="checkbox" class="checkbox" checked="checked" /> </div> <div class="fsic"> <ul class="object-tree"> <?php foreach ($templates as $template => $file) : $id = $wf->sanitize($file); ?> <li class="template-<?php echo $id ?>"> <input id="ref-template-<?php echo $wf->sanitize($file) ?>" name="ref[templates][<?php echo $file ?>][selected]" checked="checked" value="true" type="hidden" /> <input id="export-template-<?php echo $wf->sanitize($file) ?>" name="export[templates][<?php echo $file ?>][selected]" checked="checked" value="true" type="checkbox" class="checkbox" /> <label for="export-template-<?php echo $wf->sanitize($file) ?>" class="template"><i class="template"></i><?php echo $template ?></label> <?php $field_sets = MPM_TemplateFieldSet::find_by_template( $file ); ?> <?php if (count($field_sets)) : ?> <ul class="field-sets"> <?php foreach ($field_sets as $field_set) : $class = $field_set->allow_multiple ? 'metabox-add-remove-large' : 'metabox-large'; ?> <li class="field-set<?php echo $class ?>"> <input id="ref-template-<?php echo $id ?>-field-set-<?php echo $field_set->id ?>" name="ref[templates][<?php echo $file ?>][field_sets][<?php echo $field_set->id ?>][selected]" value="true" type="hidden" /> <input id="export-template-<?php echo $id ?>-field-set-<?php echo $field_set->id ?>" checked="checked" name="export[templates][<?php echo $file ?>][field_sets][<?php echo $field_set->id ?>][selected]" value="true" type="checkbox" class="checkbox" /> <label for="export-template-<?php echo $id ?>-field-set-<?php echo $field_set->id ?>" class="field-set"><i class="<?php echo $class ?>"></i><?php echo $field_set->display_label() ?></label> <?php $fields = $field_set->fields(); ?> <?php if (count($fields)) : ?> <ul class="fields"> <?php foreach ($fields as $field) : ?> <?php if ($type_class = MPFT::type_class($field->type)) : ?> <li class="field"> <input id="ref-template-<?php echo $id ?>-field-set-<?php echo $field_set->id ?>-field-<?php echo $field->id ?>" name="ref[templates][<?php echo $file ?>][field_sets][<?php echo $field_set->id ?>][fields][<?php echo $field->id ?>]" value="true" type="hidden" /> <input id="export-template-<?php echo $id ?>-field-set-<?php echo $field_set->id ?>-field-<?php echo $field->id ?>" checked="checked" name="export[templates][<?php echo $file ?>][field_sets][<?php echo $field_set->id ?>][fields][<?php echo $field->id ?>]" value="true" type="checkbox" class="checkbox" /> <label for="export-template-<?php echo $id ?>-field-set-<?php echo $field_set->id ?>-field-<?php echo $field->id ?>" class="mp-icon-field-type-<?php echo $field->type ?>"><?php echo $field->display_label() ?></label> </li> <?php endif; ?> <?php endforeach; ?> </ul> <?php endif; ?> </li> <?php endforeach; ?> </ul> <?php endif; ?> </li> <?php endforeach; ?> </ul> </div> <!-- /.fsic --> </div> </div> <!-- /.fsi --> <div class="fsi"> <div class="fsibv"> <div class="fsit"> <h4 class="roles"><i class="user-role"></i><?php _e("User Roles", MASTERPRESS_DOMAIN) ?></h4> <input id="roles-check" name="roles-all" type="checkbox" class="checkbox" checked="checked" /> </div> <div class="fsic"> <ul class="object-tree"> <?php foreach ($roles as $role) : $id = $role->id() ?> <li> <input id="ref-role-<?php echo $id ?>" name="ref[roles][<?php echo $id ?>][selected]" checked="checked" value="true" type="hidden" /> <input id="export-role-<?php echo $id ?>" name="export[roles][<?php echo $id ?>][selected]" checked="checked" value="true" type="checkbox" class="checkbox" /> <label for="export-role-<?php echo $id ?>" class="role"><i class="user-role"></i><?php echo $role->name ?></label> <?php $field_sets = MPM_RoleFieldSet::find_by_role( $id ) ?> <?php if (count($field_sets)) : ?> <ul class="field-sets"> <?php foreach ($field_sets as $field_set) : $class = $field_set->allow_multiple ? 'metabox-add-remove-large' : 'metabox-large'; ?> <li class="field-set<?php echo $class ?>"> <input id="ref-role-<?php echo $id ?>-field-set-<?php echo $field_set->id ?>" checked="checked" name="ref[roles][<?php echo $id ?>][field_sets][<?php echo $field_set->id ?>][selected]" value="true" type="hidden" /> <input id="export-role-<?php echo $id ?>-field-set-<?php echo $field_set->id ?>" checked="checked" name="export[roles][<?php echo $id ?>][field_sets][<?php echo $field_set->id ?>][selected]" value="true" type="checkbox" class="checkbox" /> <label for="export-role-<?php echo $id ?>-field-set-<?php echo $field_set->id ?>" class="field-set"><i class="<?php echo $class ?>"></i><?php echo $field_set->display_label() ?></label> <?php $fields = $field_set->fields(); ?> <?php if (count($fields)) : ?> <ul class="fields"> <?php foreach ($fields as $field) : ?> <?php if ($type_class = MPFT::type_class($field->type)) : ?> <li class="field"> <input id="ref-role-<?php echo $id ?>-field-set-<?php echo $field_set->id ?>-field-<?php echo $field->id ?>" name="ref[roles][<?php echo $id ?>][field_sets][<?php echo $field_set->id ?>][fields][<?php echo $field->id ?>]" value="true" type="hidden" /> <input id="export-role-<?php echo $id ?>-field-set-<?php echo $field_set->id ?>-field-<?php echo $field->id ?>" checked="checked" name="export[roles][<?php echo $id ?>][field_sets][<?php echo $field_set->id ?>][fields][<?php echo $field->id ?>]" value="true" type="checkbox" class="checkbox" /> <label for="export-role-<?php echo $id ?>-field-set-<?php echo $field_set->id ?>-field-<?php echo $field->id ?>" class="mp-icon-field-type-<?php echo $field->type ?>"><?php echo $field->display_label() ?></label> </li> <?php endif; ?> <?php endforeach; ?> </ul> <?php endif; ?> </li> <?php endforeach; ?> </ul> <?php endif; ?> </li> <?php endforeach; ?> </ul> </div> <!-- /.fsic --> </div> </div> <!-- /.fsi --> </div> <!-- /#export-items --> </div> <!-- /#export-ui --> <?php MPV::form_close() ?> </div> <!-- /#masterplan-export --> <?php endif; ?> <?php if (MasterPress::current_user_can("import_masterplan")) : ?> <div id="masterplan-import" class="tab-panel <?php echo $tab == "import" ? 'current' : '' ?>"> <?php if (!MPV::is_postback()) : ?> <?php MPV::form_open() ?> <div id="import-file-wrap"> <div class="title"> <h4 class="upload"><i class="upload"></i><?php _e("Package Upload", MASTERPRESS_DOMAIN) ?></h4> </div> <!-- /.title --> <label id="label-import_file" for="import_file"><?php _e("Upload a Masterplan zip package to begin.<br /><b>Note:</b> you will be able to review the contents of the package before going ahead with the import.") ?></label> <div id="import-file-uploader" class="file-uploader { allowedExtensions: ['zip'], ids: { drop: 'import_file_drop_area' }, input: '#import_file', inputName: 'import_file_ul', base_url: '<?php echo MASTERPRESS_GLOBAL_CONTENT_URL ?>', params: { dir: 'tmp/' }, limit: 1, lang: { buttonReplace: '<?php _e("Select a Different File…") ?>', buttonChoose: '<?php _e("Choose from Computer…", MASTERPRESS_DOMAIN) ?>'} }"> <div id="import_file_drop_area" class="drop-area"><?php _e("Drop file here to upload", MASTERPRESS_DOMAIN) ?></div> <?php $file_name = __("( None )", MASTERPRESS_DOMAIN); $file_class = "name-none"; ?> <div class="file"> <span class="preview"></span><span data-none="<?php echo __("( None )", MASTERPRESS_DOMAIN) ?>" class="name <?php echo $file_class ?>"><?php echo $file_name ?></span> </div> <input id="import_file" name="import_file" value="" type="hidden" /> <div class="uploader-ui"></div> </div> <!-- /.file-uploader --> </div> <!-- /#import-file-wrap --> <p id="import-fetching-summary"><?php _e("Fetching Masterplan info - Please wait…", MASTERPRESS_DOMAIN); ?></p> <div id="import-confirmation"> <div class="title"> <h4 class="upload"><i class="tick-circle"></i><?php _e("Confirmation", MASTERPRESS_DOMAIN) ?> - <span><?php _e("select import options and review the uploaded package", MASTERPRESS_DOMAIN) ?></span></h4> <button id="button-import" type="submit" class="button-import simple-primary">Import</button> </div> <!-- /.title --> <div class="content"> <div class="f"> <div class="fw"> <input id="import-backup" name="import_backup" value="yes" checked="checked" type="checkbox" class="checkbox" /> <label for="import-backup" class="checkbox"><?php _e("<strong>Backup the existing setup</strong> before importing ( highly recommended )", MASTERPRESS_DOMAIN); ?></label> </div> </div> <!-- /.f --> <div id="f-types-overwrite" class="f"> <div class="fw"> <input id="import-types-overwrite" name="import_types_overwrite" value="yes" checked="checked" type="checkbox" class="checkbox" /> <label for="import-types-overwrite" class="checkbox"><?php _e("<strong>Overwrite</strong> existing field type extensions with those included in the imported package", MASTERPRESS_DOMAIN); ?></label> </div> </div> <!-- /.f --> <div class="f f-mode"> <p> <?php _e("When items are present in the existing setup, but not in the imported Masterplan:", MASTERPRESS_DOMAIN) ?> </p> <div class="fw"> <input id="import-mode-replace" name="import_mode" value="replace" checked="checked" type="radio" class="radio" /> <label for="import-mode-replace" class="radio"><?php _e('Remove the items from the existing setup ( <strong class="replace">completely replace</strong> the existing setup )', MASTERPRESS_DOMAIN); ?></label> </div> <div class="fw"> <input id="import-mode-append" name="import_mode" value="append" type="radio" class="radio" /> <label for="import-mode-append" class="radio"><?php _e('Keep the items in the existing setup ( <strong class="append">append to</strong> the existing setup )', MASTERPRESS_DOMAIN); ?></label> </div> </div> <!-- /.f --> </div> <!-- /.content --> </div> <div id="import-preview" class="import-preview"> <input type="hidden" name="tab" value="import" /> <input id="import-masterplan" type="hidden" name="import_masterplan" value="" /> <?php // build a template list for the importer, since get_page_templates() is not available early in execution foreach (get_page_templates() as $template => $file) : ?> <input name="templates[<?php echo $file ?>]" type="hidden" value="<?php echo $template ?>" /> <?php endforeach; ?> <div id="import-rep"> <div class="fsi post-types"> <div class="fsibv"> <div class="fsit"> <h4 class="post-types"><i class="pin"></i><?php _e("Post Types", MASTERPRESS_DOMAIN) ?></h4> </div> <div class="fsic"> <ul class="object-tree post-types"> </ul> </div> <!-- /.fsic --> </div> </div> <!-- /.fsi --> <div class="fsi taxonomies"> <div class="fsibv"> <div class="fsit"> <h4 class="taxonomies"><i class="tag"></i><?php _e("Taxonomies", MASTERPRESS_DOMAIN) ?></h4> </div> <div class="fsic"> <ul class="object-tree taxonomies"> </ul> </div> <!-- /.fsic --> </div> </div> <!-- /.fsi --> <div class="fsi shared-field-sets"> <div class="fsibv"> <div class="fsit"> <h4 class="shared-field-sets"><i class="metabox-share"></i><?php _e("Shared Field Sets", MASTERPRESS_DOMAIN) ?></h4> </div> <div class="fsic"> <ul class="object-tree shared-field-sets field-sets"> </ul> </div> <!-- /.fsic --> </div> </div> <!-- /.fsi --> <div class="fsi site-field-sets"> <div class="fsibv"> <div class="fsit"> <h4 class="site-field-sets"><i class="sitemap"></i><?php _e("Site Field Sets", MASTERPRESS_DOMAIN) ?></h4> </div> <div class="fsic"> <ul class="object-tree site-field-sets field-sets"> </ul> </div> <!-- /.fsic --> </div> </div> <!-- /.fsi --> <div class="fsi templates"> <div class="fsibv"> <div class="fsit"> <h4 class="templates"><i class="template"></i><?php _e("Templates", MASTERPRESS_DOMAIN) ?></h4> </div> <div class="fsic"> <ul class="object-tree"> </ul> </div> <!-- /.fsic --> </div> </div> <!-- /.fsi --> <div class="fsi roles"> <div class="fsibv"> <div class="fsit"> <h4 class="roles"><i class="user-role"></i><?php _e("User Roles", MASTERPRESS_DOMAIN) ?></h4> </div> <div class="fsic"> <ul class="object-tree"> </ul> </div> <!-- /.fsic --> </div> </div> <!-- /.fsi --> </div> <!-- /#import-rep --> </div> <!-- /#import-summary --> <?php MPV::form_close() ?> <?php else: ?> <?php endif; ?> </div> <!-- /#masterplan-import --> <?php endif; ?> <?php if (MasterPress::current_user_can("backup_masterplan")) : ?> <div id="masterplan-backup" class="masterplan-export tab-panel" style="display: none;"> <ul class="mp-messages"> <li class="notification"><?php _e("Note - this utility does <b>not</b> backup your WordPress content.", MASTERPRESS_DOMAIN) ?></li> </ul> <?php MPV::form_open() ?> <div id="backup-progress" class="progress"> <?php _e("Backing up Masterplan. Please wait…", MASTERPRESS_DOMAIN) ?> </div> <!-- /#backup-progress --> <div id="backup-summary" class="summary"> <div id="backup-message"> <p><?php _e("Backup created successfully", MASTERPRESS_DOMAIN) ?></p> </div> <!-- /#backup-message --> <div id="backup-extras-summary" class="extras-summary"> <p> <?php _e("Note: the following dependent files were included in the Masterplan package", MASTERPRESS_DOMAIN) ?> </p> <div id="backup-extras-icons"> <h4><?php _e("Icons", MASTERPRESS_DOMAIN); ?></h4> <ul> </ul> </div> <!-- /#backup-extras-icons --> <div id="backup-extras-types"> <h4><?php _e("Field Types", MASTERPRESS_DOMAIN); ?></h4> <ul> </ul> </div> <!-- /#backup-extras-field-types --> </div> <!-- /#backup-extras-summary --> </div> <div id="backup-ui"> <div class="title"> <h4 class="package-file"><i class="zip"></i><?php _e("Package File", MASTERPRESS_DOMAIN) ?></h4> <button id="button-backup" type="submit" class="button-export simple-primary">Backup</button> </div> <!-- /.title --> <div id="f-backup-filename" class="f"> <label for="backup_filename"><?php _e("Name:", MASTERPRESS_DOMAIN) ?></label> <div class="fw"> <span id="backup_filename_prefix" class="note">_backup.</span> <input id="backup_filename" spellcheck="false" name="backup_filename" type="text" value="" class="text" /> <input id="backup_filename_suffix" spellcheck="false" name="backup_filename_suffix" type="hidden" value="<?php echo ".".$wf->format_date("[date-time-sortable]") ?>.masterplan.zip" class="text" /> <span id="backup_filename_extension" class="note"><?php echo ".".$wf->format_date("[date-time-sortable]") ?>.masterplan.zip</span> </div> <!-- /.fw --> <p id="backup_note"><?php _e("Use the editable field as a way to tag the backup for reference later ( optional )") ?></p> </div> <!-- /.f --> <div id="backup-readme"> <h4 class="readme"><i class="document-text"></i><?php _e('Read Me<span> - this Markdown-formatted text will be stored in <span class="tt">README.markdown</span> inside the Masterplan backup</span>', MASTERPRESS_DOMAIN); ?></h4> <div id="f-backup_readme"> <textarea id="backup_readme" name="backup_readme"> # Masterplan Backup for <?php echo $wf->sites()->first()->name ?> # + By: <?php echo $wf->the_user()->fullname() ?> + Created: <?php echo $wf->format_date("[date-time-long]") ?> ------------------------------------------------- </textarea> </div> </div> <!-- /#backup-readme --> </div> <?php MPV::form_close() ?> </div> <!-- /#masterplan-backup --> <?php endif; ?> <?php if (MasterPress::current_user_can("restore_masterplan")) : ?> <?php if (count($backups)) : ?> <div id="masterplan-restore" class="tab-panel <?php echo $tab == "restore" ? 'current' : '' ?>"> <?php MPV::form_open() ?> <div class="title"> <h4 class="package-file"><i class="zip"></i><?php _e("Package Selection", MASTERPRESS_DOMAIN) ?> - <span><?php _e("select a backup package to restore from", MASTERPRESS_DOMAIN) ?></span></h4> <button id="button-restore" type="submit" class="button-restore simple-primary">Restore</button> </div> <!-- /.title --> <div id="f-restore-file" class="f"> <label for="restore-masterplan" class="select"><?php _e("File:", MASTERPRESS_DOMAIN) ?></label> <div class="fw"> <select id="restore-masterplan" data-empty="<?php _e("Please Select a Masterplan to restore", MASTERPRESS_DOMAIN) ?>" name="restore_masterplan"> <option value=""><?php _e("Select a backup package") ?></option> <?php foreach ( $backups as $backup ) : ?> <option value="<?php echo $backup["file"] ?>"><?php echo $backup["label"] ?></option> <?php endforeach; ?> </select> </div> <?php MPV::form_close() ?> </div> <!-- /#masterplan-restore --> <?php endif; ?> <?php endif; ?> </div> </div> </div> <!-- /.fs .fs-masterplan --> <?php }