Ejemplo n.º 1
0
  public function confirm_delete($post_type) {
    ?>
    <div class="panel delete-panel delete-post-type-panel">
      <?php $this->form_open() ?> 
      <div class="panel-content">
        <header class="title">
          <h1><?php printf( __("Are you sure you want to delete the <em>%s</em> post type? This action is not reversible!", MASTERPRESS_DOMAIN), $post_type->display_label() ); ?></h1>

          <div class="actions">
            <button class="button-primary button-delete" type="submit"><?php _e("Delete", MASTERPRESS_DOMAIN) ?></button>
            <?php echo MPV::action_link("post-types", "manage", __("Cancel", MASTERPRESS_DOMAIN), "id=".$post_type->id, array( "class" => "button" )); ?>
          </div>  

        </header>

        <?php
          $post_count = $post_type->post_count();
          $meta_count = $post_type->meta_count();
          $field_set_count = $post_type->field_set_count();
          
          $not_this_post_type = array();
          
          foreach (MPM_PostType::find(array("orderby" => "_builtin,name")) as $pt) {
            if ($pt->name != $post_type->name) {
              $not_this_post_type[] = $pt;
            }
          }
            
          $dep_count = $post_count + $meta_count + $field_set_count;
          
        ?>
        
        <?php if ( ( $dep_count > 0 ) || $post_type->_external) : ?>

        <div class="panel-divider"><span><span>&nbsp;</span></span></div>
        
        <div class="content">
        
        
          <?php if ($post_type->_external) : ?>
          <p class="soft-warning"><i class="warning-octagon"></i><?php _e("This post type was not created by MasterPress and will not be removed upon deletion if it is still externally defined in a plug-in or theme.", MASTERPRESS_DOMAIN) ?></p>
          <?php endif; ?>

          <?php if ($dep_count > 0) : ?>
            
          <p>
          <?php echo __("This post type has:", MASTERPRESS_DOMAIN) ?>
          </p>
          
          <ul class="items">
          <?php if ($post_count > 0) : ?><li><?php echo MPU::__items($post_count, __("%d post record", MASTERPRESS_DOMAIN), __("%d post records", MASTERPRESS_DOMAIN)) ?></li><?php endif; ?>
          <?php if ($meta_count > 0) : ?><li><?php echo MPU::__items($meta_count, __("%d custom field (meta) data records", MASTERPRESS_DOMAIN), __("%d custom field (meta) data records", MASTERPRESS_DOMAIN)) ?></li><?php endif; ?>
          <?php if ($field_set_count > 0) : ?><li><?php echo MPU::__items($field_set_count, __("%d field set definition", MASTERPRESS_DOMAIN), __("%d field set definitions", MASTERPRESS_DOMAIN)) ?></li><?php endif; ?>
          </ul>
        
          <p>
          <?php _e("Please indicate how you would like to handle this related information upon deletion:", MASTERPRESS_DOMAIN); ?>
          <?php if ($meta_count > 0 && is_multisite()) : ?>
          <?php _e("<br /><b>Note:</b> If you choose to <em>Delete</em> Meta Data, it will only be removed from the <b>current site</b> in your multisite network.", MASTERPRESS_DOMAIN); ?>
          <?php endif; ?>
          </p>
          
          <?php if ($post_count > 0) : ?>
            
          <div id="f-posts" class="f">
            <span class="label label-icon"><i class="pins"></i><?php _e("Existing Posts:", MASTERPRESS_DOMAIN) ?></span>
            <div class="fw">
              <input id="posts_delete" name="posts" type="radio" value="delete" checked="checked" class="radio" /> 
              <label for="posts_delete" class="radio"><?php _e("Delete", MASTERPRESS_DOMAIN) ?></label>
              <input id="posts_reassign" name="posts" type="radio" value="reassign" class="radio" /> 
              <label for="posts_reassign" class="radio with-control"><?php _e("Re-assign to Post Type:", MASTERPRESS_DOMAIN) ?></label>
              <select id="posts_reassign_type" name="posts_reassign_type" class="check { el: '#posts_reassign' }">
              <?php foreach ($not_this_post_type as $pt) : ?>
              <?php if ($pt->name != $post_type->name): ?>
              <option value="<?php echo $pt->name ?>"><?php echo $pt->display_label() ?></option>  
              <?php endif; ?>
              <?php endforeach; ?>
              </select>
              <input id="posts_trash" name="posts" type="radio" value="trash" class="radio" /> 
              <label for="posts_trash" class="radio"><?php _e("Trash", MASTERPRESS_DOMAIN) ?></label>
              <input id="posts_keep" name="posts" type="radio" value="keep" class="radio" /> 
              <label for="posts_keep" class="radio"><?php _e("Keep", MASTERPRESS_DOMAIN) ?></label>
              
            </div>
            <!-- /.fw -->

            <div class="fw">
            </div>
            <!-- /.fw -->

          </div>
          <!-- /.f -->
          
          <?php endif; ?>
          
          <?php if ($field_set_count > 0) : ?>
          
          <div class="f">
            <span class="label label-icon"><i class="metaboxes"></i><?php _e("Field Set Definitions:", MASTERPRESS_DOMAIN) ?></span>
            <div class="fw">
              <input id="field_sets_delete" name="field_sets" type="radio" value="delete" checked="checked" class="radio" /> 
              <label id="label_field_sets_delete" for="field_sets_delete" class="radio"><?php _e("Delete <span>&nbsp;(Shared Field Sets will not be deleted)</span>", MASTERPRESS_DOMAIN) ?></label>
              <input id="field_sets_keep" name="field_sets" type="radio" value="keep" disabled="disabled" class="radio" /> 
              <label id="label_field_sets_keep" for="field_sets_keep" title="<?php _e("Re-attach by creating a post type with the same name", MASTERPRESS_DOMAIN) ?>" class="disabled radio with-tooltip"><?php _e("Keep", MASTERPRESS_DOMAIN); ?></label>
              
            </div>
            <!-- /.fw -->
          </div>
          <!-- /.f -->

          <?php endif; ?>

          <?php if ($meta_count > 0) : ?>
          

          <div class="f">
            <span class="label label-icon"><i class="database"></i><?php _e("Meta Data:", MASTERPRESS_DOMAIN) ?></span>
            <div class="fw">
              <input id="field_data_delete" name="field_data" type="radio" value="delete" class="radio" checked="checked" /> 
              <label id="label_field_data_delete" for="field_data_delete" class="radio"><?php _e("Delete", MASTERPRESS_DOMAIN) ?></label>
              <input id="field_data_keep" name="field_data" type="radio" value="keep" class="radio" /> 
              <label id="label_field_data_keep" for="field_data_keep" title="stored in the post meta table" class="radio with-tooltip"><?php _e("Keep", MASTERPRESS_DOMAIN) ?></label>

            </div>
            <!-- /.fw -->
          </div>
          <!-- /.f -->

          <?php endif; ?>

          <?php endif; ?>
        
        </div>
        <!-- /.content -->

        <?php endif; ?>
      

        <!-- /.title -->
      </div>
      <!-- /.panel-content -->

      </form>
    </div>
    
    <?php
  }
Ejemplo n.º 2
0
 public function confirm_delete($field_set) {
   MPV::incl("field-sets");
   $info = MasterPress::$view;
   $parent = $info->parent;
   MPV_FieldSets::confirm_delete_panel($field_set, __("Shared Field Set", MASTERPRESS_DOMAIN), MPV::action_link("shared-field-sets", "manage", __("Cancel", MASTERPRESS_DOMAIN), "", array( "class" => "button button-small primary" )) );
 }
Ejemplo n.º 3
0
 public function confirm_delete_field($field) {
   $info = MasterPress::$view;
   $parent = $info->parent;
   MPV_FieldSets::confirm_delete_field_panel($field, __("Field", MASTERPRESS_DOMAIN), MPV::action_link("post-types", "manage-field-sets", __("Cancel", MASTERPRESS_DOMAIN), "parent=".$parent->id, array( "class" => "button button-small primary" )) );
 }