PHP Class Event, someline-starter Code Examples

This page contains top rated real world PHP examples of class Event from package someline-starter extracted from open source projects. You can rate examples to help us improve the quality of examples
Example #1
Show file File: ops_delete.php Project: brata-hsdc/brata.masterserver
0
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);
}
Example #2
Show file File: Controller.php Project: yujunjie0603/symfony_projet2
0
 public function enforceOwnerSecurity(Event $event)
 {
     $user = $this->getUser();
     if ($user != $event->getOwner()) {
         throw $this->createAccessDeniedException('You are not the owner!!!');
     }
 }
Example #3
Show file File: Get.php Project: Hywan/moxl
0
 public function errorItemNotFound($error)
 {
     $evt = new \Event();
     if ($this->_me) {
         $evt->runEvent('myvcardinvalid');
     }
 }
Example #4
Show file File: edit.php Project: brata-hsdc/brata.masterserver
0
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);
}
Example #5
Show file File: fORMColumnTest.php Project: netcarver/flourish
0
 protected function createEvent()
 {
     $event = new Event();
     $event->setTitle('Test Event #1');
     $event->setStartDate('2010-06-01');
     return $event;
 }
Example #6
Show file File: Role_Controller.php Project: chamithanara/hoyanna.lk-1
0
 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);
             }
         }
     }
 }
Example #7
Show file File: CoworkerListInvitations.class.php Project: jacquesbagui/ofuz
0
 /**
  * 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);
     }
 }
Example #8
Show file File: EventController.php Project: snipesn/UkrYama-2
0
 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;
     }
 }
Example #9
Show file File: Message.php Project: Hywan/moxl
0
 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);
           }*/
     }
 }
Example #10
Show file File: Event.php Project: stephenx99/xframe
0
 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';
     }
 }
Example #11
Show file File: Manager.php Project: wispira/framework
0
 /**
  * @return null
  */
 public function on($name, $handler)
 {
     $event = new Event();
     $event->setName($name);
     $event->setHandler($handler);
     $this->addEvent($event);
 }
Example #12
Show file File: Event.php Project: founderio/thebuggenie
0
 /**
  * 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})");
 }
Example #13
Show file File: EventFilterIdentifiersTest.php Project: frogriotcom/jackalope
0
 /**
  * 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;
 }
Example #14
Show file File: editForm.php Project: redbugz/rootstech2013
0
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;
}
Example #15
Show file File: Mailer.class.php Project: rapude/dhamma-reise
0
 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;
 }
Example #16
Show file File: ObserverTrait.php Project: lytc/sloths
0
 /**
  * @param string|Event $event
  * @return string
  */
 protected function getEventName($event)
 {
     if ($event instanceof Event) {
         return $event->getName();
     }
     return $event;
 }
Example #17
Show file File: TestEvent.php Project: bix0r/Stjornvisi
0
 public function testAddGroupsToTheMix()
 {
     $form = new Event();
     $form->setData(['subject' => 'subject1', 'event_date' => '2014-01-01', 'event_time' => '13:00', 'event_end' => '13:01']);
     $form->bind(new \ArrayObject(['groups' => [(object) ['id' => 1, 'name_short' => '01']]]));
     $this->assertTrue($form->isValid(), print_r($form->getMessages(), true));
 }
Example #18
Show file File: Carbons.php Project: Hywan/moxl
0
 public function handle($stanza, $parent = false)
 {
     $message = $stanza->forwarded->message;
     $jid = explode('/', (string) $message->attributes()->from);
     $to = current(explode('/', (string) $message->attributes()->to));
     $evt = new \Event();
     if ($message->composing) {
         $evt->runEvent('composing', array($jid[0], $to));
     }
     if ($message->paused) {
         $evt->runEvent('paused', array($jid[0], $to));
     }
     if ($message->gone) {
         $evt->runEvent('gone', array($jid[0], $to));
     }
     if ($message->body || $message->subject) {
         $m = new \modl\Message();
         $m->set($message, $stanza->forwarded);
         if (!preg_match('#^\\?OTR#', $m->body)) {
             $md = new \modl\MessageDAO();
             $md->set($m);
             $this->pack($m);
             $this->deliver();
         }
     }
 }
Example #19
Show file File: DomEventExtension.php Project: asadlive84/uniter-jquery
0
 private function triggerEvent(DOMNode $node, Event $event, array $triggeredNodes = array())
 {
     $hash = spl_object_hash($node);
     if (isset(self::$eventHandlers[$hash][$event->getType()])) {
         foreach (self::$eventHandlers[$hash][$event->getType()] as $handlerData) {
             $handler = $handlerData['handler'];
             $selector = $handlerData['selector'];
             if ($selector === null) {
                 $boundHandler = $handler->bindTo($node);
                 $boundHandler($event);
                 // Delegated handler
             } else {
                 foreach ($triggeredNodes as $triggeredNode) {
                     $matches = $this->matchesSelector($triggeredNode, $selector);
                     if ($matches) {
                         $boundHandler = $handler->bindTo($triggeredNode);
                         $boundHandler($event);
                         if ($event->isPropagationStopped()) {
                             return;
                         }
                     }
                 }
             }
         }
     }
     if ($node->parentNode && !$event->isPropagationStopped()) {
         $triggeredNodes[] = $node;
         $this->triggerEvent($node->parentNode, $event, $triggeredNodes);
     }
 }
Example #20
Show file File: AggregateRootBehavior.php Project: cocoders/event-store
0
 public function apply(Event $event)
 {
     $method = 'apply' . $event->getName();
     if (method_exists($this, $method)) {
         $this->{$method}($event);
     }
 }
Example #21
Show file File: Event.php Project: sukui/Workerman
0
 /**
  * @see EventInterface::add()
  */
 public function add($fd, $flag, $func, $args = array())
 {
     switch ($flag) {
         case self::EV_SIGNAL:
             $fd_key = (int) $fd;
             $event = \Event::signal($this->_eventBase, $fd, $func);
             if (!$event || !$event->add()) {
                 return false;
             }
             $this->_eventSignal[$fd_key] = $event;
             return true;
         case self::EV_TIMER:
         case self::EV_TIMER_ONCE:
             $param = array($func, (array) $args, $flag, $fd, self::$_timerId);
             $event = new \Event($this->_eventBase, -1, \Event::TIMEOUT | \Event::PERSIST, array($this, "timerCallback"), $param);
             if (!$event || !$event->addTimer($fd)) {
                 return false;
             }
             $this->_eventTimer[self::$_timerId] = $event;
             return self::$_timerId++;
         default:
             $fd_key = (int) $fd;
             $real_flag = $flag === self::EV_READ ? \Event::READ | \Event::PERSIST : \Event::WRITE | \Event::PERSIST;
             $event = new \Event($this->_eventBase, $fd, $real_flag, $func, $fd);
             if (!$event || !$event->add()) {
                 return false;
             }
             $this->_allEvents[$fd_key][$flag] = $event;
             return true;
     }
 }
Example #22
Show file File: BlockWebFormList.class.php Project: jacquesbagui/ofuz
0
 function getWebFormList()
 {
     $do_userform = new WebFormUser();
     $do_userform->getUsersWebForms();
     $output = '';
     if (isset($GLOBALS['plugin_item_value'])) {
         $up = '../';
     } else {
         $up = '';
     }
     if ($do_userform->getNumRows()) {
         $count = 0;
         while ($do_userform->next()) {
             $e_remove_wf = new Event("do_userform->eventDeleteWebForm");
             $e_remove_wf->addParam('id', $do_userform->idwebformuser);
             $e_remove_wf->addParam("goto", $_SERVER['PHP_SELF']);
             $count++;
             $output .= '<div id="webform' . $count . '" class="co_worker_item co_worker_desc">';
             $output .= '<div style="position: relative;">';
             $output .= '<a href="' . $up . 'WebForm/' . $do_userform->idwebformuser . '">' . $do_userform->title . '</a>';
             $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_wf->getLink($img_del) . '</div>';
             $output .= '</div></div>';
         }
     } else {
         $this->setIsActive(false);
     }
     return $output;
 }
Example #23
Show file File: Item.php Project: krvd/cms-Inji
0
 public function afterDelete()
 {
     $event = new Event(['cart_id' => $this->cart_id, 'user_id' => \Users\User::$cur->id, 'cart_event_type_id' => 2, 'info' => $this->item_offer_price_id]);
     $event->save();
     \Ecommerce\Warehouse\Block::deleteList([['cart_id', $this->cart->id], ['item_offer_id', $this->price->item_offer_id]]);
     $this->cart->checkStage();
 }
Example #24
Show file File: deck.php Project: OldVig/gatherling
0
function content()
{
    if (strcmp($_POST['mode'], "Create Deck") == 0) {
        $deck = insertDeck();
        deckProfile($deck);
    } elseif (strcmp($_POST['mode'], "Update Deck") == 0) {
        $deck = new Deck($_POST['id']);
        if ($deck->canEdit($_SESSION['username'])) {
            $deck = updateDeck($deck);
            deckProfile($deck);
        } else {
            authFailed();
        }
    } elseif (strcmp($_POST['mode'], "Edit Deck") == 0) {
        $deck = new Deck($_POST['id']);
        if ($deck->canEdit($_SESSION['username'])) {
            deckForm($deck);
        } else {
            authFailed();
        }
    } elseif (strcmp($_GET['mode'], "create") == 0) {
        deckForm();
    } elseif (strcmp($_GET['mode'], "view") == 0) {
        if (isset($_GET['event'])) {
            $event = new Event($_GET['event']);
            $deck = $event->getPlaceDeck("1st");
        } else {
            $deck = new Deck($_GET['id']);
        }
        deckProfile($deck);
    }
}
Example #25
Show file File: controller.php Project: simontakite/cookbooks
0
 /**
  * View an event
  * @param int $id
  * @return void
  */
 private function viewEvent($id)
 {
     require_once FRAMEWORK_PATH . 'models/event.php';
     $event = new Event($this->registry, $id);
     $event->toTags('event_');
     $this->registry->getObject('template')->buildFromTemplates('header.tpl.php', 'events/view.tpl.php', 'footer.tpl.php');
 }
Example #26
Show file File: ListRemove.php Project: Hywan/moxl
0
 public function handle($stanza, $parent = false)
 {
     if ($stanza["type"] == "result") {
         $evt = new \Event();
         $evt->runEvent('groupremoved', $this->_node);
     }
 }
Example #27
Show file File: EventTest.php Project: juraj-blahunka/Bachelor-Thesis
0
 public function testSetAndGetValue()
 {
     $this->assertEquals(null, $this->object->getValue());
     $val = 'new ret val';
     $this->object->setValue($val);
     $this->assertEquals($val, $this->object->getValue());
 }
Example #28
Show file File: EventTest.php Project: panadas/event
0
 /**
  * @covers Panadas\Event\Event::stop()
  * @covers Panadas\Event\Event::isStopped()
  * @covers Panadas\Event\Event::setStopped()
  */
 public function testStop()
 {
     $event = new Event("foo", new Publisher());
     $this->assertFalse($event->isStopped());
     $event->stop();
     $this->assertTrue($event->isStopped());
 }
Example #29
Show file File: IpCheckHandler.php Project: remluben/rsf
0
 public function handle(Event $event)
 {
     $ipAdress = $this->_registry->getRequest()->getRemoteAddress();
     if (in_array($ipAdress, $this->_blockedIps)) {
         $event->cancel();
     }
 }
Example #30
Show file File: Publish.php Project: Hywan/moxl
0
 public function handle($stanza, $parent = false)
 {
     $evt = new \Event();
     $from = current(explode('/', (string) $stanza->attributes()->from));
     $cd = new \modl\ContactDAO();
     $c = $cd->get($from);
     if ($c == null) {
         $c = new \modl\Contact();
         $c->jid = $from;
     }
     $c->loclatitude = $this->_geo['latitude'];
     $c->loclongitude = $this->_geo['longitude'];
     $c->localtitude = $this->_geo['altitude'];
     $c->loccountry = $this->_geo['country'];
     $c->loccountrycode = $this->_geo['countrycode'];
     $c->locregion = $this->_geo['region'];
     $c->locpostalcode = $this->_geo['postalcode'];
     $c->loclocality = $this->_geo['locality'];
     $c->locstreet = $this->_geo['street'];
     $c->locbuilding = $this->_geo['building'];
     $c->loctext = $this->_geo['text'];
     $c->locuri = $this->_geo['uri'];
     $c->loctimestamp = date('Y-m-d H:i:s', time());
     $cd->set($c);
     $evt->runEvent('locationpublished', $c);
 }
Frequently Used Methods