Committer: Apostolos Koutsoulelos <apostolos@desktop.(none)>
[arthrology.git] / arthrology.html.php
blob4a18b3d9449cf3c8515f165211c0617d15d5e746
1 <?php
3 /*
4 * Arthrology for Elxis CMS 2008.x and 2009.x
6 * Frontend Event Handler
8 * @version 1.3
9 * @package Arthrology
10 * @author Apostolos Koutsoulelos <akoutsoulelos@yahoo.gr>
11 * @authorurl http://www.bitcraft-labs.gr
12 * @copyright Copyright (C) 2009-2011 Apostolos Koutsoulelos. All rights reserved.
13 * @license GNU/GPL (http://www.gnu.org/copyleft/gpl.html)
15 * @link http://www.elxis-downloads.com/downloads/miscellaneous/204.html
18 // Prevent direct inclusion of this file
19 defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
21 // Includes
23 /******************************************************************************/
24 /* THE CLASS THAT WILL CONTAIN THE COMPONENT'S FRONT-END HTML FUNCTIONALITY */
25 /******************************************************************************/
26 class clsArthrologyHTML {
28 /******************/
29 /* Prepare HTML */
30 /******************/
31 static public function prepareHTML() {
32 global $mainframe, $objArthrology;
34 // Print components css information and header inclusions
35 $linktag = '<link href="'.$objArthrology->live_path.'/css/arthrology.css" rel="stylesheet" type="text/css" />';
36 if (mosGetParam( $_REQUEST, 'pop', 0)) {
37 echo $linktag;
38 } else {
39 $mainframe->addCustomHeadTag($linktag);
42 echo '<h1 class="contentheading">'.$objArthrology->lng->GEN_COMPONENT_TITLE.'</h1>';
45 /************************/
46 /* Show search screen */
47 /************************/
48 static public function searchScreenHTML() {
49 global $Itemid, $objArthrology;
51 $menuitem = "&Itemid=".$Itemid;
52 $seoAction = sefRelToAbs('index.php?option=com_arthrology&task=results'.$menuitem, ARTHBASE."/results.html");
55 <div class="arthrology_searchbox">
56 <form action="<?php echo $seoAction ?>" method="post" name="hmtlForm">
58 <?php echo $objArthrology->lng->SRCH_KEYW_ENTER; ?> <br/><br/>
60 <table><tr>
61 <td>
62 <b><?php echo $objArthrology->lng->SRCH_MAG; ?>:</b>
63 </td><td>
64 <?php echo mosAdminMenus::ComponentCategory('catid','com_arthrology'); ?>
65 </td>
66 </tr><tr>
67 <td>
68 <b><?php echo $objArthrology->lng->SRCH_KEYW; ?>:</b>
69 </td><td>
70 <input type="text" name="keyword" value="" class="inputbox" size="40" />
71 </td>
72 </tr></table>
74 <input type="hidden" name="task" value="results" />
75 <input type="hidden" name="option" value="com_arthrology" />
76 <input type="hidden" name="Itemid" value="<?php echo $Itemid; ?>" />
78 <p align="center">
79 <input type="submit" value="<?php echo _E_SEARCH; ?>" title="<?php echo _E_SEARCH; ?>" class="button" />
80 </p>
81 </form>
82 </div>
83 <?php
86 /******************/
87 /* Show results */
88 /******************/
89 static public function showResultsHTML($keyword, $catid, $articles, $total, $pageNav) {
90 global $objArthrology, $Itemid; ?>
92 <h2 class="arthrology_h2">
93 <?php
94 if ($keyword) {
95 echo $objArthrology->lng->SRCH_RESULTS;
96 echo '"<i>'.$keyword.'</i>"';
97 } else {
98 if ($catid) {
99 echo $objArthrology->lng->SRCH_RESULTS;
100 echo '"<i>'.$articles[0]->cat_name.'</i>"';
101 } else {
102 echo $objArthrology->lng->SRCH_RESULTS_ALL;
106 </h2>
107 <br/>
109 <table class="arthrology_printtable">
110 <tr>
111 <td class="left"><?php echo $objArthrology->lng->SRCH_RESULTS_FOUND1; ?><b><?php echo $total ?></b><?php echo $objArthrology->lng->SRCH_RESULTS_FOUND2; ?><br/><br/></td>
112 <?php if ($total) { ?>
113 <td class="right"><?php
114 $image = mosAdminMenus::ImageCheck( 'printButton.png', '/images/M_images/', NULL, NULL, _CMN_PRINT, 'right' );
115 $link = 'index2.php?option=com_arthrology&task=printlist&keyword='.$keyword.'&catid='.$catid;
116 $status = 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no';
118 if ( $objArthrology->task == 'printlist' ) {
119 echo '<a href="javascript:void(0);" onclick="javascript:window.print(); return false" title="'._CMN_PRINT.'">'._LEND;
120 } else {
121 echo '<a href="javascript:void(0);" onclick="javascript:window.open(\''.$link.'\', \'PrintWindow\', \''.$status.'\');" title="'._CMN_PRINT.'">'._LEND;
123 echo $image._LEND;
124 echo '</a> '._LEND;
125 ?></td>
126 <?php } ?>
127 </tr>
128 </table>
130 <?php
131 if ($articles) {
133 $k = 0;
135 echo '<ul class="artrhology_ulist">'._LEND;
136 for ($i = $pageNav->limitstart; $i < (count($articles) + $pageNav->limitstart); $i++) {
137 $article = $articles[$i - $pageNav->limitstart];
139 $out = '<li class="arthrology_row'.$k.'">'._LEND;
140 $out .= '<span class="arthrology_bignum">'.($i+ 1).'</span>'._LEND;
141 $out .= $article->title.' ['.$article->cat_name.' ';
142 $out .= $article->year . '.' . $article->pages . ']' . _LEND;
143 $out .= '<br/><span class="arthrology_ulistinfo">';
144 $out .= '<b>' . $objArthrology->lng->GEN_AUTHOR . ':</b> ' . $article->author . ' - <b>Tags:</b> ' . $article->tags;
145 $out .= '</span>';
146 $out .= '</li>';
148 echo $out;
149 $k = 1 - $k;
151 echo '</ul><br />';
153 if ($objArthrology->task != 'printlist') {
154 $total_pages = ceil( $pageNav->total / $pageNav->limit );
155 if ($total_pages > 1) { ?>
156 <div class="sectiontablefooter">
157 <?php
158 $link = 'index.php?option=com_arthrology&task=results&keyword='.$keyword.'&catid='.$catid.'&Itemid='.$Itemid;
159 $seolink = ARTHBASE.'/results.html?keyword='.$keyword.'&catid='.$catid;
160 echo $pageNav->writePagesLinks($link, $seolink);
161 echo '<br />'._LEND;
162 echo $pageNav->writePagesCounter();
164 </div>
165 <?php
168 } else { ?>
169 <div class="arthrology_searchbox" style="padding: 5px;">
170 <?php echo $objArthrology->lng->SRCH_RESULTS_NONE; ?>
171 </div><br />
172 <?php
174 if ( $objArthrology->task != 'printlist' ) {
175 clsArthrologyHTML::searchScreenHTML();
179 } ?>