Skip to content

Commit

Permalink
adjusting module markup
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Jul 16, 2013
1 parent e8f3216 commit 0f34ebf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
11 changes: 6 additions & 5 deletions Core/Contents/View/Elements/modules/latest/module.ctp
Expand Up @@ -4,6 +4,9 @@ $config = array_merge(array(
'limit' => 5,
'truncate' => 60,
), $config);
if (!empty($config['id'])) {
$config['model']= $config['id'];
}

if (isset($config['model']) && $config['model'] === '1') {
$config['model'] = implode('.', current(array_values($this->request->models)));
Expand All @@ -18,7 +21,7 @@ if (isset($config['category']) && $config['category'] === '1') {

if (!empty($config['model'])) {
list($plugin,) = pluginSplit($config['model']);
if ($plugin != $this->plugin) {
if ($plugin != $this->plugin && empty($config['id'])) {
return;
}
}
Expand Down Expand Up @@ -68,10 +71,8 @@ foreach ($latestContents as &$latestContent) {
}

echo $this->Html->tag('div', implode('', array(
$this->Html->tag('div', $config['title'], array(
'class' => 'title_bar'
)),
$this->Html->tag('h4', $config['title']),
$this->Design->arrayToList($latestContents, array(
'div' => 'content'
))
)), array('class' => 'side_box'));
)), array('class' => 'span3'));
13 changes: 9 additions & 4 deletions Core/Contents/View/Elements/modules/tag_cloud/module.ctp
Expand Up @@ -8,10 +8,12 @@ $config = array_merge(array(
'tag_after' => '</li>',
'box' => true
), $config);

if (!empty($config['id']) && strstr($config['id'], '.') !== false) {
$config['model'] = $config['id'];
}
if (!empty($config['model'])) {
list($plugin,) = pluginSplit($config['model']);
if (Inflector::underscore($plugin) != $this->request->plugin) {
if (Inflector::underscore($plugin) != $this->request->plugin && empty($config['id'])) {
return;
}
}
Expand All @@ -24,6 +26,9 @@ if (empty($tags) && !empty($config['tags'])) {
$tags = $config['tags'];
}
if (empty($tags)) {
if (!empty($config['id']) && (!is_int($config['id']) || strlen($config['id']) !== 36)) {
unset($config['id']);
}
$tags = ClassRegistry::init('Blog.BlogPost')->GlobalTagged->find('cloud', array(
'limit' => $config['limit'],
'model' => $config['model'],
Expand Down Expand Up @@ -69,6 +74,6 @@ if (!$config['box']) {
}

echo $this->Html->tag('div', implode('', array(
$this->Html->tag('div', $config['title'], array('class' => 'title_bar')),
$this->Html->tag('h4', $config['title']),
$this->Html->tag('div', $tags, array('class' => 'content'))
)),array('class' => 'side_box'));
)),array('class' => 'span3'));

0 comments on commit 0f34ebf

Please sign in to comment.