本文整理汇总了PHP中Event类的典型用法代码示例。如果您正苦于以下问题:PHP Event类的具体用法?PHP Event怎么用?PHP Event使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Event类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _ops_delete
function _ops_delete($OID = 0, $CID = 0)
{
$OID = max(0, intval($OID));
$CID = max(0, intval($CID));
$msg = '';
loginRequireMgmt();
if (!loginCheckPermission(USER::TEST_EVENT)) {
redirect("errors/401");
}
$itemName = "Event";
$urlPrefix = "test_event";
$object = new Event($OID, $CID);
if (!$object->exists()) {
$msg = "{$itemName} not found!";
} else {
transactionBegin();
if ($object->delete()) {
transactionCommit();
$msg = "{$itemName} deleted!";
} else {
TransactionRollback();
$msg = "{$itemName} delete failed!";
}
}
redirect("{$urlPrefix}/manage", $msg);
}
示例2: enforceOwnerSecurity
public function enforceOwnerSecurity(Event $event)
{
$user = $this->getUser();
if ($user != $event->getOwner()) {
throw $this->createAccessDeniedException('You are not the owner!!!');
}
}
示例3: errorItemNotFound
public function errorItemNotFound($error)
{
$evt = new \Event();
if ($this->_me) {
$evt->runEvent('myvcardinvalid');
}
}
示例4: _edit
function _edit($OID = 0, $CID = 0)
{
loginRequireMgmt();
if (!loginCheckPermission(USER::TEST_EVENT)) {
redirect("errors/401");
}
$item = "Event";
$urlPrefix = "test_event";
$object = new Event();
$object->retrieve($OID, $CID);
if (!$object->exists()) {
$data['body'][] = "<p>{$item} Not Found!</p>";
} else {
$fdata['form_heading'] = "Edit {$item}";
$fdata['object'] = $object;
$fdata['actionUrl'] = myUrl("{$urlPrefix}/ops_update");
$fdata['actionLabel'] = "Submit";
$fdata['cancelUrl'] = myUrl("{$urlPrefix}/manage");
$fdata['cancelLabel'] = "Cancel";
$form = View::do_fetch(VIEW_PATH . "{$urlPrefix}/form.php", $fdata);
$data['head'][] = View::do_fetch(VIEW_PATH . "{$urlPrefix}/form_js.php");
$data['body'][] = "<h2>Edit {$item}</h2>";
$data['body'][] = $form;
}
View::do_dump(VIEW_PATH . 'layouts/mgmtlayout.php', $data);
}
示例5: createEvent
protected function createEvent()
{
$event = new Event();
$event->setTitle('Test Event #1');
$event->setStartDate('2010-06-01');
return $event;
}
示例6: redirectRole
function redirectRole()
{
$userName = $this->input->post('userName');
$password = $this->input->post('password');
$this->load->model('user');
$user = new user();
$results = $user->searchUserByUsename($userName);
if ($results[0]->userid == 1) {
$this->load->model('Vacancy');
$vacancy = new Vacancy();
$array = $vacancy->getVacancyByUser($results[0]->userid);
$data["vacancies"] = $array;
$this->load->view('mainView', $data);
} else {
if ($results[0]->userid == 2) {
$this->load->model('Vacancy');
$vacancy = new Vacancy();
$array = $vacancy->getVacancyByUser($results[0]->userid);
$data["vacancies"] = $array;
$this->load->view('employerView', $data);
} else {
if ($results[0]->userid == 3) {
$this->load->model('Event');
$event = new Event();
$array = $event->getAllEventByUser($results[0]->userid);
$data["events"] = $array;
$this->load->view('organizerview', $data);
}
}
}
}
示例7: generateCoworkerInvitationList
/**
* A custom method within the Plugin to generate the content
*
* @return string : HTML form
* @see class/UserRelations.class.php
*/
function generateCoworkerInvitationList()
{
$output = '';
$_SESSION['do_coworker']->getAllRequestsSent();
if ($_SESSION['do_coworker']->getNumrows()) {
$count = 0;
while ($_SESSION['do_coworker']->next()) {
$e_remove_invitation = new Event("do_coworker->eventRemoveInvitation");
$e_remove_invitation->addParam('id', $_SESSION['do_coworker']->iduser_relations);
$e_remove_invitation->addParam("goto", $_SERVER['PHP_SELF']);
$output .= '<div class="co_worker_item"><div class="co_worker_desc">';
$output .= '<div id="invite' . $count . '" class="co_worker_item co_worker_desc">';
$output .= '<div style="position: relative;">';
if ($_SESSION['do_coworker']->idcoworker) {
$output .= $_SESSION['do_User']->getFullName($_SESSION['do_coworker']->idcoworker);
} else {
$output .= $_SESSION['do_coworker']->decrypt($_SESSION['do_coworker']->enc_email);
}
$img_del = '<img src="/images/delete.gif" width="14px" height="14px" alt="" />';
$output .= '<div width="15px" id="trashcan' . $count . '" class="deletenote" style="right:0;">' . $e_remove_invitation->getLink($img_del) . '</div>';
$output .= '</div></div>';
$output .= '</div></div>';
}
return $output;
} else {
$this->setIsActive(false);
}
}
示例8: actionAddEvent
public function actionAddEvent()
{
$data = $_POST;
$model = new Event();
$model->u_id = $data['uid'];
$model->lat = $data['lat'];
$model->lng = $data['lng'];
$model->address = $data['address'];
$model->message = $data['message'];
$model->status = 0;
if ($model->save()) {
$e_id = $model->primaryKey;
$model = new EventMedia();
foreach (explode(",", $data['files'], -1) as $id) {
$model->updateByPk($id, array("e_id" => $e_id));
}
$tids = explode(",", $data['tid']);
foreach ($tids as $tid) {
$model = new EventType();
$model->event = $e_id;
$model->node = $tid;
$model->save();
}
echo 1;
} else {
echo 0;
}
}
示例9: handle
public function handle($stanza, $parent = false)
{
$jid = explode('/', (string) $stanza->attributes()->from);
$to = current(explode('/', (string) $stanza->attributes()->to));
$evt = new \Event();
if ($stanza->composing) {
$evt->runEvent('composing', array($jid[0], $to));
}
if ($stanza->paused) {
$evt->runEvent('paused', array($jid[0], $to));
}
if ($stanza->gone) {
$evt->runEvent('gone', array($jid[0], $to));
}
if ($stanza->body || $stanza->subject) {
$m = new \modl\Message();
$m->set($stanza, $parent);
if ($stanza->request) {
$from = (string) $stanza->attributes()->from;
$id = (string) $stanza->attributes()->id;
\Moxl\Stanza\Message::receipt($from, $id);
}
if (!preg_match('#^\\?OTR#', $m->body)) {
$md = new \modl\MessageDAO();
$md->set($m);
$this->pack($m);
$this->deliver();
}
// Can we remove this ?
/*if($m->type == 'groupchat' && $m->subject != '') {
$evt->runEvent('subject', $m);
}*/
}
}
示例10: validate_event_form
public static function validate_event_form($event_id, $event_title, $event_title, $event_content, $event_image, $event_date, $event_cat_id, $event_user_id, $event_venue, $event_time_stamp, $event_address_1, $event_address_2, $event_state, $event_city, $event_zip)
{
$create_event_ok = 'N';
if (isset($_POST['submit'])) {
if (empty($event_title)) {
echo 'Event Name field must not be empty, please enter a name for your event';
} else {
$create_event_ok = 'Y';
}
if (empty($event_date)) {
echo 'Please set a date for your event';
} else {
$create_event_ok = 'Y';
}
if (empty($event_venue)) {
echo 'Please enter a venue for your event';
} else {
$create_event_ok = 'Y';
}
if ($create_event_ok == 'Y') {
$event = new Event();
$event->create_event($event_id, $event_title, $event_title, $event_content, $event_image, $event_date, $event_cat_id, $event_user_id, $event_venue, $event_time_stamp, $event_address_1, $event_address_2, $event_state, $event_city, $event_zip);
}
} else {
echo 'Enter event info';
}
}
示例11: on
/**
* @return null
*/
public function on($name, $handler)
{
$event = new Event();
$event->setName($name);
$event->setHandler($handler);
$this->addEvent($event);
}
示例12: _trigger
/**
* Invoke a trigger
*
* @param Event $event The event that is triggered
* @param boolean $return_when_processed (optional) whether to return when processed or continue
*
* @return mixed
*/
protected static function _trigger(Event $event, $return_when_processed = false)
{
$module = $event->getModule();
$identifier = $event->getIdentifier();
Logging::log("Triggering {$module} - {$identifier}");
if (isset(self::$_registeredlisteners[$module][$identifier])) {
foreach (self::$_registeredlisteners[$module][$identifier] as $trigger) {
try {
$cb_string = is_array($trigger) ? get_class($trigger[0]) . '::' . $trigger[1] : $trigger;
if (is_object($cb_string)) {
Logging::log('Running anonymous callback function');
} else {
Logging::log('Running callback function ' . $cb_string);
}
$retval = call_user_func($trigger, $event);
if ($return_when_processed && $event->isProcessed()) {
return true;
}
if (is_object($cb_string)) {
Logging::log('done (Running anonymous callback function)');
} else {
Logging::log('done (Running callback function ' . $cb_string . ')');
}
} catch (\Exception $e) {
throw $e;
}
}
}
Logging::log("done (Triggering {$module} - {$identifier})");
}
示例13: getEvent
/**
* Get an Event with the given path
* @param string $path
* @return Event
*/
protected function getEvent($path, $id)
{
$event = new Event($this->factory, $this->getNodeTypeManager());
$event->setPath($path);
$event->setIdentifier($id);
return $event;
}
示例14: setup_edit
function setup_edit()
{
$dao = getEventDAO();
$e = new Event();
$e->setFromRequest();
$dao->getEvents($e, Q_ALL, true);
if ($e->numResults > 0) {
$per = $e->results[0]->person;
} else {
$per = new PersonDetail();
$per->setFromRequest();
$e->results = array(new Event());
$e->results[0]->type = -1;
}
$per->queryType = Q_IND;
$dao = getPeopleDAO();
$dao->getPersonDetails($per);
if ($per->numResults > 0) {
$ret = $per->results[0];
} else {
$ret = $per;
}
$ret->events = $e->results;
return $ret;
}
示例15: createMailMessage
private function createMailMessage($name, $email, $message, $transferInfo)
{
$event = new Event();
$curEvent = $event->getEventById($transferInfo['event_id']);
$offer = strcmp($transferInfo['mode'], "offer") == 0 ? true : false;
$buffer;
$buffer = "Hallo,\n";
$buffer .= "Sie haben eine Antwort auf Ihr ";
if ($offer) {
$buffer .= "Mitfahrangebot ";
} else {
$buffer .= "Mitfahrgesuch ";
}
$buffer .= "erhalten.\n\n";
$buffer .= "Es handelt sich um eine Fahrt zu dieser Veranstaltung:\n";
$buffer .= "Titel: " . $curEvent['title'] . "\n";
$buffer .= "Datum: " . date("d.m.Y", strtotime($curEvent['ev_date'])) . "\n";
$buffer .= "Start: " . $transferInfo['start'] . "\n";
$buffer .= "Ziel: " . $transferInfo['destination'] . "\n\n";
$buffer .= "Diese Nachricht wurde fuer Sie eingegeben:\n";
$buffer .= "Nachricht von: " . $name . "\n";
$buffer .= "E-Mail: " . $email . "\n";
$buffer .= "Nachricht: " . $message . "\n\n";
$buffer .= "Um sich mit dem Interessenten per Mail in Verbindung zu setzten, koennen Sie auf \"Antwort\" in Ihrem Mailprogramm klicken oder die unter \"E-Mail:\" - genannte Mailadresse nutzen.\n\n";
$buffer .= "Gute Reise und viel Freude bei der Veranstaltung wuenscht Ihnen\nDhamma-Reise/Ralf Rapude\n\n";
return $buffer;
}