public static function metaboxContent($temp, $group)
{
global $mf_domain;
global $wpdb;
global $post;
global $CUSTOM_WRITE_PANEL;
$mf_post_id = apply_filters('mf_source_post_data', @$_REQUEST['post']);
//we are passing the group_id in the args of the add_meta_box
$group = $group['args'];
//render the elements
$customFields = RCCWP_CustomGroup::GetCustomFields($group->id);
//when will be edit the Post
if (isset($mf_post_id) && count($customFields) > 0) {
//using the first field name we can know
//the order of the groups
$firstFieldName = $customFields[0]->name;
$order = RCCWP_CustomField::GetOrderDuplicates($mf_post_id, $firstFieldName);
?>
<div class="write_panel_wrapper" id="write_panel_wrap_<?php
echo $group->id;
?>
">
<?php
if ($group->duplicate) {
?>
<div class="mf-group-controls">
<div class="mf-group-count"></div>
<div class="buttons">
<a href="#" class="mf-expand-all-button"><?php
_e('Expand All', $mf_domain);
?>
</a>
<a href="#" class="mf-collapse-all-button"><?php
_e('Collapse All', $mf_domain);
?>
</a>
</div>
</div>
<?php
}
?>
<div class="mf-group-save-warning"><?php
_e("Note: to save your changes you must also <strong>Publish</strong> or <strong>Update</strong>", $mf_domain);
//echo $post->post_type;
?>
.</div>
<?php
//build the group duplicates
foreach ($order as $key => $element) {
RCCWP_WritePostPage::GroupDuplicate($group, $element, $key, false);
}
//knowing what is the biggest duplicate group
if (!empty($order)) {
$tmp = $order;
sort($tmp);
$top = $tmp[count($tmp) - 1];
} else {
$top = 0;
}
?>
<input type='hidden' name='g<?php
echo $group->id;
?>
counter' id='g<?php
echo $group->id;
?>
counter' value='<?php
echo $top;
?>
' />
</div>
<?php
} else {
?>
<div class="write_panel_wrapper" id="write_panel_wrap_<?php
echo $group->id;
?>
">
<?php
if ($group->duplicate) {
?>
<div class="mf-group-controls">
<div class="mf-group-count"></div>
<div class="buttons">
<a href="#" class="mf-expand-all-button">Expand All</a>
<a href="#" class="mf-collapse-all-button">Collapse All</a>
</div>
</div>
<?php
}
?>
<div class="mf-group-save-warning"><?php
_e("Note: to save your changes you must also <strong>Publish</strong> or <strong>Update</strong>", $mf_domain);
//echo $post->post_type;
?>
.</div>
<?php
RCCWP_WritePostPage::GroupDuplicate($group, 1, 1, false);
$gc = 1;
?>
<input type='hidden' name='g<?php
echo $group->id;
?>
counter' id='g<?php
echo $group->id;
?>
counter' value='<?php
echo $gc;
?>
' />
</div>
<?php
}
}