Exemplo n.º 1
0
    function display($selection = '', $group = '', $emails = '')
    {
        $app = JFactory::getApplication();
        $my = JFactory::getUser();
        if (empty($emails)) {
            $emails = $my->email;
        }
        $js = 'function timeoutAddNewTestAddress(currentValue){
					if(currentValue.length > 1 && ((currentValue.indexOf("@") != -1 && currentValue.slice(-1) == " ") || currentValue.slice(-1) == ";" || currentValue.slice(-1) == ",")){
						currentValue = currentValue.substring(0, currentValue.length - 1);
						setUser(currentValue);
						return;
					}
					setTimeout(function(){addNewTestAddress(currentValue);}, 500);
				}

			function addNewTestAddress(currentValue){';
        if ($app->isAdmin()) {
            $js .= 'if(currentValue != document.getElementById("message_receivers").value) return;

				try{
					var ajaxCall = new Ajax("index.php?option=com_acymailing&tmpl=component&ctrl=subscriber&task=getSubscribersByEmail&search="+currentValue,{
						method: "get",
						onComplete: function(responseText, responseXML) {
							document.getElementById("acymailing_divSelectReceiver").style.display = "block";
							document.getElementById("acymailing_receiversTable").innerHTML = responseText;
							receiversList = document.getElementById("acymailing_receiversTable");
							if(receiversList.getElementsByClassName("row_user").length==0) {
								document.getElementById("acymailing_divSelectReceiver").style.display = "none";
							}
						}
					}).request();

				}catch(err){
					new Request({
						url:"index.php?option=com_acymailing&tmpl=component&ctrl=subscriber&task=getSubscribersByEmail&search="+currentValue,
						method: "get",
						onSuccess: function(responseText, responseXML) {
							document.getElementById("acymailing_divSelectReceiver").style.display = "block";
							document.getElementById("acymailing_receiversTable").innerHTML = responseText;
							receiversList = document.getElementById("acymailing_receiversTable");
							if(receiversList.getElementsByClassName("row_user").length==0) {
								document.getElementById("acymailing_divSelectReceiver").style.display = "none";
							}
						}
					}).send();
				}';
        }
        $js .= '}

			var selected = new Array("' . str_replace(',', '","', $emails) . '");
			function setUser(userEmail){
				userEmail = userEmail.replace(/^\\s+|\\s+$/gm,"");
				if(validateEmail(userEmail, "' . str_replace('"', '\\"', JText::_('SEND_TEST_TO')) . '") && selected.indexOf(userEmail) == -1){
					selected.push(userEmail);
					document.getElementById("usersSelected").innerHTML += "<span class=\\"selectedUsers\\">"+userEmail+"<span class=\\"removeUser\\" onclick=\\"removeUser(this, \'"+userEmail+"\');\\"></span></span>";
					document.getElementById("test_emails").value = selected.join(",");
				}
				document.getElementById("message_receivers").value = "";
				document.getElementById("acymailing_divSelectReceiver").style.display = "none";
			}

			function removeUser(element, userEmail){
				var toRemove = element.parentElement;
				toRemove.parentElement.removeChild(toRemove);
				var index = selected.indexOf(userEmail);
				if (index > -1) {
					selected.splice(index, 1);
				}
				document.getElementById("test_emails").value = selected.join(",");
			}

			function showOptions(selection){
				if(selection == "users"){
					document.getElementById("userSelection").style.display = "";
					document.getElementById("groupSelection").style.display = "none";
				}else{
					document.getElementById("userSelection").style.display = "none";
					document.getElementById("groupSelection").style.display = "";
				}
			}';
        $doc = JFactory::getDocument();
        $doc->addScriptDeclaration($js);
        ?>
		<style>
			.removeUser {
				width: 20px;
				background-image: url(<?php 
        echo ACYMAILING_LIVE;
        ?>
/media/com_acymailing/images/closecross.png);
				background-size: cover;
				height: 20px;
				cursor: pointer;
				float: right;
			}
			.selectedUsers {
				background-color: #F5F5F5;
				padding-left: 5px;
				display: inline-block;
				border: solid 1px #C5C4C4;
				border-radius: 4px;
				margin-right: 3px;
				margin-top: 5px;
				line-height: 20px;
			}
			#acymailing_divSelectReceiver {
				position: absolute;
				width: 400px;
				border: solid 1px #858585;
				z-index:9999;
				background: white;
			}
			#acymailing_receiversTable .row_user:hover {
				background-color: #EBEBEB;
				cursor:pointer;
			}
			.row_user{
				border-top:solid 1px #EBEBEB;
			}
			#usersSelected {
				margin-bottom:2px;
				width:100%;
				display:block;
			}
		</style>
	<?php 
        echo acymailing_getFunctionsEmailCheck();
        if ($app->isAdmin()) {
            $values = array();
            $values[] = JHTML::_('select.option', 'users', JText::_('ACY_SUBSCRIBER'));
            $values[] = JHTML::_('select.option', 'group', JText::_('ACY_GROUP'));
            echo JHTML::_('select.genericlist', $values, 'test_selection', 'size="1" style="margin:0;" onchange="showOptions(this.value);"', 'value', 'text', $selection);
        } else {
            echo '<input class="inputbox" type="hidden" id="test_selection" name="test_selection" value="users" />';
        }
        ?>
		<div id="userSelection" style="margin-top:5px;<?php 
        if ($selection == 'group') {
            echo 'display:none;';
        }
        ?>
">
			<input style="width:212px;margin:0;" placeholder="<?php 
        echo JText::_('EMAIL_ADDRESS');
        ?>
..." type="text" id="message_receivers" onkeyup="timeoutAddNewTestAddress(this.value);" class="inputbox" autocomplete="off"/>
			<span id="usersSelected">
				<?php 
        $allEmails = explode(',', $emails);
        foreach ($allEmails as $oneEmail) {
            echo '<span class="selectedUsers">' . htmlspecialchars($oneEmail, ENT_COMPAT, 'UTF-8') . '<span class="removeUser" onclick="removeUser(this, \'' . htmlspecialchars($oneEmail, ENT_COMPAT, 'UTF-8') . '\');"></span></span>';
        }
        ?>
			</span>
			<div id="acymailing_divSelectReceiver" style="display:none; overflow-y:scroll !important;">
				<div id="acymailing_receiversTable"></div>
			</div>
			<input class="inputbox" type="hidden" id="test_emails" name="test_emails" value="<?php 
        echo htmlspecialchars($emails, ENT_COMPAT, 'UTF-8');
        ?>
" />
		</div>
	<?php 
        if ($app->isAdmin()) {
            $db = JFactory::getDBO();
            if (ACYMAILING_J16) {
                $db->setQuery('SELECT ug.id, ug.parent_id, ug.title AS text, COUNT(ugm.user_id) AS nbusers ' . 'FROM #__usergroups AS ug ' . 'LEFT JOIN #__user_usergroup_map ugm ' . 'ON ug.id = ugm.group_id ' . 'GROUP BY ug.id');
            } else {
                $db->setQuery('SELECT ug.id, ug.parent_id, ug.name AS text, COUNT(u.id) AS nbusers ' . 'FROM #__core_acl_aro_groups AS ug ' . 'LEFT JOIN #__users u ' . 'ON ug.id = u.gid ' . 'GROUP BY ug.id');
            }
            $values = $db->loadObjectList();
            $this->cats = array();
            if (!empty($values)) {
                foreach ($values as $oneCat) {
                    $this->cats[$oneCat->parent_id][] = $oneCat;
                }
            }
            $this->catvalues = array();
            $this->catvalues[] = JHTML::_('select.option', -1, '- - -');
            $this->_handleChildren();
            echo '<div id="groupSelection" style="' . ($selection != 'group' ? 'display:none;' : '') . 'margin-top:5px;">' . JHTML::_('select.genericlist', $this->catvalues, 'test_group', 'size="1"', 'value', 'text', $group) . '</div>';
        }
    }
Exemplo n.º 2
0
            ?>
 <input type="text" readonly="readonly" onclick="select();" style="width:220px;font-size:10px;" value="v=DKIM1;s=email;t=s;p=<?php 
            echo $this->escape($publicKey);
            ?>
" />
							<br /><input type="checkbox" value="1" id="dkimletme" name="dkimletme"/> <label for="dkimletme"><?php 
            echo JText::_('DKIM_LET_ME');
            ?>
</label>
							<?php 
        }
        echo '<br />';
    }
    ?>
				<a href="https://www.acyba.com/index.php?option=com_content&amp;view=article&amp;catid=34:documentation-acymailing&amp;Itemid=30&amp;id=156:acymailing-dkim" target="_blank"><?php 
    echo JText::_('ACY_HELP');
    ?>
</a>
			</fieldset>
<?php 
}
?>
		</td>
		</tr>
		</table>
	</fieldset>
<?php 
echo acymailing_getFunctionsEmailCheck(array('save', 'apply', 'test'), true);
?>
</div>
Exemplo n.º 3
0
?>
</label>
						</td>
						<td class="paramlist_value">
							<input onchange="validateEmail(this.value, '<?php 
echo addslashes(JText::_('REPLYTO_ADDRESS'));
?>
')" class="inputbox" id="replyemail" type="text" name="data[template][replyemail]" style="width:200px" value="<?php 
echo $this->escape(@$this->template->replyemail);
?>
" />
						</td>
					</tr>
				</table>
<?php 
echo acymailing_getFunctionsEmailCheck();
?>
			</td>
			<td valign="top">
			<?php 
echo $this->tabs->startPane('template_css');
echo $this->tabs->startPanel(JText::_('STYLE_IND'), 'template_css_classes');
?>
					<br style="font-size:1px"/>

					<table width="100%" >
						<tbody id="classtable">
						<tr>
							<td>
								<label for="bgcolor">
									<?php