Permalink
Browse files

adjusting module markup

  • Loading branch information...
dogmatic69 committed Jul 16, 2013
1 parent e8f3216 commit 0f34ebfecd47dcf364659a40df5374a813de1aec
@@ -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)));
@@ -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;
}
}
@@ -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'));
@@ -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;
}
}
@@ -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'],
@@ -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.