Changeset 10671
- Timestamp:
- Feb 6, 2009, 12:39:24 PM (12 years ago)
- Location:
- OpenPNE3/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
OpenPNE3/trunk/apps/pc_frontend/templates/_partsPhotoTable.php
r10426 r10671 1 <?php if (count($options ['list'])): ?>1 <?php if (count($options->list)): ?> 2 2 3 3 <?php 4 $options->setDefault('row', 10);5 4 $options->setDefault('col', 5); 6 5 $options->setDefault('type', 'full'); 6 7 $options->addRequiredOption('pager'); 7 8 ?> 8 9 9 10 <?php ob_start() ?> 10 <?php include_partial('global/pagerRelative', array('pager' => $options ['pager'], 'link_to' => $options->getRaw('link_to_pager'))) ?>11 <?php include_partial('global/pagerRelative', array('pager' => $options->pager, 'link_to' => $options->getRaw('link_to_pager'))) ?> 11 12 <?php $pager = ob_get_flush() ?> 12 13 13 14 <table> 14 <?php $row = ceil(count($options ['list']) / $options['row']) ?>15 <?php $row = ceil(count($options->list) / $options->col) ?> 15 16 <?php for ($i = $j = 1; $row >= $i; $i++): ?> 16 <?php if ($options ['type'] === 'full' || $options['type']=== 'only_image'): ?>17 <?php if ($options->type === 'full' || $options->type === 'only_image'): ?> 17 18 <tr class="photo"> 18 <?php for ($j = ($i * $options ['col']) - $options['col']; ($i * $options['col']) > $j; $j++): ?>19 <td><?php if (!empty($options ['list'][$j])): ?>20 <?php echo link_to(image_tag_sf_image($options ['list'][$j]->getImageFileName(), array('size' => '76x76')), $options['link_to'].$options['list'][$j]->getId()) ?>19 <?php for ($j = ($i * $options->col) - $options->col; ($i * $options->col) > $j; $j++): ?> 20 <td><?php if (!empty($options->list[$j])): ?> 21 <?php echo link_to(image_tag_sf_image($options->list[$j]->getImageFileName(), array('size' => '76x76')), $options->link_to.$options->list[$j]->getId()) ?> 21 22 <?php endif; ?></td> 22 23 <?php endfor; ?> 23 24 </tr> 24 25 <?php endif; ?> 25 <?php if ($options ['type'] === 'full' || $options['type']=== 'only_name'): ?>26 <?php if ($options->type === 'full' || $options->type === 'only_name'): ?> 26 27 <tr class="text"> 27 <?php for ($j = ($i * $options ['col']) - $options['col']; ($i * $options['col']) > $j; $j++): ?>28 <td><?php if (!empty($options ['list'][$j])): ?>29 <?php echo link_to($options ['list'][$j]->getName(), 'member/profile?id='.$options['list'][$j]->getId()) ?>28 <?php for ($j = ($i * $options->col) - $options->col; ($i * $options->col) > $j; $j++): ?> 29 <td><?php if (!empty($options->list[$j])): ?> 30 <?php echo link_to($options->list[$j]->getName(), 'member/profile?id='.$options->list[$j]->getId()) ?> 30 31 <?php endif; ?></td> 31 32 <?php endfor; ?> -
OpenPNE3/trunk/lib/helper/opPartsHelper.php
r10555 r10671 42 42 43 43 include_partial('global/partsLayout', $params); 44 45 $shorts = $params['options']->getShortRequiredOptions(); 46 if ($shorts) 47 { 48 throw new LogicException(sprintf('The %s parts requires the following options: \'%s\'.', $name, implode('\', \'', $shorts))); 49 } 44 50 } 45 51 -
OpenPNE3/trunk/lib/log/opFileLogger.class.php
r10242 r10671 35 35 { 36 36 parent::doLog($message, $priority); 37 chmod($this->file, 0666);37 @chmod($this->file, 0666); 38 38 } 39 39 } -
OpenPNE3/trunk/lib/view/opPartsOptionHolder.class.php
r10349 r10671 19 19 class opPartsOptionHolder extends sfParameterHolder implements ArrayAccess, IteratorAggregate 20 20 { 21 protected $required = array(); 22 21 23 public function __construct($parameters = array()) 22 24 { … … 52 54 } 53 55 56 public function addRequiredOption($name) 57 { 58 $this->required[] = $name; 59 } 60 61 public function getShortRequiredOptions() 62 { 63 $short = array(); 64 65 foreach ($this->required as $name) 66 { 67 if (!$this->has($name)) 68 { 69 $short[] = $name; 70 } 71 } 72 73 return $short; 74 } 75 54 76 public function offsetGet($name) 55 77 {
Note: See TracChangeset
for help on using the changeset viewer.