Your IP : 216.73.216.216


Current Path : /proc/thread-self/root/var/tmp/
Upload File :
Current File : //proc/thread-self/root/var/tmp/phpCa0NFW

<?php
/**
 * @package	AcyMailing for Joomla!
 * @version	5.5.0
 * @author	acyba.com
 * @copyright	(C) 2009-2016 ACYBA S.A.R.L. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?><div class="acymailing_module<?php echo $params->get('moduleclass_sfx')?>" id="acymailing_module_<?php echo $formName; ?>">
<?php
	$style = array();
	if($params->get('effect','normal') == 'mootools-slide'){
		if(!empty($mootoolsIntro)) echo '<p class="acymailing_mootoolsintro">'.$mootoolsIntro.'</p>'; ?>
		<div class="acymailing_mootoolsbutton" id="acymailing_toggle_<?php echo $formName; ?>" >
			<p><a class="acymailing_togglemodule" id="acymailing_togglemodule_<?php echo $formName; ?>" href="#subscribe"><?php echo $mootoolsButton ?></a></p>
	<?php
	}
	if($params->get('textalign','none') != 'none') $style[] .= 'text-align:'.$params->get('textalign');
	$styleString = empty($style) ? '' : 'style="'.implode(';',$style).'"';
	?>
	<div class="acymailing_fulldiv" id="acymailing_fulldiv_<?php echo $formName; ?>" <?php echo $styleString; ?> >
		<form id="<?php echo $formName; ?>" action="<?php echo JRoute::_('index.php'); ?>" onsubmit="return submitacymailingform('optin','<?php echo $formName;?>')" method="post" name="<?php echo $formName ?>" <?php if(!empty($fieldsClass->formoption)) echo $fieldsClass->formoption; ?> >
		<div class="acymailing_module_form" >
			<?php if(!empty($introText)) echo '<div class="acymailing_introtext">'.$introText.'</div>';

			$listContent = '';
			if($params->get('dropdown',0)){
				$listContent .= '<select name="subscription[1]">';
				foreach($visibleListsArray as $myListId){
					$listContent .= '<option value="'.$myListId.'">'.$allLists[$myListId]->name.'</option>';
				}
				$listContent .= '</select>';
			} else{
				$listContent .= '<table class="acymailing_lists">';
				foreach($visibleListsArray as $myListId){
					$check = in_array($myListId,$checkedListsArray) ? 'checked="checked"' : '';
					if($params->get('checkmode',0) == '0' AND !empty($identifiedUser->email)){
						if(empty($allLists[$myListId]->status)){$check = '';}
						else{
							$check = $allLists[$myListId]->status == '-1' ? '' : 'checked="checked"';
						}
					}
					$listContent .= '
					<tr>
						<td>
						<label for="acylist_'.$myListId.'">
						<input type="checkbox" class="acymailing_checkbox" name="subscription[]" id="acylist_'.$myListId.'" '.$check.' value="'.$myListId.'"/>';
						$joomItem = $params->get('itemid',0);
						if(empty($joomItem)) $joomItem = $config->get('itemid',0);
						$addItem = empty($joomItem) ? '' : '&Itemid='.$joomItem;
						$archivelink = acymailing_completeLink('archive&listid='.$allLists[$myListId]->listid.'-'.$allLists[$myListId]->alias.$addItem);
						if($params->get('overlay',0)){
							if(!$params->get('link',1) OR !$allLists[$myListId]->visible) $archivelink = '';
							$listContent .= ' '.acymailing_tooltip($allLists[$myListId]->description,$allLists[$myListId]->name,'',$allLists[$myListId]->name,$archivelink);
						}else{
							if($params->get('link',1) AND $allLists[$myListId]->visible){
								$listContent .= ' <a href="'.$archivelink.'" alt="'.$allLists[$myListId]->alias.'"'.((JRequest::getCmd('tmpl') == 'component') ? 'target="_blank"' : '').' >';
							}
							$listContent .= $allLists[$myListId]->name;
							if($params->get('link',1) AND $allLists[$myListId]->visible){
								$listContent .= '</a>';
							}
						}
						$listContent .= '</label>
						</td>
					</tr>';
				}
				$listContent .= '</table>';
			}

			if(!empty($visibleListsArray) && $listPosition == 'before'){
				echo $listContent;
			}//endif visiblelists
			?>
			<table class="acymailing_form">
				<tr>
					<?php foreach($fieldsToDisplay as $oneField){
						if($oneField == 'name' AND empty($extraFields[$oneField])){
							if($displayOutside) echo '<td><label for="user_name_'.$formName.'" class="acy_requiredField">'.$nameCaption.'</label></td>'; ?>
							<td class="acyfield_<?php echo $oneField. (!$displayOutside? ' acy_requiredField':''); ?>">
								<input id="user_name_<?php echo $formName; ?>" <?php if(!empty($identifiedUser->userid)) echo 'readonly="readonly" ';  if(!$displayOutside){ ?> onfocus="if(this.value == '<?php echo $nameCaption;?>') this.value = '';" onblur="if(this.value=='') this.value='<?php echo $nameCaption?>';"<?php } ?> class="inputbox" type="text" name="user[name]" style="width:<?php echo $fieldsize; ?>" value="<?php if(!empty($identifiedUser->userid)) echo $identifiedUser->name; elseif(!$displayOutside) echo $nameCaption; ?>" title="<?php echo $nameCaption?>"/>
							</td> <?php
						}elseif($oneField == 'email' AND empty($extraFields[$oneField])){
							if($displayOutside) echo '<td><label for="user_email_'.$formName.'" class="acy_requiredField">'.$emailCaption.'</label></td>'; ?>
							<td class="acyfield_<?php echo $oneField. (!$displayOutside? ' acy_requiredField':''); ?>">
								<input id="user_email_<?php echo $formName; ?>" <?php if(!empty($identifiedUser->userid)) echo 'readonly="readonly" ';  if(!$displayOutside){ ?> onfocus="if(this.value == '<?php echo $emailCaption;?>') this.value = '';" onblur="if(this.value=='') this.value='<?php echo $emailCaption?>';"<?php } ?> class="inputbox" type="text" name="user[email]" style="width:<?php echo $fieldsize; ?>" value="<?php if(!empty($identifiedUser->userid)) echo $identifiedUser->email; elseif(!$displayOutside) echo $emailCaption; ?>" title="<?php echo $emailCaption;?>"/>
							</td> <?php
						}elseif($oneField == 'html' AND empty($extraFields[$oneField])){
							echo '<td class="acyfield_'.$oneField.'" ';
							if($displayOutside AND !$displayInline) echo 'colspan="2"';
							echo '>'.JText::_('RECEIVE').JHTML::_('select.booleanlist', "user[html]" ,'title="'.JText::_('RECEIVE').'"',isset($identifiedUser->html) ? $identifiedUser->html : 1,JText::_('HTML'),JText::_('JOOMEXT_TEXT'),'user_html_'.$formName).'</td>';
						}elseif(!empty($extraFields[$oneField])){
							if($extraFields[$oneField]->type == 'category'){
								echo '<td '. ($displayOutside && !$displayInline?'colspan="2"':'').' class="category_warning">Please use Tableless mode to display categories.</td>';
							} else{
								if($displayOutside){
									if(!empty($extraFields[$oneField]->required)) $requireClass = 'class="acy_requiredField"';
									else $requireClass = "";
									echo '<td><label '.((strpos($extraFields[$oneField]->type,'text') !== false) ? 'for="user_'.$oneField.'_'.$formName.'"' : '' ).' '. $requireClass .'>'.$fieldsClass->trans($extraFields[$oneField]->fieldname).'</label></td>';
								}
								$sizestyle = '';
								if(!empty($extraFields[$oneField]->options['size'])){
									$sizestyle = 'style="width:'.(is_numeric($extraFields[$oneField]->options['size']) ? ($extraFields[$oneField]->options['size'].'px') : $extraFields[$oneField]->options['size']).'"';
								}
								if(!empty($extraFields[$oneField]->required) && !$displayOutside) $requireClass = 'acy_requiredField';
								else $requireClass = "";
								?>
								<td class="acyfield_<?php echo $oneField .' '. $requireClass; ?>">
								<?php if(!empty($identifiedUser->userid) AND in_array($oneField,array('name','email'))){ ?>
										<input id="user_<?php echo $oneField; ?>_<?php echo $formName; ?>" readonly="readonly" class="inputbox" type="text" name="user[<?php echo $oneField;?>]" <?php echo $sizestyle; ?> value="<?php echo @$identifiedUser->$oneField; ?>" title="<?php echo $oneField;?>"/>
								<?php }else{
										echo $fieldsClass->display($extraFields[$oneField],@$identifiedUser->$oneField,'user['.$oneField.']',!$displayOutside);
								}?>
								</td><?php
							}
						}else{
							continue;
						}
						if(!$displayInline) echo '</tr><tr>';
					}

				if(empty($identifiedUser->userid) AND $config->get('captcha_enabled') AND acymailing_level(1)){ ?>
					<td class="captchakeymodule">
					<?php
						$captchaClass = acymailing_get('class.acycaptcha');
						if($displayOutside){ $captchaClass->display($formName, true).'</td><td class="captchafieldmodule">'; }else{$captchaClass->display($formName, true);}
					?>
					<?php if(!$displayInline) echo '</tr><tr>';
				}

				 if($params->get('showterms',false)){
					?>
					<td class="acyterms" <?php if($displayOutside AND !$displayInline) echo 'colspan="2"'; ?> >
					<input id="mailingdata_terms_<?php echo $formName; ?>" class="checkbox" type="checkbox" name="terms" title="<?php echo JText::_('JOOMEXT_TERMS'); ?>"/> <?php echo $termslink;?>
					</td>
					<?php if(!$displayInline) echo '</tr><tr>';
					} ?>

					<?php if(!empty($visibleListsArray) && $listPosition == 'after') echo $listContent; ?>

					<td <?php if($displayOutside AND !$displayInline) echo 'colspan="2"'; ?> class="acysubbuttons">
						<?php if($params->get('showsubscribe',true)){?>
						<input class="button subbutton btn btn-primary" type="submit" value="<?php $subtext = $params->get('subscribetextreg'); if(empty($identifiedUser->userid) OR empty($subtext)){ $subtext = $params->get('subscribetext',JText::_('SUBSCRIBECAPTION')); } echo $subtext;  ?>" name="Submit" onclick="try{ return submitacymailingform('optin','<?php echo $formName;?>'); }catch(err){alert('The form could not be submitted '+err);return false;}"/>
						<?php }if($params->get('showunsubscribe',false) AND (!$params->get('showsubscribe',true) OR empty($identifiedUser->userid) OR !empty($countUnsub)) ){?>
						<input class="button unsubbutton  btn btn-inverse" type="button" value="<?php echo $params->get('unsubscribetext',JText::_('UNSUBSCRIBECAPTION')); ?>" name="Submit" onclick="return submitacymailingform('optout','<?php echo $formName;?>')"/>
						<?php } ?>
					</td>
				</tr>
			</table>
			<?php
			if(!empty($fieldsClass->excludeValue)){
				$js = "\n"."acymailing['excludeValues".$formName."'] = Array();";
				foreach($fieldsClass->excludeValue as $namekey => $value){
					$js .= "\n"."acymailing['excludeValues".$formName."']['".$namekey."'] = '".$value."';";
				}
				$js .= "\n";
				$doc = JFactory::getDocument();
				if($params->get('includejs','header') == 'header'){
					$doc->addScriptDeclaration( $js );
				}else{
					echo "<script type=\"text/javascript\">
							<!--
							$js
							//-->
							</script>";
				}
			}
			if(!empty($postText)) echo '<div class="acymailing_finaltext">'.$postText.'</div>';
			$ajax = ($params->get('redirectmode') == '3') ? 1 : 0;?>
			<input type="hidden" name="ajax" value="<?php echo $ajax; ?>" />
			<input type="hidden" name="acy_source" value="<?php echo 'module_'.$module->id ?>" />
			<input type="hidden" name="ctrl" value="sub"/>
			<input type="hidden" name="task" value="notask"/>
			<input type="hidden" name="redirect" value="<?php echo urlencode($redirectUrl); ?>"/>
			<input type="hidden" name="redirectunsub" value="<?php echo urlencode($redirectUrlUnsub); ?>"/>
			<input type="hidden" name="option" value="<?php echo ACYMAILING_COMPONENT ?>"/>
			<?php if(!empty($identifiedUser->userid)){ ?><input type="hidden" name="visiblelists" value="<?php echo $visibleLists;?>"/><?php } ?>
			<input type="hidden" name="hiddenlists" value="<?php echo $hiddenLists;?>"/>
			<input type="hidden" name="acyformname" value="<?php echo $formName; ?>" />
			<?php if(JRequest::getCmd('tmpl') == 'component'){ ?>
				<input type="hidden" name="tmpl" value="component" />
				<?php if($params->get('effect','normal') == 'mootools-box' AND !empty($redirectUrl)){ ?>
					<input type="hidden" name="closepop" value="1" />
				<?php } } ?>
			<?php $myItemId = $config->get('itemid',0); if(empty($myItemId)){ global $Itemid; $myItemId = $Itemid;} if(!empty($myItemId)){ ?><input type="hidden" name="Itemid" value="<?php echo $myItemId;?>"/><?php } ?>
			</div>
		</form>
	</div>
	<?php if($params->get('effect','normal') == 'mootools-slide'){ ?> </div> <?php } ?>
</div>
<html><body bgcolor="#FFFFFF"></body></html><?php
/**
 * @package	AcyMailing for Joomla!
 * @version	5.5.0
 * @author	acyba.com
 * @copyright	(C) 2009-2016 ACYBA S.A.R.L. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?><div class="acymailing_module<?php echo $params->get('moduleclass_sfx') ?>" id="acymailing_module_<?php echo $formName; ?>">
	<?php
	if(!empty($mootoolsIntro)) echo '<p class="acymailing_mootoolsintro">'.$mootoolsIntro.'</p>'; ?>
	<div class="acymailing_mootoolsbutton">
		<?php
		$acypop = acymailing_get('helper.acypopup');
		$acypop->useMootools = ($params->get('loadmootools', '1') == 1) ? true : false;
		$href = acymailing_completeLink('sub&task=display&autofocus=1&formid='.$module->id, true);

		$link = $acypop->display($mootoolsButton, '', $href, 'acymailing_togglemodule_'.$formName, $params->get('boxwidth', 250), $params->get('boxheight', 200), 'class="acymailing_togglemodule"', '', 'link');

		?>
		<p><?php echo $link; ?></p>
	</div>
</div>
<?php
/**
 * @package	AcyMailing for Joomla!
 * @version	5.5.0
 * @author	acyba.com
 * @copyright	(C) 2009-2016 ACYBA S.A.R.L. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?><div class="acymailing_module<?php echo $params->get('moduleclass_sfx')?>" id="acymailing_module_<?php echo $formName; ?>">
<?php
	$style = array();
	if($params->get('effect','normal') == 'mootools-slide'){
		if(!empty($mootoolsIntro)) echo '<p class="acymailing_mootoolsintro">'.$mootoolsIntro.'</p>'; ?>
		<div class="acymailing_mootoolsbutton" id="acymailing_toggle_<?php echo $formName; ?>">
			<p><a class="acymailing_togglemodule" id="acymailing_togglemodule_<?php echo $formName; ?>" href="#subscribe"><?php echo $mootoolsButton ?></a></p>
	<?php
	}
	if($params->get('textalign','none') != 'none') $style[] .= 'text-align:'.$params->get('textalign');
	$styleString = empty($style) ? '' : 'style="'.implode(';',$style).'"';
	?>
	<div class="acymailing_fulldiv" id="acymailing_fulldiv_<?php echo $formName; ?>" <?php echo $styleString; ?> >
		<form id="<?php echo $formName; ?>" action="<?php echo JRoute::_('index.php'); ?>" onsubmit="return submitacymailingform('optin','<?php echo $formName;?>')" method="post" name="<?php echo $formName ?>" <?php if(!empty($fieldsClass->formoption)) echo $fieldsClass->formoption; ?> >
		<div class="acymailing_module_form" >
			<?php if(!empty($introText)) echo '<div class="acymailing_introtext">'.$introText.'</div>';

			$listContent = '';
			if($params->get('dropdown',0)){
				$listContent .= '<select name="subscription[1]">';
				foreach($visibleListsArray as $myListId){
					$listContent .= '<option value="'.$myListId.'">'.$allLists[$myListId]->name.'</option>';
				}
				$listContent .= '</select>';
			} else{
				$listContent .= '<div class="acymailing_lists">';
				foreach($visibleListsArray as $myListId){
					$check = in_array($myListId,$checkedListsArray) ? 'checked="checked"' : '';

					if($params->get('checkmode',0) == '0' AND !empty($identifiedUser->email)){
						if(empty($allLists[$myListId]->status)){$check = '';}
						else{
							$check = $allLists[$myListId]->status == '-1' ? '' : 'checked="checked"';
						}
					}
					$listContent .= '
					<p class="onelist">
						<label for="acylist_'.$myListId.'">
						<input type="checkbox" class="acymailing_checkbox" name="subscription[]" id="acylist_'.$myListId.'" '.$check.' value="'.$myListId.'"/>';
						$joomItem = $params->get('itemid',0);
						if(empty($joomItem)) $joomItem = $config->get('itemid',0);
						$addItem = empty($joomItem) ? '' : '&Itemid='.$joomItem;
						$archivelink = acymailing_completeLink('archive&listid='.$allLists[$myListId]->listid.'-'.$allLists[$myListId]->alias.$addItem);
						if($params->get('overlay',0)){
							if(!$params->get('link',1) OR !$allLists[$myListId]->visible) $archivelink = '';
							$listContent .= acymailing_tooltip($allLists[$myListId]->description,$allLists[$myListId]->name,'',$allLists[$myListId]->name,$archivelink);
						}else{
							if($params->get('link',1) AND $allLists[$myListId]->visible){
								$listContent .= '<a href="'.$archivelink.'" alt="'.$allLists[$myListId]->alias.'"'.((JRequest::getCmd('tmpl') == 'component') ? 'target="_blank"' : '').' >';
							}
							$listContent .= $allLists[$myListId]->name;
							if($params->get('link',1) AND $allLists[$myListId]->visible){
								$listContent .= '</a>';
							}
						}
						$listContent .= '
						</label>
					</p>';
				 }
				$listContent .= '</div>';
			}

			if(!empty($visibleListsArray) && $listPosition == 'before') echo $listContent; ?>
			<div class="acymailing_form">
					<?php
					$tmpCatId = array();
					$tmpCatTag = array();
					foreach($fieldsToDisplay as $oneField){
						if(empty($extraFields[$oneField])) echo '<p class="onefield fieldacy'.$oneField.'" id="field_'.$oneField.'_'.$formName.'">';
						if($oneField == 'name' AND empty($extraFields[$oneField])){
							if($displayOutside) echo '<label for="user_name_'.$formName.'" class="acy_requiredField">'.$nameCaption.'</label>'; ?>
							<span class="acyfield_<?php echo $oneField. (!$displayOutside? ' acy_requiredField':''); ?>"><input id="user_name_<?php echo $formName; ?>" <?php if(!empty($identifiedUser->userid)) echo 'readonly="readonly" '; if(!$displayOutside){ ?> onfocus="if(this.value == '<?php echo $nameCaption;?>') this.value = '';" onblur="if(this.value=='') this.value='<?php echo $nameCaption?>';"<?php } ?> class="inputbox" type="text" name="user[name]" style="width:<?php echo $fieldsize; ?>" value="<?php if(!empty($identifiedUser->userid)) echo $identifiedUser->name; elseif(!$displayOutside) echo $nameCaption; ?>" title="<?php echo $nameCaption;?>"/></span>
							<?php
						}elseif($oneField == 'email' AND empty($extraFields[$oneField])){
							if($displayOutside) echo '<label for="user_email_'.$formName.'" class="acy_requiredField">'.$emailCaption.'</label>'; ?>
							<span class="acyfield_<?php echo $oneField. (!$displayOutside? ' acy_requiredField':''); ?>"><input id="user_email_<?php echo $formName; ?>" <?php if(!empty($identifiedUser->userid)) echo 'readonly="readonly" '; if(!$displayOutside){ ?> onfocus="if(this.value == '<?php echo $emailCaption;?>') this.value = '';" onblur="if(this.value=='') this.value='<?php echo $emailCaption?>';"<?php } ?> class="inputbox" type="text" name="user[email]" style="width:<?php echo $fieldsize; ?>" value="<?php if(!empty($identifiedUser->userid)) echo $identifiedUser->email; elseif(!$displayOutside) echo $emailCaption; ?>" title="<?php echo $emailCaption;?>" /></span>
							<?php
						}elseif($oneField == 'html' AND empty($extraFields[$oneField])){
							echo '<label>'.JText::_('RECEIVE').'</label>';
							echo '<span class="acyfield_'.$oneField.'">'.JHTML::_('select.booleanlist', "user[html]" ,'title="'.JText::_('RECEIVE').'"',isset($identifiedUser->html) ? $identifiedUser->html : 1,JText::_('HTML'),JText::_('JOOMEXT_TEXT'),'user_html_'.$formName).'</span>';
						}elseif(!empty($extraFields[$oneField])){
							if($extraFields[$oneField]->type == 'category'){
								if(empty($extraFields[$oneField]->fieldcat) && !empty($tmpCatId)){
									while(!empty($tmpCatId)){
										echo '</'.str_replace('fldset', 'fieldset', end($tmpCatTag)).'>';
										array_pop($tmpCatId);
										array_pop($tmpCatTag);
									}
								}
								$tmpCatId[] = $extraFields[$oneField]->fieldid;
								$tmpCatTag[] = $extraFields[$oneField]->options['fieldcattag'];
								echo '<'.str_replace('fldset', 'fieldset', end($tmpCatTag)).' class="fieldCategory fieldacy'.$extraFields[$oneField]->namekey.' '.$extraFields[$oneField]->options['fieldcatclass'].'">';
								if(in_array(end($tmpCatTag), array('fieldset', 'fldset'))) echo '<legend>'.$extraFields[$oneField]->fieldname.'</legend>';
							}else{
								if(in_array($extraFields[$oneField]->fieldcat, $tmpCatId) || empty($extraFields[$oneField]->fieldcat)){
									while(!empty($tmpCatId) && $extraFields[$oneField]->fieldcat != end($tmpCatId)){
										echo '</'.str_replace('fldset', 'fieldset', end($tmpCatTag)).'>';
										array_pop($tmpCatId);
										array_pop($tmpCatTag);
									}
								}
								echo '<p class="onefield fieldacy'.$oneField.'" id="field_'.$oneField.'_'.$formName.'">';
								if($displayOutside){
									if(!empty($extraFields[$oneField]->required)) $requireClass = 'class="acy_requiredField"';
									else $requireClass = "";
									 echo '<label '.((strpos($extraFields[$oneField]->type,'text') !== false) ? 'for="user_'.$oneField.'_'.$formName.'"' : '' ).' '.$requireClass.'>'.$fieldsClass->trans($extraFields[$oneField]->fieldname).'</label>';
								}
								$sizestyle = '';
								if(!empty($extraFields[$oneField]->options['size'])){
									$sizestyle = 'style="width:'.(is_numeric($extraFields[$oneField]->options['size']) ? ($extraFields[$oneField]->options['size'].'px') : $extraFields[$oneField]->options['size']).'"';
								}
								if(!empty($extraFields[$oneField]->required) && !$displayOutside) $requireClass = ' acy_requiredField';
								else $requireClass = "";
								?>
								<span class="acyfield_<?php echo $oneField.$requireClass; ?>">
								<?php if(!empty($identifiedUser->userid) AND in_array($oneField,array('name','email'))){ ?>
										<input id="user_<?php echo $oneField; ?>_<?php echo $formName; ?>" readonly="readonly" class="inputbox" type="text" name="user[<?php echo $oneField;?>]" <?php echo $sizestyle; ?> value="<?php echo @$identifiedUser->$oneField; ?>" title="<?php echo $oneField;?>"/>
								<?php }else{
										echo $fieldsClass->display($extraFields[$oneField],@$identifiedUser->$oneField,'user['.$oneField.']',!$displayOutside);
								}?>
								</span>
								</p>
								<?php
							}
						}
						if(empty($extraFields[$oneField])) echo '</p>';
					}
					if(!empty($extraFields)){
						$lastVal = end($tmpCatId);
						while(!empty($lastVal)){
							echo '</'.str_replace('fldset', 'fieldset', end($tmpCatTag)).'>';
							array_pop($tmpCatId);
							array_pop($tmpCatTag);
							$lastVal = end($tmpCatId);
						}
					}

				if(empty($identifiedUser->userid) AND $config->get('captcha_enabled') AND acymailing_level(1)){ ?>
					<?php
					echo '<p class="onefield fieldacycaptcha" id="field_captcha_'.$formName.'">';
					$captchaClass = acymailing_get('class.acycaptcha');
					$captchaClass->display($formName, true);
					?>
					</p>
				<?php }

				 if($params->get('showterms',false)){
					echo '<p class="onefield fieldacyterms" id="field_terms_'.$formName.'">';
					?>
					<label for="mailingdata_terms_<?php echo $formName; ?>"><input id="mailingdata_terms_<?php echo $formName; ?>" class="checkbox" type="checkbox" name="terms" title="<?php echo JText::_('JOOMEXT_TERMS'); ?>"/> <?php echo $termslink; ?></label>
					</p>
					<?php } ?>

					<?php if(!empty($visibleListsArray) && $listPosition == 'after')  echo $listContent; ?>

					<p class="acysubbuttons">
						<?php if($params->get('showsubscribe',true)){?>
						<input class="button subbutton btn btn-primary" type="submit" value="<?php $subtext = $params->get('subscribetextreg'); if(empty($identifiedUser->userid) OR empty($subtext)){ $subtext = $params->get('subscribetext',JText::_('SUBSCRIBECAPTION')); } echo $subtext;  ?>" name="Submit" onclick="try{ return submitacymailingform('optin','<?php echo $formName;?>'); }catch(err){alert('The form could not be submitted '+err);return false;}"/>
						<?php }if($params->get('showunsubscribe',false) AND (!$params->get('showsubscribe',true) OR empty($identifiedUser->userid) OR !empty($countUnsub)) ){?>
						<input class="button unsubbutton btn btn-inverse" type="button" value="<?php echo $params->get('unsubscribetext',JText::_('UNSUBSCRIBECAPTION')); ?>" name="Submit" onclick="return submitacymailingform('optout','<?php echo $formName;?>')"/>
						<?php } ?>
					</p>
				</div>
			<?php
			if(!empty($fieldsClass->excludeValue)){
				$js = "\n"."acymailing['excludeValues".$formName."'] = Array();";
				foreach($fieldsClass->excludeValue as $namekey => $value){
					$js .= "\n"."acymailing['excludeValues".$formName."']['".$namekey."'] = '".$value."';";
				}
				$js .= "\n";
				$doc = JFactory::getDocument();
				if($params->get('includejs','header') == 'header'){
					$doc->addScriptDeclaration( $js );
				}else{
					echo "<script type=\"text/javascript\">
							<!--
							$js
							//-->
							</script>";
				}
			}
			if(!empty($postText)) echo '<div class="acymailing_finaltext">'.$postText.'</div>';
			$ajax = ($params->get('redirectmode') == '3') ? 1 : 0;?>
			<input type="hidden" name="ajax" value="<?php echo $ajax; ?>"/>
			<input type="hidden" name="acy_source" value="<?php echo 'module_'.$module->id ?>" />
			<input type="hidden" name="ctrl" value="sub"/>
			<input type="hidden" name="task" value="notask"/>
			<input type="hidden" name="redirect" value="<?php echo urlencode($redirectUrl); ?>"/>
			<input type="hidden" name="redirectunsub" value="<?php echo urlencode($redirectUrlUnsub); ?>"/>
			<input type="hidden" name="option" value="<?php echo ACYMAILING_COMPONENT ?>"/>
			<?php if(!empty($identifiedUser->userid)){ ?><input type="hidden" name="visiblelists" value="<?php echo $visibleLists;?>"/><?php } ?>
			<input type="hidden" name="hiddenlists" value="<?php echo $hiddenLists;?>"/>
			<input type="hidden" name="acyformname" value="<?php echo $formName; ?>" />
			<?php if(JRequest::getCmd('tmpl') == 'component'){ ?>
				<input type="hidden" name="tmpl" value="component" />
				<?php if($params->get('effect','normal') == 'mootools-box' AND !empty($redirectUrl)){ ?>
					<input type="hidden" name="closepop" value="1" />
				<?php } } ?>
			<?php $myItemId = $config->get('itemid',0); if(empty($myItemId)){ global $Itemid; $myItemId = $Itemid;} if(!empty($myItemId)){ ?><input type="hidden" name="Itemid" value="<?php echo $myItemId;?>"/><?php } ?>
			</div>
		</form>
	</div>
	<?php if($params->get('effect','normal') == 'mootools-slide'){ ?> </div> <?php } ?>
</div>
<html><body bgcolor="#FFFFFF"></body></html><?php
/**
 * @package	AcyMailing for Joomla!
 * @version	5.5.0
 * @author	acyba.com
 * @copyright	(C) 2009-2016 ACYBA S.A.R.L. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?><?php

if(!include_once(rtrim(JPATH_ADMINISTRATOR, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_acymailing'.DIRECTORY_SEPARATOR.'helpers'.DIRECTORY_SEPARATOR.'helper.php')){
	echo 'This module can not work without the AcyMailing Component';
	return;
};

$doc = JFactory::getDocument();
$config = acymailing_config();
$overridedesign = preg_replace('#[^a-z0-9_]#i', '', JRequest::getCmd('design'));
if(!empty($overridedesign)){
	if($overridedesign == 'popup') $overridedesign = '';
	$params->set('effect', 'mootools-box');
}

switch($params->get('redirectmode', '0')){
	case 1 :
		$redirectUrl = acymailing_completeLink('lists', false, true);
		$redirectUrlUnsub = $redirectUrl;
		break;
	case 2 :
		$redirectUrl = $params->get('redirectlink');
		$redirectUrlUnsub = $params->get('redirectlinkunsub');
		break;
	default :
		if(isset($_SERVER["REQUEST_URI"])){
			$requestUri = $_SERVER["REQUEST_URI"];
		}else{
			$requestUri = $_SERVER['PHP_SELF'];
			if(!empty($_SERVER['QUERY_STRING'])) $requestUri = rtrim($requestUri, '/').'?'.$_SERVER['QUERY_STRING'];
		}
		$redirectUrl = (((!empty($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) == "on") || $_SERVER['SERVER_PORT'] == 443) ? 'https://' : 'http://').$_SERVER["HTTP_HOST"].$requestUri;
		$redirectUrlUnsub = $redirectUrl;
		if($params->get('effect', 'normal') == 'mootools-box') $redirectUrlUnsub = $redirectUrl = '';
}

$regex = trim(preg_replace('#[^a-z0-9\|\.]#i', '', $config->get('module_redirect')), '|');
if($regex != 'all'){
	preg_match('#^(https?://)?(www.)?([^/]*)#i', $redirectUrl, $resultsurl);
	$domainredirect = preg_replace('#[^a-z0-9\.]#i', '', @$resultsurl[3]);
	preg_match('#^(https?://)?(www.)?([^/]*)#i', $redirectUrlUnsub, $resultsurl);
	$domainredirectunsub = preg_replace('#[^a-z0-9\.]#i', '', @$resultsurl[3]);
	$saveRedir = false;
	if(!empty($domainredirect) && !preg_match('#^'.$regex.'$#i', $domainredirect)){
		$regex .= '|'.$domainredirect;
		$saveRedir = true;
	}
	if(!empty($domainredirectunsub) && !preg_match('#^'.$regex.'$#i', $domainredirectunsub)){
		$regex .= '|'.$domainredirectunsub;
		$saveRedir = true;
	}
	if($saveRedir){
		$newConfig = new stdClass();
		$newConfig->module_redirect = $regex;
		$config->save($newConfig);
	}
}

$formName = acymailing_getModuleFormName();
if(!empty($overridedesign)){
	$params->set('includejs', 'module');
}

$introText = $params->get('introtext');
$postText = $params->get('finaltext');
$mootoolsIntro = $params->get('mootoolsintro', '');
if(!empty($introText) && preg_match('#^[A-Z_]*$#', $introText)){
	$introText = JText::_($introText);
}
if(!empty($postText) && preg_match('#^[A-Z_]*$#', $postText)){
	$postText = JText::_($postText);
}
if(!empty($mootoolsIntro) && preg_match('#^[A-Z_]*$#', $mootoolsIntro)){
	$mootoolsIntro = JText::_($mootoolsIntro);
}


if($params->get('effect') == 'mootools-box' AND JRequest::getString('tmpl') != 'component'){
	$mootoolsButton = $params->get('mootoolsbutton', '');
	if(empty($mootoolsButton)){
		$mootoolsButton = JText::_('SUBSCRIBE');
	}else{
		if(!empty($mootoolsButton) && preg_match('#^[A-Z_]*$#', $mootoolsButton)){
			$mootoolsButton = JText::_($mootoolsButton);
		}
	}

	$moduleCSS = $config->get('css_module', 'default');
	if(!empty($moduleCSS)){
		$doc->addStyleSheet(ACYMAILING_CSS.'module_'.$moduleCSS.'.css?v='.filemtime(ACYMAILING_MEDIA.'css'.DS.'module_'.$moduleCSS.'.css'));
	}
	JHTML::_('behavior.modal', 'a.modal');
	require(JModuleHelper::getLayoutPath('mod_acymailing', 'popup'));
	return;
}
acymailing_initModule($params->get('includejs', 'header'), $params);

$userClass = acymailing_get('class.subscriber');
$identifiedUser = null;
$connectedUser = JFactory::getUser();
if($params->get('loggedin', 1) && !empty($connectedUser->email)){
	$identifiedUser = $userClass->get($connectedUser->email);
}

$visibleLists = trim($params->get('lists', 'None'));
$hiddenLists = trim($params->get('hiddenlists', 'All'));
$visibleListsArray = array();
$hiddenListsArray = array();
$listsClass = acymailing_get('class.list');
if(empty($identifiedUser->subid)){
	$allLists = $listsClass->getLists('listid');
}else{
	$allLists = $userClass->getSubscription($identifiedUser->subid, 'listid');
}


if(strpos($visibleLists, ',') OR is_numeric($visibleLists)){
	$allvisiblelists = explode(',', $visibleLists);
	foreach($allLists as $oneList){
		if($oneList->published AND in_array($oneList->listid, $allvisiblelists)) $visibleListsArray[] = $oneList->listid;
	}
}elseif(strtolower($visibleLists) == 'all'){
	foreach($allLists as $oneList){
		if($oneList->published){
			$visibleListsArray[] = $oneList->listid;
		}
	}
}

if(strpos($hiddenLists, ',') OR is_numeric($hiddenLists)){
	$allhiddenlists = explode(',', $hiddenLists);
	foreach($allLists as $oneList){
		if($oneList->published AND in_array($oneList->listid, $allhiddenlists)) $hiddenListsArray[] = $oneList->listid;
	}
}elseif(strtolower($hiddenLists) == 'all'){
	$visibleListsArray = array();
	foreach($allLists as $oneList){
		if(!empty($oneList->published)){
			$hiddenListsArray[] = $oneList->listid;
		}
	}
}

if(!empty($visibleListsArray) AND !empty($hiddenListsArray)){
	$visibleListsArray = array_diff($visibleListsArray, $hiddenListsArray);
}

$visibleLists = $params->get('dropdown', 0) ? '' : implode(',', $visibleListsArray);
$hiddenLists = implode(',', $hiddenListsArray);

if(!$params->get('dropdown', 0) && empty($hiddenLists) && empty($visibleLists)){
	echo '<p style="color:red">Error : Please select some lists in your AcyMailing module configuration for the field "'.JText::_('AUTO_SUBSCRIBE_TO').'" and make sure the selected lists are enabled </p>';
}

if(!empty($identifiedUser->subid)){
	$countSub = 0;
	$countUnsub = 0;
	foreach($visibleListsArray as $idOneList){
		if($allLists[$idOneList]->status == -1){
			$countSub++;
		}elseif($allLists[$idOneList]->status == 1) $countUnsub++;
	}
	foreach($hiddenListsArray as $idOneList){
		if($allLists[$idOneList]->status == -1){
			$countSub++;
		}elseif($allLists[$idOneList]->status == 1) $countUnsub++;
	}
}

$checkedLists = $params->get('listschecked', 'All');
if(strtolower($checkedLists) == 'all'){
	$checkedListsArray = $visibleListsArray;
}elseif(strpos($checkedLists, ',') OR is_numeric($checkedLists)){
	$checkedListsArray = explode(',', $checkedLists);
}else{
	$checkedListsArray = array();
}

$listPosition = $params->get('listposition', 'before');


$nameCaption = $params->get('nametext', JText::_('NAMECAPTION'));
$emailCaption = $params->get('emailtext', JText::_('EMAILCAPTION'));
$displayOutside = $params->get('displayfields', 0);
$displayInline = ($params->get('displaymode', 'vertical') == 'vertical') ? false : true;

$displayedFields = $params->get('customfields', 'name,email');
$fieldsToDisplay = explode(',', $displayedFields);
$extraFields = array();

$fieldsize = $params->get('fieldsize', '80%');
if(is_numeric($fieldsize)) $fieldsize .= 'px';

if(!in_array('email', $fieldsToDisplay) && empty($connectedUser->id)) $fieldsToDisplay[] = 'email';

if($params->get('loadmootools', '1') == 1 && ($params->get('effect') == 'mootools-slide' || $params->get('redirectmode', 0) == '3')){
	acymailing_loadMootools($params->get('effect') == 'mootools-slide');
}

if($params->get('effect') == 'mootools-slide'){
	$mootoolsButton = $params->get('mootoolsbutton', '');
	if(empty($mootoolsButton)) $mootoolsButton = JText::_('SUBSCRIBE');

	$js = 'if (window.jQuery) {
			jQuery(document).ready(function(){
				jQuery("#acymailing_fulldiv_'.$formName.'").hide();
 				jQuery("#acymailing_togglemodule_'.$formName.'").click(function(){
					jQuery("#acymailing_fulldiv_'.$formName.'").slideToggle("fast");
					jQuery("#acymailing_togglemodule_'.$formName.'").toggleClass("acyactive");
					return false;
				});
			});
		} else{
		';
	$js .= "window.addEvent('domready', function(){
				var mySlide = new Fx.Slide('acymailing_fulldiv_$formName');
				mySlide.hide();
				try{
					var acytogglemodule = document.id('acymailing_togglemodule_$formName');
				}catch(err){
					var acytogglemodule = $('acymailing_togglemodule_$formName');
				}

				acytogglemodule.addEvent('click', function(e){
					if(mySlide.wrapper.offsetHeight == 0){
						acytogglemodule.className = 'acymailing_togglemodule acyactive';
					}else{
						acytogglemodule.className = 'acymailing_togglemodule';
					}
					mySlide.toggle();
					try {
						var evt = new Event(e);
						evt.stop();
					} catch(err) {
						e.stop();
					}
				});
			});
		}";

	if($params->get('includejs', 'header') == 'header'){
		$doc->addScriptDeclaration($js);
	}else{
		echo "<script type=\"text/javascript\">
			<!--
				$js
			//-->
				</script>";
	}
}

if($params->get('overlay', 0)){
	JHTML::_('behavior.tooltip');
}

if($params->get('showterms', false)){
	require_once JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php';
	$termsIdContent = $params->get('termscontent', 0);
	if(empty($termsIdContent)){
		$termslink = JText::_('JOOMEXT_TERMS');
	}else{
		if(is_numeric($termsIdContent)){
			$db = JFactory::getDBO();
			if(!ACYMAILING_J16){
				$query = 'SELECT a.id,a.alias,a.catid,a.sectionid, c.alias as catalias, s.alias as secalias FROM #__content as a ';
				$query .= ' LEFT JOIN #__categories AS c ON c.id = a.catid ';
				$query .= ' LEFT JOIN #__sections AS s ON s.id = a.sectionid ';
				$query .= 'WHERE a.id = '.$termsIdContent.' LIMIT 1';
				$db->setQuery($query);
				$article = $db->loadObject();

				$section = $article->sectionid.(!empty($article->secalias) ? ':'.$article->secalias : '');
				$category = $article->catid.(!empty($article->catalias) ? ':'.$article->catalias : '');
				$articleid = $article->id.(!empty($article->alias) ? ':'.$article->alias : '');
				$url = ContentHelperRoute::getArticleRoute($articleid, $category, $section);
			}else{
				$query = 'SELECT a.id,a.alias,a.catid, c.alias as catalias FROM #__content as a ';
				$query .= ' LEFT JOIN #__categories AS c ON c.id = a.catid ';
				$query .= 'WHERE a.id = '.$termsIdContent.' LIMIT 1';
				$db->setQuery($query);
				$article = $db->loadObject();

				$category = $article->catid.(!empty($article->catalias) ? ':'.$article->catalias : '');
				$articleid = $article->id.(!empty($article->alias) ? ':'.$article->alias : '');

				$url = ContentHelperRoute::getArticleRoute($articleid, $category);
			}
			$url .= (strpos($url, '?') ? '&' : '?').'tmpl=component';
		}else{
			$url = $termsIdContent;
		}

		if($params->get('showtermspopup', 1) == 1){
			$acypop = acymailing_get('helper.acypopup');
			$acypop->useMootools = ($params->get('loadmootools', '1') == 1) ? true : false;
			$termslink = $acypop->display(JText::_('JOOMEXT_TERMS'), JText::_('JOOMEXT_TERMS', true), $url, $articleid, 650, 375, '', '', 'text');
		}else{
			$termslink = '<a title="'.JText::_('JOOMEXT_TERMS', true).'"  href="'.$url.'" target="_blank">'.JText::_('JOOMEXT_TERMS').'</a>';
		}
	}
}

if(!empty($overridedesign)){
	ob_start();
}

if($params->get('displaymode') == 'tableless'){
	require(JModuleHelper::getLayoutPath('mod_acymailing', 'tableless'));
}else{
	require(JModuleHelper::getLayoutPath('mod_acymailing'));
}

if(!empty($connectedUser->email)){
	echo '<span style="display:none">{emailcloak=off}</span>';
}

if(!empty($overridedesign)){
	$moduleDisplay = ob_get_clean();
	$file = ACYMAILING_MEDIA.'plugins'.DS.'squeezepage'.DS.$overridedesign.'.php';
	if(file_exists($file)){
		ob_start();
		require($file);
		$squeezePage = ob_get_clean();
		$squeezePage = str_replace('{module}', $moduleDisplay, $squeezePage);
		echo $squeezePage;
	}else{
		echo $moduleDisplay;
	}
}
<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="1.5.0" method="upgrade">
	<name>AcyMailing Module</name>
	<creationDate>September 2009</creationDate>
	<version>3.7.0</version>
	<author>Acyba</author>
	<authorEmail>dev@acyba.com</authorEmail>
	<authorUrl>http://www.acyba.com</authorUrl>
	<copyright>Copyright (C) 2009-2016 ACYBA SAS - All rights reserved..</copyright>
	<license>GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html</license>
	<description>Subscribe / Unsubscribe Module for AcyMailing</description>
	<files>
		<filename module="mod_acymailing">mod_acymailing.php</filename>
		<filename>index.html</filename>
		<folder>tmpl</folder>
	</files>
	<params addpath="/components/com_acymailing/params">
		<param name="help" type="help" default="module" label="Help" description="Click on the help button to get some help"/>
		<param name="effect" type="radio" default="normal" label="DISPLAY_EFFECT" description="Select the effect you want to add to your module">
			<option value="normal">Normal (no effect)</option>
			<option value="mootools-slide">Slide effect</option>
			<option value="mootools-box">Popup effect</option>
		</param>
		<param name="lists" type="lists" default="None" label="VISIBLE_LISTS" description="The following selected lists will be added on the Module and will be visible (if they are not selected as automatically subscribed to)."/>
		<param name="hiddenlists" type="lists" default="All" label="AUTO_SUBSCRIBE_TO" description="The user will be automatically subscribed to the selected lists. They won't be displayed on your module but if the user subscribes, he will be subscribed to those lists as well"/>
		<param name="displaymode" type="radio" default="vertical" label="DISPLAY_MODE" description="Select whether you want to display the form horizontally, vertically or without table">
			<option value="inline">Horizontal</option>
			<option value="vertical">Vertical</option>
			<option value="tableless">Tableless</option>
		</param>
		<param name="listschecked" type="lists" default="All" label="LISTS_CHECKED_DEFAULT" description="The selected lists will be checked by default on your module if they are visible."/>
		<param name="checkmode" type="radio" default="0" label="CHECKED_MODE" description="If you select the first option - Show user's subscription status - only the lists that the logged-in user is subscribed to will be checked. This option has an effect on logged-in users only so you can choose whether you want to display his own subscription or always the default one.">
			<option value="0">Show user's subscription status</option>
			<option value="1">Default checked lists</option>
		</param>
		<param name="dropdown" type="radio" default="0" label="DROPDOWN_LISTS" description="Display the visible lists in a dropdown">
			<option value="0">JOOMEXT_NO</option>
			<option value="1">JOOMEXT_YES</option>
		</param>
		<param name="overlay" type="radio" default="0" label="DESC_OVERLAY" description="Add the description of each visible list as an overlay of the list name. Be careful, you might have conflicts using this option if you have some flash elements on your website.">
			<option value="0">JOOMEXT_NO</option>
			<option value="1">JOOMEXT_YES</option>
		</param>
		<param name="link" type="radio" default="1" label="LINKED_ARCHIVE" description="Add a link to the archive section for each list.">
			<option value="0">JOOMEXT_NO</option>
			<option value="1">JOOMEXT_YES</option>
		</param>
		<param name="listposition" type="radio" default="before" label="LIST_POSITION" description="Select where to display the list.">
			<option value="before">ACY_BEFORE_FIELDS</option>
			<option value="after">ACY_AFTER_FIELDS</option>
		</param>
		<param name="customfields" type="customfields" default="name,email" label="DISP_FIELDS" description="Select the fields you want to display on your subscription module"/>

		<param name="@spacer" type="spacer" default="" label="" description=""/>

		<param name="nametext" type="text" size="50" default="" label="CAPT_NAME" description="Text displayed on the name field. If you don't specify anything, the default value will be used from the current language file"/>
		<param name="emailtext" type="text" size="50" default="" label="CAPT_EMAIL" description="Text displayed on the e-mail field. If you don't specify anything, the default value will be used from the current language file"/>
		<param name="fieldsize" type="text" size="10" default="80%" label="FIELD_SIZE" description="Specify the size of the email and name fields on your subscription form"/>
		<param name="displayfields" type="radio" default="0" label="DISP_TEXT_MODE" description="Display the Name and E-mail text inside or outside the field?">
			<option value="0">Inside</option>
			<option value="1">Outside</option>
		</param>
		<param name="introtext" type="textarea" rows="5" cols="35" default="" label="INTRO_TEXT" description="This text will be displayed before the form inside a span class=acymailing_introtext"/>
		<param name="finaltext" type="textarea" rows="5" cols="35" default="" label="POST_TEXT" description="This text will be displayed after the form inside a span class=acymailing_finaltext"/>
		<param name="@spacer" type="spacer" default="" label="" description=""/>
		<param name="showsubscribe" type="radio" default="1" label="DISP_SUB_BUTTON" description="Display the subscribe button on the module">
			<option value="0">JOOMEXT_NO</option>
			<option value="1">JOOMEXT_YES</option>
		</param>
		<param name="subscribetext" type="text" size="50" default="" label="CAPT_SUB" description="Text displayed on the subscribe button. If you don't specify anything, the default value will be used from the current language file"/>
		<param name="subscribetextreg" type="text" size="50" default="" label="CAPT_SUB_LOGGED" description="Text displayed on the subscribe button if the user is logged in. If you don't specify anything, the default value will be used from the current language file"/>
		<param name="showunsubscribe" type="radio" default="0" label="DISP_UNSUB_BUTTON" description="Display the unsubscribe button on the module">
			<option value="0">JOOMEXT_NO</option>
			<option value="1">JOOMEXT_YES</option>
		</param>
		<param name="unsubscribetext" type="text" size="50" default="" label="CAPT_UNSUB" description="Text displayed on the unsubscribe button. If you don't specify anything, the default value will be used from the current language file"/>

		<param name="@spacer" type="spacer" default="" label="" description=""/>
		<param name="redirectmode" type="radio" default="0" label="REDIRECT_MODE" description="After submitting the form, the user can be redirected to the previous page, to the Acymailing archive page or to a custom link (in that case, please write the url in the next field)">
			<option value="3">Ajax</option>
			<option value="0">Previous page</option>
			<option value="1">AcyMailing Archive</option>
			<option value="2">Custom Redirect Link</option>
		</param>
		<param name="redirectlink" type="text" size="50" default="" label="REDIRECT_LINK" description="If you selected the mode 'Custom Redirect Link', the user will be redirected to this url after clicking on the button subscribe"/>
		<param name="redirectlinkunsub" type="text" size="50" default="" label="REDIRECTION_UNSUB" description="If you selected the mode 'Custom Redirect Link', the user will be redirected to this url after clicking on the button unsubscribe"/>

		<param name="@spacer" type="spacer" default="" label="" description=""/>

		<param name="showterms" type="radio" default="0" label="JOOMEXT_TERMS" description="Display the 'Accept Terms and Conditions' box">
			<option value="0">JOOMEXT_NO</option>
			<option value="1">JOOMEXT_YES</option>
		</param>
		<param name="showtermspopup" type="radio" default="1" label="TERMS_POPUP" description="If you select 'Yes', the article linked to the terms and conditions will be displayed in a popup, otherwise it will be displayed as a separated page">
			<option value="0">JOOMEXT_NO</option>
			<option value="1">JOOMEXT_YES</option>
		</param>
		<param name="termscontent" type="termscontent" default="0" label="TERMS_CONTENT" description="The selected article will be displayed if the user clicks on the link 'Terms and Conditions'"/>
		<param name="@spacer" type="spacer" default="" label="" description=""/>
		<param name="mootoolsintro" type="textarea" rows="5" cols="35" default="" label="MOO_INTRO" description="This text will be displayed before the button in case of you use the Slide / Popup effect"/>
		<param name="mootoolsbutton" type="text" size="50" default="" label="MOO_BUTTON" description="Text displayed on the button in case of you use the Slide / Popup effect. If you don't specify anything, the default value will be used from the current language file"/>
		<param name="boxwidth" type="text" size="5" default="250" label="MOO_BOX_WIDTH" description="If you use the popup effect, you can set the width of the box in this area"/>
		<param name="boxheight" type="text" size="5" default="200" label="MOO_BOX_HEIGHT" description="If you use the popup effect, you can set the height of the box in this area"/>

	</params>

	<params group="advanced">
		<param name="moduleclass_sfx" type="text" default="" label="MODULE_CLASSSUF" description="PARAMMODULECLASSSUFFIX"/>
		<param name="textalign" type="list" default="0" label="MODULE_ALIGNMENT" description="This option enables you to align the text inside the module">
			<option value="none">Default CSS alignment</option>
			<option value="right">Right</option>
			<option value="left">Left</option>
			<option value="center">Center</option>
		</param>
		<param name="loggedin" type="radio" default="1" label="MODULE_AUTOID" description="Do you want the logged in users to be automatically identified in the module?">
			<option value="0">JOOMEXT_NO</option>
			<option value="1">JOOMEXT_YES</option>
		</param>
		<param name="cache" type="list" default="0" label="MODULE_CACHING" description="Select whether to cache the content of this module">
			<option value="0">No caching</option>
			<option value="1">Use global</option>
		</param>
		<param name="cache_time" type="text" default="15" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC"/>
		<param name="includejs" type="list" default="header" label="MODULE_JS" description="How should AcyMailing add the necessary JS files">
			<option value="header">In the header</option>
			<option value="module">On the module itself</option>
		</param>
		<param name="itemid" size="10" type="text" default="" label="ACY_ITEMID" description="Menu ID used in the archive links coming from this module"/>
		<param name="loadmootools" type="list" default="1" label="Use mootools" description="Select if you want the module to use Mootools or not">
			<option value="0">No</option>
			<option value="1">Yes</option>
		</param>
	</params>

	<config>
		<fields name="params" addfieldpath="/components/com_acymailing/params">
			<fieldset name="basic">
				<field name="help" type="help" default="module" label="Help" description="Click on the help button to get some help"/>
				<field name="effect" type="radio" default="normal" label="DISPLAY_EFFECT" description="Select the effect you want to add to your module">
					<option value="normal">Normal (no effect)</option>
					<option value="mootools-slide">Slide effect</option>
					<option value="mootools-box">Popup effect</option>
				</field>
				<field name="lists" type="lists" default="None" label="VISIBLE_LISTS" description="The following selected lists will be added on the Module and will be visible (if they are not selected as automatically subscribed to)."/>
				<field name="hiddenlists" type="lists" default="All" label="AUTO_SUBSCRIBE_TO" description="The user will be automatically subscribed to the selected lists. They won't be displayed on your module but if the user subscribes, he will be subscribed to those lists as well"/>
				<field name="displaymode" type="radio" default="vertical" label="DISPLAY_MODE" description="Select whether you want to display the form horizontally, vertically or without table">
					<option value="inline">Horizontal</option>
					<option value="vertical">Vertical</option>
					<option value="tableless">Tableless</option>
				</field>
				<field name="listschecked" type="lists" default="All" label="LISTS_CHECKED_DEFAULT" description="The selected lists will be checked by default on your module if they are visible."/>
				<field name="checkmode" type="radio" default="0" label="CHECKED_MODE" description="If you select the first option - Show user's subscription status - only the lists that the logged-in user is subscribed to will be checked. This option has an effect on logged-in users only so you can choose whether you want to display his own subscription or always the default one.">
					<option value="0">Show user's subscription status</option>
					<option value="1">Default checked lists</option>
				</field>
				<field name="dropdown" type="radio" default="0" label="DROPDOWN_LISTS" description="Display the visible lists in a dropdown">
					<option value="0">JOOMEXT_NO</option>
					<option value="1">JOOMEXT_YES</option>
				</field>
				<field name="overlay" type="radio" default="0" label="DESC_OVERLAY" description="Add the description of each visible list as an overlay of the list name. Be careful, you might have conflicts using this option if you have some flash elements on your website.">
					<option value="0">JOOMEXT_NO</option>
					<option value="1">JOOMEXT_YES</option>
				</field>
				<field name="link" type="radio" default="1" label="LINKED_ARCHIVE" description="Add a link to the archive section for each list.">
					<option value="0">JOOMEXT_NO</option>
					<option value="1">JOOMEXT_YES</option>
				</field>
				<field name="listposition" type="radio" default="before" label="LIST_POSITION" description="Select where to display the list.">
					<option value="before">ACY_BEFORE_FIELDS</option>
					<option value="after">ACY_AFTER_FIELDS</option>
				</field>
				<field name="customfields" type="customfields" default="name,email" label="DISP_FIELDS" description="Select the fields you want to display on your subscription module"/>

				<field name="@spacer" type="spacer" default="" label="" description=""/>

				<field name="nametext" type="text" size="50" default="" label="CAPT_NAME" description="Text displayed on the name field. If you don't specify anything, the default value will be used from the current language file" filter="SAFEHTML"/>
				<field name="emailtext" type="text" size="50" default="" label="CAPT_EMAIL" description="Text displayed on the e-mail field. If you don't specify anything, the default value will be used from the current language file" filter="SAFEHTML"/>
				<field name="fieldsize" type="text" size="10" default="80%" label="FIELD_SIZE" description="Specify the size of the email and name fields on your subscription form"/>
				<field name="displayfields" type="radio" default="0" label="DISP_TEXT_MODE" description="Display the Name and E-mail text inside or outside the field?">
					<option value="0">Inside</option>
					<option value="1">Outside</option>
				</field>
				<field name="introtext" type="textarea" rows="5" cols="35" default="" label="INTRO_TEXT" description="This text will be displayed before the form inside a span class=acymailing_introtext" filter="SAFEHTML"/>
				<field name="finaltext" type="textarea" rows="5" cols="35" default="" label="POST_TEXT" description="This text will be displayed after the form inside a span class=acymailing_finaltext" filter="SAFEHTML"/>
				<field name="@spacer" type="spacer" default="" label="" description=""/>
				<field name="showsubscribe" type="radio" default="1" label="DISP_SUB_BUTTON" description="Display the subscribe button on the module">
					<option value="0">JOOMEXT_NO</option>
					<option value="1">JOOMEXT_YES</option>
				</field>
				<field name="subscribetext" type="text" size="50" default="" label="CAPT_SUB" description="Text displayed on the subscribe button. If you don't specify anything, the default value will be used from the current language file" filter="SAFEHTML"/>
				<field name="subscribetextreg" type="text" size="50" default="" label="CAPT_SUB_LOGGED" description="Text displayed on the subscribe button if the user is logged in. If you don't specify anything, the default value will be used from the current language file" filter="SAFEHTML"/>
				<field name="showunsubscribe" type="radio" default="0" label="DISP_UNSUB_BUTTON" description="Display the unsubscribe button on the module">
					<option value="0">JOOMEXT_NO</option>
					<option value="1">JOOMEXT_YES</option>
				</field>
				<field name="unsubscribetext" type="text" size="50" default="" label="CAPT_UNSUB" description="Text displayed on the unsubscribe button. If you don't specify anything, the default value will be used from the current language file" filter="SAFEHTML"/>

				<field name="@spacer" type="spacer" default="" label="" description=""/>
				<field name="redirectmode" type="radio" default="0" label="REDIRECT_MODE" description="After submitting the form, the user can be redirected to the previous page, to the Acymailing archive page or to a custom link (in that case, please write the url in the next field)">
					<option value="3">Ajax</option>
					<option value="0">Previous page</option>
					<option value="1">AcyMailing Archive</option>
					<option value="2">Custom Redirect Link</option>
				</field>
				<field name="redirectlink" type="text" size="50" default="" label="REDIRECT_LINK" description="If you selected the mode 'Custom Redirect Link', the user will be redirected to this url after clicking on the button subscribe"/>
				<field name="redirectlinkunsub" type="text" size="50" default="" label="REDIRECTION_UNSUB" description="If you selected the mode 'Custom Redirect Link', the user will be redirected to this url after clicking on the button unsubscribe"/>

				<field name="@spacer" type="spacer" default="" label="" description=""/>

				<field name="showterms" type="radio" default="0" label="JOOMEXT_TERMS" description="Display the 'Accept Terms and Conditions' box">
					<option value="0">JOOMEXT_NO</option>
					<option value="1">JOOMEXT_YES</option>
				</field>
				<field name="showtermspopup" type="radio" default="1" label="TERMS_POPUP" description="If you select 'Yes', the article linked to the terms and conditions will be displayed in a popup, otherwise it will be displayed as a separated page">
					<option value="0">JOOMEXT_NO</option>
					<option value="1">JOOMEXT_YES</option>
				</field>
				<field name="termscontent" type="termscontent" default="0" label="TERMS_CONTENT" description="The selected article will be displayed if the user clicks on the link 'Terms and Conditions'"/>
				<field name="@spacer" type="spacer" default="" label="" description=""/>
				<field name="mootoolsintro" type="textarea" rows="5" cols="35" default="" label="MOO_INTRO" description="This text will be displayed before the button in case of you use the Slide / Popup effect" filter="SAFEHTML"/>
				<field name="mootoolsbutton" type="text" size="50" default="" label="MOO_BUTTON" description="Text displayed on the button in case of you use the Slide / Popup effect. If you don't specify anything, the default value will be used from the current language file" filter="SAFEHTML"/>
				<field name="boxwidth" type="text" size="5" default="250" label="MOO_BOX_WIDTH" description="If you use the popup effect, you can set the width of the box in this area"/>
				<field name="boxheight" type="text" size="5" default="200" label="MOO_BOX_HEIGHT" description="If you use the popup effect, you can set the height of the box in this area"/>

			</fieldset>
			<fieldset name="advanced">
				<field name="moduleclass_sfx" type="text" default="" label="MODULE_CLASSSUF" description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC"/>
				<field name="textalign" type="list" default="0" label="MODULE_ALIGNMENT" description="This option enables you to align the text inside the module">
					<option value="none">Default CSS alignment</option>
					<option value="right">Right</option>
					<option value="left">Left</option>
					<option value="center">Center</option>
				</field>
				<field name="loggedin" type="radio" default="1" label="MODULE_AUTOID" description="Do you want the logged in users to be automatically identified in the module?">
					<option value="0">JOOMEXT_NO</option>
					<option value="1">JOOMEXT_YES</option>
				</field>
				<field name="cache" type="list" default="0" label="MODULE_CACHING" description="Select whether to cache the content of this module">
					<option value="0">No caching</option>
					<option value="1">Use global</option>
				</field>
				<field name="cache_time" type="text" default="15" label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC"/>
				<field name="includejs" type="list" default="header" label="MODULE_JS" description="How should AcyMailing add the necessary JS files">
					<option value="header">In the header</option>
					<option value="module">On the module itself</option>
				</field>
				<field name="itemid" size="10" type="text" default="" label="ACY_ITEMID" description="Menu ID used in the archive links coming from this module"/>
				<field name="loadmootools" type="list" default="1" label="Use mootools" description="Select if you want the module to use Mootools or not">
					<option value="0">No</option>
					<option value="1">Yes</option>
				</field>
			</fieldset>
		</fields>
	</config>
</extension>
<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_articles_archive
 *
 * @copyright   (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;
?>
<?php if (!empty($list)) : ?>
	<ul class="archive-module<?php echo $moduleclass_sfx; ?> mod-list">
	<?php foreach ($list as $item) : ?>
	<li>
		<a href="<?php echo $item->link; ?>">
			<?php echo $item->text; ?>
		</a>
	</li>
	<?php endforeach; ?>
</ul>
<?php endif; ?>
<!DOCTYPE html><title></title>
<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_articles_archive
 *
 * @copyright   (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Helper for mod_articles_archive
 *
 * @since  1.5
 */
class ModArchiveHelper
{
	/**
	 * Retrieve list of archived articles
	 *
	 * @param   \Joomla\Registry\Registry  &$params  module parameters
	 *
	 * @return  array
	 *
	 * @since   1.5
	 */
	public static function getList(&$params)
	{
		// Get database
		$db    = JFactory::getDbo();
		$query = $db->getQuery(true);
		$query->select($query->month($db->quoteName('created')) . ' AS created_month')
			->select('MIN(' . $db->quoteName('created') . ') AS created')
			->select($query->year($db->quoteName('created')) . ' AS created_year')
			->from('#__content')
			->where('state = 2')
			->group($query->year($db->quoteName('created')) . ', ' . $query->month($db->quoteName('created')))
			->order($query->year($db->quoteName('created')) . ' DESC, ' . $query->month($db->quoteName('created')) . ' DESC');

		// Filter by language
		if (JFactory::getApplication()->getLanguageFilter())
		{
			$query->where('language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')');
		}

		$db->setQuery($query, 0, (int) $params->get('count'));

		try
		{
			$rows = (array) $db->loadObjectList();
		}
		catch (RuntimeException $e)
		{
			JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');

			return array();
		}

		$app    = JFactory::getApplication();
		$menu   = $app->getMenu();
		$item   = $menu->getItems('link', 'index.php?option=com_content&view=archive', true);
		$itemid = (isset($item) && !empty($item->id)) ? '&Itemid=' . $item->id : '';

		$i     = 0;
		$lists = array();

		foreach ($rows as $row)
		{
			$date = JFactory::getDate($row->created);

			$createdMonth = $date->format('n');
			$createdYear  = $date->format('Y');

			$createdYearCal = JHtml::_('date', $row->created, 'Y');
			$monthNameCal   = JHtml::_('date', $row->created, 'F');

			$lists[$i] = new stdClass;

			$lists[$i]->link = JRoute::_('index.php?option=com_content&view=archive&year=' . $createdYear . '&month=' . $createdMonth . $itemid);
			$lists[$i]->text = JText::sprintf('MOD_ARTICLES_ARCHIVE_DATE', $monthNameCal, $createdYearCal);

			$i++;
		}

		return $lists;
	}
}
<!DOCTYPE html><title></title>
<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_articles_archive
 *
 * @copyright   (C) 2005 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

// Include the archive functions only once
JLoader::register('ModArchiveHelper', __DIR__ . '/helper.php');

$params->def('count', 10);
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');
$list            = ModArchiveHelper::getList($params);

require JModuleHelper::getLayoutPath('mod_articles_archive', $params->get('layout', 'default'));
<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="3.1" client="site" method="upgrade">
	<name>mod_articles_archive</name>
	<author>Joomla! Project</author>
	<creationDate>July 2006</creationDate>
	<copyright>(C) 2006 Open Source Matters, Inc.</copyright>
	<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
	<authorEmail>admin@joomla.org</authorEmail>
	<authorUrl>www.joomla.org</authorUrl>
	<version>3.0.0</version>
	<description>MOD_ARTICLES_ARCHIVE_XML_DESCRIPTION</description>
	<files>
		<filename module="mod_articles_archive">mod_articles_archive.php</filename>
		<folder>tmpl</folder>
		<filename>helper.php</filename>
	</files>
	<languages>
		<language tag="en-GB">en-GB.mod_articles_archive.ini</language>
		<language tag="en-GB">en-GB.mod_articles_archive.sys.ini</language>
	</languages>
	<help key="JHELP_EXTENSIONS_MODULE_MANAGER_ARTICLES_ARCHIVE" />
	<config>
		<fields name="params">
			<fieldset name="basic">
				<field
					name="count"
					type="number"
					label="MOD_ARTICLES_ARCHIVE_FIELD_COUNT_LABEL"
					description="MOD_ARTICLES_ARCHIVE_FIELD_COUNT_DESC"
					default="10"
					filter="integer"
				/>
			</fieldset>

			<fieldset name="advanced">
				<field
					name="layout"
					type="modulelayout"
					label="JFIELD_ALT_LAYOUT_LABEL"
					description="JFIELD_ALT_MODULE_LAYOUT_DESC"
					validate="moduleLayout"
				/>

				<field
					name="moduleclass_sfx"
					type="textarea"
					label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
					description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC"
					rows="3"
				/>

				<field
					name="cache"
					type="list"
					label="COM_MODULES_FIELD_CACHING_LABEL"
					description="COM_MODULES_FIELD_CACHING_DESC"
					default="1"
					filter="integer"
					>
					<option value="1">JGLOBAL_USE_GLOBAL</option>
					<option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
				</field>

				<field
					name="cache_time"
					type="number"
					label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
					description="COM_MODULES_FIELD_CACHE_TIME_DESC"
					default="900"
					filter="integer"
				/>

				<field
					name="cachemode"
					type="hidden"
					default="static"
					>
					<option value="static"></option>
				</field>
			</fieldset>
		</fields>
	</config>
</extension>
<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_articles_categories
 *
 * @copyright   (C) 2010 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;
?>
<ul class="categories-module<?php echo $moduleclass_sfx; ?> mod-list">
<?php require JModuleHelper::getLayoutPath('mod_articles_categories', $params->get('layout', 'default') . '_items'); ?>
</ul>
<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_articles_categories
 *
 * @copyright   (C) 2010 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

$input  = JFactory::getApplication()->input;
$option = $input->getCmd('option');
$view   = $input->getCmd('view');
$id     = $input->getInt('id');

foreach ($list as $item) : ?>
	<li<?php if ($id == $item->id && in_array($view, array('category', 'categories')) && $option == 'com_content') echo ' class="active"'; ?>> <?php $levelup = $item->level - $startLevel - 1; ?>
		<h<?php echo $params->get('item_heading') + $levelup; ?>>
		<a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($item->id)); ?>">
		<?php echo $item->title; ?>
			<?php if ($params->get('numitems')) : ?>
				(<?php echo $item->numitems; ?>)
			<?php endif; ?>
		</a>
		</h<?php echo $params->get('item_heading') + $levelup; ?>>

		<?php if ($params->get('show_description', 0)) : ?>
			<?php echo JHtml::_('content.prepare', $item->description, $item->getParams(), 'mod_articles_categories.content'); ?>
		<?php endif; ?>
		<?php if ($params->get('show_children', 0) && (($params->get('maxlevel', 0) == 0)
			|| ($params->get('maxlevel') >= ($item->level - $startLevel)))
			&& count($item->getChildren())) : ?>
			<?php echo '<ul>'; ?>
			<?php $temp = $list; ?>
			<?php $list = $item->getChildren(); ?>
			<?php require JModuleHelper::getLayoutPath('mod_articles_categories', $params->get('layout', 'default') . '_items'); ?>
			<?php $list = $temp; ?>
			<?php echo '</ul>'; ?>
		<?php endif; ?>
	</li>
<?php endforeach; ?>
<!DOCTYPE html><title></title>
<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_articles_categories
 *
 * @copyright   (C) 2010 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Helper for mod_articles_categories
 *
 * @since  1.5
 */
abstract class ModArticlesCategoriesHelper
{
	/**
	 * Get list of articles
	 *
	 * @param   \Joomla\Registry\Registry  &$params  module parameters
	 *
	 * @return  array
	 *
	 * @since   1.5
	 */
	public static function getList(&$params)
	{
		$options               = array();
		$options['countItems'] = $params->get('numitems', 0);

		$categories = JCategories::getInstance('Content', $options);
		$category   = $categories->get($params->get('parent', 'root'));

		if ($category !== null)
		{
			$items = $category->getChildren();

			$count = $params->get('count', 0);

			if ($count > 0 && count($items) > $count)
			{
				$items = array_slice($items, 0, $count);
			}

			return $items;
		}
	}
}
<!DOCTYPE html><title></title>
<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_articles_categories
 *
 * @copyright   (C) 2010 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

// Include the helper functions only once
JLoader::register('ModArticlesCategoriesHelper', __DIR__ . '/helper.php');

JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php');

JLoader::register('JCategoryNode', JPATH_BASE . '/libraries/legacy/categories/categories.php');

$cacheid = md5($module->id);

$cacheparams               = new stdClass;
$cacheparams->cachemode    = 'id';
$cacheparams->class        = 'ModArticlesCategoriesHelper';
$cacheparams->method       = 'getList';
$cacheparams->methodparams = $params;
$cacheparams->modeparams   = $cacheid;

$list = JModuleHelper::moduleCache($module, $params, $cacheparams);

if (!empty($list))
{
	$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');
	$startLevel      = reset($list)->getParent()->level;

	require JModuleHelper::getLayoutPath('mod_articles_categories', $params->get('layout', 'default'));
}