Changeset 1102
- Timestamp:
- 04/30/10 11:15:17 (22 months ago)
- Location:
- plugins/apostropheBlogPlugin/trunk
- Files:
-
- 8 modified
-
lib/model/doctrine/PluginaBlogItem.class.php (modified) (3 diffs)
-
lib/model/doctrine/PluginaBlogItemTable.class.php (modified) (3 diffs)
-
modules/aBlog/lib/BaseaBlogActions.class.php (modified) (1 diff)
-
modules/aBlog/templates/_singleColumnTemplate_slot.php (modified) (1 diff)
-
modules/aBlogSingleSlot/actions/components.class.php (modified) (1 diff)
-
modules/aBlogSingleSlot/templates/_normalView.php (modified) (1 diff)
-
modules/aBlogSlot/actions/components.class.php (modified) (1 diff)
-
modules/aBlogSlot/templates/_normalView.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
plugins/apostropheBlogPlugin/trunk/lib/model/doctrine/PluginaBlogItem.class.php
r1066 r1102 95 95 foreach($this->Page->getArea($area) as $slot) 96 96 { 97 if(method_exists($slot, 'get SearchText'))97 if(method_exists($slot, 'getText')) 98 98 { 99 $text .= strip_tags($slot->get Value());99 $text .= strip_tags($slot->getText()); 100 100 } 101 101 } … … 119 119 return $this->getTextForAreas(array($area), $limit); 120 120 } 121 122 public function getMediaForArea($area, $type = null, $limit = null) 123 { 124 return $this->getMediaForAreas(array($area), $type, $limit); 125 } 126 127 /** 128 * Given an array of array this function returns the mediaItems in those areas. 129 * @param aArea $areas 130 * @param $type Set the type of media to return (image, video, pdf, etc...) 131 * @param $limit Limit the number of mediaItems returned 132 * @return array aMediaItems 133 */ 134 public function getMediaForAreas($areas, $type = null, $limit = 9999) 135 { 136 $aMediaItems = array(); 137 foreach($areas as $area) 138 { 139 foreach($this->Page->getArea($area) as $slot) 140 { 141 foreach($slot->MediaItems as $aMediaItem) 142 { 143 if(is_null($type) || $aMediaItem['type'] == $type) 144 { 145 $limit = $limit - 1; 146 $aMediaItems[] = $aMediaItem; 147 if($limit == 0) return $aMediaItems; 148 } 149 } 150 } 151 } 152 return $aMediaItems; 153 } 121 154 122 155 public function getFeedText() … … 125 158 foreach($this->Page->getArea('blog-body') as $slot) 126 159 { 127 if(method_exists($slot, 'get SearchText'))128 { 129 $text .= $slot->get SearchText();160 if(method_exists($slot, 'getText')) 161 { 162 $text .= $slot->getText(); 130 163 } 131 164 } -
plugins/apostropheBlogPlugin/trunk/lib/model/doctrine/PluginaBlogItemTable.class.php
r1022 r1102 48 48 return Doctrine::getTable('aBlogCategory')->addCategoriesForUser($user, $admin, $q); 49 49 } 50 50 51 51 52 public function addCategories(Doctrine_Query $q=null) 52 53 { … … 58 59 } 59 60 61 /** 62 * Given an array of blogItems this function will populate its virtual page 63 * areas with the current slot versions. 64 * @param aBlogItem $blogItems 65 */ 60 66 public static function populatePages($blogItems) 61 67 { … … 69 75 $q = aPageTable::queryWithSlots(); 70 76 $q->whereIn('id', $pageIds); 71 $q->execute(); 77 $pages = $q->execute(); 78 aTools::cacheVirtualPages($pages); 72 79 } 73 80 } -
plugins/apostropheBlogPlugin/trunk/modules/aBlog/lib/BaseaBlogActions.class.php
r1051 r1102 52 52 53 53 $this->pager = $pager; 54 54 55 aBlogItemTable::populatePages($pager->getResults()); 56 55 57 if($this->getRequestParameter('feed', false)) 56 58 { -
plugins/apostropheBlogPlugin/trunk/modules/aBlog/templates/_singleColumnTemplate_slot.php
r990 r1102 1 <?php echo $aBlogPost->getTextForArea('blog-body', 100) ?> 1 <div class="a-blog-post-excerpt"> 2 <?php echo $aBlogPost->getTextForArea('blog-body', $options['excerptLength']) ?> 3 </div> 2 4 5 <div class="a-blog-post-media"> 6 <?php include_component('aSlideshowSlot', 'slideshow', array( 7 'items' => $aBlogPost->getMediaForArea('blog-body', 'image', 1), 8 'id' => 'test', 9 'options' => $options['slideshowOptions'] 10 )) ?> 11 </div> 12 -
plugins/apostropheBlogPlugin/trunk/modules/aBlogSingleSlot/actions/components.class.php
r1053 r1102 26 26 aBlogItemTable::populatePages(array($this->aBlogItem)); 27 27 } 28 $this->options['word_count'] = $this->getOption('word_count', 100); 29 if(!isset($this->options['slideshowOptions'])) 30 $this->options['slideshowOptions'] = array(); 31 32 $this->options['excerptLength'] = $this->getOption('excerptLength', 200); 28 33 } 29 34 } -
plugins/apostropheBlogPlugin/trunk/modules/aBlogSingleSlot/templates/_normalView.php
r1061 r1102 2 2 <?php if (isset($values['blog_item'])): ?> 3 3 <h2><?php echo $aBlogItem['title'] ?></h2> 4 <?php include_partial('aBlog/'.$aBlogItem['template'].'_slot', array('aBlogPost' => $aBlogItem )) ?>4 <?php include_partial('aBlog/'.$aBlogItem['template'].'_slot', array('aBlogPost' => $aBlogItem, 'options' => $options)) ?> 5 5 <?php endif ?> -
plugins/apostropheBlogPlugin/trunk/modules/aBlogSlot/actions/components.class.php
r1021 r1102 31 31 $q->limit($this->values['count']); 32 32 33 if(!isset($this->options['slideshowOptions'])) 34 $this->options['slideshowOptions'] = array(); 35 36 $this->options['excerptLength'] = $this->getOption('excerptLength', 200); 33 37 34 38 $this->aBlogPosts = $q->execute(); -
plugins/apostropheBlogPlugin/trunk/modules/aBlogSlot/templates/_normalView.php
r1019 r1102 15 15 16 16 <div class="a-blog-post-excerpt-container"> 17 <?php include_partial('aBlog/'.$aBlogPost['template'].'_slot', array('aBlogPost' => $aBlogPost )) ?>17 <?php include_partial('aBlog/'.$aBlogPost['template'].'_slot', array('aBlogPost' => $aBlogPost, 'options' => $options)) ?> 18 18 <div class="a-blog-read-more"> 19 19 <?php echo link_to('Read More', 'a_blog_post', $aBlogPost, array('class' => 'a-blog-more')) ?>

