Skip to content

Commit

Permalink
Validate article is not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
htmgarcia committed May 4, 2015
1 parent 0035f4a commit be07b98
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 12 deletions.
Binary file removed assets/icon.png
Binary file not shown.
2 changes: 1 addition & 1 deletion en-GB.mod_lastworks.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ MOD_LASTWORKS_JQUERY="Load jQuery"
MOD_LASTWORKS_JQUERY_DESC="Load jQuery. Only when Alternative Layout need it and the template doesn't load."

; Module Layout
MOD_LASTWORKS_NO_ARTICLES_FOUND="You don't have articles."
MOD_LASTWORKS_NO_ARTICLES_FOUND="We don't find articles to show, or there is no category selected."
MOD_LASTWORKS_READMORE="Read more"

; Isotope Alternative Layout
Expand Down
2 changes: 1 addition & 1 deletion helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static function getCategoriesLW( $categories ){
$db = JFactory::getDBO();
$query = 'SELECT * FROM #__categories';
$query .= ' WHERE published = 1';

//categories
$query .= ' AND id IN(' . join( ',', $categories ) . ')';

Expand Down
4 changes: 3 additions & 1 deletion mod_lastworks.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
$jqueryload = $params->get('vgjquery', 0);

//data
$articles = modLastWorksHelper::getArticlesLW( $categories, $filter, $orderingtype, $ordering, $limit );
if( $categories ){
$categories = modLastWorksHelper::getCategoriesLW( $categories );
$articles = modLastWorksHelper::getArticlesLW( $categories, $filter, $orderingtype, $ordering, $limit );
}else{
$articles = null;
}

require JModuleHelper::getLayoutPath( 'mod_lastworks', $layout );
5 changes: 2 additions & 3 deletions mod_lastworks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
<version>2.4.0</version>
<description>
<![CDATA[
<img src='../modules/mod_lastworks/assets/icon.png' style='float:left; margin-right:10px;width:100px;height:100px;' />
Last Works. Show your articles as you wants. <br /><br />
Last Works. Show your articles as you wants.
Add your own Alternative Layouts inside: <em>templates/yourtemplate/html/mod_lastworks/</em> and choose it editing the module in <b>Alternative Layout</b> param. <br />
Info and support: <a href="http://htmgarcia.com" target='_blank'>www.htmgarcia.com</a>
Info and support: <a href="https://joomlatemplat.es/" target='_blank'>joomlatemplat.es</a>
]]>
</description>
<files>
Expand Down
2 changes: 1 addition & 1 deletion tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
}//.ARTICLE LOOP -->

}else{
echo '<div class="alert alert-block">' . JText::_('MOD_LASTWORKS_NO_ARTICLES_FOUND') . '</div>';
echo '<div class="lastworks-alert">' . JText::_('MOD_LASTWORKS_NO_ARTICLES_FOUND') . '</div>';
}

echo '</div>';
2 changes: 1 addition & 1 deletion tmpl/four-columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
echo '</div>';

}else{
echo '<div class="alert alert-block">' . JText::_('MOD_LASTWORKS_NO_ARTICLES_FOUND') . '</div>';
echo '<div class="lastworks-alert">' . JText::_('MOD_LASTWORKS_NO_ARTICLES_FOUND') . '</div>';
}

echo '</div>';
4 changes: 2 additions & 2 deletions tmpl/portfolio.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
echo '</div>';

}else{// .A1
echo '<p class="vg-alert">There are no articles for this module.</p>';

echo '<div class="lastworks-alert">' . JText::_('MOD_LASTWORKS_NO_ARTICLES_FOUND') . '</div>';

}// .A1 -->
echo '</div>';
Expand Down
2 changes: 1 addition & 1 deletion tmpl/three-columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
echo '</div>';

}else{
echo '<div class="alert alert-block">' . JText::_('MOD_LASTWORKS_NO_ARTICLES_FOUND') . '</div>';
echo '<div class="lastworks-alert">' . JText::_('MOD_LASTWORKS_NO_ARTICLES_FOUND') . '</div>';
}

echo '</div>';
2 changes: 1 addition & 1 deletion tmpl/two-columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
echo '</div>';

}else{
echo '<div class="alert alert-block">' . JText::_('MOD_LASTWORKS_NO_ARTICLES_FOUND') . '</div>';
echo '<div class="lastworks-alert">' . JText::_('MOD_LASTWORKS_NO_ARTICLES_FOUND') . '</div>';
}

echo '</div>';

0 comments on commit be07b98

Please sign in to comment.