diff --git a/oss/joomla/trunk/modules/index.html b/oss/joomla/trunk/modules/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_apoll/helper.php b/oss/joomla/trunk/modules/mod_apoll/helper.php
new file mode 100644
index 00000000..0f4879e3
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_apoll/helper.php
@@ -0,0 +1,126 @@
+nameQuote('#__apoll_options') . " AS o " .
+ " WHERE o.apoll_id = " . (int) $apoll_id .
+ " AND o.text <> ''" .
+ " ORDER BY o.ordering"
+ ;
+
+ $db->setQuery($query);
+
+ if (!($options = $db->loadObjectList())) {
+ echo "helper ".$db->stderr();
+ return;
+ }
+
+ return $options;
+ }
+ // checks if user has voted (if cookie is set)
+ function alreadyVoted($id) {
+
+ global $mainframe;
+
+ $cookieName = JUtility::getHash( $mainframe->getName() . 'apoll' . $id );
+ $voted = JRequest::getVar( $cookieName, '0', 'COOKIE', 'INT');
+
+ return $voted;
+ }
+
+ function userVoted($user_id, $apoll_id) {
+ $db =& JFactory::getDBO();
+ $query = "SELECT date FROM ".$db->nameQuote('#__apoll_votes')
+ ." WHERE apoll_id=".(int) $apoll_id
+ ." AND user_id=".(int)$user_id
+ ;
+ $db->setQuery($query);
+
+ return $userVoted=($db->loadResult())?1:0;
+ }
+
+ function ipVoted($apoll_id) {
+ $db =& JFactory::getDBO();
+ $ip = $_SERVER['REMOTE_ADDR'];
+$query = "SELECT ip FROM ".$db->nameQuote('#__apoll_votes')
+ ."WHERE apoll_id=".(int) $apoll_id."
+ AND ip = INET_ATON('".$ip."')"
+ ;
+ $db->setQuery($query);
+
+ return $ipVoted=($db->loadResult()) ? 1:0;
+ }
+
+ function getResults($apoll_id) {
+
+ $db =& JFactory::getDBO();
+ $query = "SELECT o.*, COUNT(v.id) AS hits,
+ (SELECT COUNT(id) FROM ".$db->nameQuote('#__apoll_votes')." WHERE apoll_id=".$apoll_id.") AS votes
+ FROM ".$db->nameQuote('#__apoll_options')." AS o
+ LEFT JOIN ".$db->nameQuote('#__apoll_votes')." AS v
+ ON (o.id = v.option_id AND v.apoll_id = ".(int)$apoll_id . ")
+ WHERE o.apoll_id=".(int)$apoll_id ."
+ AND o.text <> ''
+ GROUP BY o.id
+ ORDER BY o.ordering";
+
+ $db->setQuery($query);
+
+ return $db->loadObjectList();
+ }
+
+ function getActivePolls() {
+ $db =& JFactory::getDBO();
+ $query = "SELECT id FROM ".$db->nameQuote('#__apoll_polls') .
+ " WHERE published = 1";
+ $db->setQuery($query);
+ if ($ids = $db->loadResultArray()) {
+ return $ids;
+ } else {
+ return false;
+ }
+ }
+
+ function getItemid($apoll_id) {
+
+ $component =& JComponentHelper::getComponent('com_apoll');
+ $menus =& JApplication::getMenu('site', array());
+ $items = $menus->getItems('componentid', $component->id);
+ $match = null;
+ $itemid = null;
+
+ if (isset($items)) {
+ foreach ($items as $item) {
+ if ((@$item->query['view'] == 'apoll') && (@$item->query['id'] == $apoll_id)) {
+ $itemid = $item->id;
+ break;
+ }
+ }
+ }
+ return '&Itemid='.$itemid;
+ }
+}
+?>
diff --git a/oss/joomla/trunk/modules/mod_apoll/index.html b/oss/joomla/trunk/modules/mod_apoll/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_apoll/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_apoll/mod_apoll.php b/oss/joomla/trunk/modules/mod_apoll/mod_apoll.php
new file mode 100644
index 00000000..b3a70692
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_apoll/mod_apoll.php
@@ -0,0 +1,188 @@
+getItems('link', 'index.php?option=com_apoll&view=apoll');
+$itemid = isset($items[0]) ? '&Itemid='.$items[0]->id : '';
+$details = "";
+
+$apoll_id = $params->get( 'id', 0 );
+//if Show random poll is selected
+if (!$apoll_id) {
+ $ids = modApollHelper::getActivePolls();
+
+ if (count($ids) > 1) {
+ $apoll_id = $ids[array_rand($ids)];
+ } else {
+ $apoll_id = $ids[0];
+ }
+}
+
+$results = modApollHelper::getResults($apoll_id);
+//print_r($results); exit;
+//get the component params
+JTable::addIncludePath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_apoll'.DS.'tables');
+$apoll =& JTable::getInstance('apoll', 'Table');
+$apoll->load( $apoll_id );
+$apollParams = new JParameter($apoll->params);
+//merge them with the module params
+$params->merge($apollParams, $params);
+
+$slug = ($apoll->alias=='')? $apoll->id : $apoll->id.":".$apoll->alias;
+// check if cookie is set showing that the user has voted for this poll
+$voted = modApollHelper::alreadyVoted($apoll_id);
+// check if the registrated user has voted and if user has logged in
+$user =& JFactory::getUser();
+$userVoted = modApollHelper::userVoted($user->id, $apoll_id);
+$guest = $user->guest;
+// check if this ip has been recorder
+$ipVoted = modApollHelper::ipVoted($apoll_id);
+//reset the var display_poll
+$display_poll = 0;
+
+//check the start time and the end of poll
+global $mainframe;
+$date = &JFactory::getDate();
+$date->setOffset($mainframe->getCfg('offset'));
+$now = $date->toFormat();
+
+if(($now>$apoll->publish_up) && ($now<$apoll->publish_down)) {
+ $display_submit = 1;
+
+ // if only registered users can vote
+ if ($params->get('only_registered')) {
+ //if the user is not a guest
+ if(!$guest) {
+ //if only one vote is allowed per logged user
+ if($params->get('one_vote_per_user')) {
+ //check if user has voted
+ if($userVoted) {
+ //display the poll with disabled options
+ $display_submit = 0;
+ $msg = "You have already voted.";
+ $details = JText::_("Only one vote per user is allowed.");
+ //user has not voted yet
+ } else {
+ //display the poll
+ $display_poll = 1;
+ $display_submit = 1;
+ $msg = "";
+ }
+ // if loggedin user are allowed to vote unlimited times
+ } else {
+ // Check the cookie
+ if($voted) {
+ $display_poll = 0;
+ $display_submit = 0;
+ $msg = "You have already voted.";
+ $details = JText::sprintf("Only one vote each %u hours is allowed.", $apoll->lag/60);
+
+ //hm check the ip please but only if allowed to do that
+ } elseif ($params->get('ip_check')) {
+ if($ipVoted) {
+ //display the poll with disabled options
+ $display_poll = 0;
+ $display_submit = 0;
+ $msg = "You have already voted.";
+ $details = JText::_("Only one vote per IP is allowed.");
+ //if user's ip has not been logged
+ }
+ //if user has not voted
+ } else {
+ //display the poll
+ $display_poll = 1;
+ $display_submit = 1;
+ $msg = "";
+ }
+ }
+ //if the user has not logged in
+ } else {
+ //display message please log in
+ $display_poll = 1;
+ $display_submit = 0;
+ $msg = "Please register to vote";
+ }
+ // if anybody can vote
+ } else {
+ //if user has voted, according to the cookie check
+ if($voted) {
+ //display the poll with disabled options or the results
+ $display_poll = ($params->get('if_voted'))? 1:0;
+ $display_submit = 0;
+ $msg = "You have already voted.";
+ $details = JText::sprintf("Only one vote each %u hours is allowed.", $apoll->lag/60);
+ //if user has not voted according to the cookie
+ } else {
+ //hm check the ip please but only if allowed to do that
+ if ($params->get('ip_check')) {
+ if($ipVoted) {
+ //display the poll with disabled options
+ $display_poll = ($params->get('if_voted'))? 1:0;
+ $display_submit = 0;
+ $msg = "You have already voted.";
+ $details = JText::_("Only one vote per IP is allowed.");
+ //if user's ip has not been logged
+ } else {
+ //display the poll
+ $display_poll = 1;
+ $display_submit = 1;
+ $msg = "";
+ }
+ //if we are not allowed to do the ip check
+ } else {
+ //display the poll
+ $display_poll = 1;
+ $display_submit = 1;
+ $msg = "";
+ }
+ }
+ }
+
+} else {
+ $display_submit = 0;
+ $msg = JText::_("The voting for this poll has not started yet.")." ";
+ $publish_up = JFactory::getDate($apoll->publish_up);
+ $details = JText::_("It will start on:")." ".$publish_up->toFormat($params->get('msg_date_format'));
+}
+//if deadline has passed change the msg
+if($now>$apoll->publish_down) {
+ $display_poll = 0;
+ $msg = "The voting for this poll has ended"." ";
+ $publish_down = JFactory::getDate($apoll->publish_down);
+ $details = JText::_("on:")." ".$publish_down->toFormat($params->get('msg_date_format'));
+}
+
+$disabled = ($display_submit)? '':'disabled="disabled"';
+//if show messages is set to no, reset all messages
+//if(!$params->get('show_msg')) {$msg =' ';}
+
+if ( $apoll && $apoll->id ) {
+ $layout = JModuleHelper::getLayoutPath('mod_apoll');
+ $tabcnt = 0;
+ $options = modApollHelper::getApollOptions($apoll_id);
+ $itemid = modApollHelper::getItemid($apoll_id);
+
+ require($layout);
+
+}
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_apoll/mod_apoll.xml b/oss/joomla/trunk/modules/mod_apoll/mod_apoll.xml
new file mode 100644
index 00000000..47f46f8c
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_apoll/mod_apoll.xml
@@ -0,0 +1,86 @@
+
+
+
+ Apoll
+ Hristo Genev
+ October 2009
+ Copyright (C) 2009
+ http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
+ harrygg@gmail.com
+ http://www.afactory.org
+ 2.1.005
+ Apoll module for voting
+
+
+ mod_apoll.php
+ index.html
+ helper.php
+ tmpl
+
+
+ en-GB.mod_apoll.ini
+
+
+
+
+
+
+
+
+ Yes
+ NO
+
+
+
+ Yes
+ NO
+
+
+
+
+
+ Yes
+ NO
+
+
+
+
+
+
+
+
+ Yes
+ NO
+
+
+ Yes
+ NO
+
+
+
+ Yes
+ NO
+
+
+
+ Yes
+ NO
+
+
+ Yes
+ NO
+
+
+ Yes
+ NO
+
+
+
+
+
+ Use global
+ No caching
+
+
+
+
diff --git a/oss/joomla/trunk/modules/mod_apoll/tmpl/default.php b/oss/joomla/trunk/modules/mod_apoll/tmpl/default.php
new file mode 100644
index 00000000..ccf51f55
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_apoll/tmpl/default.php
@@ -0,0 +1,188 @@
+addStyleDeclaration("div#apoll_loading_".$apoll->id." {
+ background: url(media/system/images/mootree_loader.gif) 0% 50% no-repeat;
+ width:100%;
+ height:20px;
+ padding: 4px 0 0 20px;
+}
+");
+?>
+
+
+
+get('show_poll_title')) : ?>
+
title; ?>
+
+
+
"; ?>
+
+
+get('ajax')) {
+// add mootools
+JHTML::_('behavior.mootools');
+
+$updateValue = '';
+
+for ($i=0; $i
get('only_one_color')) {
+ $background_color = $params->get('apoll_bars_color');
+ } else {
+ $background_color = "' + options.item($i).attributes[3].nodeValue + '";
+ }
+
+ $updateValue .= "' + text.item($i).firstChild.nodeValue + ' - ' + options.item($i).attributes[1].nodeValue + '%
get('apoll_bars_border_color').";\">
";
+}
+
+ if($params->get('show_total')) {
+ $updateValue .= "".JText::_('Total votes')." : ' + voters.item(0).firstChild.nodeValue + '";
+ }
+$js = "
+/* id."').addEvent('submit', function(e) {
+ // Prevent the submit event
+ new Event(e).stop();
+
+ var options = $('apoll_vote_".$apoll->id."').getElements('input[name=voteid]');
+
+ var nothing_selected = 1;
+ options.each(function(item, index){
+ if(item.checked==1) {nothing_selected = 0;}
+ });
+ if (nothing_selected) {
+ alert('".JText::_('Please select an option')."');
+ return false;
+ } else {
+
+ $('submit_vote_".$apoll->id."').disabled = 1;
+ $('apoll_loading_".$apoll->id."').setStyle('display','');
+
+ // Update the page
+ this.send({
+ onComplete: function(response, responseXML)
+ {
+ // get the XML nodes
+ var root = responseXML.documentElement;
+ var options = root.getElementsByTagName('option');
+ var text = root.getElementsByTagName('text');
+ //var percentages = root.getElementsByTagName('percentages');
+ var voters = root.getElementsByTagName('voters');
+
+ // prepare the XHTML
+ var updateValue = '".$updateValue."';
+
+ // update the page element 'update'
+ //$('apolldiv_".$apoll->id."').removeClass('ajax-loading');
+ $('apolldiv_".$apoll->id."').empty().setHTML(updateValue);
+ var apollSlide = new Fx.Slide('apoll_comp_form');
+ apollSlide.slideOut();
+ }});
+ }
+ });
+ });/* ]]> */";
+
+
+$document->addScriptDeclaration( $js );
+
+
+}
+//If user has voted
+ } else {
+
+ foreach ($results as $row) :
+ $percent = ($row->votes)? round((100*$row->hits)/$row->votes, 1):0;
+ $width = ($percent)? $percent:2;
+ if($params->get('only_one_color'))
+ $background_color = $params->get('apoll_bars_color');
+ else
+ $background_color = $row->color; ?>
+
+
+
text." - ".$percent; ?>%
+
+
+get('show_total'))
+ echo "".JText::_('Total votes')." : ".$row->votes;
+
+ if($params->get('show_msg')) :
+ echo ''.JText::_($msg);
+ if($params->get('show_detailed_msg')) {
+ echo " ".$details;
+ }
+ echo '
';
+ endif;
+ } ?>
+
+
+
+get('show_view_details')) || ($params->get('rel_article_window'))) { ?>
+
+
+ get('show_view_details')) : ?>
+
+
+
+ get('show_rel_article')) : ?>
+
+ >'); ?>
+
+
+
+
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_apoll/tmpl/index.html b/oss/joomla/trunk/modules/mod_apoll/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_apoll/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_archive/helper.php b/oss/joomla/trunk/modules/mod_archive/helper.php
new file mode 100644
index 00000000..2ac2a221
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_archive/helper.php
@@ -0,0 +1,53 @@
+setQuery($query, 0, intval($params->get('count')));
+ $rows = $db->loadObjectList();
+
+ $menu = &JSite::getMenu();
+ $item = $menu->getItems('link', 'index.php?option=com_content&view=archive', true);
+ $itemid = isset($item) ? '&Itemid='.$item->id : '';
+
+ $i = 0;
+ $lists = array();
+ foreach ( $rows as $row )
+ {
+ $date =& JFactory::getDate($row->created);
+
+ $created_month = $date->toFormat("%m");
+ $month_name = $date->toFormat("%B");
+ $created_year = $date->toFormat("%Y");
+
+ $lists[$i]->link = JRoute::_('index.php?option=com_content&view=archive&year='.$created_year.'&month='.$created_month.$itemid);
+ $lists[$i]->text = $month_name.', '.$created_year;
+ $i++;
+ }
+ return $lists;
+ }
+}
diff --git a/oss/joomla/trunk/modules/mod_archive/index.html b/oss/joomla/trunk/modules/mod_archive/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_archive/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_archive/mod_archive.php b/oss/joomla/trunk/modules/mod_archive/mod_archive.php
new file mode 100644
index 00000000..97299a92
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_archive/mod_archive.php
@@ -0,0 +1,23 @@
+def('count', 10);
+$list = modArchiveHelper::getList($params);
+
+require(JModuleHelper::getLayoutPath('mod_archive'));
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_archive/mod_archive.xml b/oss/joomla/trunk/modules/mod_archive/mod_archive.xml
new file mode 100644
index 00000000..349605b6
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_archive/mod_archive.xml
@@ -0,0 +1,26 @@
+
+
+ Archived Content
+ Joomla! Project
+ July 2006
+ (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
+ admin@joomla.org
+ www.joomla.org
+ 1.5.0
+ DESCARCHIVE
+
+ mod_archive.php
+
+
+
+
+
+
+
+
+ Use global
+ No caching
+
+
+
diff --git a/oss/joomla/trunk/modules/mod_archive/tmpl/default.php b/oss/joomla/trunk/modules/mod_archive/tmpl/default.php
new file mode 100644
index 00000000..a08ccd3b
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_archive/tmpl/default.php
@@ -0,0 +1,10 @@
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_archive/tmpl/index.html b/oss/joomla/trunk/modules/mod_archive/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_archive/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_banners/helper.php b/oss/joomla/trunk/modules/mod_banners/helper.php
new file mode 100644
index 00000000..164ae1a4
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_banners/helper.php
@@ -0,0 +1,128 @@
+get( 'cid' );
+ $vars['catid'] = (int) $params->get( 'catid' );
+ $vars['limit'] = (int) $params->get( 'count', 1 );
+ $vars['ordering'] = $params->get( 'ordering' );
+
+ if ($params->get( 'tag_search' ))
+ {
+ $document =& JFactory::getDocument();
+ $keywords = $document->getMetaData( 'keywords' );
+
+ $vars['tag_search'] = BannerHelper::getKeywords( $keywords );
+ }
+
+ $banners = $model->getList( $vars );
+ $model->impress( $banners );
+
+ return $banners;
+ }
+
+ function getModel()
+ {
+ if (!class_exists( 'BannersModelBanner' ))
+ {
+ // Build the path to the model based upon a supplied base path
+ $path = JPATH_SITE.DS.'components'.DS.'com_banners'.DS.'models'.DS.'banner.php';
+ $false = false;
+
+ // If the model file exists include it and try to instantiate the object
+ if (file_exists( $path )) {
+ require_once( $path );
+ if (!class_exists( 'BannersModelBanner' )) {
+ JError::raiseWarning( 0, 'Model class BannersModelBanner not found in file.' );
+ return $false;
+ }
+ } else {
+ JError::raiseWarning( 0, 'Model BannersModelBanner not supported. File not found.' );
+ return $false;
+ }
+ }
+
+ $model = new BannersModelBanner();
+ return $model;
+ }
+
+ function renderBanner($params, &$item)
+ {
+ $link = JRoute::_( 'index.php?option=com_banners&task=click&bid='. $item->bid );
+ $baseurl = JURI::base();
+
+ $html = '';
+ if (trim($item->custombannercode))
+ {
+ // template replacements
+ $html = str_replace( '{CLICKURL}', $link, $item->custombannercode );
+ $html = str_replace( '{NAME}', $item->name, $html );
+ }
+ else if (BannerHelper::isImage( $item->imageurl ))
+ {
+ $image = ' ';
+ if ($item->clickurl)
+ {
+ switch ($params->get( 'target', 1 ))
+ {
+ // cases are slightly different
+ case 1:
+ // open in a new window
+ $a = '';
+ break;
+
+ case 2:
+ // open in a popup window
+ $a = " ";
+ break;
+
+ default: // formerly case 2
+ // open in parent window
+ $a = ' ';
+ break;
+ }
+
+ $html = $a . $image . ' ';
+ }
+ else
+ {
+ $html = $image;
+ }
+ }
+ else if (BannerHelper::isFlash( $item->imageurl ))
+ {
+ //echo $item->params;
+ $banner_params = new JParameter( $item->params );
+ $width = $banner_params->get( 'width');
+ $height = $banner_params->get( 'height');
+
+ $imageurl = $baseurl."images/banners/".$item->imageurl;
+ $html = "
+
+ ";
+ }
+
+ return $html;
+ }
+}
diff --git a/oss/joomla/trunk/modules/mod_banners/index.html b/oss/joomla/trunk/modules/mod_banners/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_banners/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_banners/mod_banners.php b/oss/joomla/trunk/modules/mod_banners/mod_banners.php
new file mode 100644
index 00000000..7f8dfda8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_banners/mod_banners.php
@@ -0,0 +1,24 @@
+get( 'header_text' ) );
+$footerText = trim( $params->get( 'footer_text' ) );
+
+$list = modBannersHelper::getList($params);
+require(JModuleHelper::getLayoutPath('mod_banners'));
diff --git a/oss/joomla/trunk/modules/mod_banners/mod_banners.xml b/oss/joomla/trunk/modules/mod_banners/mod_banners.xml
new file mode 100644
index 00000000..0626e7e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_banners/mod_banners.xml
@@ -0,0 +1,46 @@
+
+
+ Banner
+ Joomla! Project
+ July 2006
+ Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
+ admin@joomla.org
+ www.joomla.org
+ 1.5.0
+ DESCBANNER
+
+ mod_banners.php
+
+
+
+ Parent Window With Browser Navigation
+ New Window With Browser Navigation
+ New Window Without Browser Navigation
+
+
+
+
+
+
+ No
+ Yes
+
+
+ Sticky,Ordering
+ Sticky,Randomise
+
+
+
+
+
+
+
+
+
+ Use global
+ No caching
+
+
+
+
diff --git a/oss/joomla/trunk/modules/mod_banners/tmpl/default.php b/oss/joomla/trunk/modules/mod_banners/tmpl/default.php
new file mode 100644
index 00000000..d22202f5
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_banners/tmpl/default.php
@@ -0,0 +1,22 @@
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_banners/tmpl/index.html b/oss/joomla/trunk/modules/mod_banners/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_banners/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_breadcrumbs/helper.php b/oss/joomla/trunk/modules/mod_breadcrumbs/helper.php
new file mode 100644
index 00000000..cbf6a767
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_breadcrumbs/helper.php
@@ -0,0 +1,75 @@
+getPathway();
+ $items = $pathway->getPathWay();
+
+ $count = count($items);
+ for ($i = 0; $i < $count; $i ++)
+ {
+ $items[$i]->name = stripslashes(htmlspecialchars($items[$i]->name));
+ $items[$i]->link = JRoute::_($items[$i]->link);
+ }
+
+ if ($params->get('showHome', 1))
+ {
+ $item = new stdClass();
+ $item->name = $params->get('homeText', JText::_('Home'));
+ $item->link = JURI::base();
+ array_unshift($items, $item);
+ }
+
+ return $items;
+ }
+
+ /**
+ * Set the breadcrumbs separator for the breadcrumbs display.
+ *
+ * @param string $custom Custom xhtml complient string to separate the
+ * items of the breadcrumbs
+ * @return string Separator string
+ * @since 1.5
+ */
+ function setSeparator($custom = null)
+ {
+ global $mainframe;
+
+ $lang =& JFactory::getLanguage();
+
+ /**
+ * If a custom separator has not been provided we try to load a template
+ * specific one first, and if that is not present we load the default separator
+ */
+ if ($custom == null) {
+ if($lang->isRTL()){
+ $_separator = JHTML::_('image.site', 'arrow_rtl.png');
+ }
+ else{
+ $_separator = JHTML::_('image.site', 'arrow.png');
+ }
+ } else {
+ $_separator = $custom;
+ }
+ return $_separator;
+ }
+}
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_breadcrumbs/index.html b/oss/joomla/trunk/modules/mod_breadcrumbs/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_breadcrumbs/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_breadcrumbs/mod_breadcrumbs.php b/oss/joomla/trunk/modules/mod_breadcrumbs/mod_breadcrumbs.php
new file mode 100644
index 00000000..a840f3f3
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_breadcrumbs/mod_breadcrumbs.php
@@ -0,0 +1,27 @@
+get( 'separator' ));
+
+require(JModuleHelper::getLayoutPath('mod_breadcrumbs'));
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_breadcrumbs/mod_breadcrumbs.xml b/oss/joomla/trunk/modules/mod_breadcrumbs/mod_breadcrumbs.xml
new file mode 100644
index 00000000..0b8c706b
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_breadcrumbs/mod_breadcrumbs.xml
@@ -0,0 +1,33 @@
+
+
+ Breadcrumbs
+ Joomla! Project
+ July 2006
+ Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
+ admin@joomla.org
+ www.joomla.org
+ 1.5.0
+ This module displays the breadcrumbs
+
+ mod_breadcrumbs.php
+
+
+
+ No
+ Yes
+
+
+
+ No
+ Yes
+
+
+
+
+
+
+ Never
+
+
+
diff --git a/oss/joomla/trunk/modules/mod_breadcrumbs/tmpl/default.php b/oss/joomla/trunk/modules/mod_breadcrumbs/tmpl/default.php
new file mode 100644
index 00000000..944210e7
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_breadcrumbs/tmpl/default.php
@@ -0,0 +1,18 @@
+
+
+link)) {
+ echo ''.$list[$i]->name.' ';
+ } else {
+ echo $list[$i]->name;
+ }
+ echo ' '.$separator.' ';
+ } else if ($params->get('showLast', 1)) { // when $i == $count -1 and 'showLast' is true
+ echo $list[$i]->name;
+ }
+endfor; ?>
+
diff --git a/oss/joomla/trunk/modules/mod_breadcrumbs/tmpl/index.html b/oss/joomla/trunk/modules/mod_breadcrumbs/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_breadcrumbs/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_custom/index.html b/oss/joomla/trunk/modules/mod_custom/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_custom/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_custom/mod_custom.xml b/oss/joomla/trunk/modules/mod_custom/mod_custom.xml
new file mode 100644
index 00000000..605c34a3
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_custom/mod_custom.xml
@@ -0,0 +1,15 @@
+
+
+ Custom HTML
+ Joomla! Project
+ July 2004
+ Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
+ admin@joomla.org
+ www.joomla.org
+ 1.5.0
+ DESCMODCUSTOM
+
+
+
+
diff --git a/oss/joomla/trunk/modules/mod_feed/helper.php b/oss/joomla/trunk/modules/mod_feed/helper.php
new file mode 100644
index 00000000..636014f1
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_feed/helper.php
@@ -0,0 +1,60 @@
+get('rssurl', '');
+
+ // get RSS parsed object
+ $options = array();
+ $options['rssUrl'] = $rssurl;
+ if ($params->get('cache')) {
+ $options['cache_time'] = $params->get('cache_time', 15) ;
+ $options['cache_time'] *= 60;
+ } else {
+ $options['cache_time'] = null;
+ }
+
+ $rssDoc =& JFactory::getXMLparser('RSS', $options);
+
+ $feed = new stdclass();
+
+ if ($rssDoc != false)
+ {
+ // channel header and link
+ $feed->title = $rssDoc->get_title();
+ $feed->link = $rssDoc->get_link();
+ $feed->description = $rssDoc->get_description();
+
+ // channel image if exists
+ $feed->image->url = $rssDoc->get_image_url();
+ $feed->image->title = $rssDoc->get_image_title();
+
+ // items
+ $items = $rssDoc->get_items();
+
+ // feed elements
+ $feed->items = array_slice($items, 0, $params->get('rssitems', 5));
+ } else {
+ $feed = false;
+ }
+
+ return $feed;
+ }
+}
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_feed/index.html b/oss/joomla/trunk/modules/mod_feed/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_feed/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_feed/mod_feed.php b/oss/joomla/trunk/modules/mod_feed/mod_feed.php
new file mode 100644
index 00000000..6abc0041
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_feed/mod_feed.php
@@ -0,0 +1,43 @@
+get('rssurl', '');
+$rssrtl = $params->get('rssrtl', 0);
+
+//check if cache diretory is writable as cache files will be created for the feed
+$cacheDir = JPATH_BASE.DS.'cache';
+if (!is_writable($cacheDir))
+{
+ echo '';
+ echo JText::_('Please make cache directory writable.');
+ echo '
';
+ return;
+}
+
+//check if feed URL has been set
+if (empty ($rssurl))
+{
+ echo '';
+ echo JText::_('No feed URL specified.');
+ echo '
';
+ return;
+}
+
+$feed = modFeedHelper::getFeed($params);
+require(JModuleHelper::getLayoutPath('mod_feed'));
diff --git a/oss/joomla/trunk/modules/mod_feed/mod_feed.xml b/oss/joomla/trunk/modules/mod_feed/mod_feed.xml
new file mode 100644
index 00000000..d19ebffc
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_feed/mod_feed.xml
@@ -0,0 +1,49 @@
+
+
+ Feed Display
+ Joomla! Project
+ July 2005
+ Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
+ admin@joomla.org
+ www.joomla.org
+ 1.5.0
+ This module allows the displaying of a syndicated feed
+
+ mod_feed.php
+
+
+
+
+
+
+ Yes
+ No
+
+
+ Yes
+ No
+
+
+ Yes
+ No
+
+
+ Yes
+ No
+
+
+
+ Yes
+ No
+
+
+
+
+
+ Use global
+ No caching
+
+
+
+
diff --git a/oss/joomla/trunk/modules/mod_feed/tmpl/default.php b/oss/joomla/trunk/modules/mod_feed/tmpl/default.php
new file mode 100644
index 00000000..ca927545
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_feed/tmpl/default.php
@@ -0,0 +1,110 @@
+
+
+image->url) ? $feed->image->url : null;
+ $iTitle = isset($feed->image->title) ? $feed->image->title : null;
+ ?>
+
+ title ) && $params->get('rsstitle', 1)) {
+ ?>
+
+
+
+
+ title; ?>
+
+
+
+ get('rssdesc', 1)) {
+ ?>
+
+ description; ?>
+
+ get('rssimage', 1) && $iUrl) {
+ ?>
+
+
+
+ items );
+ $setItems = $params->get('rssitems', 5);
+
+ if ($setItems > $actualItems) {
+ $totalItems = $actualItems;
+ } else {
+ $totalItems = $setItems;
+ }
+ ?>
+
+
+
+ def('word_count', 0);
+ for ($j = 0; $j < $totalItems; $j ++)
+ {
+ $currItem = & $feed->items[$j];
+ // item title
+ ?>
+
+ get_link() ) ) {
+ ?>
+
+ get_title(); ?>
+ get('rssitemdesc', 1))
+ {
+ // item description
+ $text = $currItem->get_description();
+ $text = str_replace(''', "'", $text);
+
+ // word limit check
+ if ($words)
+ {
+ $texts = explode(' ', $text);
+ $count = count($texts);
+ if ($count > $words)
+ {
+ $text = '';
+ for ($i = 0; $i < $words; $i ++) {
+ $text .= ' '.$texts[$i];
+ }
+ $text .= '...';
+ }
+ }
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/oss/joomla/trunk/modules/mod_feed/tmpl/index.html b/oss/joomla/trunk/modules/mod_feed/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_feed/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_footer/index.html b/oss/joomla/trunk/modules/mod_footer/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_footer/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_footer/mod_footer.php b/oss/joomla/trunk/modules/mod_footer/mod_footer.php
new file mode 100644
index 00000000..e9cf1aca
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_footer/mod_footer.php
@@ -0,0 +1,35 @@
+toFormat('%Y');
+$csite_name = $mainframe->getCfg('sitename');
+
+if (JString::strpos(JText :: _('FOOTER_LINE1'), '%date%')) {
+ $line1 = ereg_replace('%date%', $cur_year, JText :: _('FOOTER_LINE1'));
+} else {
+ $line1 = JText :: _('FOOTER_LINE1');
+}
+
+if (JString::strpos($line1, '%sitename%')) {
+ $lineone = ereg_replace('%sitename%', $csite_name, $line1);
+} else {
+ $lineone = $line1;
+}
+
+require(JModuleHelper::getLayoutPath('mod_footer'));
diff --git a/oss/joomla/trunk/modules/mod_footer/mod_footer.xml b/oss/joomla/trunk/modules/mod_footer/mod_footer.xml
new file mode 100644
index 00000000..89461e76
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_footer/mod_footer.xml
@@ -0,0 +1,21 @@
+
+
+ Footer
+ Joomla! Project
+ July 2006
+ Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
+ admin@joomla.org
+ www.joomla.org
+ 1.5.0
+ This module shows the Joomla! Copyright information
+
+ mod_footer.php
+
+
+
+ Use global
+ No caching
+
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_footer/tmpl/default.php b/oss/joomla/trunk/modules/mod_footer/tmpl/default.php
new file mode 100644
index 00000000..973380a5
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_footer/tmpl/default.php
@@ -0,0 +1,4 @@
+
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_footer/tmpl/index.html b/oss/joomla/trunk/modules/mod_footer/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_footer/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_latestnews/helper.php b/oss/joomla/trunk/modules/mod_latestnews/helper.php
new file mode 100644
index 00000000..b6fbb598
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_latestnews/helper.php
@@ -0,0 +1,119 @@
+get('id');
+
+ $count = (int) $params->get('count', 5);
+ $catid = trim( $params->get('catid') );
+ $secid = trim( $params->get('secid') );
+ $show_front = $params->get('show_front', 1);
+ $aid = $user->get('aid', 0);
+
+ $contentConfig = &JComponentHelper::getParams( 'com_content' );
+ $access = !$contentConfig->get('show_noauth');
+
+ $nullDate = $db->getNullDate();
+
+ $date =& JFactory::getDate();
+ $now = $date->toMySQL();
+
+ $where = 'a.state = 1'
+ . ' AND ( a.publish_up = '.$db->Quote($nullDate).' OR a.publish_up <= '.$db->Quote($now).' )'
+ . ' AND ( a.publish_down = '.$db->Quote($nullDate).' OR a.publish_down >= '.$db->Quote($now).' )'
+ ;
+
+ // User Filter
+ switch ($params->get( 'user_id' ))
+ {
+ case 'by_me':
+ $where .= ' AND (created_by = ' . (int) $userId . ' OR modified_by = ' . (int) $userId . ')';
+ break;
+ case 'not_me':
+ $where .= ' AND (created_by <> ' . (int) $userId . ' AND modified_by <> ' . (int) $userId . ')';
+ break;
+ }
+
+ // Ordering
+ switch ($params->get( 'ordering' ))
+ {
+ case 'm_dsc':
+ $ordering = 'a.modified DESC, a.created DESC';
+ break;
+ case 'c_dsc':
+ default:
+ $ordering = 'a.created DESC';
+ break;
+ }
+
+ if ($catid)
+ {
+ $ids = explode( ',', $catid );
+ JArrayHelper::toInteger( $ids );
+ $catCondition = ' AND (cc.id=' . implode( ' OR cc.id=', $ids ) . ')';
+ }
+ if ($secid)
+ {
+ $ids = explode( ',', $secid );
+ JArrayHelper::toInteger( $ids );
+ $secCondition = ' AND (s.id=' . implode( ' OR s.id=', $ids ) . ')';
+ }
+
+ // Content Items only
+ $query = 'SELECT a.*, ' .
+ ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,'.
+ ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug'.
+ ' FROM #__content AS a' .
+ ($show_front == '0' ? ' LEFT JOIN #__content_frontpage AS f ON f.content_id = a.id' : '') .
+ ' INNER JOIN #__categories AS cc ON cc.id = a.catid' .
+ ' INNER JOIN #__sections AS s ON s.id = a.sectionid' .
+ ' WHERE '. $where .' AND s.id > 0' .
+ ($access ? ' AND a.access <= ' .(int) $aid. ' AND cc.access <= ' .(int) $aid. ' AND s.access <= ' .(int) $aid : '').
+ ($catid ? $catCondition : '').
+ ($secid ? $secCondition : '').
+ ($show_front == '0' ? ' AND f.content_id IS NULL ' : '').
+ ' AND s.published = 1' .
+ ' AND cc.published = 1' .
+ ' ORDER BY '. $ordering;
+ $db->setQuery($query, 0, $count);
+ $rows = $db->loadObjectList();
+
+ $i = 0;
+ $lists = array();
+ foreach ( $rows as $row )
+ {
+ if($row->access <= $aid)
+ {
+ $lists[$i]->link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid));
+ } else {
+ $lists[$i]->link = JRoute::_('index.php?option=com_user&view=login');
+ }
+ $lists[$i]->text = htmlspecialchars( $row->title );
+ $i++;
+ }
+
+ return $lists;
+ }
+}
diff --git a/oss/joomla/trunk/modules/mod_latestnews/index.html b/oss/joomla/trunk/modules/mod_latestnews/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_latestnews/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_latestnews/mod_latestnews.php b/oss/joomla/trunk/modules/mod_latestnews/mod_latestnews.php
new file mode 100644
index 00000000..3141ac5f
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_latestnews/mod_latestnews.php
@@ -0,0 +1,21 @@
+
+
+ Latest News
+ Joomla! Project
+ July 2004
+ Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
+ admin@joomla.org
+ www.joomla.org
+ 1.5.0
+ DESCLATESTNEWS
+
+ mod_latestnews.php
+
+
+
+
+ Recently Added First
+ Recently Modified First
+
+
+ Anyone
+ Added or modified by me
+ Not added or modified by me
+
+
+
+ show
+ hide
+
+
+
+
+
+
+
+
+ Use global
+ No caching
+
+
+
+
diff --git a/oss/joomla/trunk/modules/mod_latestnews/tmpl/default.php b/oss/joomla/trunk/modules/mod_latestnews/tmpl/default.php
new file mode 100644
index 00000000..32d1fb92
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_latestnews/tmpl/default.php
@@ -0,0 +1,10 @@
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_latestnews/tmpl/index.html b/oss/joomla/trunk/modules/mod_latestnews/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_latestnews/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_login/helper.php b/oss/joomla/trunk/modules/mod_login/helper.php
new file mode 100644
index 00000000..ea14e2d7
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_login/helper.php
@@ -0,0 +1,42 @@
+get($type))
+ {
+ $menu =& JSite::getMenu();
+ $item = $menu->getItem($itemid);
+ $url = JRoute::_($item->link.'&Itemid='.$itemid, false);
+ }
+ else
+ {
+ // stay on the same page
+ $uri = JFactory::getURI();
+ $url = $uri->toString(array('path', 'query', 'fragment'));
+ }
+
+ return base64_encode($url);
+ }
+
+ function getType()
+ {
+ $user = & JFactory::getUser();
+ return (!$user->get('guest')) ? 'logout' : 'login';
+ }
+}
diff --git a/oss/joomla/trunk/modules/mod_login/index.html b/oss/joomla/trunk/modules/mod_login/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_login/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_login/mod_login.php b/oss/joomla/trunk/modules/mod_login/mod_login.php
new file mode 100644
index 00000000..d66285e7
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_login/mod_login.php
@@ -0,0 +1,27 @@
+def('greeting', 1);
+
+$type = modLoginHelper::getType();
+$return = modLoginHelper::getReturnURL($params, $type);
+
+$user =& JFactory::getUser();
+
+require(JModuleHelper::getLayoutPath('mod_login'));
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_login/mod_login.xml b/oss/joomla/trunk/modules/mod_login/mod_login.xml
new file mode 100644
index 00000000..78fb88ea
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_login/mod_login.xml
@@ -0,0 +1,38 @@
+
+
+ Login
+ Joomla! Project
+ July 2006
+ Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
+ admin@joomla.org
+ www.joomla.org
+ 1.5.0
+ DESCLOGINFORM
+
+ mod_login.php
+
+
+
+ Never
+
+
+
+
+
+
+
+
+ No
+ Yes
+
+
+ Username
+ Name
+
+
+ No
+ Yes
+
+
+
diff --git a/oss/joomla/trunk/modules/mod_login/tmpl/default.php b/oss/joomla/trunk/modules/mod_login/tmpl/default.php
new file mode 100644
index 00000000..ace81440
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_login/tmpl/default.php
@@ -0,0 +1,78 @@
+
+
+
+
+load( 'plg_authentication_openid', JPATH_ADMINISTRATOR );
+ $langScript = 'var JLanguage = {};'.
+ ' JLanguage.WHAT_IS_OPENID = \''.JText::_( 'WHAT_IS_OPENID' ).'\';'.
+ ' JLanguage.LOGIN_WITH_OPENID = \''.JText::_( 'LOGIN_WITH_OPENID' ).'\';'.
+ ' JLanguage.NORMAL_LOGIN = \''.JText::_( 'NORMAL_LOGIN' ).'\';'.
+ ' var modlogin = 1;';
+ $document = &JFactory::getDocument();
+ $document->addScriptDeclaration( $langScript );
+ JHTML::_('script', 'openid.js');
+endif; ?>
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_login/tmpl/index.html b/oss/joomla/trunk/modules/mod_login/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_login/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_mainmenu/helper.php b/oss/joomla/trunk/modules/mod_mainmenu/helper.php
new file mode 100644
index 00000000..1d988bcb
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_mainmenu/helper.php
@@ -0,0 +1,418 @@
+getItems('menutype', $params->get('menutype'));
+ $maxdepth = $params->get('maxdepth',10);
+
+ // Build Menu Tree root down (orphan proof - child might have lower id than parent)
+ $user =& JFactory::getUser();
+ $ids = array();
+ $ids[0] = true;
+ $last = null;
+ $unresolved = array();
+ // pop the first item until the array is empty if there is any item
+ if ( is_array($rows)) {
+ while (count($rows) && !is_null($row = array_shift($rows)))
+ {
+ if (array_key_exists($row->parent, $ids)) {
+ $row->ionly = $params->get('menu_images_link');
+ $menu->addNode($params, $row);
+
+ // record loaded parents
+ $ids[$row->id] = true;
+ } else {
+ // no parent yet so push item to back of list
+ // SAM: But if the key isn't in the list and we dont _add_ this is infinite, so check the unresolved queue
+ if(!array_key_exists($row->id, $unresolved) || $unresolved[$row->id] < $maxdepth) {
+ array_push($rows, $row);
+ // so let us do max $maxdepth passes
+ // TODO: Put a time check in this loop in case we get too close to the PHP timeout
+ if(!isset($unresolved[$row->id])) $unresolved[$row->id] = 1;
+ else $unresolved[$row->id]++;
+ }
+ }
+ }
+ }
+ return $menu->toXML();
+ }
+
+ function &getXML($type, &$params, $decorator)
+ {
+ static $xmls;
+
+ if (!isset($xmls[$type])) {
+ $cache =& JFactory::getCache('mod_mainmenu');
+ $string = $cache->call(array('modMainMenuHelper', 'buildXML'), $params);
+ $xmls[$type] = $string;
+ }
+
+ // Get document
+ $xml = JFactory::getXMLParser('Simple');
+ $xml->loadString($xmls[$type]);
+ $doc = &$xml->document;
+
+ $menu = &JSite::getMenu();
+ $active = $menu->getActive();
+ $start = $params->get('startLevel');
+ $end = $params->get('endLevel');
+ $sChild = $params->get('showAllChildren');
+ $path = array();
+
+ // Get subtree
+ if ($start)
+ {
+ $found = false;
+ $root = true;
+ if(!isset($active)){
+ $doc = false;
+ }
+ else{
+ $path = $active->tree;
+ for ($i=0,$n=count($path);$i<$n;$i++)
+ {
+ foreach ($doc->children() as $child)
+ {
+ if ($child->attributes('id') == $path[$i]) {
+ $doc = &$child->ul[0];
+ $root = false;
+ break;
+ }
+ }
+
+ if ($i == $start-1) {
+ $found = true;
+ break;
+ }
+ }
+ if ((!is_a($doc, 'JSimpleXMLElement')) || (!$found) || ($root)) {
+ $doc = false;
+ }
+ }
+ }
+
+ if ($doc && is_callable($decorator)) {
+ $doc->map($decorator, array('end'=>$end, 'children'=>$sChild));
+ }
+ return $doc;
+ }
+
+ function render(&$params, $callback)
+ {
+ switch ( $params->get( 'menu_style', 'list' ) )
+ {
+ case 'list_flat' :
+ // Include the legacy library file
+ require_once(dirname(__FILE__).DS.'legacy.php');
+ mosShowHFMenu($params, 1);
+ break;
+
+ case 'horiz_flat' :
+ // Include the legacy library file
+ require_once(dirname(__FILE__).DS.'legacy.php');
+ mosShowHFMenu($params, 0);
+ break;
+
+ case 'vert_indent' :
+ // Include the legacy library file
+ require_once(dirname(__FILE__).DS.'legacy.php');
+ mosShowVIMenu($params);
+ break;
+
+ default :
+ // Include the new menu class
+ $xml = modMainMenuHelper::getXML($params->get('menutype'), $params, $callback);
+ if ($xml) {
+ $class = $params->get('class_sfx');
+ $xml->addAttribute('class', 'menu'.$class);
+ if ($tagId = $params->get('tag_id')) {
+ $xml->addAttribute('id', $tagId);
+ }
+
+ $result = JFilterOutput::ampReplace($xml->toString((bool)$params->get('show_whitespace')));
+ $result = str_replace(array('', ''), '', $result);
+ echo $result;
+ }
+ break;
+ }
+ }
+}
+
+/**
+ * Main Menu Tree Class.
+ *
+ * @package Joomla
+ * @subpackage Menus
+ * @since 1.5
+ */
+class JMenuTree extends JTree
+{
+ /**
+ * Node/Id Hash for quickly handling node additions to the tree.
+ */
+ var $_nodeHash = array();
+
+ /**
+ * Menu parameters
+ */
+ var $_params = null;
+
+ /**
+ * Menu parameters
+ */
+ var $_buffer = null;
+
+ function __construct(&$params)
+ {
+ $this->_params =& $params;
+ $this->_root = new JMenuNode(0, 'ROOT');
+ $this->_nodeHash[0] =& $this->_root;
+ $this->_current =& $this->_root;
+ }
+
+ function addNode(&$params, $item)
+ {
+ // Get menu item data
+ $data = $this->_getItemData($params, $item);
+
+ // Create the node and add it
+ $node = new JMenuNode($item->id, $item->name, $item->access, $data);
+
+ if (isset($item->mid)) {
+ $nid = $item->mid;
+ } else {
+ $nid = $item->id;
+ }
+ $this->_nodeHash[$nid] =& $node;
+ $this->_current =& $this->_nodeHash[$item->parent];
+
+ if ($item->type == 'menulink' && !empty($item->query['Itemid'])) {
+ $node->mid = $item->query['Itemid'];
+ }
+
+ if ($this->_current) {
+ $this->addChild($node, true);
+ } else {
+ // sanity check
+ JError::raiseError( 500, 'Orphan Error. Could not find parent for Item '.$item->id );
+ }
+ }
+
+ function toXML()
+ {
+ // Initialize variables
+ $this->_current =& $this->_root;
+
+ // Recurse through children if they exist
+ while ($this->_current->hasChildren())
+ {
+ $this->_buffer .= '';
+ foreach ($this->_current->getChildren() as $child)
+ {
+ $this->_current = & $child;
+ $this->_getLevelXML(0);
+ }
+ $this->_buffer .= ' ';
+ }
+ if($this->_buffer == '') { $this->_buffer = ''; }
+ return $this->_buffer;
+ }
+
+ function _getLevelXML($depth)
+ {
+ $depth++;
+
+ // Start the item
+ $rel = (!empty($this->_current->mid)) ? ' rel="'.$this->_current->mid.'"' : '';
+ $this->_buffer .= '';
+
+ // Append item data
+ $this->_buffer .= $this->_current->link;
+
+ // Recurse through item's children if they exist
+ while ($this->_current->hasChildren())
+ {
+ $this->_buffer .= '';
+ foreach ($this->_current->getChildren() as $child)
+ {
+ $this->_current = & $child;
+ $this->_getLevelXML($depth);
+ }
+ $this->_buffer .= ' ';
+ }
+
+ // Finish the item
+ $this->_buffer .= ' ';
+ }
+
+ function _getItemData(&$params, $item)
+ {
+ $data = null;
+
+ // Menu Link is a special type that is a link to another item
+ if ($item->type == 'menulink')
+ {
+ $menu = &JSite::getMenu();
+ if ($newItem = $menu->getItem($item->query['Itemid'])) {
+ $tmp = clone($newItem);
+ $tmp->name = 'name.']]> ';
+ $tmp->mid = $item->id;
+ $tmp->parent = $item->parent;
+ } else {
+ return false;
+ }
+ } else {
+ $tmp = clone($item);
+ $tmp->name = 'name.']]> ';
+ }
+
+ $iParams = new JParameter($tmp->params);
+ if ($params->get('menu_images') && $iParams->get('menu_image') && $iParams->get('menu_image') != -1) {
+ switch ($params->get('menu_images_align', 0)){
+ case 0 :
+ $imgalign='align="left"';
+ break;
+
+ case 1 :
+ $imgalign='align="right"';
+ break;
+
+ default :
+ $imgalign='';
+ break;
+ }
+
+
+ $image = ' ';
+ if($tmp->ionly){
+ $tmp->name = null;
+ }
+ } else {
+ $image = null;
+ }
+ switch ($tmp->type)
+ {
+ case 'separator' :
+ return ''.$image.$tmp->name.' ';
+ break;
+
+ case 'url' :
+ if ((strpos($tmp->link, 'index.php?') === 0) && (strpos($tmp->link, 'Itemid=') === false)) {
+ $tmp->url = $tmp->link.'&Itemid='.$tmp->id;
+ } else {
+ $tmp->url = $tmp->link;
+ }
+ break;
+
+ default :
+ $router = JSite::getRouter();
+ $tmp->url = $router->getMode() == JROUTER_MODE_SEF ? 'index.php?Itemid='.$tmp->id : $tmp->link.'&Itemid='.$tmp->id;
+ break;
+ }
+
+ // Print a link if it exists
+ if ($tmp->url != null)
+ {
+ // Handle SSL links
+ $iSecure = $iParams->def('secure', 0);
+ if ($tmp->home == 1) {
+ $tmp->url = JURI::base();
+ } elseif (strcasecmp(substr($tmp->url, 0, 4), 'http') && (strpos($tmp->link, 'index.php?') !== false)) {
+ $tmp->url = JRoute::_($tmp->url, true, $iSecure);
+ } else {
+ $tmp->url = str_replace('&', '&', $tmp->url);
+ }
+
+ switch ($tmp->browserNav)
+ {
+ default:
+ case 0:
+ // _top
+ $data = ''.$image.$tmp->name.' ';
+ break;
+ case 1:
+ // _blank
+ $data = ''.$image.$tmp->name.' ';
+ break;
+ case 2:
+ // window.open
+ $attribs = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,'.$this->_params->get('window_open');
+
+ // hrm...this is a bit dickey
+ $link = str_replace('index.php', 'index2.php', $tmp->url);
+ $data = ''.$image.$tmp->name.' ';
+ break;
+ }
+ } else {
+ $data = ''.$image.$tmp->name.' ';
+ }
+
+ return $data;
+ }
+}
+
+/**
+ * Main Menu Tree Node Class.
+ *
+ * @package Joomla
+ * @subpackage Menus
+ * @since 1.5
+ */
+class JMenuNode extends JNode
+{
+ /**
+ * Node Title
+ */
+ var $title = null;
+
+ /**
+ * Node Link
+ */
+ var $link = null;
+
+ /**
+ * CSS Class for node
+ */
+ var $class = null;
+
+ function __construct($id, $title, $access = null, $link = null, $class = null)
+ {
+ $this->id = $id;
+ $this->title = $title;
+ $this->access = $access;
+ $this->link = $link;
+ $this->class = $class;
+ }
+}
diff --git a/oss/joomla/trunk/modules/mod_mainmenu/index.html b/oss/joomla/trunk/modules/mod_mainmenu/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_mainmenu/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_mainmenu/legacy.php b/oss/joomla/trunk/modules/mod_mainmenu/legacy.php
new file mode 100644
index 00000000..04c963be
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_mainmenu/legacy.php
@@ -0,0 +1,427 @@
+type == 'menulink')
+ {
+ $menu = &JSite::getMenu();
+ if ($tmp = $menu->getItem($mitem->query['Itemid'])) {
+ $name = $mitem->name;
+ $mid = $mitem->id;
+ $parent = $mitem->parent;
+ $mitem = clone($tmp);
+ $mitem->name = $name;
+ $mitem->mid = $mid;
+ $mitem->parent = $parent;
+ } else {
+ return;
+ }
+ }
+
+ switch ($mitem->type)
+ {
+ case 'separator' :
+ $mitem->browserNav = 3;
+ break;
+
+ case 'url' :
+ if (eregi('index.php\?', $mitem->link)) {
+ if (!eregi('Itemid=', $mitem->link)) {
+ $mitem->link .= '&Itemid='.$mitem->id;
+ }
+ }
+ break;
+
+ default :
+ $mitem->link = 'index.php?Itemid='.$mitem->id;
+ break;
+ }
+
+ // Active Menu highlighting
+ $current_itemid = intval( $Itemid );
+ if (!$current_itemid) {
+ $id = '';
+ } else {
+ if ($current_itemid == $mitem->id) {
+ $id = 'id="active_menu' . $params->get('class_sfx') . '"';
+ } else {
+ if ($params->get('activate_parent') && isset ($open) && in_array($mitem->id, $open)) {
+ $id = 'id="active_menu' . $params->get('class_sfx') . '"';
+ } else {
+ if ($mitem->type == 'url' && ItemidContained($mitem->link, $current_itemid)) {
+ $id = 'id="active_menu' . $params->get('class_sfx') . '"';
+ } else {
+ $id = '';
+ }
+ }
+ }
+ }
+
+ if ($params->get('full_active_id'))
+ {
+ // support for `active_menu` of 'Link - Url' if link is relative
+ if ($id == '' && $mitem->type == 'url' && strpos($mitem->link, 'http') === false) {
+ $url = array();
+ if(strpos($mitem->link, '&') !== false)
+ {
+ $mitem->link = str_replace('&','&',$mitem->link);
+ }
+
+ parse_str($mitem->link, $url);
+ if (isset ($url['Itemid'])) {
+ if ($url['Itemid'] == $current_itemid) {
+ $id = 'id="active_menu' . $params->get('class_sfx') . '"';
+ }
+ }
+ }
+ }
+
+ // replace & with amp; for xhtml compliance
+ $menu_params = new stdClass();
+ $menu_params = new JParameter($mitem->params);
+ $menu_secure = $menu_params->def('secure', 0);
+
+ if (strcasecmp(substr($mitem->link, 0, 4), 'http')) {
+ $mitem->url = JRoute::_($mitem->link, true, $menu_secure);
+ } else {
+ $mitem->url = $mitem->link;
+ }
+
+ $menuclass = 'mainlevel' . $params->get('class_sfx');
+ if ($level > 0) {
+ $menuclass = 'sublevel' . $params->get('class_sfx');
+ }
+
+ // replace & with amp; for xhtml compliance
+ // remove slashes from excaped characters
+ $mitem->name = stripslashes(htmlspecialchars($mitem->name));
+
+ switch ($mitem->browserNav)
+ {
+ // cases are slightly different
+ case 1 :
+ // open in a new window
+ $txt = '';
+ break;
+
+ case 2 :
+ // open in a popup window
+ $txt = "url . "', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550'); return false\" class=\"$menuclass\" " . $id . ">" . $mitem->name . " \n";
+ break;
+
+ case 3 :
+ // don't link it
+ $txt = '';
+ break;
+
+ default : // formerly case 2
+ // open in parent window
+ $txt = '';
+ break;
+ }
+
+ if ($params->get('menu_images'))
+ {
+ $menu_params = new stdClass();
+ $menu_params = new JParameter($mitem->params);
+
+ $menu_image = $menu_params->def('menu_image', -1);
+ if (($menu_image <> '-1') && $menu_image) {
+ $image = ' ';
+ if ($params->get('menu_images_align')) {
+ $txt = $txt . ' ' . $image;
+ } else {
+ $txt = $image . ' ' . $txt;
+ }
+ }
+ }
+
+ return $txt;
+}
+
+/**
+* Vertically Indented Menu
+*/
+function mosShowVIMenu(& $params)
+{
+ global $mainframe, $Itemid;
+
+ $template = $mainframe->getTemplate();
+ $menu =& JSite::getMenu();
+ $user =& JFactory::getUser();
+
+ // indent icons
+ switch ($params->get('indent_image')) {
+ case '1' :
+ {
+ // Default images
+ $imgpath = JURI::base(true).'/images/M_images';
+ for ($i = 1; $i < 7; $i++) {
+ $img[$i] = ' ';
+ }
+ }
+ break;
+
+ case '2' :
+ {
+ // Use Params
+ $imgpath = JURI::base(true).'/images/M_images';
+ for ($i = 1; $i < 7; $i++) {
+ if ($params->get('indent_image' . $i) == '-1') {
+ $img[$i] = NULL;
+ } else {
+ $img[$i] = ' ';
+ }
+ }
+ }
+ break;
+
+ case '3' :
+ {
+ // None
+ for ($i = 1; $i < 7; $i++) {
+ $img[$i] = NULL;
+ }
+ }
+ break;
+
+ default :
+ {
+ // Template
+ $imgpath = JURI::base(true).'/templates/' . $template . '/images';
+ for ($i = 1; $i < 7; $i++) {
+ $img[$i] = ' ';
+ }
+ }
+ }
+
+ $indents = array (
+ // block prefix / item prefix / item suffix / block suffix
+ array (
+ ''
+ ),
+ array (
+ '',
+ '' . $img[1],
+ '
',
+ ''
+ ),
+ array (
+ '',
+ '' . $img[2],
+ '
',
+ ''
+ ),
+ array (
+ '',
+ '' . $img[3],
+ '
',
+ ''
+ ),
+ array (
+ '',
+ '' . $img[4],
+ '
',
+ ''
+ ),
+ array (
+ '',
+ '' . $img[5],
+ '
',
+ ''
+ ),
+ array (
+ '',
+ '' . $img[6],
+ '
',
+ ''
+ ),
+
+ );
+
+ // establish the hierarchy of the menu
+ $children = array ();
+
+ //get menu items
+ $rows = $menu->getItems('menutype', $params->get('menutype'));
+
+ // first pass - collect children
+ $cacheIndex = array();
+ if(is_array($rows) && count($rows)) {
+ foreach ($rows as $index => $v) {
+ if ($v->access <= $user->get('aid')) {
+ $pt = $v->parent;
+ $list = @ $children[$pt] ? $children[$pt] : array ();
+ array_push($list, $v);
+ $children[$pt] = $list;
+ }
+ $cacheIndex[$v->id] = $index;
+ }
+ }
+
+ // second pass - collect 'open' menus
+ $open = array (
+ $Itemid
+ );
+ $count = 20; // maximum levels - to prevent runaway loop
+ $id = $Itemid;
+
+ while (-- $count)
+ {
+ if (isset($cacheIndex[$id])) {
+ $index = $cacheIndex[$id];
+ if (isset ($rows[$index]) && $rows[$index]->parent > 0) {
+ $id = $rows[$index]->parent;
+ $open[] = $id;
+ } else {
+ break;
+ }
+ }
+ }
+
+ mosRecurseVIMenu(0, 0, $children, $open, $indents, $params);
+}
+
+/**
+* Utility function to recursively work through a vertically indented
+* hierarchial menu
+*/
+function mosRecurseVIMenu($id, $level, & $children, & $open, & $indents, & $params)
+{
+ if (@ $children[$id]) {
+ $n = min($level, count($indents) - 1);
+
+ echo "\n" . $indents[$n][0];
+ foreach ($children[$id] as $row) {
+
+ echo "\n" . $indents[$n][1];
+
+ echo mosGetMenuLink($row, $level, $params, $open);
+
+ // show menu with menu expanded - submenus visible
+ if (!$params->get('expand_menu')) {
+ if (in_array($row->id, $open)) {
+ mosRecurseVIMenu($row->id, $level +1, $children, $open, $indents, $params);
+ }
+ } else {
+ mosRecurseVIMenu($row->id, $level +1, $children, $open, $indents, $params);
+ }
+ echo $indents[$n][2];
+ }
+ echo "\n" . $indents[$n][3];
+ }
+}
+
+/**
+* Draws a horizontal 'flat' style menu (very simple case)
+*/
+function mosShowHFMenu(& $params, $style = 0)
+{
+ $menu = & JSite::getMenu();
+ $user = & JFactory::getUser();
+
+ //get menu items
+ $rows = $menu->getItems('menutype', $params->get('menutype'));
+
+ $links = array ();
+ if(is_array($rows) && count($rows)) {
+ foreach ($rows as $row)
+ {
+ if ($row->access <= $user->get('aid', 0)) {
+ $links[] = mosGetMenuLink($row, 0, $params);
+ }
+ }
+ }
+
+ $menuclass = 'mainlevel' . $params->get('class_sfx');
+ $lang =& JFactory::getLanguage();
+
+ if (count($links))
+ {
+ switch ($style)
+ {
+ case 1 :
+ echo '';
+ break;
+
+ default :
+ $spacer_start = $params->get('spacer');
+ $spacer_end = $params->get('end_spacer');
+
+ echo '';
+ echo '';
+ echo '';
+
+ if ($spacer_end) {
+ echo '';
+ }
+
+ if ($spacer_start) {
+ $html = '';
+ echo implode($html, $links);
+ } else {
+ echo implode('', $links);
+ }
+
+ if ($spacer_end) {
+ echo '';
+ }
+
+ echo ' ';
+ echo ' ';
+ echo '
';
+ break;
+ }
+ }
+}
+
+/**
+* Search for Itemid in link
+*/
+function ItemidContained($link, $Itemid)
+{
+ $link = str_replace('&', '&', $link);
+ $temp = explode("&", $link);
+ $linkItemid = "";
+ foreach ($temp as $value) {
+ $temp2 = explode("=", $value);
+ if ($temp2[0] == "Itemid") {
+ $linkItemid = $temp2[1];
+ break;
+ }
+ }
+ if ($linkItemid != "" && $linkItemid == $Itemid) {
+ return true;
+ } else {
+ return false;
+ }
+}
diff --git a/oss/joomla/trunk/modules/mod_mainmenu/mod_mainmenu.php b/oss/joomla/trunk/modules/mod_mainmenu/mod_mainmenu.php
new file mode 100644
index 00000000..d6aa29fd
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_mainmenu/mod_mainmenu.php
@@ -0,0 +1,42 @@
+def('menutype', 'mainmenu');
+$params->def('class_sfx', '');
+$params->def('menu_images', 0);
+$params->def('menu_images_align', 0);
+$params->def('expand_menu', 0);
+$params->def('activate_parent', 0);
+$params->def('indent_image', 0);
+$params->def('indent_image1', 'indent1.png');
+$params->def('indent_image2', 'indent2.png');
+$params->def('indent_image3', 'indent3.png');
+$params->def('indent_image4', 'indent4.png');
+$params->def('indent_image5', 'indent5.png');
+$params->def('indent_image6', 'indent.png');
+$params->def('spacer', '');
+$params->def('end_spacer', '');
+$params->def('full_active_id', 0);
+
+// Added in 1.5
+$params->def('startLevel', 0);
+$params->def('endLevel', 0);
+$params->def('showAllChildren', 0);
+
+require(JModuleHelper::getLayoutPath('mod_mainmenu'));
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_mainmenu/mod_mainmenu.xml b/oss/joomla/trunk/modules/mod_mainmenu/mod_mainmenu.xml
new file mode 100644
index 00000000..173fe02e
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_mainmenu/mod_mainmenu.xml
@@ -0,0 +1,92 @@
+
+
+ Menu
+ Joomla! Project
+ July 2006
+ Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
+ admin@joomla.org
+ www.joomla.org
+ 1.5.0
+ Displays a menu.
+
+ mod_mainmenu.php
+
+
+
+
+ List
+ Legacy - Vertical
+ Legacy - Horizontal
+ Legacy - Flat List
+
+
+
+
+
+ No
+ Yes
+
+
+
+
+
+
+ Yes
+ No
+
+
+
+ Use global
+ No caching
+
+
+
+
+
+
+
+
+
+ No
+ Yes
+
+
+ Left
+ Right
+ None
+
+
+ No
+ Yes
+
+
+ No
+ Yes
+
+
+ No
+ Yes
+
+
+ No
+ Yes
+
+
+
+ Template
+ Joomla! default images
+ Use params below
+ None
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/oss/joomla/trunk/modules/mod_mainmenu/tmpl/default.php b/oss/joomla/trunk/modules/mod_mainmenu/tmpl/default.php
new file mode 100644
index 00000000..bfe20444
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_mainmenu/tmpl/default.php
@@ -0,0 +1,82 @@
+getActive();
+ $path = isset($active) ? array_reverse($active->tree) : null;
+
+ if (($args['end']) && ($node->attributes('level') >= $args['end']))
+ {
+ $children = $node->children();
+ foreach ($node->children() as $child)
+ {
+ if ($child->name() == 'ul') {
+ $node->removeChild($child);
+ }
+ }
+ }
+
+ if ($node->name() == 'ul') {
+ foreach ($node->children() as $child)
+ {
+ if ($child->attributes('access') > $user->get('aid', 0)) {
+ $node->removeChild($child);
+ }
+ }
+ }
+
+ if (($node->name() == 'li') && isset($node->ul)) {
+ $node->addAttribute('class', 'parent');
+ }
+
+ if (isset($path) && (in_array($node->attributes('id'), $path) || in_array($node->attributes('rel'), $path)))
+ {
+ if ($node->attributes('class')) {
+ $node->addAttribute('class', $node->attributes('class').' active');
+ } else {
+ $node->addAttribute('class', 'active');
+ }
+ }
+ else
+ {
+ if (isset($args['children']) && !$args['children'])
+ {
+ $children = $node->children();
+ foreach ($node->children() as $child)
+ {
+ if ($child->name() == 'ul') {
+ $node->removeChild($child);
+ }
+ }
+ }
+ }
+
+ if (($node->name() == 'li') && ($id = $node->attributes('id'))) {
+ if ($node->attributes('class')) {
+ $node->addAttribute('class', $node->attributes('class').' item'.$id);
+ } else {
+ $node->addAttribute('class', 'item'.$id);
+ }
+ }
+
+ if (isset($path) && $node->attributes('id') == $path[0]) {
+ $node->addAttribute('id', 'current');
+ } else {
+ $node->removeAttribute('id');
+ }
+ $node->removeAttribute('rel');
+ $node->removeAttribute('level');
+ $node->removeAttribute('access');
+}
+ define('modMainMenuXMLCallbackDefined', true);
+}
+
+modMainMenuHelper::render($params, 'modMainMenuXMLCallback');
diff --git a/oss/joomla/trunk/modules/mod_mainmenu/tmpl/index.html b/oss/joomla/trunk/modules/mod_mainmenu/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_mainmenu/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_mostread/helper.php b/oss/joomla/trunk/modules/mod_mostread/helper.php
new file mode 100644
index 00000000..2c1e0d4c
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_mostread/helper.php
@@ -0,0 +1,89 @@
+get('count', 5));
+ $catid = trim($params->get('catid'));
+ $secid = trim($params->get('secid'));
+ $show_front = $params->get('show_front', 1);
+ $aid = $user->get('aid', 0);
+
+ $contentConfig = &JComponentHelper::getParams( 'com_content' );
+ $access = !$contentConfig->get('show_noauth');
+
+ $nullDate = $db->getNullDate();
+ $date =& JFactory::getDate();
+ $now = $date->toMySQL();
+
+ if ($catid) {
+ $ids = explode( ',', $catid );
+ JArrayHelper::toInteger( $ids );
+ $catCondition = ' AND (cc.id=' . implode( ' OR cc.id=', $ids ) . ')';
+ }
+ if ($secid) {
+ $ids = explode( ',', $secid );
+ JArrayHelper::toInteger( $ids );
+ $secCondition = ' AND (s.id=' . implode( ' OR s.id=', $ids ) . ')';
+ }
+
+ //Content Items only
+ $query = 'SELECT a.*,' .
+ ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,'.
+ ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug'.
+ ' FROM #__content AS a' .
+ ' LEFT JOIN #__content_frontpage AS f ON f.content_id = a.id' .
+ ' INNER JOIN #__categories AS cc ON cc.id = a.catid' .
+ ' INNER JOIN #__sections AS s ON s.id = a.sectionid' .
+ ' WHERE ( a.state = 1 AND s.id > 0 )' .
+ ' AND ( a.publish_up = '.$db->Quote($nullDate).' OR a.publish_up <= '.$db->Quote($now).' )' .
+ ' AND ( a.publish_down = '.$db->Quote($nullDate).' OR a.publish_down >= '.$db->Quote($now).' )'.
+ ($access ? ' AND a.access <= ' .(int) $aid. ' AND cc.access <= ' .(int) $aid. ' AND s.access <= ' .(int) $aid : '').
+ ($catid ? $catCondition : '').
+ ($secid ? $secCondition : '').
+ ($show_front == '0' ? ' AND f.content_id IS NULL' : '').
+ ' AND s.published = 1' .
+ ' AND cc.published = 1' .
+ ' ORDER BY a.hits DESC';
+ $db->setQuery($query, 0, $count);
+ $rows = $db->loadObjectList();
+
+ $i = 0;
+ $lists = array();
+ foreach ( $rows as $row )
+ {
+ if($row->access <= $aid)
+ {
+ $lists[$i]->link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid));
+ } else {
+ $lists[$i]->link = JRoute::_('index.php?option=com_user&view=login');
+ }
+ $lists[$i]->text = htmlspecialchars( $row->title );
+ $i++;
+ }
+
+ return $lists;
+ }
+}
diff --git a/oss/joomla/trunk/modules/mod_mostread/index.html b/oss/joomla/trunk/modules/mod_mostread/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_mostread/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_mostread/mod_mostread.php b/oss/joomla/trunk/modules/mod_mostread/mod_mostread.php
new file mode 100644
index 00000000..c9fa4652
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_mostread/mod_mostread.php
@@ -0,0 +1,21 @@
+
+
+ Most Read Content
+ Joomla! Project
+ July 2006
+ Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
+ admin@joomla.org
+ www.joomla.org
+ 1.5.0
+ DESCMOSTREAD
+
+ mod_mostread.php
+
+
+
+
+
+ show
+ hide
+
+
+
+
+
+
+
+ Use global
+ No caching
+
+
+
+
diff --git a/oss/joomla/trunk/modules/mod_mostread/tmpl/default.php b/oss/joomla/trunk/modules/mod_mostread/tmpl/default.php
new file mode 100644
index 00000000..1c7d3d98
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_mostread/tmpl/default.php
@@ -0,0 +1,10 @@
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_mostread/tmpl/index.html b/oss/joomla/trunk/modules/mod_mostread/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_mostread/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_newsflash/helper.php b/oss/joomla/trunk/modules/mod_newsflash/helper.php
new file mode 100644
index 00000000..ec2f3e7b
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_newsflash/helper.php
@@ -0,0 +1,102 @@
+text = $item->introtext;
+ $item->groups = '';
+ $item->readmore = (trim($item->fulltext) != '');
+ $item->metadesc = '';
+ $item->metakey = '';
+ $item->created = '';
+ $item->modified = '';
+
+ if ($params->get('readmore') || $params->get('link_titles'))
+ {
+ if ($params->get('intro_only'))
+ {
+ // Check to see if the user has access to view the full article
+ if ($item->access <= $user->get('aid', 0)) {
+ $item->linkOn = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid));
+ $item->linkText = JText::_('Read more text');
+ } else {
+ $item->linkOn = JRoute::_('index.php?option=com_user&view=login');
+ $item->linkText = JText::_('Login To Read More');
+ }
+ }
+ }
+
+ if (!$params->get('image')) {
+ $item->text = preg_replace( '/ ]*>/', '', $item->text );
+ }
+
+ $results = $mainframe->triggerEvent('onAfterDisplayTitle', array (&$item, &$params, 1));
+ $item->afterDisplayTitle = trim(implode("\n", $results));
+
+ $results = $mainframe->triggerEvent('onBeforeDisplayContent', array (&$item, &$params, 1));
+ $item->beforeDisplayContent = trim(implode("\n", $results));
+
+ require(JModuleHelper::getLayoutPath('mod_newsflash', '_item'));
+ }
+
+ function getList(&$params, &$access)
+ {
+ global $mainframe;
+
+ $db =& JFactory::getDBO();
+ $user =& JFactory::getUser();
+ $aid = $user->get('aid', 0);
+
+ $catid = (int) $params->get('catid', 0);
+ $items = (int) $params->get('items', 0);
+
+ $contentConfig = &JComponentHelper::getParams( 'com_content' );
+ $noauth = !$contentConfig->get('show_noauth');
+ $date =& JFactory::getDate();
+ $now = $date->toMySQL();
+
+ $nullDate = $db->getNullDate();
+
+ // query to determine article count
+ $query = 'SELECT a.*,' .
+ ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,'.
+ ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug'.
+ ' FROM #__content AS a' .
+ ' INNER JOIN #__categories AS cc ON cc.id = a.catid' .
+ ' INNER JOIN #__sections AS s ON s.id = a.sectionid' .
+ ' WHERE a.state = 1 ' .
+ ($noauth ? ' AND a.access <= ' .(int) $aid. ' AND cc.access <= ' .(int) $aid. ' AND s.access <= ' .(int) $aid : '').
+ ' AND (a.publish_up = '.$db->Quote($nullDate).' OR a.publish_up <= '.$db->Quote($now).' ) ' .
+ ' AND (a.publish_down = '.$db->Quote($nullDate).' OR a.publish_down >= '.$db->Quote($now).' )' .
+ ' AND cc.id = '. (int) $catid .
+ ' AND cc.section = s.id' .
+ ' AND cc.published = 1' .
+ ' AND s.published = 1' .
+ ' ORDER BY a.ordering';
+ $db->setQuery($query, 0, $items);
+ $rows = $db->loadObjectList();
+
+ return $rows;
+ }
+}
diff --git a/oss/joomla/trunk/modules/mod_newsflash/index.html b/oss/joomla/trunk/modules/mod_newsflash/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_newsflash/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_newsflash/mod_newsflash.php b/oss/joomla/trunk/modules/mod_newsflash/mod_newsflash.php
new file mode 100644
index 00000000..1ef302ee
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_newsflash/mod_newsflash.php
@@ -0,0 +1,45 @@
+set('intro_only', 1);
+$params->set('hide_author', 1);
+$params->set('hide_createdate', 0);
+$params->set('hide_modifydate', 1);
+
+
+// Disable edit ability icon
+$access = new stdClass();
+$access->canEdit = 0;
+$access->canEditOwn = 0;
+$access->canPublish = 0;
+
+$list = modNewsFlashHelper::getList($params, $access);
+
+// check if any results returned
+$items = count($list);
+if (!$items) {
+ return;
+}
+
+$layout = $params->get('layout', 'default');
+$layout = JFilterInput::clean($layout, 'word');
+$path = JModuleHelper::getLayoutPath('mod_newsflash', $layout);
+if (file_exists($path)) {
+ require($path);
+}
diff --git a/oss/joomla/trunk/modules/mod_newsflash/mod_newsflash.xml b/oss/joomla/trunk/modules/mod_newsflash/mod_newsflash.xml
new file mode 100644
index 00000000..5d150992
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_newsflash/mod_newsflash.xml
@@ -0,0 +1,53 @@
+
+
+ Newsflash
+ Joomla! Project
+ July 2006
+ Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
+ admin@joomla.org
+ www.joomla.org
+ 1.5.0
+ DESCNEWSFLASH
+
+ mod_newsflash.php
+
+
+
+
+ Randomly choose one at a time
+ Horizontal
+ Vertical
+
+
+ Yes
+ No
+
+
+ Use Global
+ No
+ Yes
+
+
+ No
+ Yes
+
+
+ Hide
+ Show
+
+
+ No
+ Yes
+
+
+
+
+
+
+ Use global
+ No caching
+
+
+
+
diff --git a/oss/joomla/trunk/modules/mod_newsflash/tmpl/_item.php b/oss/joomla/trunk/modules/mod_newsflash/tmpl/_item.php
new file mode 100644
index 00000000..9d2662a4
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_newsflash/tmpl/_item.php
@@ -0,0 +1,36 @@
+
+get('item_title')) : ?>
+
+
+
+ get('link_titles') && $item->linkOn != '') : ?>
+
+ title;?>
+
+ title; ?>
+
+
+
+
+
+
+get('intro_only')) :
+ echo $item->afterDisplayTitle;
+endif; ?>
+
+beforeDisplayContent; ?>
+
+
+
+ text; ?>
+
+
+
+
+ linkOn) && $item->readmore && $params->get('readmore')) :
+ echo ''.$item->linkText.' ';
+ endif; ?>
+
+
+
diff --git a/oss/joomla/trunk/modules/mod_newsflash/tmpl/default.php b/oss/joomla/trunk/modules/mod_newsflash/tmpl/default.php
new file mode 100644
index 00000000..0c6bdff9
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_newsflash/tmpl/default.php
@@ -0,0 +1,8 @@
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_newsflash/tmpl/horiz.php b/oss/joomla/trunk/modules/mod_newsflash/tmpl/horiz.php
new file mode 100644
index 00000000..0bf7ed31
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_newsflash/tmpl/horiz.php
@@ -0,0 +1,11 @@
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_newsflash/tmpl/index.html b/oss/joomla/trunk/modules/mod_newsflash/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_newsflash/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_newsflash/tmpl/vert.php b/oss/joomla/trunk/modules/mod_newsflash/tmpl/vert.php
new file mode 100644
index 00000000..449514fa
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_newsflash/tmpl/vert.php
@@ -0,0 +1,8 @@
+
+
+ 1 && (($i < $n - 1) || $params->get('showLastSeparator'))) : ?>
+
+
+
diff --git a/oss/joomla/trunk/modules/mod_poll/helper.php b/oss/joomla/trunk/modules/mod_poll/helper.php
new file mode 100644
index 00000000..2603784f
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_poll/helper.php
@@ -0,0 +1,59 @@
+setQuery($query);
+ $result = $db->loadObject();
+
+ if ($db->getErrorNum()) {
+ JError::raiseWarning( 500, $db->stderr() );
+ }
+
+ return $result;
+ }
+
+ function getPollOptions($id)
+ {
+ $db =& JFactory::getDBO();
+
+ $query = 'SELECT id, text' .
+ ' FROM #__poll_data' .
+ ' WHERE pollid = ' . (int) $id .
+ ' AND text <> ""' .
+ ' ORDER BY id';
+ $db->setQuery($query);
+
+ if (!($options = $db->loadObjectList())) {
+ echo "MD ".$db->stderr();
+ return;
+ }
+
+ return $options;
+ }
+}
+?>
diff --git a/oss/joomla/trunk/modules/mod_poll/index.html b/oss/joomla/trunk/modules/mod_poll/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_poll/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_poll/mod_poll.php b/oss/joomla/trunk/modules/mod_poll/mod_poll.php
new file mode 100644
index 00000000..95d69b01
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_poll/mod_poll.php
@@ -0,0 +1,34 @@
+getItems('link', 'index.php?option=com_poll&view=poll');
+$itemid = isset($items[0]) ? '&Itemid='.$items[0]->id : '';
+
+$poll = modPollHelper::getPoll($params->get( 'id', 0 ));
+
+if ( $poll && $poll->id ) {
+ $layout = JModuleHelper::getLayoutPath('mod_poll');
+ $tabcnt = 0;
+ $options = modPollHelper::getPollOptions($poll->id);
+
+ require($layout);
+}
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_poll/mod_poll.xml b/oss/joomla/trunk/modules/mod_poll/mod_poll.xml
new file mode 100644
index 00000000..ca56f143
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_poll/mod_poll.xml
@@ -0,0 +1,26 @@
+
+
+ Poll
+ Joomla! Project
+ July 2006
+ Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
+ admin@joomla.org
+ www.joomla.org
+ 1.5.0
+ DESCPOLL
+
+ mod_poll.php
+
+
+
+
+
+
+
+ Use global
+ No caching
+
+
+
+
diff --git a/oss/joomla/trunk/modules/mod_poll/tmpl/default.php b/oss/joomla/trunk/modules/mod_poll/tmpl/default.php
new file mode 100644
index 00000000..47b3f1ba
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_poll/tmpl/default.php
@@ -0,0 +1,49 @@
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_poll/tmpl/index.html b/oss/joomla/trunk/modules/mod_poll/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_poll/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_random_image/helper.php b/oss/joomla/trunk/modules/mod_random_image/helper.php
new file mode 100644
index 00000000..e6250078
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_random_image/helper.php
@@ -0,0 +1,116 @@
+get( 'width' );
+ $height = $params->get( 'height' );
+
+ $i = count($images);
+ $random = mt_rand(0, $i - 1);
+ $image = $images[$random];
+ $size = getimagesize (JPATH_BASE.DS.$image->folder .DS. $image->name);
+
+
+ if ($width == '') {
+ $width = 100;
+ }
+
+ if ($size[0] < $width) {
+ $width = $size[0];
+ }
+
+ $coeff = $size[0]/$size[1];
+ if ($height == '') {
+ $height = (int) ($width/$coeff);
+ } else {
+ $newheight = min ($height, (int) ($width/$coeff));
+ if ($newheight < $height) {
+ $height = $newheight;
+ } else {
+ $width = $height * $coeff;
+ }
+ }
+
+ $image->width = $width;
+ $image->height = $height;
+ $image->folder = str_replace( '\\', '/', $image->folder );
+
+ return $image;
+ }
+
+ function getImages(&$params, $folder)
+ {
+ $type = $params->get( 'type', 'jpg' );
+
+ $files = array();
+ $images = array();
+
+ $dir = JPATH_BASE.DS.$folder;
+
+ // check if directory exists
+ if (is_dir($dir))
+ {
+ if ($handle = opendir($dir)) {
+ while (false !== ($file = readdir($handle))) {
+ if ($file != '.' && $file != '..' && $file != 'CVS' && $file != 'index.html' ) {
+ $files[] = $file;
+ }
+ }
+ }
+ closedir($handle);
+
+ $i = 0;
+ foreach ($files as $img)
+ {
+ if (!is_dir($dir .DS. $img))
+ {
+ if (eregi($type, $img)) {
+ $images[$i]->name = $img;
+ $images[$i]->folder = $folder;
+ ++$i;
+ }
+ }
+ }
+ }
+
+ return $images;
+ }
+
+ function getFolder(&$params)
+ {
+ $folder = $params->get( 'folder' );
+
+ $LiveSite = JURI::base();
+
+ // if folder includes livesite info, remove
+ if ( JString::strpos($folder, $LiveSite) === 0 ) {
+ $folder = str_replace( $LiveSite, '', $folder );
+ }
+ // if folder includes absolute path, remove
+ if ( JString::strpos($folder, JPATH_SITE) === 0 ) {
+ $folder= str_replace( JPATH_BASE, '', $folder );
+ }
+ $folder = str_replace('\\',DS,$folder);
+ $folder = str_replace('/',DS,$folder);
+
+ return $folder;
+ }
+}
+
diff --git a/oss/joomla/trunk/modules/mod_random_image/index.html b/oss/joomla/trunk/modules/mod_random_image/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_random_image/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_random_image/mod_random_image.php b/oss/joomla/trunk/modules/mod_random_image/mod_random_image.php
new file mode 100644
index 00000000..53b66d5b
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_random_image/mod_random_image.php
@@ -0,0 +1,31 @@
+get( 'link' );
+
+$folder = modRandomImageHelper::getFolder($params);
+$images = modRandomImageHelper::getImages($params, $folder);
+
+if (!count($images)) {
+ echo JText::_( 'No images ');
+ return;
+}
+
+$image = modRandomImageHelper::getRandomImage($params, $images);
+require(JModuleHelper::getLayoutPath('mod_random_image'));
diff --git a/oss/joomla/trunk/modules/mod_random_image/mod_random_image.xml b/oss/joomla/trunk/modules/mod_random_image/mod_random_image.xml
new file mode 100644
index 00000000..76a1edc2
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_random_image/mod_random_image.xml
@@ -0,0 +1,31 @@
+
+
+ Random Image
+ Joomla! Project
+ July 2006
+ Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
+ admin@joomla.org
+ www.joomla.org
+ 1.5.0
+ DESCRANDOMIMAGE
+
+ mod_random_image.php
+
+
+
+
+
+
+
+
+
+
+
+
+ Use global
+ No caching
+
+
+
+
diff --git a/oss/joomla/trunk/modules/mod_random_image/tmpl/default.php b/oss/joomla/trunk/modules/mod_random_image/tmpl/default.php
new file mode 100644
index 00000000..7ea6f342
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_random_image/tmpl/default.php
@@ -0,0 +1,11 @@
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_random_image/tmpl/index.html b/oss/joomla/trunk/modules/mod_random_image/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_random_image/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_related_items/helper.php b/oss/joomla/trunk/modules/mod_related_items/helper.php
new file mode 100644
index 00000000..86e1f7d5
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_related_items/helper.php
@@ -0,0 +1,106 @@
+get('showDate', 0);
+
+ $nullDate = $db->getNullDate();
+
+
+ $date =& JFactory::getDate();
+ $now = $date->toMySQL();
+
+ $related = array();
+
+ if ($option == 'com_content' && $view == 'article' && $id)
+ {
+
+ // select the meta keywords from the item
+ $query = 'SELECT metakey' .
+ ' FROM #__content' .
+ ' WHERE id = '.(int) $id;
+ $db->setQuery($query);
+
+ if ($metakey = trim($db->loadResult()))
+ {
+ // explode the meta keys on a comma
+ $keys = explode(',', $metakey);
+ $likes = array ();
+
+ // assemble any non-blank word(s)
+ foreach ($keys as $key)
+ {
+ $key = trim($key);
+ if ($key) {
+ $likes[] = ',' . $db->getEscaped($key) . ','; // surround with commas so first and last items have surrounding commas
+ }
+ }
+
+ if (count($likes))
+ {
+ // select other items based on the metakey field 'like' the keys found
+ $query = 'SELECT a.id, a.title, DATE_FORMAT(a.created, "%Y-%m-%d") AS created, a.sectionid, a.catid, cc.access AS cat_access, s.access AS sec_access, cc.published AS cat_state, s.published AS sec_state,' .
+ ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,'.
+ ' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug'.
+ ' FROM #__content AS a' .
+ ' LEFT JOIN #__content_frontpage AS f ON f.content_id = a.id' .
+ ' LEFT JOIN #__categories AS cc ON cc.id = a.catid' .
+ ' LEFT JOIN #__sections AS s ON s.id = a.sectionid' .
+ ' WHERE a.id != '.(int) $id .
+ ' AND a.state = 1' .
+ ' AND a.access <= ' .(int) $user->get('aid', 0) .
+ ' AND ( CONCAT(",", REPLACE(a.metakey,", ",","),",") LIKE "%'.implode('%" OR CONCAT(",", REPLACE(a.metakey,", ",","),",") LIKE "%', $likes).'%" )' . //remove single space after commas in keywords
+ ' AND ( a.publish_up = '.$db->Quote($nullDate).' OR a.publish_up <= '.$db->Quote($now).' )' .
+ ' AND ( a.publish_down = '.$db->Quote($nullDate).' OR a.publish_down >= '.$db->Quote($now).' )';
+ $db->setQuery($query);
+ $temp = $db->loadObjectList();
+
+ if (count($temp))
+ {
+ foreach ($temp as $row)
+ {
+ if (($row->cat_state == 1 || $row->cat_state == '') && ($row->sec_state == 1 || $row->sec_state == '') && ($row->cat_access <= $user->get('aid', 0) || $row->cat_access == '') && ($row->sec_access <= $user->get('aid', 0) || $row->sec_access == ''))
+ {
+ $row->route = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid));
+ $related[] = $row;
+ }
+ }
+ }
+ unset ($temp);
+ }
+ }
+ }
+
+ return $related;
+ }
+}
diff --git a/oss/joomla/trunk/modules/mod_related_items/index.html b/oss/joomla/trunk/modules/mod_related_items/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_related_items/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_related_items/mod_related_items.php b/oss/joomla/trunk/modules/mod_related_items/mod_related_items.php
new file mode 100644
index 00000000..3c3b1bd1
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_related_items/mod_related_items.php
@@ -0,0 +1,28 @@
+get('showDate', 0);
+
+require(JModuleHelper::getLayoutPath('mod_related_items'));
diff --git a/oss/joomla/trunk/modules/mod_related_items/mod_related_items.xml b/oss/joomla/trunk/modules/mod_related_items/mod_related_items.xml
new file mode 100644
index 00000000..eb1301f6
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_related_items/mod_related_items.xml
@@ -0,0 +1,30 @@
+
+
+ Related Items
+ Joomla! Project
+ July 2004
+ Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
+ http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
+ admin@joomla.org
+ www.joomla.org
+ 1.0.0
+ DESCRELATEDITEMS
+
+ mod_related_items.php
+
+
+
+ Hide
+ Show
+
+
+
+
+
+
+ Use global
+ No caching
+
+
+
+
diff --git a/oss/joomla/trunk/modules/mod_related_items/tmpl/default.php b/oss/joomla/trunk/modules/mod_related_items/tmpl/default.php
new file mode 100644
index 00000000..ba1e2fa0
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_related_items/tmpl/default.php
@@ -0,0 +1,11 @@
+
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_related_items/tmpl/index.html b/oss/joomla/trunk/modules/mod_related_items/tmpl/index.html
new file mode 100644
index 00000000..fa6d84e8
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_related_items/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/oss/joomla/trunk/modules/mod_search/helper.php b/oss/joomla/trunk/modules/mod_search/helper.php
new file mode 100644
index 00000000..823a8e82
--- /dev/null
+++ b/oss/joomla/trunk/modules/mod_search/helper.php
@@ -0,0 +1,22 @@
+