當前位置: 首頁>>代碼示例>>PHP>>正文


PHP event類代碼示例

本文整理匯總了PHP中event的典型用法代碼示例。如果您正苦於以下問題:PHP event類的具體用法?PHP event怎麽用?PHP event使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了event類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: openqrm_dhcpd_appliance

function openqrm_dhcpd_appliance($cmd, $appliance_fields)
{
    global $OPENQRM_SERVER_BASE_DIR;
    global $OPENQRM_EXEC_PORT;
    $openqrm_server = new openqrm_server();
    $OPENQRM_SERVER_IP_ADDRESS = $openqrm_server->get_ip_address();
    $event = new event();
    $appliance_id = $appliance_fields["appliance_id"];
    $appliance_name = $appliance_fields["appliance_name"];
    $resource = new resource();
    $resource->get_instance_by_id($appliance_fields["appliance_resources"]);
    $resource_mac = $resource->mac;
    $resource_ip = $resource->ip;
    $appliance = new appliance();
    $appliance->get_instance_by_id($appliance_id);
    if ($resource->id == "-1" || $resource->id == "") {
        return;
    }
    $event->log("openqrm_dhcpd_appliance", $_SERVER['REQUEST_TIME'], 5, "openqrm-dhcpd-appliance-hook.php", "Handling {$cmd} event {$appliance_id}/{$appliance_name}/{$resource_ip}/{$resource_mac}", "", "", 0, 0, $resource->id);
    switch ($cmd) {
        case "start":
            $event->log("openqrm_dhcpd_appliance", $_SERVER['REQUEST_TIME'], 5, "openqrm-dhcpd-appliance-hook.php", "Adding hostname " . $appliance->name . " from resource " . $resource->id . ".", "", "", 0, 0, $resource->id);
            $dhcpd_command = $OPENQRM_SERVER_BASE_DIR . "/openqrm/plugins/dhcpd/bin/openqrm-dhcpd-appliance add_hostname -m " . $resource_mac . " -n " . $appliance->name . " -d " . $resource->id . " --openqrm-cmd-mode background";
            $openqrm_server->send_command($dhcpd_command);
            break;
        case "stop":
            $event->log("openqrm_dhcpd_appliance", $_SERVER['REQUEST_TIME'], 5, "openqrm-dhcpd-appliance-hook.php", "Removing hostname " . $appliance->name . " from resource " . $resource->id . ".", "", "", 0, 0, $resource->id);
            $dhcpd_command = $OPENQRM_SERVER_BASE_DIR . "/openqrm/plugins/dhcpd/bin/openqrm-dhcpd-appliance remove_hostname -m " . $resource_mac . " -n " . $appliance->name . " -d " . $resource->id . " --openqrm-cmd-mode background";
            $openqrm_server->send_command($dhcpd_command);
            break;
    }
}
開發者ID:kelubo,項目名稱:OpenQRM,代碼行數:32,代碼來源:openqrm-dhcpd-appliance-hook.php

示例2: _range_panel

function _range_panel(&$app, $c)
{
    global $lang;
    $p =& $app->ui;
    $def =& $app->db->def;
    $m = array('marker_field' => 'marker');
    $p->paragraph();
    # Link to creator of new record.
    $p->v->cursor->set_key('');
    $p->open_row();
    $e = new event('tk_range_edit_select', $m);
    $e->set_next($app->event());
    $p->submit_button('select range', $e);
    $sel = tk_range_edit_all_selected($app, 'marker');
    if ($sel == 0 || $sel == 2) {
        $e = new event('tk_range_edit_select', $m);
        $e->set_next($app->event());
        $p->submit_button('select all', $e);
    }
    if ($sel == 1 || $sel == 2) {
        $e = new event('tk_range_edit_unselect', $m);
        $e->set_next($app->event());
        $p->submit_button('select all', $e);
    }
    $e_delete = new event('record_delete');
    $e_delete->set_next($app->event());
    $e = new event('tk_range_edit_call', array('view' => $e_delete, 'argname' => 'id', 'marker_field' => 'marker'));
    generic_create($app, $c);
    if ($c->have_submit_button) {
        $p->cmd_update();
    }
    $p->close_row();
    $p->paragraph();
}
開發者ID:Geopay,項目名稱:dev-coin-online-shop,代碼行數:34,代碼來源:generic_list.php

示例3: category_overview

function category_overview(&$app)
{
    global $lang;
    $p =& $app->ui;
    $conf = new tree_edit_conf();
    $conf->source = 'directories';
    $conf->id = '1';
    $conf->treeview = $app->event();
    $conf->nodeview = 'view_pages';
    $conf->nodecreator = 'create_category';
    $conf->rootname = 'shop';
    $conf->table = 'directories';
    $conf->name = 'name';
    $conf->id = 'id';
    $conf->preset_values = array('id_directory_type' => get_directory_type_id($app->db, 'category'));
    $conf->txt_select_node = $lang['msg choose category to move'];
    $conf->txt_select_dest = $lang['msg choose dest category'];
    $conf->txt_moved = $lang['msg category moved'];
    $conf->txt_not_moved = $lang['err category not moved'];
    $conf->txt_move_again = $lang['cmd move further'];
    $conf->txt_back = $lang['cmd back/quit'];
    $conf->txt_unnamed = $lang['unnamed'];
    $e = new event('tree_edit_move', array('conf' => $conf));
    $e->set_caller($app->event());
    $p->link($lang['cmd move_category'], $e);
    tree_edit($app, $conf);
}
開發者ID:Geopay,項目名稱:dev-coin-online-shop,代碼行數:27,代碼來源:categories.php

示例4: callback

 public function callback(event $event)
 {
     $this->message = $event->click();
     if ($this->message instanceof process) {
         $this->message->process();
     }
 }
開發者ID:flydement,項目名稱:MyTest,代碼行數:7,代碼來源:OCP實例.php

示例5: onAfterSaveSubscriptionPlan

 /**
  * Store setting into database, in this case, use params field of plans table
  * @param event $row
  * @param Boolean $isNew true if create new plan, false if edit
  */
 function onAfterSaveSubscriptionPlan($row, $data, $isNew)
 {
     // $row of table EB_plans
     $params = new JRegistry($row->params);
     $params->set('mailchimp_list_ids', implode(',', $data['mailchimp_list_ids']));
     $row->params = $params->toString();
     $row->store();
 }
開發者ID:vstorm83,項目名稱:propertease,代碼行數:13,代碼來源:mailchimp.php

示例6: notifyUntil

 public function notifyUntil(event $event)
 {
     $args = func_get_args();
     foreach ($this->getListeners($event->getName()) as $listener) {
         if (call_user_func_array($listener, $args)) {
             $event->setProcessed(true);
             break;
         }
     }
     return $event;
 }
開發者ID:alexqwert,項目名稱:kanon,代碼行數:11,代碼來源:eventDispatcher.php

示例7: saveNewEvent

 public function saveNewEvent()
 {
     Flight::auth()->check();
     $response = Flight::util()->validate('event', Flight::request()->data);
     if (is_array($response)) {
         Flight::util()->render('newEvent', array('team_id' => Flight::request()->data->team, 'error' => $response));
         return;
     }
     $event = new event(Flight::request()->data);
     $id = $event->store();
     Flight::redirect('/event/' . $id);
 }
開發者ID:happyoniens,項目名稱:Club,代碼行數:12,代碼來源:eventController.php

示例8: _make_cmd

 function _make_cmd($cmd, $label, $handler, $args)
 {
     global $lang;
     if (!$label) {
         $label = $lang["cmd {$cmd}"];
     }
     $this->open_row_and_cell();
     $e = new event(($this->no_update || $cmd == 'delete' ? 'record' : 'form') . "_{$cmd}");
     $e->set_next($this->make_event($handler, $args));
     $this->submit_button($label, $e);
     $this->close_cell_and_row();
 }
開發者ID:Geopay,項目名稱:dev-coin-online-shop,代碼行數:12,代碼來源:admin_panel.php

示例9: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $dataView = array();
     $dataView['page_title'] = "Eventos";
     $dataView['events'] = event::all();
     return view('event.index', $dataView);
 }
開發者ID:lautaruni,項目名稱:billboard,代碼行數:12,代碼來源:EventController.php

示例10: delAll

 /**
  * 刪除所有定時
  */
 public static function delAll()
 {
     self::$_tasks = array();
     if (self::$_event) {
         self::$_event->clearAllTimer();
     }
 }
開發者ID:shsrain,項目名稱:ypyzApi,代碼行數:10,代碼來源:Timer.php

示例11: get_tpl

/**
 * Check if a version of this template exists in this theme or for the igb.
 * If client is igb check if theme has an igb version. If not check in default
 *  theme for one. If client is not igb check if the theme has the template.
 *  If not then again return the default template.
 *
 *  @param string $name containing the name of the template.
 */
function get_tpl($name)
{
    global $themename;
    event::call('get_tpl', $name);
    // If a specific tempate file is already asked for then simply return it.
    if (substr($name, -3) == 'tpl') {
        return $name;
    }
    if ($themename == 'default') {
        if (IS_IGB && file_exists('./themes/default/templates/igb_' . $name . '.tpl')) {
            return 'igb_' . $name . '.tpl';
        }
        return $name . '.tpl';
    } else {
        if (IS_IGB) {
            if (is_file('./themes/' . $themename . '/templates/igb_' . $name . '.tpl')) {
                return 'igb_' . $name . '.tpl';
            } else {
                if (is_file('./themes/default/templates/igb_' . $name . '.tpl')) {
                    return '../../default/templates/igb_' . $name . '.tpl';
                }
            }
        }
        if (is_file('./themes/' . $themename . '/templates/' . $name . '.tpl')) {
            return $name . '.tpl';
        } else {
            if (is_file('./themes/default/templates/' . $name . '.tpl')) {
                return '../../default/templates/' . $name . '.tpl';
            }
        }
    }
    return $name . '.tpl';
}
開發者ID:biow0lf,項目名稱:evedev-kb,代碼行數:41,代碼來源:globals.php

示例12: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $event = event::find($id);
     $input = Request::all();
     $event->update(['name' => $input['name']]);
     return redirect()->action('EventsController@index');
 }
開發者ID:jacqhernandez,項目名稱:lsopcs,代碼行數:14,代碼來源:EventsController.php

示例13: logout

 public function logout()
 {
     //
     Auth::logout();
     // logout user
     return Redirect::to('/')->with('events', event::all())->with('allDayEvent', allDayEvent::all());
     //redirect back to login
 }
開發者ID:HoYinChau,項目名稱:laravel,代碼行數:8,代碼來源:AdminHomeController.php

示例14: batch_action

 function batch_action(){
     if(front::post('batch') == 'delete'){
         $sql = "DELETE FROM `".config::get('database', 'prefix')."event`";
         $this->_table->query($sql);
         event::log('日誌清除','成功');
         front::refresh(url::modify('act/manage',true));
     }
 }
開發者ID:jiangsuei8,項目名稱:public_php_shl,代碼行數:8,代碼來源:adminlogs_admin.php

示例15: lateProcess

 public static function lateProcess()
 {
     // let all mods know we're here so they can register their functions
     event::call('xajax_initialised', $this);
     // Also register this for old mods registered to the ajax mod.
     event::call('mod_xajax_initialised', $this);
     // now process all xajax calls
     global $xajax;
     $xajax->processRequest();
 }
開發者ID:biow0lf,項目名稱:evedev-kb,代碼行數:10,代碼來源:xajax.php


注:本文中的event類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。