OSDN Git Service

Linkの種類追加
[trpgtools-onweb/cake-frame.git] / app / plugins / links / views / elements / link_box.ctp
index 43c8cc3..87fc482 100644 (file)
 
 <div class="boxHeader">
 <h3>
-<?php
-echo __('Links', true);
-
-if (!empty($links)) {
-       echo " - ";
-       echo $linkSelect->get_i18n_type($links[0]['Link']['type'], $type);
+<?php 
+$key = array_search($name, $model_type);
+if ($key !== false) {
+       echo $linkSelect->get_i18n_type($key, $type);
 }
 
 echo $this->Html->tag('span',  
@@ -32,15 +30,17 @@ echo $this->Html->tag('span',
                'controller' => 'links',
                'action' => 'listview',
                'plugin' => 'links',
-               $links[0]['Link']['type']
+               $key
        ), array(
        ))
 );
+
 ?></h3>
 </div>
 <div class="boxBody">
+<?php if (!empty($links[$name])): ?>
 <table class="recentLink">
-<?php foreach($links as $k => $link) : ?>
+<?php foreach($links[$name] as $k => $link) : ?>
 <tr>
 <?php
 $url = array(
@@ -93,12 +93,13 @@ if (!empty($link['Attachment'])) {
 ?></div>
 <div class="infoModified">
 <span><?php echo $this->Html->link($link['User']['name'], array('controller' => 'users', 'action' => 'view', $link['User']['id'])); ?></span>
-(:<span><?php echo $time->niceshort($link['Link']['modified']); ?></span>)
+(<span><?php echo $time->niceshort($link['Link']['modified']); ?></span>)
 </div>
 </td>
 </tr>
 <?php endforeach; ?>
 </table>
+<?php endif; ?>
 </div>
 <div class="boxFooter"><?php if (isset($footer)): ?><?php echo $footer; ?><?php endif; ?></div>
 </div>