Exemplo n.º 1
0
function bfox_bp_plans_list_readings($schedule_ids, $readings, $args = array())
{
    extract($args);
    if (empty($ref_name)) {
        $ref_name = BibleMeta::name_short;
    }
    if (empty($date_format)) {
        $date_format = 'M j';
    }
    BfoxReadingSchedule::collect_checkbox_ids_start();
    if (!empty($schedule_ids)) {
        ?>
	<ul class="bible-reading-plan-checklist<?php 
        if ($is_item_list) {
            echo ' item-list';
        }
        ?>
">
	<?php 
        foreach ($schedule_ids as $schedule_id) {
            $schedule = BfoxReadingSchedule::schedule($schedule_id);
            ?>
		<?php 
            $plan = $schedule->plan();
            ?>
		<li class="bible-reading-schedule">
			<?php 
            if ($is_item_list) {
                ?>
			<div class="item-avatar">
				<a href="<?php 
                echo $plan->url();
                ?>
"><?php 
                echo $plan->avatar('type=thumb&width=50&height=50');
                ?>
</a>
			</div>

			<div class="item">
				<div class="item-title"><a href="<?php 
                echo $schedule->url($user_id);
                ?>
"><?php 
                echo $schedule->label();
                ?>
</a> <?php 
                _e('by', 'bfox');
                ?>
 <?php 
                echo $plan->owner_name();
                ?>
</div>

				<div class="item-desc"></div>
			<?php 
            } else {
                ?>
				<a href="<?php 
                echo $schedule->url($user_id);
                ?>
"><?php 
                echo $schedule->label();
                ?>
</a>
			<?php 
            }
            ?>

				<ul class="item-reading-list">
				<?php 
            $schedule_readings = $readings[$schedule->revision_id];
            ?>
				<?php 
            if (empty($schedule_readings)) {
                ?>
					<li class="bible-reading"><?php 
                _e('No readings', 'bfox');
                ?>
</li>
				<?php 
            } else {
                ?>
					<?php 
                foreach ($schedule_readings as $reading_id => $reading) {
                    ?>

					<li class="bible-reading">
						<label>
						<?php 
                    if ($show_checks) {
                        echo $schedule->reading_checkbox($reading_id);
                    }
                    ?>
						<?php 
                    echo $schedule->reading_date($reading_id, $date_format) . ':';
                    if ($show_number) {
                        echo ' #' . ($reading_id + 1);
                    }
                    ?>
</label>
						<?php 
                    echo bfox_ref_bible_link(array('ref_str' => $reading->get_string($ref_name), 'disable_tooltip' => true));
                    ?>
					</li>

					<?php 
                }
                ?>
				<?php 
            }
            ?>
				</ul>
			<?php 
            if ($is_item_list) {
                ?>
			</div>
			<?php 
            }
            ?>

		</li>
	<?php 
        }
        ?>
	</ul>
	<?php 
    } else {
        echo '<p>' . __('No Reading Plans found') . '</p>';
    }
    return BfoxReadingSchedule::collect_checkbox_ids_end();
}