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


PHP acymailing::initJSStrings方法代码示例

本文整理汇总了PHP中acymailing::initJSStrings方法的典型用法代码示例。如果您正苦于以下问题:PHP acymailing::initJSStrings方法的具体用法?PHP acymailing::initJSStrings怎么用?PHP acymailing::initJSStrings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在acymailing的用法示例。


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

示例1: initModule

 function initModule()
 {
     static $i = 0;
     if (empty($i)) {
         $lang =& JFactory::getLanguage();
         $lang->load(ACYMAILING_COMPONENT, JPATH_SITE);
         $doc =& JFactory::getDocument();
         acymailing::initJSStrings();
         $doc->addScript(ACYMAILING_JS . 'acymailing_module.js');
         $config = acymailing::config();
         $moduleCSS = $config->get('css_module', 'default');
         if (!empty($moduleCSS)) {
             $doc->addStyleSheet(ACYMAILING_CSS . 'module_' . $moduleCSS . '.css');
         }
     }
     $i++;
     return 'formAcymailing' . $i;
 }
开发者ID:rlee1962,项目名称:diylegalcenter,代码行数:18,代码来源:helper.php

示例2: initModule

 function initModule($includejs, $params)
 {
     static $alreadyThere = false;
     if ($alreadyThere) {
         return;
     }
     $alreadyThere = true;
     $lang =& JFactory::getLanguage();
     $lang->load(ACYMAILING_COMPONENT, JPATH_SITE);
     acymailing::initJSStrings($includejs, $params);
     $doc =& JFactory::getDocument();
     $config = acymailing::config();
     if ($includejs == 'header') {
         $doc->addScript(ACYMAILING_JS . 'acymailing_module.js');
     } else {
         echo "\n" . '<script type="text/javascript" src="' . ACYMAILING_JS . 'acymailing_module.js" ></script>' . "\n";
     }
     $moduleCSS = $config->get('css_module', 'default');
     if (!empty($moduleCSS)) {
         $doc->addStyleSheet(ACYMAILING_CSS . 'module_' . $moduleCSS . '.css');
     }
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:22,代码来源:helper.php

示例3: modify

 function modify()
 {
     global $Itemid;
     $app =& JFactory::getApplication();
     $pathway =& $app->getPathway();
     $document =& JFactory::getDocument();
     $listsClass = acymailing::get('class.list');
     $subscriberClass = acymailing::get('class.subscriber');
     $menus =& JSite::getMenu();
     $menu = $menus->getActive();
     if (empty($menu) and !empty($Itemid)) {
         $menus->setActive($Itemid);
         $menu = $menus->getItem($Itemid);
     }
     if (is_object($menu)) {
         jimport('joomla.html.parameter');
         $menuparams = new JParameter($menu->params);
         if (!empty($menuparams)) {
             $this->assignRef('introtext', $menuparams->get('introtext'));
             $this->assignRef('finaltext', $menuparams->get('finaltext'));
         }
     }
     $subscriber = $subscriberClass->identify(true);
     if (empty($subscriber)) {
         $subscription = $listsClass->getLists('listid');
         $subscriber = null;
         $subscriber->html = 1;
         $subscriber->subid = 0;
         $subscriber->key = 0;
         if (!empty($subscription)) {
             foreach ($subscription as $id => $onesub) {
                 $subscription[$id]->status = 1;
                 if (!empty($menuparams) and strtolower($menuparams->get('listschecked', 'all')) != 'all' and !in_array($id, explode(',', $menuparams->get('listschecked', 'all')))) {
                     $subscription[$id]->status = 0;
                 }
             }
         }
         $pathway->addItem(JText::_('SUBSCRIPTION'));
         $document->setTitle(JText::_('SUBSCRIPTION'));
     } else {
         $subscription = $subscriberClass->getSubscription($subscriber->subid, 'listid');
         $pathway->addItem(JText::_('MODIFY_SUBSCRIPTION'));
         $document->setTitle(JText::_('MODIFY_SUBSCRIPTION'));
     }
     acymailing::initJSStrings();
     if (!empty($menuparams) and strtolower($menuparams->get('lists', 'all')) != 'all') {
         $visibleLists = strtolower($menuparams->get('lists', 'all'));
         if ($visibleLists == 'none') {
             $subscription = array();
         } else {
             $newSubscription = array();
             $visiblesListsArray = explode(',', $visibleLists);
             foreach ($subscription as $id => $onesub) {
                 if (in_array($id, $visiblesListsArray)) {
                     $newSubscription[$id] = $onesub;
                 }
             }
             $subscription = $newSubscription;
         }
     }
     $displayLists = false;
     foreach ($subscription as $oneSub) {
         if (!empty($oneSub->published) and $oneSub->visible) {
             $displayLists = true;
             break;
         }
     }
     $this->assignRef('status', acymailing::get('type.festatus'));
     $this->assignRef('subscription', $subscription);
     $this->assignRef('subscriber', $subscriber);
     $this->assignRef('displayLists', $displayLists);
     $this->assignRef('config', acymailing::config());
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:73,代码来源:view.html.php

示例4: modify

 function modify()
 {
     $app =& JFactory::getApplication();
     $pathway =& $app->getPathway();
     $document =& JFactory::getDocument();
     $listsClass = acymailing::get('class.list');
     $subscriberClass = acymailing::get('class.subscriber');
     $subscriber = $subscriberClass->identify(true);
     if (empty($subscriber)) {
         $subscription = $listsClass->getLists();
         $subscriber = null;
         $subscriber->html = 1;
         $subscriber->subid = 0;
         $subscriber->key = 0;
         if (!empty($subscription)) {
             foreach ($subscription as $id => $onesub) {
                 $subscription[$id]->status = 1;
             }
         }
         $pathway->addItem(JText::_('SUBSCRIPTION'));
         $document->setTitle(JText::_('SUBSCRIPTION'));
     } else {
         $subscription = $subscriberClass->getSubscription($subscriber->subid);
         $pathway->addItem(JText::_('MODIFY_SUBSCRIPTION'));
         $document->setTitle(JText::_('MODIFY_SUBSCRIPTION'));
     }
     acymailing::initJSStrings();
     if (acymailing::level(1)) {
         $subscription = $listsClass->onlyCurrentLanguage($subscription);
     }
     if (acymailing::level(3)) {
         $fieldsClass = acymailing::get('class.fields');
         $this->assignRef('fieldsClass', $fieldsClass);
         $extraFields = $fieldsClass->getFields('frontcomp', $subscriber);
         $this->assignRef('extraFields', $extraFields);
         $requiredFields = array();
         $validMessages = array();
         foreach ($extraFields as $oneField) {
             if (in_array($oneField->namekey, array('name', 'email'))) {
                 continue;
             }
             if (!empty($oneField->required)) {
                 $requiredFields[] = $oneField->namekey;
                 if (!empty($oneField->options['errormessage'])) {
                     $validMessages[] = addslashes($fieldsClass->trans($oneField->options['errormessage']));
                 } else {
                     $validMessages[] = addslashes(JText::sprintf('FIELD_VALID', $fieldsClass->trans($oneField->fieldname)));
                 }
             }
         }
         if (!empty($requiredFields)) {
             $js = "<!--\r\r\n\t\t\t\tacymailing['reqFieldsComp'] = Array('" . implode("','", $requiredFields) . "');\r\r\n\t\t\t\tacymailing['validFieldsComp'] = Array('" . implode("','", $validMessages) . "');\r\r\n\t\t\t\t//-->";
             $doc =& JFactory::getDocument();
             $doc->addScriptDeclaration($js);
         }
         $my = JFactory::getUser();
         foreach ($subscription as $listid => $oneList) {
             if (!$subscription[$listid]->published) {
                 continue;
             }
             if ($oneList->access_sub == 'all') {
                 continue;
             }
             if ($oneList->access_sub == 'none' or empty($my->id) or empty($my->gid)) {
                 $subscription[$listid]->published = false;
                 continue;
             }
             if (!in_array($my->gid, explode(',', $oneList->access_sub))) {
                 $subscription[$listid]->published = false;
                 continue;
             }
         }
     }
     $displayLists = false;
     for ($i = 0, $a = count($subscription); $i < $a; $i++) {
         if (!empty($subscription[$i]->published) and $subscription[$i]->visible) {
             $displayLists = true;
             break;
         }
     }
     $this->assignRef('status', acymailing::get('type.festatus'));
     $this->assignRef('subscription', $subscription);
     $this->assignRef('subscriber', $subscriber);
     $this->assignRef('displayLists', $displayLists);
     $this->assignRef('config', acymailing::config());
 }
开发者ID:rlee1962,项目名称:diylegalcenter,代码行数:86,代码来源:view.html.php


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