Example #1
0
function render_posts_table($context)
{
    //dependencies
    $post_type = $context['post_type'];
    $tag = $context['tag'];
    $staged_posts = get_staged_posts($post_type);
    $possible_orphans = $staged_posts;
    $posts = get_posts_data($post_type, $staged_posts);
    $orphans = get_orphans($possible_orphans);
    ?>

	<table class="<?php 
    echo $tag . '-table';
    ?>
 stage-craft-table widefat fixed">
		<thead>
			<?php 
    render_posts_table_header();
    ?>
		</thead>
		<tbody>
		<?php 
    foreach ($posts as $index => $post) {
        $classes = array();
        if ($index % 2 == 0) {
            $classes = array('alternate');
        }
        render_posts_row($post, $classes);
    }
    ?>
		</tbody>
	</table>

	<table class="<?php 
    echo $tag . 'orphans-table';
    ?>
 stage-craft-table widefat fixed">
		<thead>
			<?php 
    render_orphans_table_header();
    ?>
		</thead>
		<tbody>
		<?php 
    foreach ($orphans as $index => $orphan) {
        $classes = array();
        if ($index % 2 == 0) {
            $classes = array('alternate');
        }
        render_orphans_row($orphan, $classes);
    }
    ?>
		</tbody>
	</table>

<?php 
}
Example #2
0
   FROM ' . CATEGORIES_TABLE . '
   WHERE dir IS NULL
 ;';
            $virtual_categories = query2array($query, null, 'id');
            if (!empty($virtual_categories)) {
                $query = '
 SELECT DISTINCT(image_id)
   FROM ' . IMAGE_CATEGORY_TABLE . '
   WHERE category_id IN (' . implode(',', $virtual_categories) . ')
 ;';
                $linked_to_virtual = query2array($query, null, 'image_id');
            }
            $filter_sets[] = array_diff($all_elements, $linked_to_virtual);
            break;
        case 'no_album':
            $filter_sets[] = get_orphans();
            break;
        case 'no_tag':
            $query = '
SELECT
    id
  FROM ' . IMAGES_TABLE . '
    LEFT JOIN ' . IMAGE_TAG_TABLE . ' ON id = image_id
  WHERE tag_id is null
;';
            $filter_sets[] = query2array($query, null, 'id');
            break;
        case 'duplicates':
            $duplicates_on_fields = array('file');
            if (isset($_SESSION['bulk_manager_filter']['duplicates_date'])) {
                $duplicates_on_fields[] = 'date_creation';
Example #3
0
    if ($nb_comments > 0) {
        $template->assign('NB_PENDING_COMMENTS', $nb_comments);
    }
}
// any photo in the caddie?
$query = '
SELECT COUNT(*)
  FROM ' . CADDIE_TABLE . '
  WHERE user_id = ' . $user['id'] . '
;';
list($nb_photos_in_caddie) = pwg_db_fetch_row(pwg_query($query));
if ($nb_photos_in_caddie > 0) {
    $template->assign(array('NB_PHOTOS_IN_CADDIE' => $nb_photos_in_caddie, 'U_CADDIE' => $link_start . 'batch_manager&amp;filter=prefilter-caddie'));
}
// any orphan photo?
$nb_orphans = count(get_orphans());
if ($nb_orphans > 0) {
    $template->assign(array('NB_ORPHANS' => $nb_orphans, 'U_ORPHANS' => $link_start . 'batch_manager&amp;filter=prefilter-no_album'));
}
// +-----------------------------------------------------------------------+
// | Plugin menu                                                           |
// +-----------------------------------------------------------------------+
$plugin_menu_links = trigger_change('get_admin_plugin_menu_links', array());
function UC_name_compare($a, $b)
{
    return strcmp(strtolower($a['NAME']), strtolower($b['NAME']));
}
usort($plugin_menu_links, 'UC_name_compare');
$template->assign('plugin_menu_items', $plugin_menu_links);
// +-----------------------------------------------------------------------+
// | Refresh permissions                                                   |
function draw_team_form() {
	$team_leaders = get_team_leaders();
	$orphans = get_orphans();
	?>
	
	<?php
}