• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List

system/admin/posts_items.php

00001 <?php
00002 namespace Habari;
00003 if ( !defined( 'HABARI_PATH' ) ) { die('No direct access'); }
00004 ?>
00005 <?php if ( count($posts) != 0 ) :
00007   foreach ( $posts as $post ) :
00008     $post_permissions = $post->get_access();
00009 ?>
00010 <div class="item <?php echo $post->statusname; ?>" id="post_<?php echo $post->id; ?>">
00011   <div class="head">
00012     <?php if ( ACL::access_check( $post_permissions, 'delete' ) ) { ?>
00013     <span class="checkbox title">
00014       <input type="checkbox" class="checkbox post_item" name="checkbox_ids[<?php echo $post->id; ?>]" value="<?php echo $post->id; ?>">
00015     </span>
00016     <?php } ?>
00017     <span class="checkbox title">
00018       <?php if ( ACL::access_check( $post_permissions, 'edit' ) ) { ?>
00019         <a href="<?php echo URL::out('display_publish', $post, false); ?>" class="title" title="<?php _e('Edit \'%s\'', array( Utils::htmlspecialchars( $post->title ) ) ) ?>"><?php echo ($post->title == '') ? '&nbsp;' : Utils::htmlspecialchars( $post->title ); ?></a>
00020       <?php } else { ?>
00021         <?php echo ($post->title == '') ? '&nbsp;' : Utils::htmlspecialchars( $post->title ); ?>
00022       <?php } ?>
00023     </span>
00024     <span class="state"><a href="<?php URL::out('admin', array('page' => 'posts', 'type' => $post->content_type, 'status' => $post->status ) ); ?>" title="<?php _e('Search for other %s items', array( MultiByte::ucfirst( Plugins::filter( "post_status_display", $post->statusname ) ) ) ); ?>"><?php echo MultiByte::ucfirst( Plugins::filter( "post_status_display", $post->statusname ) ); ?></a></span>
00025     <span class="author"><span><?php _e('by'); ?></span> <a href="<?php URL::out('admin', array('page' => 'posts', 'user_id' => $post->user_id, 'type' => $post->content_type, 'status' => 'any') ); ?>" title="<?php _e('Search for other items by %s', array( $post->author->displayname ) ) ?>"><?php echo $post->author->displayname; ?></a></span>
00026     <span class="date"><span><?php _e('on'); ?></span> <a href="<?php URL::out('admin', array('page' => 'posts', 'type' => $post->content_type, 'year_month' => $post->pubdate->get('Y-m') ) ); ?>" title="<?php _e('Search for other items from %s', array( $post->pubdate->get( 'M, Y' ) ) ); ?>"><?php $post->pubdate->out( DateTime::get_default_date_format() ); ?></a></span>
00027     <span class="time"><span><?php _e('at'); ?> <?php $post->pubdate->out( DateTime::get_default_time_format()); ?></span></span>
00028 
00029     <?php
00030     $post_actions = FormControlDropbutton::create('post_actions');
00031     $post_actions->append(
00032       FormControlSubmit::create('edit')->set_caption(_t('Edit'))
00033         ->set_url(URL::get( 'display_publish', $post, false ))
00034         ->set_property('title', _t( 'Edit \'%s\'', array( $post->title ) ) )
00035         ->set_enable(function($control) use($post) {
00036           return ACL::access_check( $post->get_access(), 'edit' );
00037         })
00038     );
00039     $post_actions->append(
00040       FormControlSubmit::create('view')->set_caption(_t('View'))
00041         ->set_url($post->permalink . '?preview=1')
00042         ->set_property('title', _t( 'View \'%s\'', array( $post->title ) ) )
00043     );
00044     $post_actions->append(
00045       FormControlSubmit::create('delete')->set_caption(_t('Delete'))
00046         ->set_url('javascript:itemManage.remove('. $post->id . ', \'post\');')
00047         ->set_property('title', _t( 'Delete \'%s\'', array( $post->title ) ) )
00048         ->set_enable(function($control) use($post) {
00049           return ACL::access_check( $post->get_access(), 'delete' );
00050         })
00051     );
00052     Plugins::act('post_actions', $post_actions, $post);
00053     echo $post_actions->pre_out();
00054     echo $post_actions->get($theme);
00055     ?>
00056   </div>
00057 
00058   <span class="content" ><?php echo MultiByte::substr( strip_tags( $post->content ), 0, 250); ?>&hellip;</span>
00059 </div>
00060 
00061 <?php endforeach;
00062 else : ?>
00063 <div class="message none">
00064   <p><?php _e('No posts could be found to match the query criteria.'); ?></p>
00065 </div>
00066 <?php endif; ?>

Generated on Sun Aug 4 2013 12:51:43 for Habari by  doxygen 1.7.1