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


PHP JEVHelper::canPublishEvent方法代码示例

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


在下文中一共展示了JEVHelper::canPublishEvent方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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

示例2: canUserEdit

 function canUserEdit()
 {
     $is_event_creator = JEVHelper::isEventCreator();
     $user = JFactory::getUser();
     // are we authorised to do anything with this category or calendar
     $jevuser = JEVHelper::getAuthorisedUser();
     if ($this->_icsid > 0 && $jevuser && $jevuser->calendars != "" && $jevuser->calendars != "all") {
         $allowedcals = explode("|", $jevuser->calendars);
         if (!in_array($this->_icsid, $allowedcals)) {
             return false;
         }
     }
     if ($this->_catid > 0 && $jevuser && $jevuser->categories != "" && $jevuser->categories != "all") {
         $allowedcats = explode("|", $jevuser->categories);
         if (!in_array($this->_catid, $allowedcats)) {
             return false;
         }
     }
     // if can create events and this was created by this user then can edit (not valid for anon users)
     if ($is_event_creator && $this->isEditable() && $this->created_by() == $user->id && $user->id > 0) {
         return true;
     }
     // if "event publisher" or "event editor" can always edit event
     if (JEVHelper::canEditEvent($this)) {
         return true;
     }
     if (JEVHelper::canPublishEvent($this)) {
         return true;
     }
     return false;
 }
开发者ID:poorgeek,项目名称:JEvents,代码行数:31,代码来源:jeventcal.php

示例3: DefaultEventManagementDialog

/**
 * Creates mini event dialog for view detail page etc.
 * note this must be contained in a position:relative block element in order to work
 *
 * @param Jevent or descendent $row
 */
function DefaultEventManagementDialog($view, $row, $mask, $bootstrap = false)
{
    JevHtmlBootstrap::modal("action_dialogJQ" . $row->rp_id());
    $user = JFactory::getUser();
    if ($user->get("id") == 0) {
        return "";
    }
    if (JEVHelper::canEditEvent($row) || JEVHelper::canPublishEvent($row) || JEVHelper::canDeleteEvent($row)) {
        $popup = false;
        $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
        if ($params->get("editpopup", 0) && JEVHelper::isEventCreator()) {
            JevHtmlBootstrap::modal();
            JEVHelper::script('editpopupJQ.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
            $popup = true;
            $popupw = $params->get("popupw", 800);
            $popuph = $params->get("popuph", 600);
        }
        if (JRequest::getInt("pop", 0)) {
            // do not call the modal scripts if already in a popup window!
            $popup = false;
        }
        $hasrepeat = false;
        $pathIMG = JURI::root() . 'components/' . JEV_COM_COMPONENT . '/assets/images';
        $editImg = JHtml::image('com_jevents/icons-32/edit.png', JText::_("EDIT_EVENT"), null, true);
        $editLink = $row->editLink();
        $editLink = $popup ? "javascript:jevEditPopupNoHeader('" . $editLink . "');" : $editLink;
        $editCopyImg = JHtml::image('com_jevents/icons-32/copy.png', JText::_("COPY_AND_EDIT_EVENT"), null, true);
        $editCopyLink = $row->editCopyLink();
        $editCopyLink = $popup ? "javascript:jevEditPopupNoHeader('" . $editCopyLink . "');" : $editCopyLink;
        $deleteImg = JHtml::image('com_jevents/icons-32/discard.png', JText::_("DELETE_EVENT"), null, true);
        $deleteLink = $row->deleteLink();
        if ($row->until() != $row->dtstart() || $row->count() > 1) {
            $hasrepeat = true;
            $editRepeatImg = JHtml::image('com_jevents/icons-32/edit.png', JText::_("EDIT_REPEAT"), null, true);
            $editRepeatLink = $row->editRepeatLink();
            $editRepeatLink = $popup ? "javascript:jevEditPopupNoHeader('" . $editRepeatLink . "');" : $editRepeatLink;
            $deleteRepeatImg = JHtml::image('com_jevents/icons-32/discard.png', JText::_("DELETE_THIS_REPEAT"), null, true);
            $deleteRepeatLink = $row->deleteRepeatLink();
            $deleteFutureImg = JHtml::image('com_jevents/icons-32/discards.png', JText::_("JEV_DELETE_FUTURE_REPEATS"), null, true);
            $deleteFutureLink = $row->deleteFutureLink();
            $deleteImg = JHtml::image('com_jevents/icons-32/discards.png', JText::_("DELETE_ALL_REPEATS"), null, true);
        } else {
            $editRepeatLink = "";
            $deleteRepeatLink = "";
            $deleteFutureLink = "";
        }
        if (!JEVHelper::canEditEvent($row)) {
            $editLink = "";
            $editRepeatLink = "";
            $editCopyLink = "";
        }
        if (!JEVHelper::canDeleteEvent($row)) {
            $deleteLink = "";
            $deleteRepeatLink = "";
            $deleteFutureLink = "";
        }
        $publishLink = "";
        if (JEVHelper::canPublishEvent($row)) {
            if ($row->published() > 0) {
                $publishImg = JHtml::image('com_jevents/icons-32/cancel.png', JText::_("UNPUBLISH_EVENT"), null, true);
                $publishLink = $row->unpublishLink();
                $publishText = JText::_('UNPUBLISH_EVENT');
            } else {
                $publishImg = JHtml::image('com_jevents/icons-32/accept.png', JText::_("PUBLISH_EVENT"), null, true);
                $publishLink = $row->publishLink();
                $publishText = JText::_('PUBLISH_EVENT');
            }
        }
        if ($publishLink . $editRepeatLink . $editLink . $deleteRepeatLink . $deleteLink . $deleteFutureLink == "") {
            return false;
        }
        ?>
		<div id="action_dialogJQ<?php 
        echo $row->rp_id();
        ?>
" class="action_dialogJQ modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog modal-sm">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
						<h4 class="modal-title" id="myModalLabel"><?php 
        echo JText::_("JEV_MANAGE_EVENT");
        ?>
</h4>
					</div>
					<div class="modal-body">
						<?php 
        if ($publishLink != "") {
            ?>
						<a href="<?php 
            echo $publishLink;
            ?>
" id="publish_reccur"  title="<?php 
            echo $publishText;
//.........这里部分代码省略.........
开发者ID:poorgeek,项目名称:JEvents,代码行数:101,代码来源:defaulteventmanagementdialog.php

示例4: canDeleteEvent

 /**
  * Test to see if user can delete event
  *
  * @param unknown_type $row
  * @param unknown_type $user
  * @return unknown
  */
 public static function canDeleteEvent($row, $user = null)
 {
     // store in static to save repeated database calls
     static $authdata_coredeleteall = array();
     // TODO make this call a plugin
     if ($user == null) {
         $user = JFactory::getUser();
     }
     // are we authorised to do anything with this category or calendar
     $jevuser = JEVHelper::getAuthorisedUser();
     if ($row->_icsid > 0 && $jevuser && $jevuser->calendars != "" && $jevuser->calendars != "all") {
         $allowedcals = explode("|", $jevuser->calendars);
         if (!in_array($row->_icsid, $allowedcals)) {
             return false;
         }
     }
     if ($row->_catid > 0 && $jevuser && $jevuser->categories != "" && $jevuser->categories != "all") {
         $allowedcats = explode("|", $jevuser->categories);
         if (!in_array($row->_catid, $allowedcats)) {
             return false;
         }
         // check multi cats too
         if (JEVHelper::rowCatids($row)) {
             if (count(array_diff(JEVHelper::rowCatids($row), $allowedcats))) {
                 return false;
             }
         }
     }
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     $authorisedonly = $params->get("authorisedonly", 1);
     if ($authorisedonly) {
         if (!$jevuser) {
             return false;
         }
         if (!is_null($jevuser) && $jevuser->candeleteall) {
             return true;
         } else {
             if (!is_null($jevuser) && $jevuser->candeleteown && $row->created_by() == $user->id) {
                 return true;
             }
         }
         return false;
     }
     // This involes TOO many database queries in Joomla - one per category which can be a LOT
     /*
      $cats = JEVHelper::getAuthorisedCategories($user,'com_jevents', 'core.deleteall');
      if (in_array($row->_catid, $cats))
      return true;
     */
     $key = $row->catids() ? json_encode($row->catids()) : json_encode(intval($row->catid()));
     if (!isset($authdata_coredeleteall[$key])) {
         $authdata_coredeleteall[$key] = JEVHelper::authoriseCategories('core.deleteall', $key, $user);
     }
     if ($authdata_coredeleteall[$key]) {
         return $authdata_coredeleteall[$key];
     }
     // can delete all?
     if (JEVHelper::isEventDeletor(true)) {
         // any category restrictions on this?
         // This involes TOO many database queries in Joomla - one per category which can be a LOT
         /*
          $cats = JEVHelper::getAuthorisedCategories($user,'com_jevents', 'core.deleteall');
          if (in_array($row->_catid, $cats))
          return true;
         */
         $key = $row->catids() ? json_encode($row->catids()) : json_encode(intval($row->catid()));
         if (!isset($authdata_coredeleteall[$key])) {
             $authdata_coredeleteall[$key] = JEVHelper::authoriseCategories('core.deleteall', $key, $user);
         }
         if ($authdata_coredeleteall[$key]) {
             return $authdata_coredeleteall[$key];
         }
     }
     // There seems to be a problem with category permissions - sometimes Joomla ACL set to yes in category but result is false!
     // fall back to being able to delete own events if a publisher
     if ($row->created_by() == $user->id) {
         $jevuser = JEVHelper::getAuthorisedUser();
         if (!is_null($jevuser)) {
             return $jevuser->candeleteown;
         }
         // if a user can publish their own then cal delete their own too
         $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
         $authorisedonly = $params->get("authorisedonly", 1);
         $publishown = $params->get("jevpublishown", 0);
         if (!$authorisedonly && ($publishown || JEVHelper::canPublishEvent($row, $user))) {
             return true;
         }
     }
     return false;
 }
开发者ID:madcsaba,项目名称:li-de,代码行数:97,代码来源:helper.php

示例5: simulateSaveEvent

function simulateSaveEvent($requestObject)
{
    include_once JPATH_SITE . "/components/com_jevents/jevents.defines.php";
    if (!JEVHelper::isEventCreator()) {
        throwerror(JText::_('ALERTNOTAUTH'));
    }
    // Convert formdata to array
    $formdata = array();
    foreach (get_object_vars($requestObject->formdata) as $k => $v) {
        $k = str_replace("[]", "", $k);
        $formdata[$k] = $v;
    }
    $array = JRequest::_cleanVar($formdata, JREQUEST_ALLOWHTML);
    $rrule = SaveIcalEvent::generateRRule($array);
    // ensure authorised
    if (isset($array["evid"]) && $array["evid"] > 0) {
        $event = $this->queryModel->getEventById(intval($array["evid"]), 1, "icaldb");
        if (!JEVHelper::canEditEvent($event)) {
            JError::raiseError(403, JText::_('ALERTNOTAUTH'));
        }
    }
    $clearout = false;
    // remove all exceptions since they are no longer needed
    if (isset($array["evid"]) && $array["evid"] > 0) {
        $clearout = true;
    }
    if ($event = SaveIcalEvent::save($array, $this->queryModel, $rrule)) {
        $row = new jIcalEventDB($event);
        if (JEVHelper::canPublishEvent($row)) {
            $msg = JText::_("Event Saved", true);
        } else {
            $msg = JText::_("Event Saved Under Review", true);
        }
        if ($clearout) {
            $db = JFactory::getDBO();
            $query = "DELETE FROM #__jevents_exception WHERE eventid = " . $array["evid"];
            $db->setQuery($query);
            $db->query();
            // TODO clear out old exception details
        }
    } else {
        $msg = JText::_("Event Not Saved", true);
    }
}
开发者ID:madseller,项目名称:coperio,代码行数:44,代码来源:checkconflict-keep.php

示例6: DefaultViewEventRowAdmin

function DefaultViewEventRowAdmin($view, $row, $manage = false)
{
    $popup = false;
    $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
    if ($params->get("editpopup", 0)) {
        JHTML::_('behavior.modal');
        JEVHelper::script('editpopup.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
        $popup = true;
        $popupw = $params->get("popupw", 800);
        $popuph = $params->get("popuph", 600);
    }
    $editLink = $row->editLink(true);
    $editLink = $popup ? "javascript:jevEditPopup('" . $editLink . "',{$popupw}, {$popuph});" : $editLink;
    $modifylink = "";
    if (!$manage && JEVHelper::canEditEvent($row)) {
        $modifylink = '<a href="' . $row->editlink(true) . '" title="' . JText::_('JEV_MODIFY') . '"><b>' . JText::_('JEV_MODIFY') . "</b></a>\n";
        $modifylink = '<a href="' . $editLink . '" title="' . JText::_('JEV_MODIFY') . '"><b>' . JText::_('JEV_MODIFY') . "</b></a>\n";
    }
    $deletelink = "";
    if (!$manage && JEVHelper::canDeleteEvent($row)) {
        $deletelink = '<a href="' . $row->deletelink(false) . "&rettask=admin.listevents" . '" title="' . JText::_('JEV_DELETE') . '"><b>' . JText::_('JEV_DELETE') . "</b></a>\n";
    }
    if (!$manage && JEVHelper::canPublishEvent($row)) {
        if ($row->published()) {
            $publishlink = '<a href="' . $row->unpublishlink(false) . "&rettask=admin.listevents" . '" title="' . JText::_('UNPUBLISH') . '"><b>' . JText::_('UNPUBLISH') . "</b></a>\n";
        } else {
            $publishlink = '<a href="' . $row->publishlink(false) . "&rettask=admin.listevents" . '" title="' . JText::_('PUBLISH') . '"><b>' . JText::_('PUBLISH') . "</b></a>\n";
        }
    } else {
        $publishlink = "";
    }
    $eventlink = $row->viewDetailLink($row->yup(), $row->mup(), $row->dup(), false);
    $eventlink = JRoute::_($eventlink . $view->datamodel->getCatidsOutLink());
    $border = "border-color:" . $row->bgcolor() . ";";
    ?>
		
		<li class="ev_td_li" style="<?php 
    echo $border;
    ?>
">
			<a class="<?php 
    echo $row->state() ? 'ev_link_row' : 'ev_link_unpublished';
    ?>
" href="<?php 
    echo $eventlink;
    ?>
" title="<?php 
    echo JEventsHTML::special($row->title()) . ($row->state() ? '' : JText::_('JEV_UNPUBLISHED'));
    ?>
"><?php 
    echo $row->title() . ($row->state() ? '' : JText::_('JEV_UNPUBLISHED'));
    ?>
</a>
			&nbsp;<?php 
    echo JText::_('JEV_BY');
    ?>
			&nbsp;<i><?php 
    echo $row->contactlink('', true);
    ?>
</i>
			&nbsp;&nbsp;<?php 
    echo $deletelink;
    ?>
			&nbsp;&nbsp;<?php 
    echo $modifylink;
    ?>
			&nbsp;&nbsp;<?php 
    echo $publishlink;
    ?>
		</li>
		<?php 
}
开发者ID:madcsaba,项目名称:li-de,代码行数:72,代码来源:defaultvieweventrowadmin.php

示例7: getEventData

 function getEventData($rpid, $jevtype, $year, $month, $day, $uid = "")
 {
     $data = array();
     $pop = intval(JRequest::getVar('pop', 0));
     $Itemid = JEVHelper::getItemid();
     $db = JFactory::getDBO();
     $user = JFactory::getUser();
     $cfg = JEVConfig::getInstance();
     $row = $this->queryModel->listEventsById($rpid, 1, $jevtype);
     // include unpublished events for publishers and above
     // if the event is not published then make sure the user can edit or publish it or created it before allowing it to be seen!
     if ($row && $row->published() != 1) {
         if ($user->id != $row->created_by() && !JEVHelper::canEditEvent($row) && !JEVHelper::canPublishEvent($row) && !JEVHelper::isAdminUser($user)) {
             $row = null;
         }
     }
     $num_row = count($row);
     // No matching rows - use uid as alternative
     if ($num_row == 0 && JString::strlen($uid) > 0) {
         $rpid = $this->queryModel->findMatchingRepeat($uid, $year, $month, $day);
         if (isset($rpid) && $rpid > 0) {
             $row = $this->queryModel->listEventsById($rpid, 1, $jevtype);
             // include unpublished events for publishers and above
             if ($row && !$row->published()) {
                 if ($user->id != $row->created_by() && !JEVHelper::canEditEvent($row) && !JEVHelper::canPublishEvent($row) && !JEVHelper::isAdminUser($user)) {
                     $row = null;
                 }
             }
             $num_row = count($row);
         }
     }
     if ($num_row) {
         // process the new plugins
         $dispatcher = JEventDispatcher::getInstance();
         $dispatcher->trigger('onGetEventData', array(&$row));
         $params = new JRegistry(null);
         $row->contactlink = JEventsHTML::getUserMailtoLink($row->id(), $row->created_by(), false, $row);
         $event_up = new JEventDate($row->publish_up());
         $row->start_date = JEventsHTML::getDateFormat($event_up->year, $event_up->month, $event_up->day, 0);
         $row->start_time = JEVHelper::getTime($row->getUnixStartTime());
         $event_down = new JEventDate($row->publish_down());
         $row->stop_date = JEventsHTML::getDateFormat($event_down->year, $event_down->month, $event_down->day, 0);
         $row->stop_time = JEVHelper::getTime($row->getUnixEndTime());
         $row->stop_time_midnightFix = $row->stop_time;
         $row->stop_date_midnightFix = $row->stop_date;
         if ($event_down->second == 59) {
             $row->stop_time_midnightFix = JEVHelper::getTime($row->getUnixEndTime() + 1);
             $row->stop_date_midnightFix = JEventsHTML::getDateFormat($event_down->year, $event_down->month, $event_down->day + 1, 0);
         }
         // *******************
         // ** This cloaking should be done by mambot/Joomla function
         // *******************
         // Parse http and  wrap in <a> tag
         // trigger content plugin
         JPluginHelper::importPlugin('content');
         $pattern = '[a-zA-Z0-9&?_.,=%\\-\\/]';
         // Addresse
         if (!is_numeric($row->location())) {
             // don't convert address that already has a link tag
             if (strpos($row->location(), '<a href=') === false) {
                 $row->location(preg_replace('#(http://)(' . $pattern . '*)#i', '<a href="\\1\\2">\\1\\2</a>', $row->location()));
             }
             $tmprow = new stdClass();
             $tmprow->text = $row->location();
             $dispatcher = JEventDispatcher::getInstance();
             $dispatcher->trigger('onContentPrepare', array('com_jevents', &$tmprow, &$params, 0));
             $row->location($tmprow->text);
         }
         //Contact
         if (strpos($row->contact_info(), '<a href=') === false) {
             $row->contact_info(preg_replace('#(http://)(' . $pattern . '*)#i', '<a href="\\1\\2">\\1\\2</a>', $row->contact_info()));
         }
         $tmprow = new stdClass();
         $tmprow->text = $row->contact_info();
         $dispatcher->trigger('onContentPrepare', array('com_jevents', &$tmprow, &$params, 0));
         $row->contact_info($tmprow->text);
         //Extra
         if (strpos($row->extra_info(), '<a href=') === false) {
             $row->extra_info(preg_replace('#(http://)(' . $pattern . '*)#i', '<a href="\\1\\2">\\1\\2</a>', $row->extra_info()));
         }
         //$row->extra_info(eregi_replace('[^(href=|href="|href=\')](((f|ht){1}tp://)[-a-zA-Z0-9@:%_\+.~#?&//=]+)','\\1', $row->extra_info()));
         $tmprow = new stdClass();
         $tmprow->text = $row->extra_info();
         $dispatcher->trigger('onContentPrepare', array('com_jevents', &$tmprow, &$params, 0));
         $row->extra_info($tmprow->text);
         $mask = JFactory::getApplication()->getCfg('hideAuthor') ? MASK_HIDEAUTHOR : 0;
         $mask |= JFactory::getApplication()->getCfg('hideCreateDate') ? MASK_HIDECREATEDATE : 0;
         $mask |= JFactory::getApplication()->getCfg('hideModifyDate') ? MASK_HIDEMODIFYDATE : 0;
         $mask |= JFactory::getApplication()->getCfg('hidePdf') ? MASK_HIDEPDF : 0;
         $mask |= JFactory::getApplication()->getCfg('hidePrint') ? MASK_HIDEPRINT : 0;
         $mask |= JFactory::getApplication()->getCfg('hideEmail') ? MASK_HIDEEMAIL : 0;
         //$mask |= JFactory::getApplication()->getCfg( 'vote' ) ? MASK_VOTES : 0;
         $mask |= JFactory::getApplication()->getCfg('vote') ? MASK_VOTES | MASK_VOTEFORM : 0;
         $mask |= $pop ? MASK_POPUP | MASK_IMAGES | MASK_BACKTOLIST : 0;
         // Do main mambot processing here
         // process bots
         //$row->text      = $row->content;
         $params->set("image", 1);
         $row->text = $row->content();
         $dispatcher->trigger('onContentPrepare', array('com_jevents', &$row, &$params, 0));
//.........这里部分代码省略.........
开发者ID:hriggs,项目名称:cs-website,代码行数:101,代码来源:datamodel.php

示例8: DefaultEventManagementDialog16

function DefaultEventManagementDialog16($view, $row, $mask, $bootstrap = false)
{
    $user = JFactory::getUser();
    if ($user->get("id") == 0) {
        return "";
    }
    if ((JEVHelper::canEditEvent($row) || JEVHelper::canPublishEvent($row) || JEVHelper::canDeleteEvent($row)) && !($mask & MASK_POPUP)) {
        $popup = false;
        $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
        if ($params->get("editpopup", 0) && JEVHelper::isEventCreator()) {
            JEVHelper::script('editpopup.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
            $popup = true;
            $popupw = $params->get("popupw", 800);
            $popuph = $params->get("popuph", 600);
        }
        $hasrepeat = false;
        $pathIMG = JURI::root() . 'components/' . JEV_COM_COMPONENT . '/assets/images';
        $editImg = $pathIMG . "/edit_f2.png";
        $editLink = $row->editLink();
        $editLink = $popup ? "javascript:jevEditPopup('" . $editLink . "',{$popupw}, {$popuph});" : $editLink;
        $editCopyImg = $pathIMG . "/copy_f2.png";
        $editCopyLink = $row->editCopyLink();
        $editCopyLink = $popup ? "javascript:jevEditPopup('" . $editCopyLink . "',{$popupw}, {$popuph});" : $editCopyLink;
        $deleteImg = $pathIMG . "/delete_f2.png";
        $deleteLink = $row->deleteLink();
        if ($row->until() != $row->dtstart() || $row->count() > 1) {
            $hasrepeat = true;
            $editRepeatImg = $pathIMG . "/edit_f2.png";
            $editRepeatLink = $row->editRepeatLink();
            $editRepeatLink = $popup ? "javascript:jevEditPopup('" . $editRepeatLink . "',{$popupw}, {$popuph});" : $editRepeatLink;
            $deleteRepeatImg = $pathIMG . "/delete_f2.png";
            $deleteRepeatLink = $row->deleteRepeatLink();
            $deleteFutureImg = $pathIMG . "/delete_f2.png";
            $deleteFutureLink = $row->deleteFutureLink();
        } else {
            $editRepeatLink = "";
            $deleteRepeatLink = "";
            $deleteFutureLink = "";
        }
        if (!JEVHelper::canEditEvent($row)) {
            $editLink = "";
            $editRepeatLink = "";
            $editCopyLink = "";
        }
        if (!JEVHelper::canDeleteEvent($row)) {
            $deleteLink = "";
            $deleteRepeatLink = "";
            $deleteFutureLink = "";
        }
        $publishLink = "";
        if (JEVHelper::canPublishEvent($row)) {
            if ($row->published() > 0) {
                $publishImg = $pathIMG . "/publish_r.png";
                $publishLink = $row->unpublishLink();
                $publishText = JText::_('UNPUBLISH_EVENT');
            } else {
                $publishImg = $pathIMG . "/publish_g.png";
                $publishLink = $row->publishLink();
                $publishText = JText::_('PUBLISH_EVENT');
            }
        }
        if ($publishLink . $editRepeatLink . $editLink . $deleteRepeatLink . $deleteLink . $deleteFutureLink == "") {
            return false;
        }
        ?>
            <div id="action_dialog" >
            	<div class="close_dialog" >
            		<a href="javascript:void(0)" onclick="closedialog()" >x</a>
            	</div>
                 <?php 
        if ($publishLink != "") {
            ?>
                 <a href="<?php 
            echo $publishLink;
            ?>
" id="publish_reccur"  title="<?php 
            echo $publishText;
            ?>
" ><img src="<?php 
            echo $publishImg;
            ?>
" alt="" /><?php 
            echo $publishText;
            ?>
</a><br/>
                 <?php 
        }
        ?>
                 <?php 
        if ($editRepeatLink != "") {
            ?>
                 <a href="<?php 
            echo $editRepeatLink;
            ?>
" id="edit_reccur"  title="edit event" ><img src="<?php 
            echo $editRepeatImg;
            ?>
" alt="" /><?php 
            echo JText::_('EDIT_REPEAT');
            ?>
//.........这里部分代码省略.........
开发者ID:pguilford,项目名称:vcomcc,代码行数:101,代码来源:defaulteventmanagementdialog16.php

示例9: DefaultLoadedFromTemplate


//.........这里部分代码省略.........
" name="image"  alt="<?php 
                    echo JText::_('JEV_SAVEICAL');
                    ?>
" class="jev_ev_sml nothumb"/>
						</a>
						<div class="jevdialogs">
						<?php 
                    $search[] = "{{ICALDIALOG}}";
                    if ($view) {
                        ob_start();
                        $view->eventIcalDialog($event, $mask);
                        $dialog = ob_get_clean();
                        $replace[] = $dialog;
                    } else {
                        $replace[] = "";
                    }
                    $blank[] = "";
                    echo $dialog;
                    ?>
						</div>

						<?php 
                    $search[] = "{{ICALBUTTON}}";
                    $replace[] = ob_get_clean();
                    $blank[] = "";
                } else {
                    $search[] = "{{ICALBUTTON}}";
                    $replace[] = "";
                    $blank[] = "";
                    $search[] = "{{ICALDIALOG}}";
                    $replace[] = "";
                    $blank[] = "";
                }
                if (JEVHelper::canEditEvent($event) || JEVHelper::canPublishEvent($event) || JEVHelper::canDeleteEvent($event)) {
                    JEVHelper::script('view_detail.js', 'components/' . JEV_COM_COMPONENT . "/assets/js/");
                    ob_start();
                    ?>
						<a href="javascript:void(0)" onclick='clickEditButton()' title="<?php 
                    echo JText::_('JEV_E_EDIT');
                    ?>
">
							<?php 
                    echo JEVHelper::imagesite('edit.png', JText::_('JEV_E_EDIT'));
                    ?>
						</a>
						<div class="jevdialogs">
						<?php 
                    $search[] = "{{EDITDIALOG}}";
                    if ($view) {
                        ob_start();
                        $view->eventManagementDialog($event, $mask);
                        $dialog = ob_get_clean();
                        $replace[] = $dialog;
                    } else {
                        $replace[] = "";
                    }
                    $blank[] = "";
                    echo $dialog;
                    ?>
						</div>

						<?php 
                    $search[] = "{{EDITBUTTON}}";
                    $replace[] = ob_get_clean();
                    $blank[] = "";
                } else {
开发者ID:madcsaba,项目名称:li-de,代码行数:67,代码来源:defaultloadedfromtemplate.php

示例10: DefaultEventManagementDialog

/**
 * Creates mini event dialog for view detail page etc.
 * note this must be contained in a position:relative block element in order to work
 *
 * @param Jevent or descendent $row
 */
function DefaultEventManagementDialog($view, $row, $mask)
{
    if ((JEVHelper::canEditEvent($row) || JEVHelper::canPublishEvent($row) || JEVHelper::canDeleteEvent($row)) && !($mask & MASK_POPUP)) {
        $popup = false;
        $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
        if ($params->get("editpopup", 0)) {
            JHTML::_('behavior.modal');
            JEVHelper::script('editpopup.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
            $popup = true;
            $popupw = $params->get("popupw", 800);
            $popuph = $params->get("popuph", 600);
        }
        $hasrepeat = false;
        if (JVersion::isCompatible("1.6.0")) {
            $pathIMG = JURI::root() . 'components/' . JEV_COM_COMPONENT . '/assets/images';
        } else {
            $pathIMG = JURI::root() . 'administrator/images';
        }
        $editImg = $pathIMG . "/edit_f2.png";
        $editLink = $row->editLink();
        $editLink = $popup ? "javascript:jevEditPopup('" . $editLink . "',{$popupw}, {$popuph});" : $editLink;
        $editCopyImg = $pathIMG . "/copy_f2.png";
        $editCopyLink = $row->editCopyLink();
        $editCopyLink = $popup ? "javascript:jevEditPopup('" . $editCopyLink . "',{$popupw}, {$popuph});" : $editCopyLink;
        $deleteImg = $pathIMG . "/delete_f2.png";
        $deleteLink = $row->deleteLink();
        if ($row->until() != $row->dtstart() || $row->count() > 1) {
            $hasrepeat = true;
            $editRepeatImg = $pathIMG . "/edit_f2.png";
            $editRepeatLink = $row->editRepeatLink();
            $editRepeatLink = $popup ? "javascript:jevEditPopup('" . $editRepeatLink . "',{$popupw}, {$popuph});" : $editRepeatLink;
            $deleteRepeatImg = $pathIMG . "/delete_f2.png";
            $deleteRepeatLink = $row->deleteRepeatLink();
            $deleteFutureImg = $pathIMG . "/delete_f2.png";
            $deleteFutureLink = $row->deleteFutureLink();
        } else {
            $editRepeatLink = "";
            $deleteRepeatLink = "";
            $deleteFutureLink = "";
        }
        if (!JEVHelper::canEditEvent($row)) {
            $editLink = "";
            $editRepeatLink = "";
            $editCopyLink = "";
        }
        if (!JEVHelper::canDeleteEvent($row)) {
            $deleteLink = "";
            $deleteRepeatLink = "";
            $deleteFutureLink = "";
        }
        $publishLink = "";
        if (JEVHelper::canPublishEvent($row)) {
            if ($row->published() > 0) {
                $publishImg = $pathIMG . "/publish_r.png";
                $publishLink = $row->unpublishLink();
                $publishText = JText::_('UNPUBLISH_EVENT');
            } else {
                $publishImg = $pathIMG . "/publish_g.png";
                $publishLink = $row->publishLink();
                $publishText = JText::_('PUBLISH_EVENT');
            }
        }
        if ($publishLink . $editRepeatLink . $editLink . $deleteRepeatLink . $deleteLink . $deleteFutureLink == "") {
            return false;
        }
        ?>
            <div id="action_dialog"  style="position:absolute;right:0px;background-color:#dedede;border:solid 1px #000000;width:200px;padding:10px;visibility:hidden;z-index:999;">
            	<div style="width:12px!important;position:absolute;right:0px;top:0px;background-color:#ffffff;;border:solid #000000;border-width:0 0 1px 1px;text-align:center;">
            		<a href="javascript:void(0)" onclick="closedialog()" style="font-weight:bold;text-decoration:none;color:#000000;">x</a>
            	</div>
                 <?php 
        if ($publishLink != "") {
            ?>
                 <a href="<?php 
            echo $publishLink;
            ?>
" id="publish_reccur"  title="<?php 
            echo $publishText;
            ?>
" style="text-decoration:none;"><img src="<?php 
            echo $publishImg;
            ?>
" style="width:20px;height:20px;border:0px;margin-right:1em;vertical-align:middle;" alt="" /><?php 
            echo $publishText;
            ?>
</a><br/>
                 <?php 
        }
        ?>
                 <?php 
        if ($editRepeatLink != "") {
            ?>
                 <a href="<?php 
            echo $editRepeatLink;
//.........这里部分代码省略.........
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:101,代码来源:defaulteventmanagementdialog.php

示例11: DefaultLoadedFromTemplate


//.........这里部分代码省略.........
">
			<img src="<?php 
        echo JURI::root() . 'administrator/components/' . JEV_COM_COMPONENT . '/assets/images/jevents_event_sml.png';
        ?>
" align="middle" name="image"  alt="<?php 
        echo JText::_('JEV_SAVEICAL');
        ?>
" style="height:24px;"/>
		</a>
        <div class="jevdialogs">
        <?php 
        $search[] = "{{ICALDIALOG}}";
        ob_start();
        $view->eventIcalDialog($event, $mask);
        $dialog = ob_get_clean();
        $replace[] = $dialog;
        $blank[] = "";
        echo $dialog;
        ?>
        </div>
		
		<?php 
        $search[] = "{{ICALBUTTON}}";
        $replace[] = ob_get_clean();
        $blank[] = "";
    } else {
        $search[] = "{{ICALBUTTON}}";
        $replace[] = "";
        $blank[] = "";
        $search[] = "{{ICALDIALOG}}";
        $replace[] = "";
        $blank[] = "";
    }
    if ((JEVHelper::canEditEvent($event) || JEVHelper::canPublishEvent($event) || JEVHelper::canDeleteEvent($event)) && !($mask & MASK_POPUP)) {
        JEVHelper::script('view_detail.js', 'components/' . JEV_COM_COMPONENT . "/assets/js/");
        ob_start();
        ?>
        <a href="javascript:void(0)" onclick='clickEditButton()' title="<?php 
        echo JText::_('JEV_E_EDIT');
        ?>
">
			<?php 
        echo JEVHelper::imagesite('edit.png', JText::_('JEV_E_EDIT'));
        ?>
        </a>
        <div class="jevdialogs">
        <?php 
        $search[] = "{{EDITDIALOG}}";
        ob_start();
        $view->eventManagementDialog($event, $mask);
        $dialog = ob_get_clean();
        $replace[] = $dialog;
        $blank[] = "";
        echo $dialog;
        ?>
        </div>
        
        <?php 
        $search[] = "{{EDITBUTTON}}";
        $replace[] = ob_get_clean();
        $blank[] = "";
    } else {
        $search[] = "{{EDITBUTTON}}";
        $replace[] = "";
        $blank[] = "";
        $search[] = "{{EDITDIALOG}}";
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:67,代码来源:defaultloadedfromtemplate.php


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