4 * Arthrology for Elxis CMS 2008.x and 2009.x
6 * Frontend Event Handler
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.' );
23 /******************************************************************************/
24 /* THE CLASS THAT WILL CONTAIN THE COMPONENT'S FRONT-END HTML FUNCTIONALITY */
25 /******************************************************************************/
26 class clsArthrologyHTML
{
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)) {
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
/>
62 <b
><?php
echo $objArthrology->lng
->SRCH_MAG
; ?
>:</b
>
64 <?php
echo mosAdminMenus
::ComponentCategory('catid','com_arthrology'); ?
>
68 <b
><?php
echo $objArthrology->lng
->SRCH_KEYW
; ?
>:</b
>
70 <input type
="text" name
="keyword" value
="" class="inputbox" size
="40" />
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; ?>" />
79 <input type
="submit" value
="<?php echo _E_SEARCH; ?>" title
="<?php echo _E_SEARCH; ?>" class="button" />
89 static public function showResultsHTML($keyword, $catid, $articles, $total, $pageNav) {
90 global $objArthrology, $Itemid; ?
>
92 <h2
class="arthrology_h2">
95 echo $objArthrology->lng
->SRCH_RESULTS
;
96 echo '"<i>'.$keyword.'</i>"';
99 echo $objArthrology->lng
->SRCH_RESULTS
;
100 echo '"<i>'.$articles[0]->cat_name
.'</i>"';
102 echo $objArthrology->lng
->SRCH_RESULTS_ALL
;
109 <table
class="arthrology_printtable">
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
;
121 echo '<a href="javascript:void(0);" onclick="javascript:window.open(\''.$link.'\', \'PrintWindow\', \''.$status.'\');" title="'._CMN_PRINT
.'">'._LEND
;
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
;
153 if ($objArthrology->task
!= 'printlist') {
154 $total_pages = ceil( $pageNav->total
/ $pageNav->limit
);
155 if ($total_pages > 1) { ?
>
156 <div
class="sectiontablefooter">
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);
162 echo $pageNav->writePagesCounter();
169 <div
class="arthrology_searchbox" style
="padding: 5px;">
170 <?php
echo $objArthrology->lng
->SRCH_RESULTS_NONE
; ?
>
174 if ( $objArthrology->task
!= 'printlist' ) {
175 clsArthrologyHTML
::searchScreenHTML();