Example #1
0
  function manage() {
    
    global $wf;
    
    $info = MasterPress::$view;
    $site = $wf->site();

    if (isset($_GET["updated"])) {
      MPV::notify(__("Content Updated", MASTERPRESS_DOMAIN));
    }
    
    ?>
    
    <?php MPV::messages() ?>

    <?php MPV::form_open() ?>


    <div id="site-content">

    <button id="bt-save-changes-top" type="submit" class="simple-primary"><?php _e("Save Changes", MASTERPRESS_DOMAIN) ?></button>
      
    <?php foreach ($info->sets as $set) : ?>

    <?php if ($set->current_user_can_see()) : ?>

    <input type="hidden" name="mp_meta[__present]" value="1" />
      
    <div id="field-set-<?php echo $set->html_id() ?>" class="postbox nodrag">
      <h3 class="hndle"><em><?php echo $set->display_label() ?></em>
      <?php
      
      if (current_user_can("manage_options")) { ?>
        <a href="<?php echo $set->manage_url() ?>" class="mp-go" title="<?php _e("Manage Field Set") ?>">Manage</a>  
      <?php
      }
      
      ?>  
      </h3>
      <div class="inside">
      <?php MPV_Meta::set($site, $set); ?>
      </div>
    </div>
    
    <?php endif; ?>
  
    <?php endforeach; ?>
      
    </div>
  
    <button type="submit" class="button button-primary"><?php _e("Save Changes", MASTERPRESS_DOMAIN) ?></button>
    <?php MPV::form_close() ?>

    
    
    <?php
  }
Example #2
0
  public static function field_sets($t) {
    
    global $wf;
    $term = self::get_term();
    $sets = self::assigned_field_sets();

    ?>
    
    <tr class="meta-boxes">
      <td colspan="2">
      
      
      <?php foreach ($sets as $set) : ?>

      <?php if ($set->current_user_can_see()) : ?>

      <div id="field-set-<?php echo $set->html_id() ?>" class="postbox nodrag">
        <h3 class="hndle">
          <em><?php echo $set->display_label() ?></em>
          <?php

          if ($set->current_user_can_manage()) { 
            $mu = $set->manage_url();
            
            if ($mu) { ?>
              <a href="<?php echo $mu ?>" class="mp-go with-mptt" data-tooltip="<?php _e("Manage Field Set", MASTERPRESS_DOMAIN) ?>"><?php _e("Manage", MASTERPRESS_DOMAIN) ?></a>  
            <?php
            }

          }
          ?>  
        </h3>
        <div class="inside">
        <?php MPV_Meta::set($term, $set); ?>
        </div>
      </div>
      
      <?php endif; ?>
      
      <?php endforeach; ?>
          
      </td>
    
    </tr>

    <?php

  }
Example #3
0
  public static function field_set_meta_box_content($post, $r) {
    global $wf;
    
    $args = $r["args"];
    $set = $args["set"];

    $the_post = $wf->post($post->ID);

    MPV_Meta::set($the_post, $set);
  }