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


PHP JEV_CommonFunctions::notifyAuthorPublished方法代码示例

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


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

示例1: toggleICalEventPublish

 protected function toggleICalEventPublish($cid, $newstate)
 {
     // clean out the cache
     $cache =& JFactory::getCache('com_jevents');
     $cache->clean(JEV_COM_COMPONENT);
     // Must be at least an event creator to publish events
     $is_event_editor = JEVHelper::isEventPublisher();
     if (!$is_event_editor) {
         if (is_array($cid)) {
             foreach ($cid as $id) {
                 if (!JEVHelper::canPublishOwnEvents($id)) {
                     JError::raiseError(403, JText::_('ALERTNOTAUTH'));
                 }
             }
         }
         $is_event_editor = true;
     }
     if (!$is_event_editor) {
         JError::raiseError(403, JText::_('ALERTNOTAUTH'));
     }
     $db =& JFactory::getDBO();
     foreach ($cid as $id) {
         // I should be able to do this in one operation but that can come later
         $event = $this->queryModel->getEventById(intval($id), 1, "icaldb");
         if (is_null($event) || !JEVHelper::canPublishEvent($event)) {
             JError::raiseError(403, JText::_('ALERTNOTAUTH'));
         }
         $sql = "UPDATE #__jevents_vevent SET state={$newstate} where ev_id='" . $id . "'";
         $db->setQuery($sql);
         $db->query();
         $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
         if ($newstate == 1 && $params->get("com_notifyauthor", 0) && !$event->_author_notified) {
             $sql = "UPDATE #__jevents_vevent SET author_notified=1 where ev_id='" . $id . "'";
             $db->setQuery($sql);
             $db->query();
             JEV_CommonFunctions::notifyAuthorPublished($event);
         }
     }
     // I also need to trigger any onpublish event triggers
     $dispatcher =& JDispatcher::getInstance();
     // just incase we don't have jevents plugins registered yet
     JPluginHelper::importPlugin("jevents");
     $res = $dispatcher->trigger('onPublishEvent', array($cid, $newstate));
     if (JFactory::getApplication()->isAdmin()) {
         $this->setRedirect('index.php?option=' . JEV_COM_COMPONENT . '&task=icalevent.list', "IcalEvent  : New published state Saved");
     } else {
         $Itemid = JRequest::getInt("Itemid");
         list($year, $month, $day) = JEVHelper::getYMD();
         $rettask = JRequest::getString("rettask", "day.listevents");
         // Don't return to the event detail since we may be filtering on published state!
         //$this->setRedirect( JRoute::_('index.php?option=' . JEV_COM_COMPONENT. "&task=icalrepeat.detail&evid=$id&year=$year&month=$month&day=$day&Itemid=$Itemid",false),"IcalEvent  : New published state Saved");
         $this->setRedirect(JRoute::_('index.php?option=' . JEV_COM_COMPONENT . "&task={$rettask}&year={$year}&month={$month}&day={$day}&Itemid={$Itemid}", false), "IcalEvent  : New published state Saved");
     }
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:54,代码来源:icalevent.php


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