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


PHP JEVHelper::isEventCreator方法代码示例

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


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

示例1: _createFilter

 function _createFilter($prefix = "")
 {
     if (!$this->filterField) {
         return "ev.state=1";
     }
     // The default is only to show published events
     if ($this->filter_value == 0) {
         return "ev.state=1";
     }
     // only show published events to non-logged in users
     $user = JFactory::getUser();
     if ($user->get('id') == 0) {
         return "ev.state=1";
     }
     if (JEVHelper::isEventPublisher(true) || JEVHelper::isEventEditor()) {
         if ($this->filter_value == -1) {
             return "";
         }
         return "ev.state=0";
     } else {
         if (JEVHelper::isEventCreator()) {
             $user = JFactory::getUser();
             if ($this->filter_value == -1) {
                 return "(ev.state=1 OR ev.created_by=" . $user->id . ")";
             }
             return "ev.state=0 && ev.created_by=" . $user->id;
         }
     }
     return "ev.state=1";
 }
开发者ID:madseller,项目名称:coperio,代码行数:30,代码来源:Published.php

示例2: DefaultViewDatecellAddEvent

function DefaultViewDatecellAddEvent($view, $year, $month, $day)
{
    if (JEVHelper::isEventCreator()) {
        JEVHelper::script('view_detail.js', 'components/' . JEV_COM_COMPONENT . "/assets/js/");
        // no events on Saturday or Sunday!
        //if (date("N",mktime(0,0,0,$month,$day, $year))>5) return;
        $editLink = JRoute::_('index.php?option=' . JEV_COM_COMPONENT . '&task=icalevent.edit' . '&year=' . $year . '&month=' . $month . '&day=' . $day . '&Itemid=' . $view->Itemid, true);
        $eventlinkadd = $view->popup ? "javascript:jevEditPopup('" . $editLink . "',{$view->popupw}, {$view->popuph});" : $editLink;
        $transparentGif = JURI::root() . "components/" . JEV_COM_COMPONENT . "/views/" . $view->getViewName() . "/assets/images/transp.gif";
        ?>
    	<a href="<?php 
        echo $eventlinkadd;
        ?>
" title="<?php 
        echo JText::_('JEV_ADDEVENT');
        ?>
" class="addjevent">
        	<img src="<?php 
        echo $transparentGif;
        ?>
" alt="<?php 
        echo JText::_('JEV_ADDEVENT');
        ?>
"/>
    	</a>
    	<?php 
    }
}
开发者ID:madcsaba,项目名称:li-de,代码行数:28,代码来源:defaultviewdatecelladdevent.php

示例3: edit

 function edit($tpl = null)
 {
     $document = JFactory::getDocument();
     include JEV_ADMINLIBS . "/editStrings.php";
     $document->addScriptDeclaration($editStrings);
     JEVHelper::script('editical.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
     JEVHelper::script('view_detail.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
     JEVHelper::script('JevStdRequiredFields.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
     $document->setTitle(JText::_('EDIT_ICAL_REPEAT'));
     // Set toolbar items for the page
     JToolBarHelper::title(JText::_('EDIT_ICAL_REPEAT'), 'jevents');
     $bar = JToolBar::getInstance('toolbar');
     $this->toolbarConfirmButton("icalrepeat.save", JText::_("JEV_SAVE_ICALEVENT_WARNING"), 'save', 'save', 'Save', false);
     if (JEVHelper::isEventEditor()) {
         $this->toolbarConfirmButton("icalrepeat.apply", JText::_("JEV_SAVE_ICALEVENT_WARNING"), 'apply', 'apply', 'jev_Apply', false);
     }
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     if ($params->get("editpopup", 0) && JEVHelper::isEventCreator()) {
         $document->addStyleDeclaration("div#toolbar-box{margin:10px 10px 0px 10px;} div#jevents {margin:0px 10px 10px 10px;} ");
         $this->toolbarButton("icalevent.close", 'cancel', 'cancel', 'Cancel', false);
         JRequest::setVar('tmpl', 'component');
         //force the component template
     } else {
         $this->toolbarButton("icalevent.detail", 'cancel', 'cancel', 'Cancel', false);
     }
     //JToolBarHelper::help( 'screen.icalrepeat.edit', true);
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     JHTML::_('behavior.tooltip');
     $this->_adminStart();
     if (JevJoomlaVersion::isCompatible("3.0")) {
         // load Joomla javascript classes
         JHTML::_('behavior.core');
         $this->setLayout("edit");
     } else {
         $this->setLayout("edit16");
     }
     $this->setupEditForm();
     JEVHelper::componentStylesheet($this, "editextra.css");
     jimport('joomla.filesystem.file');
     // Lets check if we have editted before! if not... rename the custom file.
     if (JFile::exists(JPATH_SITE . "/components/com_jevents/assets/css/jevcustom.css")) {
         // It is definitely now created, lets load it!
         JEVHelper::stylesheet('jevcustom.css', 'components/' . JEV_COM_COMPONENT . '/assets/css/');
     }
     parent::displaytemplate($tpl);
     $this->_adminEnd();
 }
开发者ID:pguilford,项目名称:vcomcc,代码行数:47,代码来源:view.html.php

示例4: listevents

 function listevents()
 {
     $is_event_editor = JEVHelper::isEventCreator();
     $Itemid = JEVHelper::getItemid();
     $user = JFactory::getUser();
     if (!$is_event_editor) {
         $returnlink = JRoute::_('index.php?option=' . JEV_COM_COMPONENT . '&task=month.calendar&Itemid=' . $Itemid, false);
         $this->setRedirect($returnlink, html_entity_decode(JText::_('JEV_NOPERMISSION')));
         $this->redirect();
         return;
     }
     list($year, $month, $day) = JEVHelper::getYMD();
     // Joomla unhelpfully switched limitstart to start when sef is enabled!  includes/router.php line 390
     $limitstart = intval(JRequest::getVar('start', JRequest::getVar('limitstart', 0)));
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     $limit = intval(JFactory::getApplication()->getUserStateFromRequest('jevlistlimit', 'limit', $params->get("com_calEventListRowsPpg", 15)));
     $Itemid = JEVHelper::getItemid();
     $task = $this->_task;
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     $adminuser = $params->get("jevadmin", -1);
     if (JEVHelper::isAdminUser($user) || $user->id == $adminuser) {
         $creator_id = 'ADMIN';
     } else {
         $creator_id = $user->id;
     }
     // get the view
     $document = JFactory::getDocument();
     $viewType = $document->getType();
     $cfg = JEVConfig::getInstance();
     $theme = JEV_CommonFunctions::getJEventsViewName();
     $view = "admin";
     $this->addViewPath($this->_basePath . '/' . "views" . '/' . $theme);
     $this->view = $this->getView($view, $viewType, $theme . "View", array('base_path' => $this->_basePath, "template_path" => $this->_basePath . '/' . "views" . '/' . $theme . '/' . $view . '/' . 'tmpl', "name" => $theme . '/' . $view));
     // Set the layout
     $this->view->setLayout('listevents');
     $this->view->assign("Itemid", $Itemid);
     $this->view->assign("limitstart", $limitstart);
     $this->view->assign("limit", $limit);
     $this->view->assign("month", $month);
     $this->view->assign("day", $day);
     $this->view->assign("year", $year);
     $this->view->assign("task", $task);
     $this->view->assign("creator_id", $creator_id);
     $this->view->display();
 }
开发者ID:poorgeek,项目名称:JEvents,代码行数:45,代码来源:admin.php

示例5: ical

 function ical($tpl = null)
 {
     JEVHelper::componentStylesheet($this);
     $document = JFactory::getDocument();
     // TODO do this properly
     //$document->setTitle(JText::_( 'BROWSER_TITLE' ));
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     //$this->assign("introduction", $params->get("intro",""));
     $this->data = $this->datamodel->getCalendarData($this->year, $this->month, $this->day);
     // for adding events in day cell
     $this->popup = false;
     if ($params->get("editpopup", 0) && JEVHelper::isEventCreator()) {
         JevHtmlBootstrap::modal();
         JEVHelper::script('editpopup.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
         $this->popup = true;
         $this->popupw = $params->get("popupw", 800);
         $this->popuph = $params->get("popuph", 600);
     }
     $this->is_event_creator = JEVHelper::isEventCreator();
 }
开发者ID:pguilford,项目名称:vcomcc,代码行数:20,代码来源:view.html.php

示例6: apply

 function apply()
 {
     // Must be at least an event creator to save events
     $is_event_editor = JEVHelper::isEventCreator();
     if (!$is_event_editor) {
         JError::raiseError(403, JText::_('ALERTNOTAUTH'));
     }
     parent::apply();
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:9,代码来源:icalevent.php

示例7: doSave

 private function doSave(&$msg)
 {
     if (!JEVHelper::isEventCreator()) {
         JError::raiseError(403, JText::_('ALERTNOTAUTH'));
     }
     // clean out the cache
     $cache =& JFactory::getCache('com_jevents');
     $cache->clean(JEV_COM_COMPONENT);
     // JREQUEST_ALLOWHTML requires at least Joomla 1.5 svn9979 (past 1.5 stable)
     $array = JRequest::get('request', JREQUEST_ALLOWHTML);
     // Should we allow raw content through unfiltered
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     if ($params->get("allowraw", 0)) {
         $array['jevcontent'] = JRequest::getString("jevcontent", "", "POST", JREQUEST_ALLOWRAW);
     }
     if (!JEVHelper::canCreateEvent($array)) {
         JError::raiseError(403, JText::_('ALERTNOTAUTH'));
     }
     $rrule = SaveIcalEvent::generateRRule($array);
     // ensure authorised
     if (isset($array["evid"]) && $array["evid"] > 0) {
         $event = $this->queryModel->getEventById(intval($array["evid"]), 1, "icaldb");
         if (!$event || !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);
     }
     return $row;
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:50,代码来源:icalevent.php

示例8: importdata

    function importdata()
    {
        // Check for request forgeries
        JRequest::checkToken() or jexit('Invalid Token');
        // Can only do this if can add an event
        // Must be at least an event creator to edit or create events
        $is_event_editor = JEVHelper::isEventCreator();
        if (!$is_event_editor) {
            $user = JFactory::getUser();
            if ($user->id) {
                $this->setRedirect(JURI::root(), JText::_('JEV_NOTAUTH_CREATE_EVENT'));
                $this->redirect();
            } else {
                $comuser = version_compare(JVERSION, '1.6.0', '>=') ? "com_users" : "com_user";
                $this->setRedirect(JRoute::_("index.php?option={$comuser}&view=login"), JText::_('JEV_NOTAUTH_CREATE_EVENT'));
                $this->redirect();
            }
            return;
        }
        $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
        if (!$params->get("feimport", 0)) {
            return;
        }
        $catid = JRequest::getInt('catid', 0);
        $ignoreembedcat = JRequest::getInt('ignoreembedcat', 0);
        // Should come from the form or existing item
        $access = 0;
        $state = 1;
        $uploadURL = JRequest::getVar('uploadURL', '');
        $icsLabel = uniqid('icsLabel');
        $icsid = JRequest::getInt('icsid', 0);
        $autorefresh = 0;
        if ($catid == 0) {
            // Paranoia, should not be here, validation is done by java script
            // Just load the ical event list on redirect for now.
            $redirect_task = "icalevent.list";
            JError::raiseError('Fatal error', JText::_('JEV_E_WARNCAT'));
            $this->setRedirect("index.php?option=" . JEV_COM_COMPONENT . "&task={$redirect_task}", JText::_('JEV_E_WARNCAT'));
            $this->redirect();
            return;
        }
        // I need a better check and expiry information etc.
        if (JString::strlen($uploadURL) > 0) {
            $icsFile = iCalICSFile::newICSFileFromURL($uploadURL, $icsid, $catid, $access, $state, $icsLabel, $autorefresh, $ignoreembedcat);
        } else {
            if (isset($_FILES['upload']) && is_array($_FILES['upload'])) {
                $file = $_FILES['upload'];
                if ($file['size'] == 0) {
                    //|| !($file['type']=="text/calendar" || $file['type']=="application/octet-stream")){
                    JError::raiseWarning(0, 'empty upload file');
                    $icsFile = false;
                } else {
                    $icsFile = iCalICSFile::newICSFileFromFile($file, $icsid, $catid, $access, $state, $icsLabel, 0, $ignoreembedcat);
                }
            }
        }
        $count = 0;
        if ($icsFile !== false) {
            $count = $icsFile->storeEvents();
        }
        list($year, $month, $day) = JEVHelper::getYMD();
        ob_end_clean();
        ?>
		<script type="text/javascript">
			window.alert("<?php 
        echo JText::sprintf("JEV_EVENTS_IMPORTED", $count);
        ?>
");
			try {
				window.parent.jQuery('#myImportModal').modal('hide');
			}
			catch (e){}
			try {
				window.parent.SqueezeBox.close();
			}
			catch (e){}
			//window.parent.location.reload();
		</script>
		<?php 
        exit;
    }
开发者ID:poorgeek,项目名称:JEvents,代码行数:81,代码来源:icals.php

示例9: delete

 function delete()
 {
     $is_event_editor = JEVHelper::isEventCreator();
     if (!$is_event_editor) {
         JError::raiseError(403, JText::_('ALERTNOTAUTH'));
     }
     parent::delete();
 }
开发者ID:madseller,项目名称:coperio,代码行数:8,代码来源:icalrepeat.php

示例10: getDataForAdmin

 function getDataForAdmin($creator_id, $limit, $limitstart, $showrepeats = false, $orderby = "")
 {
     $data = array();
     $is_event_editor = JEVHelper::isEventCreator();
     $user =& JFactory::getUser();
     $Itemid = JEVHelper::getItemid();
     $user =& JFactory::getUser();
     $db =& JFactory::getDBO();
     $cfg =& JEVConfig::getInstance();
     include_once JPATH_ADMINISTRATOR . "/components/" . JEV_COM_COMPONENT . "/libraries/colorMap.php";
     // Note that these are the vevents not the repeats
     if (!$showrepeats) {
         $total = $this->queryModel->countIcalEventsByCreator($creator_id);
     } else {
         $total = $this->queryModel->countIcalEventRepeatsByCreator($creator_id);
     }
     $data['total'] = $total;
     $data['limit'] = $limit;
     if ($data["total"] <= $data["limit"]) {
         $limitstart = 0;
     }
     $data["limitstart"] = $limitstart;
     // Note that these are the vevents not the repeats
     if (!$showrepeats) {
         $rows = $this->queryModel->listIcalEventsByCreator($creator_id, $limitstart, $limit, $orderby);
     } else {
         $rows = $this->queryModel->listIcalEventRepeatsByCreator($creator_id, $limitstart, $limit, $orderby);
     }
     $adminView = true;
     $num_events = count($rows);
     if ($num_events > 0) {
         for ($r = 0; $r < $num_events; $r++) {
             $row =& $rows[$r];
             $row->catname($row->getCategoryName());
             $row->contactlink(JEventsHTML::getUserMailtoLink($row->id(), $row->created_by(), true));
             $row->bgcolor = JEV_CommonFunctions::setColor($row);
             $row->fgcolor = JevMapColor($row->bgcolor);
         }
     }
     $data['rows'] = $rows;
     return $data;
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:42,代码来源:datamodel.php

示例11: doSave

 private function doSave(&$msg)
 {
     if (!JEVHelper::isEventCreator()) {
         throw new Exception(JText::_('ALERTNOTAUTH'), 403);
         return false;
     }
     // clean out the cache
     $cache = JFactory::getCache('com_jevents');
     $cache->clean(JEV_COM_COMPONENT);
     // JREQUEST_ALLOWHTML requires at least Joomla 1.5 svn9979 (past 1.5 stable)
     $array = JRequest::get('request', JREQUEST_ALLOWHTML);
     // Should we allow raw content through unfiltered
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     if ($params->get("allowraw", 0)) {
         $array['jevcontent'] = JRequest::getString("jevcontent", "", "POST", JREQUEST_ALLOWRAW);
         $array['extra_info'] = JRequest::getString("extra_info", "", "POST", JREQUEST_ALLOWRAW);
     }
     // convert nl2br if there is no HTML
     if (strip_tags($array['jevcontent']) == $array['jevcontent']) {
         $array['jevcontent'] = nl2br($array['jevcontent']);
     }
     if (strip_tags($array['extra_info']) == $array['extra_info']) {
         $array['extra_info'] = nl2br($array['extra_info']);
     }
     // convert event data to objewct so we can test permissions
     $eventobj = new stdClass();
     foreach ($array as $key => $val) {
         $newkey = "_" . $key;
         $eventobj->{$newkey} = $val;
     }
     $eventobj->_icsid = $eventobj->_ics_id;
     if (is_array($eventobj->_catid)) {
         $eventobj->_catid = current($eventobj->_catid);
     }
     if (!JEVHelper::canCreateEvent($eventobj)) {
         throw new Exception(JText::_('ALERTNOTAUTH'), 403);
         return false;
     }
     $rrule = SaveIcalEvent::generateRRule($array);
     // ensure authorised
     if (isset($array["evid"]) && $array["evid"] > 0) {
         $event = $this->queryModel->getEventById(intval($array["evid"]), 1, "icaldb");
         if (!$event || !JEVHelper::canEditEvent($event)) {
             throw new Exception(JText::_('ALERTNOTAUTH'), 403);
             return false;
         }
     }
     $clearout = false;
     // remove all exceptions since they are no longer needed
     if (isset($array["evid"]) && $array["evid"] > 0 && JRequest::getInt("updaterepeats", 1)) {
         $clearout = true;
     }
     if ($event = SaveIcalEvent::save($array, $this->queryModel, $rrule)) {
         $row = new jIcalEventRepeat($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);
         $row = null;
     }
     return $row;
 }
开发者ID:pguilford,项目名称:vcomcc,代码行数:72,代码来源:icalevent.php

示例12: apply

 function apply()
 {
     // Must be at least an event creator to save events
     $is_event_editor = JEVHelper::isEventCreator();
     if (!$is_event_editor) {
         throw new Exception(JText::_('ALERTNOTAUTH'), 403);
         return false;
     }
     parent::apply();
 }
开发者ID:poorgeek,项目名称:JEvents,代码行数:10,代码来源:icalevent.php

示例13: DefaultViewEventRowAdmin

function DefaultViewEventRowAdmin($view, $row, $manage = false)
{
    $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);
    }
    $editLink = $row->editLink(true);
    $editLink = $popup ? "javascript:jevEditPopup('" . $editLink . "');" : $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:poorgeek,项目名称:JEvents,代码行数:72,代码来源:defaultvieweventrowadmin.php

示例14: __construct

    function __construct($view, $today_date, $view_date, $dates, $alts, $option, $task, $Itemid)
    {
        global $catidsOut;
        if (JRequest::getInt('pop', 0)) {
            return;
        }
        $cfg = JEVConfig::getInstance();
        $compname = JEV_COM_COMPONENT;
        //Lets check if we should show the nav on event details
        if ($task == "icalrepeat.detail" && $cfg->get('shownavbar_detail', 1) == 0) {
            return;
        }
        $this->iconstoshow = $cfg->get('iconstoshow', array('byyear', 'bymonth', 'byweek', 'byday', 'search'));
        $viewimages = JURI::root() . "components/" . JEV_COM_COMPONENT . "/views/" . $view->getViewName() . "/assets/images";
        $cat = "";
        $hiddencat = "";
        if ($catidsOut != 0) {
            $cat = '&catids=' . $catidsOut;
            $hiddencat = '<input type="hidden" name="catids" value="' . $catidsOut . '"/>';
        }
        // for popup editing
        $view->popup = false;
        $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
        if ($params->get("editpopup", 0) && JEVHelper::isEventCreator()) {
            JevHtmlBootstrap::modal();
            JEVHelper::script('editpopup.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
            $view->popup = true;
            $view->popupw = $params->get("popupw", 800);
            $view->popuph = $params->get("popuph", 600);
        }
        $link = 'index.php?option=' . $option . '&task=' . $task . $cat . '&Itemid=' . $Itemid . '&';
        ?>
		<table class="ev_navigation" bgcolor="#ffffff" border="0" cellpadding="10" cellspacing="0" width="100%" >
			<tr>
				<td class="tableh1" align="center">
					<table border="0" cellpadding="0" cellspacing="0">
						<tr>
							<!-- BEGIN add_event -->
							<!--//
							<?php 
        if (JEVHelper::isEventCreator()) {
            list($year, $month, $day) = JEVHelper::getYMD();
            $editLink = JRoute::_('index.php?option=' . JEV_COM_COMPONENT . '&task=icalevent.edit' . '&year=' . $year . '&month=' . $month . '&day=' . $day . '&Itemid=' . $view->Itemid, true);
            $eventlinkadd = $view->popup ? "javascript:jevEditPopup('" . $editLink . "');" : $editLink;
            ?>
										<td><img name="spacer" src="<?php 
            echo $viewimages;
            ?>
/spacer.gif"  alt="" border="0" height="25" width="10"/></td>
										<td class="buttontext" align="center" nowrap="nowrap" valign="middle">
											<a href="<?php 
            echo $eventlinkadd;
            ?>
" title="Add Event" class="buttontext">
												<img src="<?php 
            echo $viewimages;
            ?>
/icon-addevent.gif" alt="Add Event" border="0"/><br/>
										<?php 
            echo JText::_('JEV_ADD_EVENT');
            ?>
</a>
										</td>
							<?php 
        }
        ?>
								//-->
							<!-- END add_event -->
		<?php 
        if (in_array("byyear", $this->iconstoshow)) {
            ?>
								<td><img name="spacer" src="<?php 
            echo $viewimages;
            ?>
/spacer.gif"  alt="" border="0" height="25" width="10"/></td>
								<td class="buttontext" align="center" nowrap="nowrap" valign="middle">
									<a href="<?php 
            echo JRoute::_('index.php?option=' . $option . $cat . '&task=year.listevents&' . $view_date->toDateURL() . '&Itemid=' . $Itemid);
            ?>
" title="<?php 
            echo JText::_('JEV_VIEWBYYEAR');
            ?>
"  class="buttontext">
										<img src="<?php 
            echo $viewimages;
            ?>
/icon-flyer.gif" alt="Flat View" border="0"/><br/>
								<?php 
            echo JText::_('JEV_VIEWBYYEAR');
            ?>
</a>
								</td>
		<?php 
        }
        ?>
		<?php 
        if (in_array("bymonth", $this->iconstoshow)) {
            ?>
								<td><img name="spacer" src="<?php 
            echo $viewimages;
//.........这里部分代码省略.........
开发者ID:pguilford,项目名称:vcomcc,代码行数:101,代码来源:extviewnavtablebariconic.php

示例15: simulateSaveRepeat

function simulateSaveRepeat($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);
    if (!array_key_exists("rp_id", $array) || intval($array["rp_id"]) <= 0) {
        throwerror(JText::_("Not a repeat", true));
    }
    $rp_id = intval($array["rp_id"]);
    $dataModel = new JEventsDataModel("JEventsAdminDBModel");
    $queryModel = new JEventsDBModel($dataModel);
    // I should be able to do this in one operation but that can come later
    $event = $queryModel->listEventsById(intval($rp_id), 1, "icaldb");
    if (!JEVHelper::canEditEvent($event)) {
        throwerror(JText::_('ALERTNOTAUTH'));
    }
    $db =& JFactory::getDBO();
    $rpt = new iCalRepetition($db);
    $rpt->load($rp_id);
    $query = "SELECT detail_id FROM #__jevents_vevent WHERE ev_id={$rpt->eventid}";
    $db->setQuery($query);
    $eventdetailid = $db->loadResult();
    $data["UID"] = valueIfExists($array, "uid", md5(uniqid(rand(), true)));
    $data["X-EXTRAINFO"] = valueIfExists($array, "extra_info", "");
    $data["LOCATION"] = valueIfExists($array, "location", "");
    $data["allDayEvent"] = valueIfExists($array, "allDayEvent", "off");
    $data["CONTACT"] = valueIfExists($array, "contact_info", "");
    // allow raw HTML (mask =2)
    $data["DESCRIPTION"] = valueIfExists($array, "jevcontent", "", 'request', 'html', 2);
    $data["publish_down"] = valueIfExists($array, "publish_down", "2006-12-12");
    $data["publish_up"] = valueIfExists($array, "publish_up", "2006-12-12");
    $interval = valueIfExists($array, "rinterval", 1);
    $data["SUMMARY"] = valueIfExists($array, "title", "");
    $data["MULTIDAY"] = intval(valueIfExists($array, "multiday", "1"));
    $data["NOENDTIME"] = intval(valueIfExists($array, "noendtime", 0));
    $ics_id = valueIfExists($array, "ics_id", 0);
    if ($data["allDayEvent"] == "on") {
        $start_time = "00:00";
    } else {
        $start_time = valueIfExists($array, "start_time", "08:00");
    }
    $publishstart = $data["publish_up"] . ' ' . $start_time . ':00';
    $data["DTSTART"] = JevDate::strtotime($publishstart);
    if ($data["allDayEvent"] == "on") {
        $end_time = "23:59";
        $publishend = $data["publish_down"] . ' ' . $end_time . ':59';
    } else {
        $end_time = valueIfExists($array, "end_time", "15:00");
        $publishend = $data["publish_down"] . ' ' . $end_time . ':00';
    }
    $data["DTEND"] = JevDate::strtotime($publishend);
    // iCal for whole day uses 00:00:00 on the next day JEvents uses 23:59:59 on the same day
    list($h, $m, $s) = explode(":", $end_time . ':00');
    if ($h + $m + $s == 0 && $data["allDayEvent"] == "on" && $data["DTEND"] > $data["DTSTART"]) {
        $publishend = JevDate::strftime('%Y-%m-%d 23:59:59', $data["DTEND"] - 86400);
        $data["DTEND"] = JevDate::strtotime($publishend);
    }
    $data["X-COLOR"] = valueIfExists($array, "color", "");
    // Add any custom fields into $data array
    foreach ($array as $key => $value) {
        if (strpos($key, "custom_") === 0) {
            $data[$key] = $value;
        }
    }
    // populate rpt with data
    $start = $data["DTSTART"];
    $end = $data["DTEND"];
    $rpt->startrepeat = JevDate::strftime('%Y-%m-%d %H:%M:%S', $start);
    $rpt->endrepeat = JevDate::strftime('%Y-%m-%d %H:%M:%S', $end);
    $rpt->duplicatecheck = md5($rpt->eventid . $start);
    $rpt->rp_id = $rp_id;
    $rpt->event = $event;
    return $rpt;
}
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:82,代码来源:checkconflict.php


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