Skip to content

Commit

Permalink
Merge ccf4556 into 3aafd84
Browse files Browse the repository at this point in the history
  • Loading branch information
akagane99 committed Dec 31, 2018
2 parents 3aafd84 + ccf4556 commit ef3b719
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
8 changes: 5 additions & 3 deletions Model/TopicFramesPlugin.php
Expand Up @@ -126,12 +126,14 @@ public function getPlugins($topicFrameSetting, $conditions = []) {
)
), true);

$conditions = Hash::merge(
array($this->alias . '.frame_key' => Current::read('Frame.key')),
$conditions
);
$plugin = $this->find('list', array(
'recursive' => 0,
'fields' => array('Plugin.key', 'Plugin.name'),
'conditions' => array(
$this->alias . '.frame_key' => Current::read('Frame.key'),
),
'conditions' => $conditions,
'order' => 'weight'
));
} else {
Expand Down
13 changes: 11 additions & 2 deletions View/Elements/Topics/header.ctp
Expand Up @@ -8,13 +8,22 @@
* @license http://www.netcommons.org/license.txt NetCommons License
* @copyright Copyright 2014, NetCommons Project
*/
$named = $this->Paginator->params['named'];
$named['page'] = '1';
$url = NetCommonsUrl::blockUrl($named);
?>

<header>
<?php if ($topicFrameSetting['unit_type'] === TopicFrameSetting::UNIT_TYPE_DAYS) : ?>
<?php echo $this->DisplayNumber->dropDownToggleDays(array('currentDays' => $topicFrameSetting['display_days'])); ?>
<?php echo $this->DisplayNumber->dropDownToggleDays(array(
'currentDays' => $topicFrameSetting['display_days'],
'url' => $url
)); ?>
<?php else : ?>
<?php echo $this->DisplayNumber->dropDownToggle(array('currentLimit' => $topicFrameSetting['display_number'])); ?>
<?php echo $this->DisplayNumber->dropDownToggle(array(
'currentLimit' => $topicFrameSetting['display_number'],
'url' => $url
)); ?>
<?php endif; ?>

<?php if (Current::read('User.id')) : ?>
Expand Down
2 changes: 1 addition & 1 deletion View/Elements/Topics/select_status.ctp
Expand Up @@ -18,7 +18,7 @@
<ul class="dropdown-menu" role="menu">
<?php foreach ($options as $key => $label) : ?>
<li>
<?php echo $this->Paginator->link($label, $url + ['status' => $key]); ?>
<?php echo $this->Paginator->link($label, array_merge($url, ['status' => $key])); ?>
</li>
<?php endforeach; ?>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion View/Topics/json/index_plugins.ctp
Expand Up @@ -14,4 +14,4 @@ $pluginKey = $this->request->query['plugin_key'];
echo $this->NetCommonsHtml->json(array(
'paging' => $topics[$pluginKey]['paging'],
'topics' => $this->Topics->camelizeKeyRecursive($topics[$pluginKey]['topics'])
));
), 'OK', 200, false);
2 changes: 1 addition & 1 deletion View/Topics/json/index_rooms.ctp
Expand Up @@ -14,4 +14,4 @@ $roomId = $this->request->query['room_id'];
echo $this->NetCommonsHtml->json(array(
'paging' => $topics[$roomId]['paging'],
'topics' => $this->Topics->camelizeKeyRecursive($topics[$roomId]['topics'])
));
), 'OK', 200, false);

0 comments on commit ef3b719

Please sign in to comment.