当前位置: 首页>>代码示例>>PHP>>正文


PHP acymailing_bytes函数代码示例

本文整理汇总了PHP中acymailing_bytes函数的典型用法代码示例。如果您正苦于以下问题:PHP acymailing_bytes函数的具体用法?PHP acymailing_bytes怎么用?PHP acymailing_bytes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了acymailing_bytes函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: doexport


//.........这里部分代码省略.........
         if (!empty($exportFieldsOthers)) {
             foreach ($exportFieldsOthers as $oneField) {
                 $selectOthers .= ' , ' . $oneField . ' AS ' . str_replace('.', '_', $oneField);
             }
         }
         $query = 'SELECT DISTINCT s.`subid`, ' . $selectFields . $selectOthers . ' ' . $currentSession->get('acyexportquery');
     }
     $query .= ' ORDER BY s.subid';
     $db = JFactory::getDBO();
     $encodingClass = acymailing_get('helper.encoding');
     $exportHelper = acymailing_get('helper.export');
     $fileName = 'export_' . date('Y-m-d');
     if (!empty($exportLists)) {
         $fileName = '';
         $db->setQuery('SELECT name FROM #__acymailing_list WHERE listid IN (' . implode(',', $exportLists) . ')');
         $allExportedLists = $db->loadObjectList();
         foreach ($allExportedLists as $oneList) {
             $fileName .= '__' . $oneList->name;
         }
         $fileName = trim($fileName, '__');
     }
     $exportHelper->addHeaders($fileName);
     $eol = "\r\n";
     $before = '"';
     $separator = '"' . $inseparator . '"';
     $after = '"';
     $allFields = array_merge($exportFields, $exportFieldsOthers);
     if (!empty($exportFieldsList)) {
         $allFields = array_merge($allFields, $exportFieldsList);
         $selectFields = 'l.`' . implode('`, l.`', $exportFieldsList) . '`';
         $selectFields = str_replace('listname', 'name', $selectFields);
     }
     echo $before . implode($separator, $allFields) . $after . $eol;
     if (acymailing_bytes(ini_get('memory_limit')) > 150000000) {
         $nbExport = 50000;
     } elseif (acymailing_bytes(ini_get('memory_limit')) > 80000000) {
         $nbExport = 15000;
     } else {
         $nbExport = 5000;
     }
     if (!empty($exportFieldsList)) {
         $nbExport = 500;
     }
     $valDep = 0;
     $dateFields = array('created', 'confirmed_date', 'lastopen_date', 'lastclick_date', 'lastsent_date', 'userstats_opendate', 'userstats_senddate', 'urlclick_date', 'hist_date');
     do {
         $db->setQuery($query . ' LIMIT ' . $valDep . ', ' . $nbExport);
         $valDep += $nbExport;
         $allData = $db->loadAssocList();
         if (empty($allData)) {
             break;
         }
         $dataUser = array();
         $subids = array();
         for ($i = 0, $a = count($allData); $i < $a; $i++) {
             $subids[] = (int) $allData[$i]['subid'];
             if (!in_array('subid', $exportFields)) {
                 array_shift($allData[$i]);
             }
             foreach ($allData[$i] as $fieldName => $oneUser) {
                 if (!in_array($fieldName, $dateFields)) {
                     $dataUser[$subids[$i]][$fieldName] = $oneUser;
                 } else {
                     $dataUser[$subids[$i]][$fieldName] = acymailing_getDate($oneUser, '%Y-%m-%d %H:%M:%S');
                 }
             }
开发者ID:freaqzilla,项目名称:joomla-site,代码行数:67,代码来源:data.php

示例2: defined

<?php

/**
 * @package	AcyMailing for Joomla!
 * @version	4.9.3
 * @author	acyba.com
 * @copyright	(C) 2009-2015 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');
?>
<table class="admintable" cellspacing="1">
	<tr id="trfileupload">
		<td class="key" >
			<?php 
echo JText::_('UPLOAD_FILE');
?>
		</td>
		<td>
			<input type="file" style="width:auto;" name="importfile" />
			<?php 
echo '<br />' . JText::sprintf('MAX_UPLOAD', acymailing_bytes(ini_get('upload_max_filesize')) > acymailing_bytes(ini_get('post_max_size')) ? ini_get('post_max_size') : ini_get('upload_max_filesize'));
?>
		</td>
	</tr>
</table>
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:26,代码来源:file.php

示例3: form

    function form()
    {
        $mailid = acymailing_getCID('mailid');
        $templateClass = acymailing_get('class.template');
        $config =& acymailing_config();
        if (!empty($mailid)) {
            $mailClass = acymailing_get('class.mail');
            $mail = $mailClass->get($mailid);
            if (!empty($mail->tempid)) {
                $myTemplate = $templateClass->get($mail->tempid);
            }
        } else {
            $mail = new stdClass();
            $mail->created = time();
            $mail->published = 0;
            if ($this->type == 'followup') {
                $mail->published = 1;
            }
            $mail->visible = 1;
            $mail->html = 1;
            $mail->body = '';
            $mail->altbody = '';
            $mail->tempid = 0;
            $templateid = JRequest::getInt('templateid');
            if (empty($templateid)) {
                $myTemplate = $templateClass->getDefault();
            } else {
                $myTemplate = $templateClass->get($templateid);
            }
            if (!empty($myTemplate->tempid)) {
                $mail->body = acymailing_absoluteURL($myTemplate->body);
                $mail->altbody = $myTemplate->altbody;
                $mail->tempid = $myTemplate->tempid;
                $mail->subject = $myTemplate->subject;
                $mail->replyname = $myTemplate->replyname;
                $mail->replyemail = $myTemplate->replyemail;
                $mail->fromname = $myTemplate->fromname;
                $mail->fromemail = $myTemplate->fromemail;
            }
            if ($this->type == 'autonews') {
                $mail->frequency = 604800;
            }
        }
        $sentbyname = '';
        if (!empty($mail->sentby)) {
            $db = JFactory::getDBO();
            $db->setQuery('SELECT `name` FROM `#__users` WHERE `id`= ' . intval($mail->sentby) . ' LIMIT 1');
            $sentbyname = $db->loadResult();
        }
        $this->assignRef('sentbyname', $sentbyname);
        if (JRequest::getVar('task', '') == 'replacetags') {
            $mailerHelper = acymailing_get('helper.mailer');
            JPluginHelper::importPlugin('acymailing');
            $dispatcher = JDispatcher::getInstance();
            $dispatcher->trigger('acymailing_replacetags', array(&$mail, false));
            if (!empty($mail->altbody)) {
                $mail->altbody = $mailerHelper->textVersion($mail->altbody, false);
            }
        }
        $extraInfos = '';
        $values = new stdClass();
        if ($this->type == 'followup') {
            $campaignid = JRequest::getInt('campaign', 0);
            $extraInfos .= '&campaign=' . $campaignid;
            $values->delay = acymailing_get('type.delay');
            $this->assignRef('campaignid', $campaignid);
        } else {
            $listmailClass = acymailing_get('class.listmail');
            $lists = $listmailClass->getLists($mailid);
        }
        acymailing_setTitle(JText::_($this->nameForm), $this->icon, $this->ctrl . '&task=edit&mailid=' . $mailid . $extraInfos);
        $bar = JToolBar::getInstance('toolbar');
        if (acymailing_isAllowed($config->get('acl_templates_view', 'all'))) {
            $bar->appendButton('Acypopup', 'acytemplate', JText::_('ACY_TEMPLATE'), "index.php?option=com_acymailing&ctrl=template&task=theme&tmpl=component", 750, 550);
        }
        if (acymailing_isAllowed($config->get('acl_tags_view', 'all'))) {
            $bar->appendButton('Acytags', $this->type);
        }
        if (in_array($this->type, array('news', 'followup')) && acymailing_isAllowed($config->get('acl_tags_view', 'all'))) {
            JToolBarHelper::custom('replacetags', 'replacetag', '', JText::_('REPLACE_TAGS'), false);
        }
        $buttonPreview = JText::_('ACY_PREVIEW');
        if ($this->type == 'news') {
            $buttonPreview .= ' / ' . JText::_('SEND');
        }
        JToolBarHelper::divider();
        JToolBarHelper::custom('savepreview', 'acypreview', '', $buttonPreview, false);
        JToolBarHelper::save();
        JToolBarHelper::apply();
        JToolBarHelper::cancel();
        JToolBarHelper::divider();
        $bar->appendButton('Pophelp', $this->doc);
        $values->maxupload = acymailing_bytes(ini_get('upload_max_filesize')) > acymailing_bytes(ini_get('post_max_size')) ? ini_get('post_max_size') : ini_get('upload_max_filesize');
        $toggleClass = acymailing_get('helper.toggle');
        $editor = acymailing_get('helper.editor');
        $editor->setTemplate($mail->tempid);
        $editor->name = 'editor_body';
        $editor->content = $mail->body;
        $editor->prepareDisplay();
        $js = "function updateAcyEditor(htmlvalue){";
//.........这里部分代码省略.........
开发者ID:alesconti,项目名称:FF_2015,代码行数:101,代码来源:view.html.php

示例4: form


//.........这里部分代码省略.........
        if ($this->type == 'followup') {
            $campaignid = JRequest::getInt('campaign', 0);
            $extraInfos .= '&campaign=' . $campaignid;
            $values->delay = acymailing_get('type.delay');
            $this->assignRef('campaignid', $campaignid);
        } else {
            $listmailClass = acymailing_get('class.listmail');
            $lists = $listmailClass->getLists($mailid);
        }
        if ($app->isAdmin()) {
            acymailing_setTitle(JText::_($this->nameForm), $this->icon, $this->ctrl . '&task=edit&mailid=' . $mailid . $extraInfos);
            $bar = JToolBar::getInstance('toolbar');
            if (acymailing_isAllowed($config->get('acl_templates_view', 'all'))) {
                $bar->appendButton('Acypopup', 'acytemplate', JText::_('ACY_TEMPLATE'), "index.php?option=com_acymailing&ctrl=template&task=theme&tmpl=component", 750, 550);
            }
            if (acymailing_isAllowed($config->get('acl_tags_view', 'all'))) {
                $bar->appendButton('Acypopup', 'acytags', JText::_('TAGS'), JURI::base() . "index.php?option=com_acymailing&ctrl=tag&task=tag&tmpl=component&type=" . $this->type, 780, 550);
            }
            if (in_array($this->type, array('news', 'followup')) && acymailing_isAllowed($config->get('acl_tags_view', 'all'))) {
                JToolBarHelper::custom('replacetags', 'replacetag', '', JText::_('REPLACE_TAGS'), false);
            }
            $buttonPreview = JText::_('ACY_PREVIEW');
            if ($this->type == 'news') {
                $buttonPreview .= ' / ' . JText::_('SEND');
            }
            JToolBarHelper::divider();
            JToolBarHelper::custom('savepreview', 'acypreview', '', $buttonPreview, false);
            JToolBarHelper::save();
            JToolBarHelper::apply();
            JToolBarHelper::cancel();
            JToolBarHelper::divider();
            $bar->appendButton('Pophelp', $this->doc);
        }
        $values->maxupload = acymailing_bytes(ini_get('upload_max_filesize')) > acymailing_bytes(ini_get('post_max_size')) ? ini_get('post_max_size') : ini_get('upload_max_filesize');
        $toggleClass = acymailing_get('helper.toggle');
        if (!$app->isAdmin()) {
            $toggleClass->ctrl = 'frontnewsletter';
            $toggleClass->extra = '&listid=' . JRequest::getInt('listid');
            $copyAllLists = $lists;
            foreach ($copyAllLists as $listid => $oneList) {
                if (!$oneList->published or empty($my->id)) {
                    unset($lists[$listid]);
                    continue;
                }
                if ($oneList->access_manage == 'all') {
                    continue;
                }
                if ((int) $my->id == (int) $oneList->userid) {
                    continue;
                }
                if (!acymailing_isAllowed($oneList->access_manage)) {
                    unset($lists[$listid]);
                    continue;
                }
            }
            if (empty($lists)) {
                $app = JFactory::getApplication();
                $app->enqueueMessage('You don\'t have the rights to add or edit an e-mail', 'error');
                $app->redirect(acymailing_completeLink('frontnewsletter', false, true));
            }
        }
        $editor = acymailing_get('helper.editor');
        $editor->setTemplate($mail->tempid);
        $editor->name = 'editor_body';
        $editor->content = $mail->body;
        $editor->prepareDisplay();
开发者ID:educakanchay,项目名称:educared,代码行数:67,代码来源:view.html.php

示例5: doexport


//.........这里部分代码省略.........
     }
     $query .= ' ORDER BY s.subid';
     $db = JFactory::getDBO();
     $encodingClass = acymailing_get('helper.encoding');
     $exportHelper = acymailing_get('helper.export');
     $fileName = 'export_' . date('Y-m-d');
     if (!empty($exportLists)) {
         $fileName = '';
         $db->setQuery('SELECT name FROM #__acymailing_list WHERE listid IN (' . implode(',', $exportLists) . ')');
         $allExportedLists = $db->loadObjectList();
         foreach ($allExportedLists as $oneList) {
             $fileName .= '__' . $oneList->name;
         }
         $fileName = trim($fileName, '__');
     }
     $exportHelper->addHeaders($fileName);
     acymailing_displayErrors();
     $eol = "\r\n";
     $before = '"';
     $separator = '"' . $inseparator . '"';
     $after = '"';
     $allFields = array_merge($exportFields, $exportFieldsOthers);
     if (!empty($exportFieldsList)) {
         $allFields = array_merge($allFields, $exportFieldsList);
         $selectFields = 'l.`' . implode('`, l.`', $exportFieldsList) . '`';
         $selectFields = str_replace('listname', 'name', $selectFields);
     }
     if (!empty($exportFieldsGeoloc)) {
         $allFields = array_merge($allFields, $exportFieldsGeoloc);
     }
     $titleLine = $before . implode($separator, $allFields) . $after . $eol;
     $titleLine = str_replace('listid', 'listids', $titleLine);
     echo $titleLine;
     if (acymailing_bytes(ini_get('memory_limit')) > 150000000) {
         $nbExport = 50000;
     } elseif (acymailing_bytes(ini_get('memory_limit')) > 80000000) {
         $nbExport = 15000;
     } else {
         $nbExport = 5000;
     }
     if (!empty($exportFieldsList)) {
         $nbExport = 500;
     }
     $valDep = 0;
     $dateFields = array('created', 'confirmed_date', 'lastopen_date', 'lastclick_date', 'lastsent_date', 'userstats_opendate', 'userstats_senddate', 'urlclick_date', 'hist_date');
     do {
         $db->setQuery($query . ' LIMIT ' . $valDep . ', ' . $nbExport);
         $valDep += $nbExport;
         $allData = $db->loadAssocList('subid');
         if ($allData === false) {
             echo $eol . $eol . 'Error : ' . $db->getErrorMsg();
         }
         if (empty($allData)) {
             break;
         }
         foreach ($allData as $subid => &$oneUser) {
             if (!in_array('subid', $exportFields)) {
                 unset($allData[$subid]['subid']);
             }
             foreach ($dateFields as &$fieldName) {
                 if (isset($allData[$subid][$fieldName])) {
                     $allData[$subid][$fieldName] = acymailing_getDate($allData[$subid][$fieldName], '%Y-%m-%d %H:%M:%S');
                 }
             }
         }
         if (!empty($exportFieldsList) && !empty($allData)) {
开发者ID:madcsaba,项目名称:li-de,代码行数:67,代码来源:data.php

示例6: form

    function form()
    {
        acymailing_loadMootools();
        $app = JFactory::getApplication();
        $mailid = acymailing_getCID('mailid');
        if (empty($mailid)) {
            $mailid = JRequest::getString('mailid');
        }
        $mailClass = acymailing_get('class.mail');
        $mail = $mailClass->get($mailid);
        if (empty($mail)) {
            $config =& acymailing_config();
            $mail = new stdClass();
            $mail->created = time();
            $mail->fromname = $config->get('from_name');
            $mail->fromemail = $config->get('from_email');
            $mail->replyname = $config->get('reply_name');
            $mail->replyemail = $config->get('reply_email');
            $mail->subject = '';
            $mail->type = JRequest::getString('type');
            $mail->published = 1;
            $mail->visible = 0;
            $mail->html = 1;
            $mail->body = '';
            $mail->altbody = '';
            $mail->tempid = 0;
            $mail->alias = '';
        }
        $values = new stdClass();
        $values->maxupload = acymailing_bytes(ini_get('upload_max_filesize')) > acymailing_bytes(ini_get('post_max_size')) ? ini_get('post_max_size') : ini_get('upload_max_filesize');
        $toggleClass = acymailing_get('helper.toggle');
        JHTML::_('behavior.modal', 'a.modal');
        $acyToolbar = acymailing::get('helper.toolbar');
        $acyToolbar->custom('', JText::_('ACY_TEMPLATES'), 'template', false, 'displayTemplates(); return false;');
        $acyToolbar->custom('', JText::_('TAGS'), 'tag', false, 'try{IeCursorFix();}catch(e){}; displayTags(); return false;');
        $acyToolbar->divider();
        $acyToolbar->custom('test', JText::_('SEND_TEST'), 'send', false);
        $acyToolbar->custom('apply', JText::_('ACY_APPLY'), 'apply', false);
        $acyToolbar->setTitle(JText::_('ACY_EDIT'));
        $acyToolbar->topfixed = false;
        $acyToolbar->display();
        $editor = acymailing_get('helper.editor');
        $editor->setTemplate($mail->tempid);
        $editor->name = 'editor_body';
        $editor->content = $mail->body;
        $js = "function updateAcyEditor(htmlvalue){";
        $js .= 'if(htmlvalue == \'0\'){window.document.getElementById("htmlfieldset").style.display = \'none\'}else{window.document.getElementById("htmlfieldset").style.display = \'block\'}';
        $js .= '}';
        $script = '
		var attachmentNb = 1;
		function addFileLoader(){
			if(attachmentNb > 9) return;
			window.document.getElementById("attachmentsdiv"+attachmentNb).style.display = "";
			attachmentNb++;
		}';
        if (!ACYMAILING_J16) {
            $script .= 'function submitbutton(pressbutton){
						if (pressbutton == \'cancel\') {
							submitform( pressbutton );
							return;
						}';
        } else {
            $script .= 'Joomla.submitbutton = function(pressbutton) {
						if (pressbutton == \'cancel\') {
							Joomla.submitform(pressbutton,document.adminForm);
							return;
						}';
        }
        $script .= 'if(window.document.getElementById("subject").value.length < 2){alert(\'' . JText::_('ENTER_SUBJECT', true) . '\'); return false;}';
        $script .= $editor->jsCode();
        if (!ACYMAILING_J16) {
            $script .= 'submitform( pressbutton );} ';
        } else {
            $script .= 'Joomla.submitform(pressbutton,document.adminForm);}; ';
        }
        $script .= "function insertTag(tag){\n\t\ttry{\n\t\t\tif(window.parent.tinymce){ parentTinymce = window.parent.tinymce; window.parent.tinymce = false; }\n\t\t\tjInsertEditorText(tag,'editor_body');\n\t\t\tif(typeof parentTinymce !== 'undefined'){ window.parent.tinymce = parentTinymce; }\n\t\t\tdocument.getElementById('iframetag').style.display = 'none';\n\t\t\tdisplayTags();\n\t\t\treturn true;\n\t\t}catch(err){alert('Your editor does not enable AcyMailing to automatically insert the tag, please copy/paste it manually in your Newsletter'); return false;}}";
        $typeMail = 'news';
        if (strpos($mail->alias, 'notification') !== false) {
            $typeMail = 'notification';
        }
        $iFrame = "'<iframe src=\\'index.php?option=com_acymailing&ctrl=tag&task=tag&type=" . $typeMail . "&tmpl=component\\' width=\\'100%\\' height=\\'100%\\' scrolling=\\'auto\\'></iframe>'";
        $script .= "var openTag = true;\n\t\t\t\t\tfunction displayTags(){var box=\$('iframetag'); if(openTag){box.innerHTML = " . $iFrame . "; box.setStyle('display','block');}\n\t\t\t\t\ttry{\n\t\t\t\t\t\tvar fx = box.effects({duration: 1500, transition: Fx.Transitions.Quart.easeOut});\n\t\t\t\t\t\tif(openTag){fx.start({'height': 300});}else{fx.start({'height': 0}).chain(function() {box.innerHTML = '';box.setStyle('display','none');})};\n\t\t\t\t\t}catch(err){\n\t\t\t\t\t\tbox.style.height = '300px';\n\t\t\t\t\t\tvar myVerticalSlide = new Fx.Slide('iframetag');\n\t\t\t\t\t\tif(openTag){\n\t\t\t\t\t\t\tmyVerticalSlide.slideIn();\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tmyVerticalSlide.slideOut().chain(function() {\n\t\t\t\t\t\t\t\tbox.innerHTML='';\n\t\t\t\t\t\t\t\tbox.setStyle('display','none');\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\topenTag = !openTag;}";
        $iFrame = "'<iframe src=\\'index.php?option=com_acymailing&ctrl=template&task=theme&tmpl=component\\' width=\\'100%\\' height=\\'100%\\' scrolling=\\'auto\\'></iframe>'";
        $script .= "var openTemplate = true;\n\t\t\t\t\tfunction displayTemplates(){var box=\$('iframetemplate'); if(openTemplate){box.innerHTML = " . $iFrame . "; box.setStyle('display','block');}\n\t\t\t\t\ttry{\n\t\t\t\t\t\tvar fx = box.effects({duration: 1500, transition: Fx.Transitions.Quart.easeOut});\n\t\t\t\t\t\tif(openTemplate){fx.start({'height': 300});}else{fx.start({'height': 0}).chain(function() {box.innerHTML = '';box.setStyle('display','none');})};\n\t\t\t\t\t}catch(err){\n\t\t\t\t\t\tbox.style.height = '300px';\n\t\t\t\t\t\tvar myVerticalSlide = new Fx.Slide('iframetemplate');\n\t\t\t\t\t\tif(openTemplate){\n\t\t\t\t\t\t\tmyVerticalSlide.slideIn();\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tmyVerticalSlide.slideOut().chain(function() {\n\t\t\t\t\t\t\t\tbox.innerHTML='';\n\t\t\t\t\t\t\t\tbox.setStyle('display','none');\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\topenTemplate = !openTemplate;}";
        $script .= "function changeTemplate(newhtml,newtext,newsubject,stylesheet,fromname,fromemail,replyname,replyemail,tempid){\n\t\t\tif(newhtml.length>2){" . $editor->setContent('newhtml') . "}\n\t\t\tvar vartextarea =\$('altbody'); if(newtext.length>2) vartextarea.innerHTML = newtext;\n\t\t\tdocument.getElementById('tempid').value = tempid;\n\t\t\tif(fromname.length>1){document.getElementById('fromname').value = fromname;}\n\t\t\tif(fromemail.length>1){document.getElementById('fromemail').value = fromemail;}\n\t\t\tif(replyname.length>1){document.getElementById('replyname').value = replyname;}\n\t\t\tif(replyemail.length>1){document.getElementById('replyemail').value = replyemail;}\n\t\t\tif(newsubject.length>1){document.getElementById('subject').value = newsubject;}\n\t\t\t" . $editor->setEditorStylesheet('tempid') . "\n\t\t\tdocument.getElementById('iframetemplate').style.display = 'none'; displayTemplates();\n\t\t}\n\t\t";
        $doc = JFactory::getDocument();
        $doc->addScriptDeclaration($js . $script);
        $this->assignRef('toggleClass', $toggleClass);
        $this->assignRef('editor', $editor);
        $this->assignRef('values', $values);
        $this->assignRef('mail', $mail);
        $tabs = acymailing_get('helper.acytabs');
        $tabs->setOptions(array('useCookie' => true));
        $this->assignRef('tabs', $tabs);
        $this->assign('app', $app);
    }
开发者ID:madcsaba,项目名称:li-de,代码行数:96,代码来源:view.html.php

示例7: form

    function form()
    {
        JHTML::_('behavior.mootools');
        $mailid = acymailing_getCID('mailid');
        if (empty($mailid)) {
            $mailid = JRequest::getString('mailid');
        }
        $mailClass = acymailing_get('class.mail');
        $mail = $mailClass->get($mailid);
        if (empty($mail)) {
            $config =& acymailing_config();
            $mail->created = time();
            $mail->fromname = $config->get('from_name');
            $mail->fromemail = $config->get('from_email');
            $mail->replyname = $config->get('reply_name');
            $mail->replyemail = $config->get('reply_email');
            $mail->subject = '';
            $mail->type = JRequest::getString('type');
            $mail->published = 1;
            $mail->visible = 0;
            $mail->html = 1;
            $mail->body = '';
            $mail->altbody = '';
            $mail->tempid = 0;
        }
        jimport('joomla.html.pane');
        $tabs =& JPane::getInstance('tabs');
        $values = null;
        $values->maxupload = acymailing_bytes(ini_get('upload_max_filesize')) > acymailing_bytes(ini_get('post_max_size')) ? ini_get('post_max_size') : ini_get('upload_max_filesize');
        $toggleClass = acymailing_get('helper.toggle');
        $editor = acymailing_get('helper.editor');
        $editor->name = 'editor_body';
        $editor->content = $mail->body;
        $js = "function updateAcyEditor(htmlvalue){";
        $js .= 'if(htmlvalue == \'0\'){window.document.getElementById("htmlfieldset").style.display = \'none\'}else{window.document.getElementById("htmlfieldset").style.display = \'block\'}';
        $js .= '}';
        $js .= 'window.addEvent(\'load\', function(){ updateAcyEditor(' . $mail->html . '); });';
        $script = 'function addFileLoader(){
		var divfile=window.document.getElementById("loadfile");
		var input = document.createElement(\'input\');
		input.type = \'file\';
		input.size = \'30\';
		input.name = \'attachments[]\';
		divfile.appendChild(document.createElement(\'br\'));
		divfile.appendChild(input);}
		';
        if (version_compare(JVERSION, '1.6.0', '<')) {
            $script .= 'function submitbutton(pressbutton){
						if (pressbutton == \'cancel\') {
							submitform( pressbutton );
							return;
						}';
        } else {
            $script .= 'Joomla.submitbutton = function(pressbutton) {
						if (pressbutton == \'cancel\') {
							Joomla.submitform(pressbutton,document.adminForm);
							return;
						}';
        }
        $script .= 'if(window.document.getElementById("subject").value.length < 2){alert(\'' . JText::_('ENTER_SUBJECT', true) . '\'); return false;}';
        $script .= $editor->jsCode();
        if (version_compare(JVERSION, '1.6.0', '<')) {
            $script .= 'submitform( pressbutton );} ';
        } else {
            $script .= 'Joomla.submitform(pressbutton,document.adminForm);}; ';
        }
        $script .= "function insertTag(tag){ try{jInsertEditorText(tag,'editor_body'); document.getElementById('iframetag').style.display = 'none'; displayTags(); return true;} catch(err){alert('Your editor does not enable AcyMailing to automatically insert the tag, please copy/paste it manually in your Newsletter'); return false;}}";
        $iFrame = "'<iframe src=\\'index.php?option=com_acymailing&ctrl=tag&task=tag&type=news\\' width=\\'100%\\' height=\\'100%\\' scrolling=\\'auto\\'></iframe>'";
        $script .= "var openTag = true;\r\r\n\t\t\t\t\tfunction displayTags(){var box=\$('iframetag'); if(openTag){box.innerHTML = " . $iFrame . "; box.setStyle('display','block');}\r\r\n\t\t\t\t\ttry{\r\r\n\t\t\t\t\t\tvar fx = box.effects({duration: 1500, transition: Fx.Transitions.Quart.easeOut});\r\r\n\t\t\t\t\t\tif(openTag){fx.start({'height': 300});}else{fx.start({'height': 0}).chain(function() {box.innerHTML = '';box.setStyle('display','none');})};\r\r\n\t\t\t\t\t}catch(err){\r\r\n\t\t\t\t\t\tbox.style.height = '300px';\r\r\n\t\t\t\t\t\tvar myVerticalSlide = new Fx.Slide('iframetag');\r\r\n\t\t\t\t\t\tif(openTag){\r\r\n\t\t\t\t\t\t\tmyVerticalSlide.slideIn();\r\r\n\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\tmyVerticalSlide.slideOut().chain(function() {\r\r\n\t\t\t\t\t\t\t\tbox.innerHTML='';\r\r\n\t\t\t\t\t\t\t\tbox.setStyle('display','none');\r\r\n\t\t\t\t\t\t\t});\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\topenTag = !openTag;}";
        $iFrame = "'<iframe src=\\'index.php?option=com_acymailing&ctrl=template&task=theme&tmpl=component\\' width=\\'100%\\' height=\\'100%\\' scrolling=\\'auto\\'></iframe>'";
        $script .= "var openTemplate = true;\r\r\n\t\t\t\t\tfunction displayTemplates(){var box=\$('iframetemplate'); if(openTemplate){box.innerHTML = " . $iFrame . "; box.setStyle('display','block');}\r\r\n\t\t\t\t\ttry{\r\r\n\t\t\t\t\t\tvar fx = box.effects({duration: 1500, transition: Fx.Transitions.Quart.easeOut});\r\r\n\t\t\t\t\t\tif(openTemplate){fx.start({'height': 300});}else{fx.start({'height': 0}).chain(function() {box.innerHTML = '';box.setStyle('display','none');})};\r\r\n\t\t\t\t\t}catch(err){\r\r\n\t\t\t\t\t\tbox.style.height = '300px';\r\r\n\t\t\t\t\t\tvar myVerticalSlide = new Fx.Slide('iframetemplate');\r\r\n\t\t\t\t\t\tif(openTemplate){\r\r\n\t\t\t\t\t\t\tmyVerticalSlide.slideIn();\r\r\n\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\tmyVerticalSlide.slideOut().chain(function() {\r\r\n\t\t\t\t\t\t\t\tbox.innerHTML='';\r\r\n\t\t\t\t\t\t\t\tbox.setStyle('display','none');\r\r\n\t\t\t\t\t\t\t});\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\topenTemplate = !openTemplate;}";
        $script .= "function changeTemplate(newhtml,newtext,newsubject,stylesheet,fromname,fromemail,replyname,replyemail,tempid){\r\r\n\t\t\tif(newhtml.length>2){" . $editor->setContent('newhtml') . "}\r\r\n\t\t\tvar vartextarea =\$('altbody'); if(newtext.length>2) vartextarea.innerHTML = newtext;\r\r\n\t\t\tdocument.getElementById('tempid').value = tempid;\r\r\n\t\t\tif(fromname.length>1){document.getElementById('fromname').value = fromname;}\r\r\n\t\t\tif(fromemail.length>1){document.getElementById('fromemail').value = fromemail;}\r\r\n\t\t\tif(replyname.length>1){document.getElementById('replyname').value = replyname;}\r\r\n\t\t\tif(replyemail.length>1){document.getElementById('replyemail').value = replyemail;}\r\r\n\t\t\tif(newsubject.length>1){document.getElementById('subject').value = newsubject;}\r\r\n\t\t\tdocument.getElementById('iframetemplate').style.display = 'none'; displayTemplates();\r\r\n\t\t}\r\r\n\t\t";
        $doc =& JFactory::getDocument();
        $doc->addScriptDeclaration($js . $script);
        $doc->addStyleSheet(ACYMAILING_CSS . 'frontendedition.css');
        $this->assignRef('toggleClass', $toggleClass);
        $this->assignRef('editor', $editor);
        $this->assignRef('values', $values);
        $this->assignRef('mail', $mail);
        $this->assignRef('tabs', $tabs);
    }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:81,代码来源:view.html.php


注:本文中的acymailing_bytes函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。