Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function executeRssBox()
$this->result = @$fetcher->fetch($this->gadget->getConfig('url'), true);
if ($this->result)
{
$this->result[1] = array_slice($this->result[1], 0, 5);
$this->result[1] = array_slice($this->result[1], 0, $this->gadget->getConfig('col'));
}
}
catch (Exception $e)
Expand Down
10 changes: 9 additions & 1 deletion apps/pc_frontend/modules/default/templates/_rssBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@
<div class="partsHeading"><h3><?php echo $gadget->getConfig('title') ? $gadget->getConfig('title') : $result[0]; ?></h3></div>
<div class="block">
<ul class="articleList">
<?php foreach ($result[1] as $entry): ?>
<?php if ($gadget->getConfig('is_show_detail')): ?>
<?php $res = $sf_data->getRaw('result') ?>
<?php else: ?>
<?php $res = $result ?>
<?php endif; ?>
<?php foreach ($res[1] as $entry): ?>
<?php if ('' === $entry['date']): ?>
<?php $dateStr = __("Unknown Day");?>
<?php else: ?>
<?php $dateStr = op_format_date($entry['date'], 'XShortDateJa');?>
<?php endif; ?>
<li><span class="date"><?php echo $dateStr ?></span>
<?php echo link_to($entry['title'], $entry['link']) ?>
<?php if ($gadget->getConfig('is_show_detail')): ?>
<?php echo nl2br($entry['body']) ?>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
Expand Down
16 changes: 16 additions & 0 deletions lib/config/config/gadget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,22 @@ rssBox:
FormType: "input"
ValueType: "text"
IsRequired: false
is_show_detail:
Name: "detail"
Caption: "詳細表示"
FormType: "radio"
ValueType: "int"
IsRequired: true
Default: 1
Choices: {0: "No", 1: "Yes"}
col:
Name: "col"
Caption: "表示件数"
FormType: "select"
ValueType: "int"
IsRequired: true
Default: 3
Choices: {1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, 10: 10}

linkListBox:
caption:
Expand Down
16 changes: 16 additions & 0 deletions lib/config/config/login_gadget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,22 @@ rssBox:
FormType: "input"
ValueType: "text"
IsRequired: false
is_show_detail:
Name: "detail"
Caption: "詳細表示"
FormType: "radio"
ValueType: "int"
IsRequired: true
Default: 1
Choices: {0: "No", 1: "Yes"}
col:
Name: "col"
Caption: "表示件数"
FormType: "select"
ValueType: "int"
IsRequired: true
Default: 3
Choices: {1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, 10: 10}

linkListBox:
caption:
Expand Down
16 changes: 16 additions & 0 deletions lib/config/config/side_banner_gadget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,22 @@ rssBox:
FormType: "input"
ValueType: "text"
IsRequired: false
is_show_detail:
Name: "detail"
Caption: "詳細表示"
FormType: "radio"
ValueType: "int"
IsRequired: true
Default: 1
Choices: {0: "No", 1: "Yes"}
col:
Name: "col"
Caption: "表示件数"
FormType: "select"
ValueType: "int"
IsRequired: true
Default: 3
Choices: {1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, 10: 10}

linkListBox:
caption:
Expand Down