On branch master
[arthrology_module.git] / mod_arthrology.php
blob86e9bb03bb0ec62361079aa80feb200cb758c46b
1 <?php
3 /*
4 * Arthrology (module) for Elxis CMS 2008.x/2009.x
6 * @version 1.0
7 * @package Arthrology
8 * @author Apostolos Koutsoulelos <akoutsoulelos@yahoo.gr>
9 * @copyright Copyright (C) 2009 Apostolos Koutsoulelos. All rights reserved.
10 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
11 * @link http://www.elxis-downloads.com/com_downloads/miscellaneous/167.html
15 // Prevent direct inclusion of this file
16 defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
18 // Get globals
19 global $lang;
21 // Includes
22 if ( file_exists($mosConfig_absolute_path.'/modules/mod_arthrology/'.$lang.'.php') ) {
23 require_once( $mosConfig_absolute_path.'/modules/mod_arthrology/'.$lang.'.php' );
24 } else {
25 require_once( $mosConfig_absolute_path.'/modules/mod_eventcalendar/language/english.php' );
28 // Check if module is already declared
29 if (!function_exists('mod_arthrology')) {
31 function mod_arthrology() {
32 global $Itemid, $database, $my, $lang, $mainframe;
34 $menuitem = $Itemid;
35 if ($mainframe->getCfg('sef') != 2) {
36 $access = !$mainframe->getCfg('shownoauth');
37 $query = "SELECT id FROM #__menu WHERE link='index.php?option=com_arthrology' AND published='1'"
38 ."\n AND ((language IS NULL) OR (language LIKE '%".$lang."%'))"
39 .($access ? "\n AND access IN (".$my->allowed.")" : '');
40 $database->setQuery($query, '#__', 1, 0);
41 $menuitem = intval($database->loadResult());
42 if (!$menuitem) { $menuitem = $Itemid; }
45 $seoAction = sefRelToAbs('index.php?option=com_arthrology&task=results&Itemid='.$menuitem, "arthrology/results.html");
48 <div class="searchbox">
49 <form action="<?php echo $seoAction ?>" method="post" name="hmtlForm">
51 <?php echo CX_ARTH_SRCH_ENTER; ?> <br/><br/>
53 <table><tr>
54 <td>
55 <b><?php echo CX_ARTH_SRCH_MAG; ?>:</b>
56 </td><td>
57 <?php echo mosAdminMenus::ComponentCategory('catid','com_arthrology'); ?>
58 </td>
59 </tr><tr>
60 <td>
61 <b><?php echo CX_ARTH_SRCH_KEYW; ?>:</b>
62 </td><td>
63 <input type="text" name="keyword" value="" class="inputbox" size="40" />
64 </td>
65 </tr></table>
67 <input type="hidden" name="option" value="com_arthrology" />
68 <input type="hidden" name="Itemid" value="<?php echo $Itemid; ?>" />
70 <p align="center">
71 <input type="submit" value="<?php echo _E_SEARCH; ?>" title="<?php echo _E_SEARCH; ?>" class="button" />
72 </p>
73 </form>
74 </div>
75 <?php
80 // Get module parameters
82 // Start module
83 mod_arthrology();